Check user validity before retrying authentication
When managed profile gets wiped Settings may crash with SecurityException when trying to retry authentication for no longer valid user. Test: manually with TestDPC Bug: 201513984 Change-Id: Ib7309abf89be76fcc1bf756c37c09d6b60c6b95c
This commit is contained in:
@@ -108,6 +108,10 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
|||||||
if (errorCode == BiometricPrompt.BIOMETRIC_ERROR_USER_CANCELED
|
if (errorCode == BiometricPrompt.BIOMETRIC_ERROR_USER_CANCELED
|
||||||
|| errorCode == BiometricPrompt.BIOMETRIC_ERROR_CANCELED) {
|
|| errorCode == BiometricPrompt.BIOMETRIC_ERROR_CANCELED) {
|
||||||
finish();
|
finish();
|
||||||
|
} else if (mUserManager.getUserInfo(mUserId) == null) {
|
||||||
|
// This can happen when profile gets wiped due to too many failed auth attempts.
|
||||||
|
Log.i(TAG, "Finishing, user no longer valid: " + mUserId);
|
||||||
|
finish();
|
||||||
} else {
|
} else {
|
||||||
// All other errors go to some version of CC
|
// All other errors go to some version of CC
|
||||||
showConfirmCredentials();
|
showConfirmCredentials();
|
||||||
|
Reference in New Issue
Block a user