Merge "Add config to control app cloning building blocks" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a3b93dcc4b
@@ -6435,4 +6435,8 @@
|
|||||||
<bool name="config_persistBrightnessNitsForDefaultDisplay">false</bool>
|
<bool name="config_persistBrightnessNitsForDefaultDisplay">false</bool>
|
||||||
<!-- Whether to request the approval before commit sessions. -->
|
<!-- Whether to request the approval before commit sessions. -->
|
||||||
<bool name="config_isPreApprovalRequestAvailable">true</bool>
|
<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>
|
</resources>
|
||||||
|
|||||||
@@ -480,6 +480,7 @@
|
|||||||
<java-symbol type="bool" name="config_multiuserDelayUserDataLocking" />
|
<java-symbol type="bool" name="config_multiuserDelayUserDataLocking" />
|
||||||
<java-symbol type="bool" name="config_multiuserVisibleBackgroundUsers" />
|
<java-symbol type="bool" name="config_multiuserVisibleBackgroundUsers" />
|
||||||
<java-symbol type="bool" name="config_multiuserVisibleBackgroundUsersOnDefaultDisplay" />
|
<java-symbol type="bool" name="config_multiuserVisibleBackgroundUsersOnDefaultDisplay" />
|
||||||
|
<java-symbol type="bool" name="config_enableAppCloningBuildingBlocks" />
|
||||||
<java-symbol type="bool" name="config_enableTimeoutToDockUserWhenDocked" />
|
<java-symbol type="bool" name="config_enableTimeoutToDockUserWhenDocked" />
|
||||||
<java-symbol type="integer" name="config_userTypePackageWhitelistMode"/>
|
<java-symbol type="integer" name="config_userTypePackageWhitelistMode"/>
|
||||||
<java-symbol type="xml" name="config_user_types" />
|
<java-symbol type="xml" name="config_user_types" />
|
||||||
|
|||||||
@@ -892,9 +892,8 @@ public class SyncManager {
|
|||||||
* @return true/false if contact sharing is enabled/disabled
|
* @return true/false if contact sharing is enabled/disabled
|
||||||
*/
|
*/
|
||||||
protected boolean isContactSharingAllowedForCloneProfile() {
|
protected boolean isContactSharingAllowedForCloneProfile() {
|
||||||
// TODO(b/253449368): This method should also check for the config controlling
|
return mContext.getResources().getBoolean(R.bool.config_enableAppCloningBuildingBlocks)
|
||||||
// all app-cloning features.
|
&& mAppCloningDeviceConfigHelper.getEnableAppCloningBuildingBlocks();
|
||||||
return mAppCloningDeviceConfigHelper.getEnableAppCloningBuildingBlocks();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import android.content.pm.PackageManager;
|
|||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
|
|
||||||
|
import com.android.internal.R;
|
||||||
import com.android.internal.config.appcloning.AppCloningDeviceConfigHelper;
|
import com.android.internal.config.appcloning.AppCloningDeviceConfigHelper;
|
||||||
import com.android.server.pm.pkg.PackageStateInternal;
|
import com.android.server.pm.pkg.PackageStateInternal;
|
||||||
import com.android.server.pm.resolution.ComponentResolverApi;
|
import com.android.server.pm.resolution.ComponentResolverApi;
|
||||||
@@ -61,7 +62,8 @@ public class NoFilteringResolver extends CrossProfileResolver {
|
|||||||
long flags) {
|
long flags) {
|
||||||
final long token = Binder.clearCallingIdentity();
|
final long token = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
return appCloningDeviceConfigHelper.getEnableAppCloningBuildingBlocks()
|
return context.getResources().getBoolean(R.bool.config_enableAppCloningBuildingBlocks)
|
||||||
|
&& appCloningDeviceConfigHelper.getEnableAppCloningBuildingBlocks()
|
||||||
&& (resolveForStart || (((flags & PackageManager.MATCH_CLONE_PROFILE) != 0)
|
&& (resolveForStart || (((flags & PackageManager.MATCH_CLONE_PROFILE) != 0)
|
||||||
&& hasPermission(context, Manifest.permission.QUERY_CLONED_APPS)));
|
&& hasPermission(context, Manifest.permission.QUERY_CLONED_APPS)));
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user