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

Commit c8fe08bd authored by Jigar Thakkar's avatar Jigar Thakkar
Browse files

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
parent 820fe847
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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>
+1 −0
Original line number Diff line number Diff line
@@ -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" />
+2 −3
Original line number Diff line number Diff line
@@ -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();
    }

    /**
+3 −1
Original line number Diff line number Diff line
@@ -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 {