diff options
author | Makoto Onuki <omakoto@google.com> | 2017-01-30 11:45:47 -0800 |
---|---|---|
committer | Makoto Onuki <omakoto@google.com> | 2017-01-30 11:51:56 -0800 |
commit | 63bb78af06e34968cd2ee33775589bc4df4bd195 (patch) | |
tree | fd4b2423d9dfea87a46f776dcf609114b6b6a1a6 /src | |
parent | fbb0877ef60e631b25286355b4a81b02c20d18ae (diff) | |
download | ContactsProvider-63bb78af06e34968cd2ee33775589bc4df4bd195.tar.gz |
Revive CONTACTS_DATABASE_CREATED, and...
Remove STATUS_CHANGE_NOTIFICATION_CONTENT_URI.
Bug 33390320
Test: adb shell am instrument -w -e size small com.android.providers.contacts.tests
Test: adb shell am instrument -w -e size medium com.android.providers.contacts.tests
Test: adb shell am instrument -w -e size large com.android.providers.contacts.tests
Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsContactsProviderWipe
Change-Id: I10052a0682cb4bde0d94f6a22c50d0cff3a253fe
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/providers/contacts/ContactsDatabaseHelper.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/providers/contacts/ContactsDatabaseHelper.java b/src/com/android/providers/contacts/ContactsDatabaseHelper.java index 88f8eaf0..2376ea4e 100644 --- a/src/com/android/providers/contacts/ContactsDatabaseHelper.java +++ b/src/com/android/providers/contacts/ContactsDatabaseHelper.java @@ -1664,6 +1664,12 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper { // Trigger all sync adapters. ContentResolver.requestSync(null /* all accounts */, ContactsContract.AUTHORITY, new Bundle()); + + // Send the broadcast. + final Intent dbCreatedIntent = new Intent( + ContactsContract.Intents.CONTACTS_DATABASE_CREATED); + dbCreatedIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); + mContext.sendBroadcast(dbCreatedIntent, android.Manifest.permission.READ_CONTACTS); } protected void initializeAutoIncrementSequences(SQLiteDatabase db) { @@ -4967,9 +4973,6 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper { public static void notifyProviderStatusChange(Context context) { context.getContentResolver().notifyChange(ProviderStatus.CONTENT_URI, /* observer= */ null, /* syncToNetwork= */ false); - context.getContentResolver().notifyChange( - ProviderStatus.STATUS_CHANGE_NOTIFICATION_CONTENT_URI, - /* observer= */ null, /* syncToNetwork= */ false); } public long getDatabaseCreationTime() { |