From de593df5b54d75478f5ede312abeac8d7008003d Mon Sep 17 00:00:00 2001 From: Jigar Thakkar Date: Wed, 19 Apr 2023 19:44:33 +0000 Subject: Add check for clone building blocks config Bug: 253449368 Test: Tested by flashing on test device Change-Id: Ie411ccfe24d4735277726f4ee04b025cde5ec7fa --- src/com/android/providers/contacts/ContactsProvider2.java | 14 ++++++++------ 1 file 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(); } /** -- cgit v1.2.3