diff options
author | Jigar Thakkar <jigarthakkar@google.com> | 2023-04-19 19:44:33 +0000 |
---|---|---|
committer | Jigar Thakkar <jigarthakkar@google.com> | 2023-05-02 02:05:41 +0000 |
commit | de593df5b54d75478f5ede312abeac8d7008003d (patch) | |
tree | e43b21731137ade5c9483a8a459f81e0b5f6e6aa | |
parent | 38d26e6c64e7d732305448cf81b09fbe9d0d0b60 (diff) | |
download | ContactsProvider-de593df5b54d75478f5ede312abeac8d7008003d.tar.gz |
Add check for clone building blocks config
Bug: 253449368
Test: Tested by flashing on test device
Change-Id: Ie411ccfe24d4735277726f4ee04b025cde5ec7fa
-rw-r--r-- | src/com/android/providers/contacts/ContactsProvider2.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java index e77526f0..f4ce5c74 100644 --- a/src/com/android/providers/contacts/ContactsProvider2.java +++ b/src/com/android/providers/contacts/ContactsProvider2.java @@ -140,6 +140,7 @@ import android.util.SparseArray; import com.android.common.content.ProjectionMap; import com.android.common.content.SyncStateContentProviderHelper; import com.android.common.io.MoreCloseables; +import com.android.internal.R; import com.android.internal.annotations.GuardedBy; import com.android.internal.config.appcloning.AppCloningDeviceConfigHelper; import com.android.internal.util.ArrayUtils; @@ -2194,16 +2195,17 @@ public class ContactsProvider2 extends AbstractContactsProvider } /** - * Returned whether the feature flag for contacts sharing for clone profile is set. If true, - * the clone contacts provider would use the parent contacts providers contacts data to serve - * its requests. + * Returns whether contacts sharing is enabled allowing the clone contacts provider to use the + * parent contacts providers contacts data to serve its requests. The method returns true if + * the device supports clone profile contacts sharing and the feature flag for the same is + * turned on. + * * @return true/false if contact sharing is enabled/disabled */ @VisibleForTesting protected boolean isContactSharingEnabledForCloneProfile() { - // TODO(b/253449368): This method should also check for the config controlling - // all app-cloning features. - return mAppCloningDeviceConfigHelper.getEnableAppCloningBuildingBlocks(); + return getContext().getResources().getBoolean(R.bool.config_enableAppCloningBuildingBlocks) + && mAppCloningDeviceConfigHelper.getEnableAppCloningBuildingBlocks(); } /** |