diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-12-16 00:19:29 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-12-16 00:19:29 +0000 |
commit | 459a7870b5e91980eaaa1ceae059d0149495762a (patch) | |
tree | 10aa02a9fb32e77f3a4e1b8f0b401150497ed860 | |
parent | 2f71d4de6918edffc0d251e9d48712071f2328b1 (diff) | |
parent | 9f617a65b305233b5f19715187b49a77881b16e6 (diff) | |
download | ContactsProvider-android11-qpr1-release.tar.gz |
Merge cherrypicks of [13232455, 13232456, 13232432, 13232495, 13232299, 13232399, 13232951, 13232952, 13232953, 13232954, 13232955, 13232956, 13232957, 13232522, 13232433, 13232353, 13232400, 13232354, 13232699, 13232700, 13232701, 13232702] into rvc-qpr1-releaseandroid-11.0.0_r29android11-qpr1-release
Change-Id: I1a9e73de47a8de6ddce94b78e8267191533b7eda
-rw-r--r-- | src/com/android/providers/contacts/CallLogProvider.java | 12 | ||||
-rw-r--r-- | src/com/android/providers/contacts/DbModifierWithNotification.java | 16 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/com/android/providers/contacts/CallLogProvider.java b/src/com/android/providers/contacts/CallLogProvider.java index ebe111f1..7a610151 100644 --- a/src/com/android/providers/contacts/CallLogProvider.java +++ b/src/com/android/providers/contacts/CallLogProvider.java @@ -563,7 +563,11 @@ public class CallLogProvider extends ContentProvider { throw new UnsupportedOperationException("Cannot update URL: " + uri); } - return qb.update(db, values, selectionBuilder.build(), selectionArgs); + int rowsUpdated = qb.update(db, values, selectionBuilder.build(), selectionArgs); + if (rowsUpdated > 0) { + DbModifierWithNotification.notifyCallLogChange(getContext()); + } + return rowsUpdated; } private int deleteInternal(Uri uri, String selection, String[] selectionArgs) { @@ -596,7 +600,11 @@ public class CallLogProvider extends ContentProvider { case CALLS: // TODO: Special case - We may want to forward the delete request on user 0 to the // shadow provider too. - return qb.delete(db, selectionBuilder.build(), selectionArgs); + int deletedCount = qb.delete(db, selectionBuilder.build(), selectionArgs); + if (deletedCount > 0) { + DbModifierWithNotification.notifyCallLogChange(getContext()); + } + return deletedCount; default: throw new UnsupportedOperationException("Cannot delete that URL: " + uri); } diff --git a/src/com/android/providers/contacts/DbModifierWithNotification.java b/src/com/android/providers/contacts/DbModifierWithNotification.java index 852301d3..03ebd1f1 100644 --- a/src/com/android/providers/contacts/DbModifierWithNotification.java +++ b/src/com/android/providers/contacts/DbModifierWithNotification.java @@ -109,7 +109,7 @@ public class DbModifierWithNotification implements DatabaseModifier { packagesModified); } if (rowId > 0 && mIsCallsTable) { - notifyCallLogChange(); + notifyCallLogChange(mContext); } return rowId; } @@ -126,20 +126,20 @@ public class DbModifierWithNotification implements DatabaseModifier { ContentUris.withAppendedId(mBaseUri, rowId), packagesModified); } if (rowId > 0 && mIsCallsTable) { - notifyCallLogChange(); + notifyCallLogChange(mContext); } return rowId; } - private void notifyCallLogChange() { - mContext.getContentResolver().notifyChange(Calls.CONTENT_URI, null, false); + public static void notifyCallLogChange(Context context) { + context.getContentResolver().notifyChange(Calls.CONTENT_URI, null, false); Intent intent = new Intent("com.android.internal.action.CALL_LOG_CHANGE"); intent.setComponent(new ComponentName("com.android.calllogbackup", "com.android.calllogbackup.CallLogChangeReceiver")); - if (!mContext.getPackageManager().queryBroadcastReceivers(intent, 0).isEmpty()) { - mContext.sendBroadcast(intent); + if (!context.getPackageManager().queryBroadcastReceivers(intent, 0).isEmpty()) { + context.sendBroadcast(intent); } } @@ -201,7 +201,7 @@ public class DbModifierWithNotification implements DatabaseModifier { notifyVoicemailChange(mBaseUri, packagesModified); } if (count > 0 && mIsCallsTable) { - notifyCallLogChange(); + notifyCallLogChange(mContext); } if (hasMarkedRead) { // A "New" voicemail has been marked as read by the server. This voicemail is no longer @@ -283,7 +283,7 @@ public class DbModifierWithNotification implements DatabaseModifier { notifyVoicemailChange(mBaseUri, packagesModified); } if (count > 0 && mIsCallsTable) { - notifyCallLogChange(); + notifyCallLogChange(mContext); } return count; } |