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

Commit 6f3b1bb1 authored by Danielle Millett's avatar Danielle Millett
Browse files

DO NOT MERGE Cherry picking from MR0 cl 147215

Adding an improve face matching settings option for Face Unlock

Adding an option which will launch a version of setup where faces
can be added to the current gallery.  It requires the user to first
confirm their password before launching addToSetup.

Patch 3 - Updated for renaming of FackLockTutorial to SetupIntro.
Now it is called every time regardless of it it's showing the tutorial
and a flag is passed in to determine whether or not SetupIntro shows
the tutorial.

Patch 4 - Removed 'Setup Complete' toast at the end of screen lock
setups since it was primarily for Face Unlock and the congratulations
screen removes the need for it.

Change-Id: Idc5f960809d992ec7bbce59ef1e13b95ef7cce45
parent de8cd9e6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -637,6 +637,9 @@

    <!-- Security Settings --><skip />

    <!-- Security settings screen when using face unlock, setting option name to start an activity that allows the user to improve accuracy by adding additional enrollment faces -->
    <string name="biometric_weak_improve_matching_title">Improve face matching</string>

    <!-- Security settings screen, setting option name to change screen timeout -->
    <string name="lock_after_timeout">Automatically lock</string>
    <!-- Security settings screen, setting option summary to change screen timeout -->
+4 −0
Original line number Diff line number Diff line
@@ -26,6 +26,10 @@
            android:summary="@string/unlock_set_unlock_mode_biometric_weak"
            android:persistent="false"/>

        <PreferenceScreen
            android:key="biometric_weak_improve_matching"
            android:title="@string/biometric_weak_improve_matching_title"/>

        <CheckBoxPreference
            android:key="visiblepattern"
            android:title="@string/lockpattern_settings_enable_visible_pattern_title"/>
+4 −5
Original line number Diff line number Diff line
@@ -276,7 +276,7 @@ public class ChooseLockGeneric extends PreferenceActivity {
                    KEY_UNLOCK_SET_PATTERN.equals(key) || KEY_UNLOCK_SET_PIN.equals(key);
        }

        private Intent getBiometricSensorIntent(int quality) {
        private Intent getBiometricSensorIntent() {
            Intent fallBackIntent = new Intent().setClass(getActivity(), ChooseLockGeneric.class);
            fallBackIntent.putExtra(LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, true);
            fallBackIntent.putExtra(CONFIRM_CREDENTIALS, false);
@@ -287,9 +287,8 @@ public class ChooseLockGeneric extends PreferenceActivity {
            boolean showTutorial = ALWAY_SHOW_TUTORIAL ||
                    !mChooseLockSettingsHelper.utils().isBiometricWeakEverChosen();
            Intent intent = new Intent();
            intent.setClassName("com.android.facelock", showTutorial
                        ? "com.android.facelock.FaceLockTutorial"
                        : "com.android.facelock.SetupFaceLock");
            intent.setClassName("com.android.facelock", "com.android.facelock.SetupIntro");
            intent.putExtra("showTutorial", showTutorial);
            PendingIntent pending = PendingIntent.getActivity(getActivity(), 0, fallBackIntent, 0);
            intent.putExtra("PendingIntent", pending);
            return intent;
@@ -353,7 +352,7 @@ public class ChooseLockGeneric extends PreferenceActivity {
                    startActivity(intent);
                }
            } else if (quality == DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK) {
                Intent intent = getBiometricSensorIntent(quality);
                Intent intent = getBiometricSensorIntent();
                startActivity(intent);
            } else if (quality == DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {
                mChooseLockSettingsHelper.utils().clearLock(false);
+0 −2
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ import android.view.inputmethod.EditorInfo;
import android.widget.Button;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
import android.widget.Toast;

public class ChooseLockPassword extends PreferenceActivity {
    public static final String PASSWORD_MIN_KEY = "lockscreen.password_min";
@@ -388,7 +387,6 @@ public class ChooseLockPassword extends PreferenceActivity {
                            LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, false);
                    mLockPatternUtils.clearLock(isFallback);
                    mLockPatternUtils.saveLockPassword(pin, mRequestedQuality, isFallback);
                    Toast.makeText(getActivity(), R.string.lock_setup, Toast.LENGTH_SHORT).show();
                    getActivity().finish();
                } else {
                    updateStage(Stage.ConfirmWrong);
+0 −3
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.Collections;
@@ -513,8 +512,6 @@ public class ChooseLockPattern extends PreferenceActivity {
            utils.saveLockPattern(mChosenPattern, isFallback);
            utils.setLockPatternEnabled(true);

            Toast.makeText(getActivity(), R.string.lock_setup, Toast.LENGTH_SHORT).show();

            if (lockVirgin) {
                utils.setVisiblePatternEnabled(true);
                utils.setTactileFeedbackEnabled(false);
Loading