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

Commit 458bb5a7 authored by Marcus Hagerott's avatar Marcus Hagerott Committed by Android (Google) Code Review
Browse files

Merge "Add methods for the contacts provider local account"

parents d85e2b46 66dc2a0a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -38344,6 +38344,8 @@ package android.provider {
  public static final class ContactsContract.RawContacts implements android.provider.BaseColumns android.provider.ContactsContract.ContactNameColumns android.provider.ContactsContract.ContactOptionsColumns android.provider.ContactsContract.RawContactsColumns android.provider.ContactsContract.SyncColumns {
    method public static android.net.Uri getContactLookupUri(android.content.ContentResolver, android.net.Uri);
    method @Nullable public static String getLocalAccountName(@NonNull android.content.Context);
    method @Nullable public static String getLocalAccountType(@NonNull android.content.Context);
    method public static android.content.EntityIterator newEntityIterator(android.database.Cursor);
    field public static final int AGGREGATION_MODE_DEFAULT = 0; // 0x0
    field public static final int AGGREGATION_MODE_DISABLED = 3; // 0x3
+36 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package android.provider;

import android.accounts.Account;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
@@ -2901,6 +2903,40 @@ public final class ContactsContract {
            return lookupUri;
        }

        /**
         * The default value used for {@link #ACCOUNT_NAME} of raw contacts when they are inserted
         * without a value for this column.
         *
         * <p>This account is used to identify contacts that are only stored locally in the
         * contacts database instead of being associated with an {@link Account} managed by an
         * installed application.
         *
         * <p>When this returns null then {@link #getLocalAccountType} will also return null and
         * when it is non-null {@link #getLocalAccountType} will also return a non-null value.
         */
        @Nullable
        public static String getLocalAccountName(@NonNull Context context) {
            return TextUtils.nullIfEmpty(context.getString(
                    com.android.internal.R.string.config_rawContactsLocalAccountName));
        }

        /**
         * The default value used for {@link #ACCOUNT_TYPE} of raw contacts when they are inserted
         * without a value for this column.
         *
         * <p>This account is used to identify contacts that are only stored locally in the
         * contacts database instead of being associated with an {@link Account} managed by an
         * installed application.
         *
         * <p>When this returns null then {@link #getLocalAccountName} will also return null and
         * when it is non-null {@link #getLocalAccountName} will also return a non-null value.
         */
        @Nullable
        public static String getLocalAccountType(@NonNull Context context) {
            return TextUtils.nullIfEmpty(context.getString(
                    com.android.internal.R.string.config_rawContactsLocalAccountType));
        }

        /**
         * A sub-directory of a single raw contact that contains all of its
         * {@link ContactsContract.Data} rows. To access this directory
+14 −0
Original line number Diff line number Diff line
@@ -4185,4 +4185,18 @@

    <!-- The package name for the default bug report handler app from power menu short press. This app must be whitelisted. -->
    <string name="config_defaultBugReportHandlerApp" translatable="false"></string>

    <!-- The default value used for RawContacts.ACCOUNT_NAME when contacts are inserted without this
         column set. These contacts are stored locally on the device and will not be removed even
         if an android.account.Account with this name and type exists. A null string will be used
         if the value is left empty. When this is non-empty then config_rawContactsLocalAccountType
         should also be non-empty.  -->
    <string name="config_rawContactsLocalAccountName" translatable="false"></string>

    <!-- The default value used for RawContacts.ACCOUNT_TYPE when contacts are inserted without this
         column set. These contacts are stored locally on the device and will not be removed even
         if an android.account.Account with this name and type exists. A null string will be used
         if the value is left empty.  When this is non-empty then config_rawContactsLocalAccountName
         should also be non-empty.-->
    <string name="config_rawContactsLocalAccountType" translatable="false"></string>
</resources>
+4 −0
Original line number Diff line number Diff line
@@ -3768,4 +3768,8 @@
  <java-symbol type="string" name="accessibility_system_action_toggle_split_screen_label" />

  <java-symbol type="string" name="accessibility_freeform_caption" />

  <!-- For contacts provider. -->
  <java-symbol type="string" name="config_rawContactsLocalAccountName" />
  <java-symbol type="string" name="config_rawContactsLocalAccountType" />
</resources>