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

Commit 1f8cdd4e authored by Eric Biggers's avatar Eric Biggers Committed by Automerger Merge Worker
Browse files

Merge "Remove unused methods from android.security.KeyStore" into main am:...

Merge "Remove unused methods from android.security.KeyStore" into main am: c264cd5c am: 35935a2c

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2974617



Change-Id: I8104370e36210d4d346cdfb67bb7beabb81db7da
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 840c8ce5 35935a2c
Loading
Loading
Loading
Loading
+6 −57
Original line number Original line Diff line number Diff line
@@ -21,12 +21,14 @@ import android.os.Build;
import android.os.StrictMode;
import android.os.StrictMode;


/**
/**
 * @hide This should not be made public in its present form because it
 * This class provides some constants and helper methods related to Android's Keystore service.
 * assumes that private and secret key bytes are available and would
 * This class was originally much larger, but its functionality was superseded by other classes.
 * preclude the use of hardware crypto.
 * It now just contains a few remaining pieces for which the users haven't been updated yet.
 * You may be looking for {@link java.security.KeyStore} instead.
 *
 * @hide
 */
 */
public class KeyStore {
public class KeyStore {
    private static final String TAG = "KeyStore";


    // ResponseCodes - see system/security/keystore/include/keystore/keystore.h
    // ResponseCodes - see system/security/keystore/include/keystore/keystore.h
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@@ -42,50 +44,6 @@ public class KeyStore {
        return KEY_STORE;
        return KEY_STORE;
    }
    }


    /** @hide */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    public byte[] get(String key) {
        return null;
    }

    /** @hide */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    public boolean delete(String key) {
        return false;
    }

    /**
     * List uids of all keys that are auth bound to the current user.
     * Only system is allowed to call this method.
     * @hide
     * @deprecated This function always returns null.
     */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    public int[] listUidsOfAuthBoundKeys() {
        return null;
    }


    /**
     * @hide
     * @deprecated This function has no effect.
     */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    public boolean unlock(String password) {
        return false;
    }

    /**
     *
     * @return
     * @deprecated This function always returns true.
     * @hide
     */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
    public boolean isEmpty() {
        return true;
    }

    /**
    /**
     * Add an authentication record to the keystore authorization table.
     * Add an authentication record to the keystore authorization table.
     *
     *
@@ -105,13 +63,4 @@ public class KeyStore {
    public void onDeviceOffBody() {
    public void onDeviceOffBody() {
        AndroidKeyStoreMaintenance.onDeviceOffBody();
        AndroidKeyStoreMaintenance.onDeviceOffBody();
    }
    }

    /**
     * Returns a {@link KeyStoreException} corresponding to the provided keystore/keymaster error
     * code.
     */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    public static KeyStoreException getKeyStoreException(int errorCode) {
        return new KeyStoreException(-10000, "Should not be called.");
    }
}
}