summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2018-01-04 14:11:33 -0800
committerCopybara-Service <copybara-piper@google.com>2018-01-04 15:02:13 -0800
commit2eff9c20bd5eda56fd193d5e40c03b4bdb31245b (patch)
tree21b09064d37a80e0c719cb6ff86ed8705c1a5454 /java
parent640e4181a6efb0f659853db45eac55dd44be2bc5 (diff)
Fix the crash when deleting call details if CallDetailsActivity is launched from the new call log.
Bug: 70218437 Test: Manual PiperOrigin-RevId: 180843892 Change-Id: Id4c582457bae90327f41b1c6431eff1385bdfd35
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/calldetails/CallDetailsCursorLoader.java13
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}.