diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-01-04 23:55:04 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-01-04 23:55:04 +0000 |
commit | 417be6a9e3482472cce238e0a51b6367b86aba1f (patch) | |
tree | 21b09064d37a80e0c719cb6ff86ed8705c1a5454 | |
parent | 27187c061ef64d1877f0e16a9bc1167b97e926a3 (diff) | |
parent | 2eff9c20bd5eda56fd193d5e40c03b4bdb31245b (diff) |
Merge "Fix the crash when deleting call details if CallDetailsActivity is launched from the new call log."
-rw-r--r-- | java/com/android/dialer/calldetails/CallDetailsCursorLoader.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/java/com/android/dialer/calldetails/CallDetailsCursorLoader.java b/java/com/android/dialer/calldetails/CallDetailsCursorLoader.java index 838525372..15c64c927 100644 --- a/java/com/android/dialer/calldetails/CallDetailsCursorLoader.java +++ b/java/com/android/dialer/calldetails/CallDetailsCursorLoader.java @@ -64,6 +64,19 @@ public final class CallDetailsCursorLoader extends CursorLoader { AnnotatedCallLog.TIMESTAMP + " DESC"); } + @Override + public void onContentChanged() { + // Do nothing here. + // This is to prevent the loader to reload data when Loader.ForceLoadContentObserver detects a + // change. + // Without this, the app will crash when the user deletes call details as the deletion triggers + // the data loading but no data can be fetched and we want to ensure the data set is not empty + // when building CallDetailsEntries proto (see toCallDetailsEntries(Cursor)). + // + // CallDetailsActivity doesn't respond to underlying data changes when launched from the old + // call log and we decided to keep it that way when launched from the new call log. + } + /** * Build a string of the form "COLUMN_NAME IN (?, ?, ..., ?)", where COLUMN_NAME is the name of * the ID column in {@link AnnotatedCallLog}. |