summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Makoto Onuki <omakoto@google.com> 2017-01-30 11:59:46 -0800
committer Makoto Onuki <omakoto@google.com> 2017-01-30 12:00:23 -0800
commit2a61537b392c838f1515464d8a7442cd9e4466a4 (patch)
tree7e4bf50eb8991ca6bed543071aacc9e3cceb0dcf
parent90572a4ab8ac393c57e896be3c608e634866ed38 (diff)
API change for: 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: I2162aa846c089b6979b68afcca4897dfc1dabade
-rw-r--r--api/current.txt3
-rw-r--r--api/system-current.txt3
-rw-r--r--api/test-current.txt3
-rw-r--r--core/java/android/provider/ContactsContract.java32
4 files changed, 11 insertions, 30 deletions
diff --git a/api/current.txt b/api/current.txt
index e2616a6f9036..7194d2d18ec2 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -32909,7 +32909,7 @@ package android.provider {
ctor public ContactsContract.Intents();
field public static final java.lang.String ACTION_VOICE_SEND_MESSAGE_TO_CONTACTS = "android.provider.action.VOICE_SEND_MESSAGE_TO_CONTACTS";
field public static final java.lang.String ATTACH_IMAGE = "com.android.contacts.action.ATTACH_IMAGE";
- field public static final deprecated java.lang.String CONTACTS_DATABASE_CREATED = "android.provider.Contacts.DATABASE_CREATED";
+ field public static final java.lang.String CONTACTS_DATABASE_CREATED = "android.provider.Contacts.DATABASE_CREATED";
field public static final java.lang.String EXTRA_CREATE_DESCRIPTION = "com.android.contacts.action.CREATE_DESCRIPTION";
field public static final java.lang.String EXTRA_FORCE_CREATE = "com.android.contacts.action.FORCE_CREATE";
field public static final java.lang.String EXTRA_RECIPIENT_CONTACT_CHAT_ID = "android.provider.extra.RECIPIENT_CONTACT_CHAT_ID";
@@ -33022,7 +33022,6 @@ package android.provider {
field public static final java.lang.String DATABASE_CREATION_TIMESTAMP = "database_creation_timestamp";
field public static final java.lang.String STATUS = "status";
field public static final int STATUS_BUSY = 1; // 0x1
- field public static final android.net.Uri STATUS_CHANGE_NOTIFICATION_CONTENT_URI;
field public static final int STATUS_EMPTY = 2; // 0x2
field public static final int STATUS_NORMAL = 0; // 0x0
}
diff --git a/api/system-current.txt b/api/system-current.txt
index 21f15f273b5b..ecad529dba6f 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -35778,7 +35778,7 @@ package android.provider {
ctor public ContactsContract.Intents();
field public static final java.lang.String ACTION_VOICE_SEND_MESSAGE_TO_CONTACTS = "android.provider.action.VOICE_SEND_MESSAGE_TO_CONTACTS";
field public static final java.lang.String ATTACH_IMAGE = "com.android.contacts.action.ATTACH_IMAGE";
- field public static final deprecated java.lang.String CONTACTS_DATABASE_CREATED = "android.provider.Contacts.DATABASE_CREATED";
+ field public static final java.lang.String CONTACTS_DATABASE_CREATED = "android.provider.Contacts.DATABASE_CREATED";
field public static final java.lang.String EXTRA_CREATE_DESCRIPTION = "com.android.contacts.action.CREATE_DESCRIPTION";
field public static final java.lang.String EXTRA_FORCE_CREATE = "com.android.contacts.action.FORCE_CREATE";
field public static final java.lang.String EXTRA_RECIPIENT_CONTACT_CHAT_ID = "android.provider.extra.RECIPIENT_CONTACT_CHAT_ID";
@@ -35921,7 +35921,6 @@ package android.provider {
field public static final java.lang.String DATABASE_CREATION_TIMESTAMP = "database_creation_timestamp";
field public static final java.lang.String STATUS = "status";
field public static final int STATUS_BUSY = 1; // 0x1
- field public static final android.net.Uri STATUS_CHANGE_NOTIFICATION_CONTENT_URI;
field public static final int STATUS_EMPTY = 2; // 0x2
field public static final int STATUS_NORMAL = 0; // 0x0
}
diff --git a/api/test-current.txt b/api/test-current.txt
index 940f68bc7660..97109e5cc704 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -33027,7 +33027,7 @@ package android.provider {
ctor public ContactsContract.Intents();
field public static final java.lang.String ACTION_VOICE_SEND_MESSAGE_TO_CONTACTS = "android.provider.action.VOICE_SEND_MESSAGE_TO_CONTACTS";
field public static final java.lang.String ATTACH_IMAGE = "com.android.contacts.action.ATTACH_IMAGE";
- field public static final deprecated java.lang.String CONTACTS_DATABASE_CREATED = "android.provider.Contacts.DATABASE_CREATED";
+ field public static final java.lang.String CONTACTS_DATABASE_CREATED = "android.provider.Contacts.DATABASE_CREATED";
field public static final java.lang.String EXTRA_CREATE_DESCRIPTION = "com.android.contacts.action.CREATE_DESCRIPTION";
field public static final java.lang.String EXTRA_FORCE_CREATE = "com.android.contacts.action.FORCE_CREATE";
field public static final java.lang.String EXTRA_RECIPIENT_CONTACT_CHAT_ID = "android.provider.extra.RECIPIENT_CONTACT_CHAT_ID";
@@ -33140,7 +33140,6 @@ package android.provider {
field public static final java.lang.String DATABASE_CREATION_TIMESTAMP = "database_creation_timestamp";
field public static final java.lang.String STATUS = "status";
field public static final int STATUS_BUSY = 1; // 0x1
- field public static final android.net.Uri STATUS_CHANGE_NOTIFICATION_CONTENT_URI;
field public static final int STATUS_EMPTY = 2; // 0x2
field public static final int STATUS_NORMAL = 0; // 0x0
}
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index 1b512c69901f..a0d16bc2d9b0 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -19,6 +19,7 @@ package android.provider;
import android.accounts.Account;
import android.annotation.SystemApi;
import android.app.Activity;
+import android.content.BroadcastReceiver;
import android.content.ContentProviderClient;
import android.content.ContentProviderOperation;
import android.content.ContentResolver;
@@ -30,6 +31,7 @@ import android.content.CursorEntityIterator;
import android.content.Entity;
import android.content.EntityIterator;
import android.content.Intent;
+import android.content.IntentFilter;
import android.content.res.AssetFileDescriptor;
import android.content.res.Resources;
import android.database.Cursor;
@@ -8170,29 +8172,11 @@ public final class ContactsContract {
/**
* The content:// style URI for this table. Requests to this URI can be
* performed on the UI thread because they are always unblocking.
- *
- * <p>Note when you listen on this URI (or any other sub-URIs), you'll be notified for
- * regular contact change notifications too, which will be sent on the root URI.
- * If you only want to be notified for provider status change notifications, listen on
- * {@link #STATUS_CHANGE_NOTIFICATION_CONTENT_URI} instead.
*/
public static final Uri CONTENT_URI =
Uri.withAppendedPath(AUTHORITY_URI, "provider_status");
/**
- * URI to listen to provider status changes without listening to regular
- * contact changes. If a client only wants to monitor {@link ProviderStatus} with
- * {@link android.app.job.JobScheduler}, then this URI should be used instead of
- * {@link #CONTENT_URI}, because a job on {@link #CONTENT_URI} will also be invoked
- * when contacts are changed.
- *
- * <p>Note this URI cannot be queried. A query should be always made on
- * {@link #CONTENT_URI}.
- */
- public static final Uri STATUS_CHANGE_NOTIFICATION_CONTENT_URI =
- Uri.parse("content://com.android.contacts.provider_status");
-
- /**
* The MIME-type of {@link #CONTENT_URI} providing a directory of
* settings.
*/
@@ -8794,13 +8778,13 @@ public final class ContactsContract {
* This is the intent that is fired when the contacts database is created. <p> The
* READ_CONTACT permission is required to receive these broadcasts.
*
- * <p>As of O, this broadcast will no longer be sent. Applications can use
- * use {@link android.app.job.JobScheduler} to monitor
- * {@link ProviderStatus#STATUS_CHANGE_NOTIFICATION_CONTENT_URI}, and read
- * {@link ProviderStatus#DATABASE_CREATION_TIMESTAMP} to get when
- * the contacts database was initialized.
+ * <p>Because this is an implicit broadcast, apps targeting Android O will no longer
+ * receive this broadcast via a manifest broadcast receiver. (Broadcast receivers
+ * registered at runtime with
+ * {@link Context#registerReceiver(BroadcastReceiver, IntentFilter)} will still receive it.)
+ * Instead, an app can use {@link ProviderStatus#DATABASE_CREATION_TIMESTAMP} to see if the
+ * contacts database has been initialized when it starts.
*/
- @Deprecated
public static final String CONTACTS_DATABASE_CREATED =
"android.provider.Contacts.DATABASE_CREATED";