Add config to control app cloning building blocks

Adding a platform config to control app cloning building block adding in
the U release. The default setting is to allow the building blocks to be
enabled.

Bug: 253449368
Test: Tested by flashing the changes on test device
Change-Id: Id30a6841667bd047f7f028ee0107feeeacef0f0c
This commit is contained in:
Jigar Thakkar
2023-04-19 19:27:29 +00:00
parent 820fe8475a
commit c8fe08bdca
4 changed files with 10 additions and 4 deletions

View File

@@ -6408,4 +6408,8 @@
<bool name="config_persistBrightnessNitsForDefaultDisplay">false</bool>
<!-- Whether to request the approval before commit sessions. -->
<bool name="config_isPreApprovalRequestAvailable">true</bool>
<!-- Whether the AOSP support for app cloning building blocks is to be enabled for the
device. -->
<bool name="config_enableAppCloningBuildingBlocks">true</bool>
</resources>

View File

@@ -480,6 +480,7 @@
<java-symbol type="bool" name="config_multiuserDelayUserDataLocking" />
<java-symbol type="bool" name="config_multiuserVisibleBackgroundUsers" />
<java-symbol type="bool" name="config_multiuserVisibleBackgroundUsersOnDefaultDisplay" />
<java-symbol type="bool" name="config_enableAppCloningBuildingBlocks" />
<java-symbol type="bool" name="config_enableTimeoutToDockUserWhenDocked" />
<java-symbol type="integer" name="config_userTypePackageWhitelistMode"/>
<java-symbol type="xml" name="config_user_types" />

View File

@@ -892,9 +892,8 @@ public class SyncManager {
* @return true/false if contact sharing is enabled/disabled
*/
protected boolean isContactSharingAllowedForCloneProfile() {
// TODO(b/253449368): This method should also check for the config controlling
// all app-cloning features.
return mAppCloningDeviceConfigHelper.getEnableAppCloningBuildingBlocks();
return mContext.getResources().getBoolean(R.bool.config_enableAppCloningBuildingBlocks)
&& mAppCloningDeviceConfigHelper.getEnableAppCloningBuildingBlocks();
}
/**

View File

@@ -23,6 +23,7 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Binder;
import com.android.internal.R;
import com.android.internal.config.appcloning.AppCloningDeviceConfigHelper;
import com.android.server.pm.pkg.PackageStateInternal;
import com.android.server.pm.resolution.ComponentResolverApi;
@@ -61,7 +62,8 @@ public class NoFilteringResolver extends CrossProfileResolver {
long flags) {
final long token = Binder.clearCallingIdentity();
try {
return appCloningDeviceConfigHelper.getEnableAppCloningBuildingBlocks()
return context.getResources().getBoolean(R.bool.config_enableAppCloningBuildingBlocks)
&& appCloningDeviceConfigHelper.getEnableAppCloningBuildingBlocks()
&& (resolveForStart || (((flags & PackageManager.MATCH_CLONE_PROFILE) != 0)
&& hasPermission(context, Manifest.permission.QUERY_CLONED_APPS)));
} finally {