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

Commit eb8962d2 authored by Clara Bayarri's avatar Clara Bayarri
Browse files

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
parent 5a3dec0c
Loading
Loading
Loading
Loading
+19 −5
Original line number Diff line number Diff line
@@ -611,12 +611,26 @@ public class ChooseLockGeneric extends SettingsActivity {

        private void removeAllFingerprintTemplatesAndFinish() {
            if (mFingerprintManager != null && mFingerprintManager.isHardwareDetected()
                    && mFingerprintManager.getEnrolledFingerprints().size() > 0) {
                    && mFingerprintManager.hasEnrolledFingerprints(mUserId)) {
                mFingerprintManager.setActiveUser(mUserId);
                mFingerprintManager.remove(
                        new Fingerprint(null, 0, 0, 0), mUserId, mRemovalCallback);
            } else {
                finish();
                        new Fingerprint(null, mUserId, 0, 0), mUserId,
                        new RemovalCallback() {
                            @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
@@ -636,7 +650,7 @@ public class ChooseLockGeneric extends SettingsActivity {
        }

        private int getResIdForFactoryResetProtectionWarningMessage() {
            boolean hasFingerprints = mFingerprintManager.hasEnrolledFingerprints();
            boolean hasFingerprints = mFingerprintManager.hasEnrolledFingerprints(mUserId);
            boolean isProfile = Utils.isManagedProfile(UserManager.get(getActivity()), mUserId);
            switch (mLockPatternUtils.getKeyguardStoredPasswordQuality(mUserId)) {
                case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING: