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

Commit 4d8462cb authored by Eric Biggers's avatar Eric Biggers
Browse files

Use KeyProperties.UID_SELF instead of KeyStore.UID_SELF

Since the class 'android.security.KeyStore' is going away, the UID_SELF
constant is being moved to a more appropriate location in KeyProperties.
Update code that references this constant to use the new location.  No
change in behavior; the value of the constant remains the same.

Bug: 326508120
Test: build
Flag: NONE mechanical refactoring with no behavior change
Change-Id: I86aa1add526a9eb45bb89a73cc18bb54ba3496c3
parent 94e596ec
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;