summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/calllog/ui
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2018-06-28 10:14:11 -0700
committerCopybara-Service <copybara-piper@google.com>2018-06-28 16:23:40 -0700
commit6310dfd04e0d3561d1ef58121046e6255eac8c87 (patch)
tree540eab204891128af97c7864f7bb5ec8e1ce3c02 /java/com/android/dialer/calllog/ui
parentf375be6e66c0c06db3a8f045b31425153b9a0902 (diff)
Also ignore IllegalStateException thrown by SQLiteClosable when coalescing fails.
Test: Manual PiperOrigin-RevId: 202499434 Change-Id: Ie41eeb782072d82c5613b44be99649f43807498d
Diffstat (limited to 'java/com/android/dialer/calllog/ui')
-rw-r--r--java/com/android/dialer/calllog/ui/NewCallLogFragment.java19
1 files changed, 8 insertions, 11 deletions
diff --git a/java/com/android/dialer/calllog/ui/NewCallLogFragment.java b/java/com/android/dialer/calllog/ui/NewCallLogFragment.java
index 4141fe723..5e72a1af3 100644
--- a/java/com/android/dialer/calllog/ui/NewCallLogFragment.java
+++ b/java/com/android/dialer/calllog/ui/NewCallLogFragment.java
@@ -17,7 +17,6 @@ package com.android.dialer.calllog.ui;
import android.app.Activity;
import android.database.Cursor;
-import android.database.StaleDataException;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
@@ -34,6 +33,7 @@ import android.view.ViewGroup;
import com.android.dialer.calllog.CallLogComponent;
import com.android.dialer.calllog.RefreshAnnotatedCallLogReceiver;
import com.android.dialer.calllog.database.CallLogDatabaseComponent;
+import com.android.dialer.calllog.database.Coalescer;
import com.android.dialer.calllog.model.CoalescedRow;
import com.android.dialer.common.Assert;
import com.android.dialer.common.LogUtil;
@@ -337,16 +337,13 @@ public final class NewCallLogFragment extends Fragment implements LoaderCallback
}
},
throwable -> {
- if (throwable instanceof StaleDataException) {
- // Coalescing can fail if the cursor passed to Coalescer is closed by the loader while
- // the work is still in progress.
- // This can happen when the loader restarts and finishes loading data before the
- // coalescing work is completed.
- // This failure doesn't need to be thrown as coalescing will be restarted on the latest
- // data obtained by the loader.
- // TODO(linyuh): Also throw an exception if the failure above can be avoided.
- LogUtil.e("NewCallLogFragment.onLoadFinished", "coalescing failed", throwable);
- } else {
+ // Coalescing can fail if the cursor passed to Coalescer is closed by the loader while
+ // the work is still in progress.
+ // This can happen when the loader restarts and finishes loading data before the
+ // coalescing work is completed.
+ // This failure is identified by ExpectedCoalescerException and doesn't need to be
+ // thrown as coalescing will be restarted on the latest data obtained by the loader.
+ if (!(throwable instanceof Coalescer.ExpectedCoalescerException)) {
throw new AssertionError(throwable);
}
});