Fixes for Work Challenge Fingerprint
When enrolling fingerprints on both personal and work and then setting the lock to none or swipe, the fingerprints for that user were not being correctly removed due to wrong userIds being passed in. Also fix the wipe dialog message as it was always querying whether the main user has fingerprints instead of the user the dialog applies to. Bug: 27263452, 27199237 Change-Id: I8d170e36f31b5595bc0bb41168a87db9f57eda2f
This commit is contained in:
@@ -611,12 +611,26 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
|
|
||||||
private void removeAllFingerprintTemplatesAndFinish() {
|
private void removeAllFingerprintTemplatesAndFinish() {
|
||||||
if (mFingerprintManager != null && mFingerprintManager.isHardwareDetected()
|
if (mFingerprintManager != null && mFingerprintManager.isHardwareDetected()
|
||||||
&& mFingerprintManager.getEnrolledFingerprints().size() > 0) {
|
&& mFingerprintManager.hasEnrolledFingerprints(mUserId)) {
|
||||||
|
mFingerprintManager.setActiveUser(mUserId);
|
||||||
mFingerprintManager.remove(
|
mFingerprintManager.remove(
|
||||||
new Fingerprint(null, 0, 0, 0), mUserId, mRemovalCallback);
|
new Fingerprint(null, mUserId, 0, 0), mUserId,
|
||||||
} else {
|
new RemovalCallback() {
|
||||||
finish();
|
@Override
|
||||||
|
public void onRemovalError(Fingerprint fp, int errMsgId,
|
||||||
|
CharSequence errString) {
|
||||||
|
mRemovalCallback.onRemovalError(fp, errMsgId, errString);
|
||||||
|
mFingerprintManager.setActiveUser(UserHandle.myUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRemovalSucceeded(Fingerprint fingerprint) {
|
||||||
|
mRemovalCallback.onRemovalSucceeded(fingerprint);
|
||||||
|
mFingerprintManager.setActiveUser(UserHandle.myUserId());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -636,7 +650,7 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getResIdForFactoryResetProtectionWarningMessage() {
|
private int getResIdForFactoryResetProtectionWarningMessage() {
|
||||||
boolean hasFingerprints = mFingerprintManager.hasEnrolledFingerprints();
|
boolean hasFingerprints = mFingerprintManager.hasEnrolledFingerprints(mUserId);
|
||||||
boolean isProfile = Utils.isManagedProfile(UserManager.get(getActivity()), mUserId);
|
boolean isProfile = Utils.isManagedProfile(UserManager.get(getActivity()), mUserId);
|
||||||
switch (mLockPatternUtils.getKeyguardStoredPasswordQuality(mUserId)) {
|
switch (mLockPatternUtils.getKeyguardStoredPasswordQuality(mUserId)) {
|
||||||
case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
|
case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
|
||||||
|
Reference in New Issue
Block a user