Merge "Add config to control app cloning building blocks" into udc-dev

This commit is contained in:
Jigar Thakkar
2023-05-05 14:12:13 +00:00
committed by Android (Google) Code Review
4 changed files with 10 additions and 4 deletions

View File

@@ -6435,4 +6435,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 {