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

Commit 044a0a76 authored by Danielle Millett's avatar Danielle Millett
Browse files

Showing a congratulations screen after choosing face unlock backup lock

Once a backup lock has been chosen, it sends an intent to show a
congratulations screen.  The moveTempGallery function has been moved
inside this new activity so it is no longer needed in LockPatternUtils.

Change-Id: I66868e6e3391b8b740f618fe633047ce388f55ca
parent 6581043a
Loading
Loading
Loading
Loading
+14 −15
Original line number Diff line number Diff line
@@ -438,17 +438,6 @@ public class LockPatternUtils {
        this.saveLockPattern(pattern, false);
    }

    /**
     * Calls back SetupFaceLock to save the temporary gallery file if this is the backup lock.
     * This doesn't have to verify that biometric is enabled because it's only called in that case
    */
    void moveTempGallery() {
        Intent intent = new Intent().setClassName("com.android.facelock",
                "com.android.facelock.SetupFaceLock");
        intent.putExtra("moveTempGallery", true);
        mContext.startActivity(intent);
    }

    /**
     * Calls back SetupFaceLock to delete the temporary gallery file
     */
@@ -501,8 +490,7 @@ public class LockPatternUtils {
                    setLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK);
                    setLong(PASSWORD_TYPE_ALTERNATE_KEY,
                            DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
                    setBoolean(BIOMETRIC_WEAK_EVER_CHOSEN_KEY, true);
                    moveTempGallery();
                    finishBiometricWeak();
                }
                dpm.setActivePasswordState(DevicePolicyManager.PASSWORD_QUALITY_SOMETHING, pattern
                        .size(), 0, 0, 0, 0, 0, 0);
@@ -619,8 +607,7 @@ public class LockPatternUtils {
                } else {
                    setLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK);
                    setLong(PASSWORD_TYPE_ALTERNATE_KEY, Math.max(quality, computedQuality));
                    setBoolean(BIOMETRIC_WEAK_EVER_CHOSEN_KEY, true);
                    moveTempGallery();
                    finishBiometricWeak();
                }
                if (computedQuality != DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {
                    int letters = 0;
@@ -1087,4 +1074,16 @@ public class LockPatternUtils {
        }
        return false;
    }

    private void finishBiometricWeak() {
        setBoolean(BIOMETRIC_WEAK_EVER_CHOSEN_KEY, true);

        // Launch intent to show final screen, this also
        // moves the temporary gallery to the actual gallery
        Intent intent = new Intent();
        intent.setClassName("com.android.facelock",
                "com.android.facelock.SetupEndScreen");
        mContext.startActivity(intent);
    }

}