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

Commit 44a9810e authored by Liefu Liu's avatar Liefu Liu Committed by Android (Google) Code Review
Browse files

Revert "Added LocalAndSimContactWriteException in ContactsContract."

Revert submission 30533261-LocalSimContactsWriteException

Reason for revert: CTS test failed. In addition, the root cause of CTS test failure is that specific exception type thrown in ContentProvider.insert() or .update()  cannot be parceled to ContentResolver.insert() or .update(). In such case, client of ContentResolver cannot catch the specific exception that is thrown by ContentProvider.  

Reverted changes: /q/submissionid:30533261-LocalSimContactsWriteException

Change-Id: I7ff5ee6ef424ecaa084250970e9805fe8579e584
parent 897e38f1
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -37605,10 +37605,6 @@ package android.provider {
    field public static final String TERTIARY_PHONE_TYPE = "tertiary_phone_type";
  }
  @FlaggedApi("android.provider.new_default_account_api_enabled") public static class ContactsContract.LocalSimContactsWriteException extends java.lang.IllegalArgumentException {
    ctor public ContactsContract.LocalSimContactsWriteException(@NonNull String);
  }
  public static final class ContactsContract.PhoneLookup implements android.provider.BaseColumns android.provider.ContactsContract.ContactNameColumns android.provider.ContactsContract.ContactOptionsColumns android.provider.ContactsContract.ContactsColumns android.provider.ContactsContract.PhoneLookupColumns {
    field public static final android.net.Uri CONTENT_FILTER_URI;
    field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
+0 −22
Original line number Diff line number Diff line
@@ -10859,28 +10859,6 @@ public final class ContactsContract {
                "vnd.android.cursor.item/contact_metadata_sync_state";
    }

    /**
     * This exception is thrown when an attempt is made to perform a write operation
     * on a contact or contact group targeting a local account or a SIM account,
     * and the operation is not permitted under the current conditions.
     * The local account can be retrieved using {@link RawContacts#getLocalAccountName(Context)}
     * and {@link RawContacts#getLocalAccountType(Context)}.
     * SIM accounts can be retrieved using {@link SimContacts#getSimAccounts(ContentResolver)}.
     *
     * <p>Local and SIM accounts have limitations that may prevent write operations
     * due to their nature, underlying implementation, or the current system state.
     * For example, the SIM card may be full, read-only, or not present.
     *
     * <p>The specific conditions under which write operations are permitted on
     * local or SIM accounts can vary.
     */
    @FlaggedApi(Flags.FLAG_NEW_DEFAULT_ACCOUNT_API_ENABLED)
    public static class LocalSimContactsWriteException extends IllegalArgumentException {
        public LocalSimContactsWriteException(@NonNull String s) {
            super(s);
        }
    }

    private static Bundle nullSafeCall(@NonNull ContentResolver resolver, @NonNull Uri uri,
            @NonNull String method, @Nullable String arg, @Nullable Bundle extras) {
        try (ContentProviderClient client = resolver.acquireContentProviderClient(uri)) {