summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Liefu Liu <liefuliu@google.com> 2024-10-30 12:11:31 -0700
committer Liefu Liu <liefuliu@google.com> 2024-10-31 15:35:33 -0700
commitbfddac850b7a136d3fb6f9511056cde543e4d4c3 (patch)
tree5113f07b4511febda062a4d2b54a50502db70780
parentcfe2434ea5c7d9020c7083f346448ef45d2f7f97 (diff)
Mark the API of Settings.getDefaultAccount and
Settings.setDefaultAccount as deprecated. Bug: 352313110 Test: local test Flag: android.provider.new_default_account_api_enabled modified: core/java/android/provider/ContactsContract.java modified: core/api/current.txt modified: core/api/system-current.txt Change-Id: I61b37969c2e7a7083e72f3f3ee69b7926d63501a
-rw-r--r--core/api/current.txt2
-rw-r--r--core/api/system-current.txt2
-rw-r--r--core/java/android/provider/ContactsContract.java14
3 files changed, 16 insertions, 2 deletions
diff --git a/core/api/current.txt b/core/api/current.txt
index c31928dc013e..340b3ae0b1c9 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -37196,7 +37196,7 @@ package android.provider {
}
public static final class ContactsContract.Settings implements android.provider.ContactsContract.SettingsColumns {
- method @Nullable public static android.accounts.Account getDefaultAccount(@NonNull android.content.ContentResolver);
+ method @Deprecated @FlaggedApi("android.provider.new_default_account_api_enabled") @Nullable public static android.accounts.Account getDefaultAccount(@NonNull android.content.ContentResolver);
field public static final String ACTION_SET_DEFAULT_ACCOUNT = "android.provider.action.SET_DEFAULT_ACCOUNT";
field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/setting";
field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/setting";
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 261c2ae30780..8a64eeec3844 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -12106,7 +12106,7 @@ package android.provider {
}
public static final class ContactsContract.Settings implements android.provider.ContactsContract.SettingsColumns {
- method @RequiresPermission(android.Manifest.permission.SET_DEFAULT_ACCOUNT_FOR_CONTACTS) public static void setDefaultAccount(@NonNull android.content.ContentResolver, @Nullable android.accounts.Account);
+ method @Deprecated @FlaggedApi("android.provider.new_default_account_api_enabled") @RequiresPermission(android.Manifest.permission.SET_DEFAULT_ACCOUNT_FOR_CONTACTS) public static void setDefaultAccount(@NonNull android.content.ContentResolver, @Nullable android.accounts.Account);
}
public static final class ContactsContract.SimContacts {
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index 8afc1779ed00..1b289fdabbd1 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -9383,7 +9383,14 @@ public final class ContactsContract {
* @param resolver the ContentResolver to query.
* @return the default account for new contacts, or null if it's not set or set to NULL
* account.
+ *
+ * @deprecated This API is only supported up to Android version
+ * * {@link Build.VERSION_CODES#VANILLA_ICE_CREAM}. On later versions,
+ * {@link ContactsContract.RawContacts.DefaultAccount#getDefaultAccountForNewContacts}
+ * should be used.
*/
+ @Deprecated
+ @FlaggedApi(Flags.FLAG_NEW_DEFAULT_ACCOUNT_API_ENABLED)
@Nullable
public static Account getDefaultAccount(@NonNull ContentResolver resolver) {
Bundle response = resolver.call(ContactsContract.AUTHORITY_URI,
@@ -9404,7 +9411,14 @@ public final class ContactsContract {
* @param resolver the ContentResolver to query.
* @param account the account to be set to default.
* @hide
+ *
+ * @deprecated This API is only supported up to Android version
+ * * {@link Build.VERSION_CODES#VANILLA_ICE_CREAM}. On later versions,
+ * {@link ContactsContract.RawContacts.DefaultAccount#setDefaultAccountForNewContacts}
+ * should be used.
*/
+ @Deprecated
+ @FlaggedApi(Flags.FLAG_NEW_DEFAULT_ACCOUNT_API_ENABLED)
@SystemApi
@RequiresPermission(android.Manifest.permission.SET_DEFAULT_ACCOUNT_FOR_CONTACTS)
public static void setDefaultAccount(@NonNull ContentResolver resolver,