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

Commit 40405d81 authored by Eric Biggers's avatar Eric Biggers Committed by Automerger Merge Worker
Browse files

Merge "Improve documentation for unlockUserKeyIfUnsecured()" into main am:...

Merge "Improve documentation for unlockUserKeyIfUnsecured()" into main am: c410ea7a am: de2f11c6 am: 78745183

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



Change-Id: I9f3cfafbbed6b771d8805a08460e4c4e6d480cc7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 27a6e18c 78745183
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -1934,15 +1934,21 @@ public class LockPatternUtils {
    }

    /**
     * Unlocks the credential-encrypted storage for the given user if the user is not secured, i.e.
     * doesn't have an LSKF.
     * If the user is not secured, ie doesn't have an LSKF, then decrypt the user's synthetic
     * password and use it to unlock various cryptographic keys associated with the user.  This
     * primarily includes unlocking the user's credential-encrypted (CE) storage.  It also includes
     * deriving or decrypting the vendor auth secret and sending it to the AuthSecret HAL.
     * <p>
     * These tasks would normally be done when the LSKF is verified.  This method is where these
     * tasks are done when the user doesn't have an LSKF.  It's called when the user is started.
     * <p>
     * Except on permission denied, this method doesn't throw an exception on failure.  However, the
     * last thing that it does is unlock CE storage, and whether CE storage has been successfully
     * unlocked can be determined by {@link StorageManager#isCeStorageUnlocked()}.
     * <p>
     * Whether the storage has been unlocked can be determined by
     * {@link StorageManager#isUserKeyUnlocked()}.
     *
     * Requires the {@link android.Manifest.permission#ACCESS_KEYGUARD_SECURE_STORAGE} permission.
     *
     * @param userId the ID of the user whose storage to unlock
     * @param userId the ID of the user whose keys to unlock
     */
    public void unlockUserKeyIfUnsecured(@UserIdInt int userId) {
        try {