Merge "Fix the crash when deleting call details if CallDetailsActivity is launched from the new call log."
diff --git a/java/com/android/dialer/calldetails/CallDetailsCursorLoader.java b/java/com/android/dialer/calldetails/CallDetailsCursorLoader.java
index 8385253..15c64c9 100644
--- a/java/com/android/dialer/calldetails/CallDetailsCursorLoader.java
+++ b/java/com/android/dialer/calldetails/CallDetailsCursorLoader.java
@@ -64,6 +64,19 @@
         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}.