Fix installKeyPair cred mng app access control

* Should not be user selectable

Bug: 186159641
Test: atest android.devicepolicy.cts.CredentialManagementAppTest
Change-Id: Ie1ddbe79ed5fe6e9aba33aeb3fd92fe275a48d47
This commit is contained in:
Alex Johnston
2021-04-23 11:01:09 +01:00
parent f715fddd3c
commit 06abbc7d47

View File

@@ -5457,7 +5457,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
&& (isProfileOwner(caller) || isDeviceOwner(caller)))
|| (caller.hasPackage() && (isCallerDelegate || isCredentialManagementApp)));
if (isCredentialManagementApp) {
Preconditions.checkCallAuthorization(isUserSelectable, "The credential "
Preconditions.checkCallAuthorization(!isUserSelectable, "The credential "
+ "management app is not allowed to install a user selectable key pair");
Preconditions.checkCallAuthorization(
isAliasInCredentialManagementAppPolicy(caller, alias),