Dialer: Notify content observers upon call log entry deletion
* This change makes call log refresh its data after deleting an entry.
Change-Id: Iaa8a559cd02853be05b69cd2daca1e321679369e
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java
index f6f60b1..af4fb29 100644
--- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java
+++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java
@@ -1395,6 +1395,9 @@
Calls.CONTENT_URI,
CallLog.Calls._ID + " IN (" + callIdsStr + ")" /* where */,
null /* selectionArgs */);
+ context
+ .getContentResolver()
+ .notifyChange(Calls.CONTENT_URI, null);
}
return null;
diff --git a/java/com/android/dialer/app/calllog/ClearCallLogDialog.java b/java/com/android/dialer/app/calllog/ClearCallLogDialog.java
index 197d2da..bea06d3 100644
--- a/java/com/android/dialer/app/calllog/ClearCallLogDialog.java
+++ b/java/com/android/dialer/app/calllog/ClearCallLogDialog.java
@@ -101,6 +101,7 @@
@Override
public Void doInBackground(@Nullable Void unused) throws Throwable {
appContext.getContentResolver().delete(Calls.CONTENT_URI, null, null);
+ appContext.getContentResolver().notifyChange(Calls.CONTENT_URI, null);
CachedNumberLookupService cachedNumberLookupService =
PhoneNumberCache.get(appContext).getCachedNumberLookupService();
if (cachedNumberLookupService != null) {
diff --git a/java/com/android/dialer/calldetails/CallDetailsActivityCommon.java b/java/com/android/dialer/calldetails/CallDetailsActivityCommon.java
index 79e7613..808d08c 100644
--- a/java/com/android/dialer/calldetails/CallDetailsActivityCommon.java
+++ b/java/com/android/dialer/calldetails/CallDetailsActivityCommon.java
@@ -277,6 +277,9 @@
context
.getContentResolver()
.delete(Calls.CONTENT_URI, selection.getSelection(), selection.getSelectionArgs());
+ context
+ .getContentResolver()
+ .notifyChange(Calls.CONTENT_URI, null);
return null;
}
diff --git a/java/com/android/dialer/calllog/ui/menu/DeleteCallLogItemModule.java b/java/com/android/dialer/calllog/ui/menu/DeleteCallLogItemModule.java
index a929961..c5ade3d 100644
--- a/java/com/android/dialer/calllog/ui/menu/DeleteCallLogItemModule.java
+++ b/java/com/android/dialer/calllog/ui/menu/DeleteCallLogItemModule.java
@@ -100,6 +100,9 @@
context
.getContentResolver()
.delete(Calls.CONTENT_URI, selection.getSelection(), selection.getSelectionArgs());
+ context
+ .getContentResolver()
+ .notifyChange(Calls.CONTENT_URI, null);
if (numRowsDeleted != coalescedIds.getCoalescedIdCount()) {
LogUtil.e(