From 98033730da5ba29c294540b376d44b35337f3ce6 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Wed, 3 Feb 2021 14:26:53 +0100 Subject: Dialer: Notify content observers upon call log entry deletion * This change makes call log refresh its data after deleting an entry. Change-Id: Iaa8a559cd02853be05b69cd2daca1e321679369e --- java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | 3 +++ java/com/android/dialer/app/calllog/ClearCallLogDialog.java | 1 + java/com/android/dialer/calldetails/CallDetailsActivityCommon.java | 3 +++ java/com/android/dialer/calllog/ui/menu/DeleteCallLogItemModule.java | 3 +++ 4 files changed, 10 insertions(+) diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index 1d50a82ac..b61fdc80d 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -1395,6 +1395,9 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder 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 197d2dad4..bea06d31a 100644 --- a/java/com/android/dialer/app/calllog/ClearCallLogDialog.java +++ b/java/com/android/dialer/app/calllog/ClearCallLogDialog.java @@ -101,6 +101,7 @@ public class ClearCallLogDialog extends DialogFragment { @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 79e761368..808d08cda 100644 --- a/java/com/android/dialer/calldetails/CallDetailsActivityCommon.java +++ b/java/com/android/dialer/calldetails/CallDetailsActivityCommon.java @@ -277,6 +277,9 @@ abstract class CallDetailsActivityCommon extends AppCompatActivity { 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 a929961d6..c5ade3d36 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 @@ final class DeleteCallLogItemModule implements HistoryItemActionModule { context .getContentResolver() .delete(Calls.CONTENT_URI, selection.getSelection(), selection.getSelectionArgs()); + context + .getContentResolver() + .notifyChange(Calls.CONTENT_URI, null); if (numRowsDeleted != coalescedIds.getCoalescedIdCount()) { LogUtil.e( -- cgit v1.2.3