diff options
author | Eric Biggers <ebiggers@google.com> | 2024-05-06 17:34:53 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-05-06 17:34:53 +0000 |
commit | 8f3e19862792534e7032cf8a1c83876ad8f8c26e (patch) | |
tree | c3501ad1ec688b8ffb42cd5132a32ebd4d29cd98 | |
parent | 7f01eaea3595a0774b4d22a5c072ef8b9de09f46 (diff) | |
parent | 4d8462cb28e4c79f5fe6b379fd3d3fda23923ca3 (diff) | |
download | base-8f3e19862792534e7032cf8a1c83876ad8f8c26e.tar.gz |
Merge "Use KeyProperties.UID_SELF instead of KeyStore.UID_SELF" into main
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index dd49260e160e..9dfca4deebbd 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -432,10 +432,10 @@ import android.security.IKeyChainAliasCallback; import android.security.IKeyChainService; import android.security.KeyChain; import android.security.KeyChain.KeyChainConnection; -import android.security.KeyStore; import android.security.keymaster.KeymasterCertificateChain; import android.security.keystore.AttestationUtils; import android.security.keystore.KeyGenParameterSpec; +import android.security.keystore.KeyProperties; import android.security.keystore.ParcelableKeyGenParameterSpec; import android.stats.devicepolicy.DevicePolicyEnums; import android.telecom.TelecomManager; @@ -6248,7 +6248,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { KeyChain.bindAsUser(mContext, caller.getUserHandle()); try { IKeyChainService keyChain = keyChainConnection.getService(); - if (!keyChain.installKeyPair(privKey, cert, chain, alias, KeyStore.UID_SELF)) { + if (!keyChain.installKeyPair(privKey, cert, chain, alias, KeyProperties.UID_SELF)) { logInstallKeyPairFailure(caller, isCredentialManagementApp); return false; } @@ -6588,7 +6588,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } // As the caller will be granted access to the key, ensure no UID was specified, as // it will not have the desired effect. - if (keySpec.getUid() != KeyStore.UID_SELF) { + if (keySpec.getUid() != KeyProperties.UID_SELF) { Slogf.e(LOG_TAG, "Only the caller can be granted access to the generated keypair."); logGenerateKeyPairFailure(caller, isCredentialManagementApp); return false; |