Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98033730 authored by LuK1337's avatar LuK1337 Committed by Michael Bestas
Browse files

Dialer: Notify content observers upon call log entry deletion

* This change makes call log refresh its data after deleting an entry.

Change-Id: Iaa8a559cd02853be05b69cd2daca1e321679369e
parent 4b4f5119
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -1395,6 +1395,9 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
                Calls.CONTENT_URI,
                Calls.CONTENT_URI,
                CallLog.Calls._ID + " IN (" + callIdsStr + ")" /* where */,
                CallLog.Calls._ID + " IN (" + callIdsStr + ")" /* where */,
                null /* selectionArgs */);
                null /* selectionArgs */);
        context
            .getContentResolver()
            .notifyChange(Calls.CONTENT_URI, null);
      }
      }


      return null;
      return null;
+1 −0
Original line number Original line Diff line number Diff line
@@ -101,6 +101,7 @@ public class ClearCallLogDialog extends DialogFragment {
    @Override
    @Override
    public Void doInBackground(@Nullable Void unused) throws Throwable {
    public Void doInBackground(@Nullable Void unused) throws Throwable {
      appContext.getContentResolver().delete(Calls.CONTENT_URI, null, null);
      appContext.getContentResolver().delete(Calls.CONTENT_URI, null, null);
      appContext.getContentResolver().notifyChange(Calls.CONTENT_URI, null);
      CachedNumberLookupService cachedNumberLookupService =
      CachedNumberLookupService cachedNumberLookupService =
          PhoneNumberCache.get(appContext).getCachedNumberLookupService();
          PhoneNumberCache.get(appContext).getCachedNumberLookupService();
      if (cachedNumberLookupService != null) {
      if (cachedNumberLookupService != null) {
+3 −0
Original line number Original line Diff line number Diff line
@@ -277,6 +277,9 @@ abstract class CallDetailsActivityCommon extends AppCompatActivity {
      context
      context
          .getContentResolver()
          .getContentResolver()
          .delete(Calls.CONTENT_URI, selection.getSelection(), selection.getSelectionArgs());
          .delete(Calls.CONTENT_URI, selection.getSelection(), selection.getSelectionArgs());
      context
          .getContentResolver()
          .notifyChange(Calls.CONTENT_URI, null);
      return null;
      return null;
    }
    }


+3 −0
Original line number Original line Diff line number Diff line
@@ -100,6 +100,9 @@ final class DeleteCallLogItemModule implements HistoryItemActionModule {
          context
          context
              .getContentResolver()
              .getContentResolver()
              .delete(Calls.CONTENT_URI, selection.getSelection(), selection.getSelectionArgs());
              .delete(Calls.CONTENT_URI, selection.getSelection(), selection.getSelectionArgs());
      context
          .getContentResolver()
          .notifyChange(Calls.CONTENT_URI, null);


      if (numRowsDeleted != coalescedIds.getCoalescedIdCount()) {
      if (numRowsDeleted != coalescedIds.getCoalescedIdCount()) {
        LogUtil.e(
        LogUtil.e(