Skip to content
Commit ca7007be authored by Rubin Xu's avatar Rubin Xu
Browse files

Fix clearing password with DPM.resetPasswordWithToken()

Using resetPasswordWithToken() to clear password does not function
correctly before user unlock for the following two reasons:
1. it tries to remove keys from vold & keystore before they are unlocked,
    resulting in execution failure and data loss.
2. once lockscreen is cleared, it does not progress user unlock so
    the user is stuck in USER_LOCKED state.

This change fixes both of these issues.

Also make a small change to LockSettingsShellCommand so it no longer accepts
arbitray password if the device is not secured.

Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/
Test: atest com.android.cts.devicepolicy.ManagedProfileTest#testClearPasswordWithTokenBeforeUnlock
Test: atest com.android.cts.devicepolicy.ManagedProfileTest#testResetPasswordWithTokenBeforeUnlock
Fix: 123514964
Bug: 124094969
Bug: 129669035
Change-Id: I38af4842b3cccea37f9e3e61d30bd3d2939e8ab8
parent 23e88129
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment