OSDN Git Service

Purge biometric weak from internal code
authorAdrian Roos <roosa@google.com>
Wed, 7 Jan 2015 19:51:57 +0000 (20:51 +0100)
committerAdrian Roos <roosa@google.com>
Wed, 7 Jan 2015 19:52:09 +0000 (20:52 +0100)
Bug: 18931518
Change-Id: I5da41908b1d6895a69f981e139f2d268327fafcd

res/values/strings.xml
res/xml/security_settings_biometric_weak.xml [deleted file]
res/xml/security_settings_picker.xml
src/com/android/settings/ChooseLockGeneric.java
src/com/android/settings/ChooseLockPassword.java
src/com/android/settings/ChooseLockPattern.java
src/com/android/settings/SecuritySettings.java
src/com/android/settings/SetupChooseLockGeneric.java
src/com/android/settings/SetupChooseLockPassword.java
src/com/android/settings/SetupChooseLockPattern.java

index 2e1477a..8eb0f7a 100644 (file)
 
     <!-- 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>
-<!-- On the security settings screen when using face unlock.  This checkbox is used to toggle whether liveliness detection is required.  If it is checked the user must blink during unlock to prove it's not a photo  -->
-    <string name="biometric_weak_liveliness_title">Liveness check</string>
-    <!-- On the security settings screen when using face unlock.  The summary of the liveliness checkbox -->
-    <string name="biometric_weak_liveliness_summary" msgid="7980026533493781616">Require eye blink while unlocking</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 -->
     <!-- Summary for preference that disables unlock security [CHAR LIMIT=45]-->
     <string name="unlock_set_unlock_none_summary">No security</string>
 
-    <!-- Title for preference that guides the user through a weak biometric lock [CHAR LIMIT=22] -->
-    <string name="unlock_set_unlock_biometric_weak_title">Face Unlock</string>
-    <!-- Summary for preference that disables unlock security [CHAR LIMIT=45]-->
-    <string name="unlock_set_unlock_biometric_weak_summary">Low security, experimental</string>
-
     <!-- Title for preference that guides the user through creating an unlock pattern [CHAR LIMIT=22]-->
     <string name="unlock_set_unlock_pattern_title">Pattern</string>
     <!-- Summary for preference that guides the user through creating an unlock pattern [CHAR LIMIT=45] -->
     <string name="unlock_set_unlock_mode_off">None</string>
     <!-- Summary for "Configure lockscreen" when security is disabled [CHAR LIMIT=45] -->
     <string name="unlock_set_unlock_mode_none">Swipe</string>
-    <!-- Summary for "Configure lockscreen" when security biometric weak is enabled [CHAR LIMIT=45] -->
-    <string name="unlock_set_unlock_mode_biometric_weak">Face Unlock</string>
     <!-- Summary for "Configure lockscreen" when security pattern is enabled [CHAR LIMIT=45] -->
     <string name="unlock_set_unlock_mode_pattern">Pattern</string>
     <!-- Summary for "Configure lockscreen" when security PIN is enabled [CHAR LIMIT=45] -->
diff --git a/res/xml/security_settings_biometric_weak.xml b/res/xml/security_settings_biometric_weak.xml
deleted file mode 100644 (file)
index 4879fe6..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
-                  android:title="@string/security_settings_title">
-
-    <PreferenceCategory
-        android:key="security_category"
-        android:title="@string/lock_settings_title">
-
-        <PreferenceScreen
-            android:key="unlock_set_or_change"
-            android:title="@string/unlock_set_unlock_launch_picker_title"
-            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"/>
-
-        <SwitchPreference
-           android:key="biometric_weak_liveliness"
-           android:title="@string/biometric_weak_liveliness_title"
-           android:summary="@string/biometric_weak_liveliness_summary"/>
-
-        <SwitchPreference
-            android:key="visiblepattern"
-            android:title="@string/lockpattern_settings_enable_visible_pattern_title"/>
-
-        <ListPreference
-            android:key="lock_after_timeout"
-            android:title="@string/lock_after_timeout"
-            android:summary="@string/lock_after_timeout_summary"
-            android:entries="@array/lock_after_timeout_entries"
-            android:entryValues="@array/lock_after_timeout_values"
-            android:persistent="false"/>
-
-        <SwitchPreference
-            android:key="power_button_instantly_locks"
-            android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
-
-        <PreferenceScreen
-            android:key="owner_info_settings"
-            android:fragment="com.android.settings.OwnerInfoSettings"
-            android:title="@string/owner_info_settings_title"
-            android:summary="@string/owner_info_settings_summary"/>
-
-    </PreferenceCategory>
-
-</PreferenceScreen>
index fda44e1..e0c5185 100644 (file)
             android:persistent="false"/>
 
     <PreferenceScreen
-            android:key="unlock_set_biometric_weak"
-            android:title="@string/unlock_set_unlock_biometric_weak_title"
-            android:persistent="false"/>
-
-    <PreferenceScreen
             android:key="unlock_set_pattern"
             android:title="@string/unlock_set_unlock_pattern_title"
             android:persistent="false"/>
index b289e7a..f3fdb98 100644 (file)
@@ -76,12 +76,10 @@ public class ChooseLockGeneric extends SettingsActivity {
         private static final String KEY_UNLOCK_BACKUP_INFO = "unlock_backup_info";
         private static final String KEY_UNLOCK_SET_OFF = "unlock_set_off";
         private static final String KEY_UNLOCK_SET_NONE = "unlock_set_none";
-        private static final String KEY_UNLOCK_SET_BIOMETRIC_WEAK = "unlock_set_biometric_weak";
         private static final String KEY_UNLOCK_SET_PIN = "unlock_set_pin";
         private static final String KEY_UNLOCK_SET_PASSWORD = "unlock_set_password";
         private static final String KEY_UNLOCK_SET_PATTERN = "unlock_set_pattern";
         private static final int CONFIRM_EXISTING_REQUEST = 100;
-        private static final int FALLBACK_REQUEST = 101;
         private static final int ENABLE_ENCRYPTION_REQUEST = 102;
         private static final String PASSWORD_CONFIRMED = "password_confirmed";
 
@@ -195,31 +193,12 @@ public class ChooseLockGeneric extends SettingsActivity {
         }
 
         @Override
-        public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                Bundle savedInstanceState) {
-            View v = super.onCreateView(inflater, container, savedInstanceState);
-            final boolean onlyShowFallback = getActivity().getIntent()
-                    .getBooleanExtra(LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, false);
-            if (onlyShowFallback) {
-                View header = v.inflate(getActivity(),
-                        R.layout.weak_biometric_fallback_header, null);
-                ((ListView) v.findViewById(android.R.id.list)).addHeaderView(header, null, false);
-            }
-
-            return v;
-        }
-
-        @Override
         public void onActivityResult(int requestCode, int resultCode, Intent data) {
             super.onActivityResult(requestCode, resultCode, data);
             mWaitingForConfirmation = false;
             if (requestCode == CONFIRM_EXISTING_REQUEST && resultCode == Activity.RESULT_OK) {
                 mPasswordConfirmed = true;
                 updatePreferencesOrFinish();
-            } else if (requestCode == FALLBACK_REQUEST) {
-                mChooseLockSettingsHelper.utils().deleteTempGallery();
-                getActivity().setResult(resultCode);
-                finish();
             } else if (requestCode == ENABLE_ENCRYPTION_REQUEST
                     && resultCode == Activity.RESULT_OK) {
                 mRequirePassword = data.getBooleanExtra(
@@ -248,22 +227,21 @@ public class ChooseLockGeneric extends SettingsActivity {
             if (quality == -1) {
                 // If caller didn't specify password quality, show UI and allow the user to choose.
                 quality = intent.getIntExtra(MINIMUM_QUALITY_KEY, -1);
-                MutableBoolean allowBiometric = new MutableBoolean(false);
-                quality = upgradeQuality(quality, allowBiometric);
+                quality = upgradeQuality(quality);
                 final PreferenceScreen prefScreen = getPreferenceScreen();
                 if (prefScreen != null) {
                     prefScreen.removeAll();
                 }
                 addPreferencesFromResource(R.xml.security_settings_picker);
-                disableUnusablePreferences(quality, allowBiometric);
+                disableUnusablePreferences(quality);
                 updatePreferenceSummaryIfNeeded();
             } else {
                 updateUnlockMethodAndFinish(quality, false);
             }
         }
 
-        /** increases the quality if necessary, and returns whether biometric is allowed */
-        private int upgradeQuality(int quality, MutableBoolean allowBiometric) {
+        /** increases the quality if necessary */
+        private int upgradeQuality(int quality) {
             quality = upgradeQualityForDPM(quality);
             quality = upgradeQualityForKeyStore(quality);
             return quality;
@@ -292,28 +270,21 @@ public class ChooseLockGeneric extends SettingsActivity {
          * implementation is in disableUnusablePreferenceImpl.
          *
          * @param quality the requested quality.
-         * @param allowBiometric whether to allow biometic screen lock.
          */
-        protected void disableUnusablePreferences(final int quality,
-                MutableBoolean allowBiometric) {
-            disableUnusablePreferencesImpl(quality, allowBiometric, false /* hideDisabled */);
+        protected void disableUnusablePreferences(final int quality) {
+            disableUnusablePreferencesImpl(quality, false /* hideDisabled */);
         }
 
         /***
          * Disables preferences that are less secure than required quality.
          *
          * @param quality the requested quality.
-         * @param allowBiometric whether to allow biometic screen lock.
          * @param hideDisabled whether to hide disable screen lock options.
          */
         protected void disableUnusablePreferencesImpl(final int quality,
-                MutableBoolean allowBiometric, boolean hideDisabled) {
+                boolean hideDisabled) {
             final PreferenceScreen entries = getPreferenceScreen();
             final Intent intent = getActivity().getIntent();
-            final boolean onlyShowFallback = intent.getBooleanExtra(
-                    LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, false);
-            final boolean weakBiometricAvailable =
-                    mChooseLockSettingsHelper.utils().isBiometricWeakInstalled();
 
             // if there are multiple users, disable "None" setting
             UserManager mUm = (UserManager) getSystemService(Context.USER_SERVICE);
@@ -331,10 +302,6 @@ public class ChooseLockGeneric extends SettingsActivity {
                         visible = singleUser; // don't show when there's more than 1 user
                     } else if (KEY_UNLOCK_SET_NONE.equals(key)) {
                         enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
-                    } else if (KEY_UNLOCK_SET_BIOMETRIC_WEAK.equals(key)) {
-                        enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK ||
-                                allowBiometric.value;
-                        visible = weakBiometricAvailable; // If not available, then don't show it.
                     } else if (KEY_UNLOCK_SET_PATTERN.equals(key)) {
                         enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_SOMETHING;
                     } else if (KEY_UNLOCK_SET_PIN.equals(key)) {
@@ -345,7 +312,7 @@ public class ChooseLockGeneric extends SettingsActivity {
                     if (hideDisabled) {
                         visible = visible && enabled;
                     }
-                    if (!visible || (onlyShowFallback && !allowedForFallback(key))) {
+                    if (!visible) {
                         entries.removePreference(pref);
                     } else if (!enabled) {
                         pref.setSummary(R.string.unlock_set_unlock_disabled_summary);
@@ -381,46 +348,16 @@ public class ChooseLockGeneric extends SettingsActivity {
             }
         }
 
-        /**
-         * Check whether the key is allowed for fallback (e.g. bio sensor). Returns true if it's
-         * supported as a backup.
-         *
-         * @param key
-         * @return true if allowed
-         */
-        private boolean allowedForFallback(String key) {
-            return KEY_UNLOCK_BACKUP_INFO.equals(key)  ||
-                    KEY_UNLOCK_SET_PATTERN.equals(key) || KEY_UNLOCK_SET_PIN.equals(key);
-        }
-
-        private Intent getBiometricSensorIntent() {
-            Intent fallBackIntent = new Intent().setClass(getActivity(),
-                    ChooseLockGeneric.InternalActivity.class);
-            fallBackIntent.putExtra(LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, true);
-            fallBackIntent.putExtra(CONFIRM_CREDENTIALS, false);
-            fallBackIntent.putExtra(EXTRA_SHOW_FRAGMENT_TITLE,
-                    R.string.backup_lock_settings_picker_title);
-
-            boolean showTutorial = ALWAY_SHOW_TUTORIAL ||
-                    !mChooseLockSettingsHelper.utils().isBiometricWeakEverChosen();
-            Intent intent = new Intent();
-            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;
-        }
-
         protected Intent getLockPasswordIntent(Context context, int quality,
-                final boolean isFallback, int minLength, final int maxLength,
+                int minLength, final int maxLength,
                 boolean requirePasswordToDecrypt, boolean confirmCredentials) {
-            return ChooseLockPassword.createIntent(context, quality, isFallback, minLength,
+            return ChooseLockPassword.createIntent(context, quality, minLength,
                     maxLength, requirePasswordToDecrypt, confirmCredentials);
         }
 
-        protected Intent getLockPatternIntent(Context context, final boolean isFallback,
-                final boolean requirePassword, final boolean confirmCredentials) {
-            return ChooseLockPattern.createIntent(context, isFallback, requirePassword,
+        protected Intent getLockPatternIntent(Context context, final boolean requirePassword,
+                final boolean confirmCredentials) {
+            return ChooseLockPattern.createIntent(context, requirePassword,
                     confirmCredentials);
         }
 
@@ -444,10 +381,7 @@ public class ChooseLockGeneric extends SettingsActivity {
                 throw new IllegalStateException("Tried to update password without confirming it");
             }
 
-            final boolean isFallback = getActivity().getIntent()
-                .getBooleanExtra(LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, false);
-
-            quality = upgradeQuality(quality, null);
+            quality = upgradeQuality(quality);
 
             final Context context = getActivity();
             if (quality >= DevicePolicyManager.PASSWORD_QUALITY_NUMERIC) {
@@ -456,33 +390,19 @@ public class ChooseLockGeneric extends SettingsActivity {
                     minLength = MIN_PASSWORD_LENGTH;
                 }
                 final int maxLength = mDPM.getPasswordMaximumLength(quality);
-                Intent intent = getLockPasswordIntent(context, quality, isFallback, minLength,
+                Intent intent = getLockPasswordIntent(context, quality, minLength,
                         maxLength, mRequirePassword,  /* confirm credentials */false);
-                if (isFallback) {
-                    startActivityForResult(intent, FALLBACK_REQUEST);
-                    return;
-                } else {
-                    mFinishPending = true;
-                    intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
-                    startActivity(intent);
-                }
+                mFinishPending = true;
+                intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
+                startActivity(intent);
             } else if (quality == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING) {
-                Intent intent = getLockPatternIntent(context, isFallback, mRequirePassword,
+                Intent intent = getLockPatternIntent(context, mRequirePassword,
                         /* confirm credentials */false);
-                if (isFallback) {
-                    startActivityForResult(intent, FALLBACK_REQUEST);
-                    return;
-                } else {
-                    mFinishPending = true;
-                    intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
-                    startActivity(intent);
-                }
-            } else if (quality == DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK) {
-                Intent intent = getBiometricSensorIntent();
                 mFinishPending = true;
+                intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
                 startActivity(intent);
             } else if (quality == DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {
-                mChooseLockSettingsHelper.utils().clearLock(false);
+                mChooseLockSettingsHelper.utils().clearLock();
                 mChooseLockSettingsHelper.utils().setLockScreenDisabled(disabled);
                 getActivity().setResult(Activity.RESULT_OK);
                 finish();
@@ -526,9 +446,6 @@ public class ChooseLockGeneric extends SettingsActivity {
             } else if (KEY_UNLOCK_SET_NONE.equals(unlockMethod)) {
                 updateUnlockMethodAndFinish(
                         DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED, false /* disabled */ );
-            } else if (KEY_UNLOCK_SET_BIOMETRIC_WEAK.equals(unlockMethod)) {
-                maybeEnableEncryption(
-                        DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK, false);
             } else if (KEY_UNLOCK_SET_PATTERN.equals(unlockMethod)) {
                 maybeEnableEncryption(
                         DevicePolicyManager.PASSWORD_QUALITY_SOMETHING, false);
index fa1c678..bbe3bbb 100644 (file)
@@ -63,7 +63,7 @@ public class ChooseLockPassword extends SettingsActivity {
         return modIntent;
     }
 
-    public static Intent createIntent(Context context, int quality, final boolean isFallback,
+    public static Intent createIntent(Context context, int quality,
             int minLength, final int maxLength, boolean requirePasswordToDecrypt,
             boolean confirmCredentials) {
         Intent intent = new Intent().setClass(context, ChooseLockPassword.class);
@@ -71,7 +71,6 @@ public class ChooseLockPassword extends SettingsActivity {
         intent.putExtra(PASSWORD_MIN_KEY, minLength);
         intent.putExtra(PASSWORD_MAX_KEY, maxLength);
         intent.putExtra(ChooseLockGeneric.CONFIRM_CREDENTIALS, confirmCredentials);
-        intent.putExtra(LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, isFallback);
         intent.putExtra(EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, requirePasswordToDecrypt);
         return intent;
     }
@@ -431,14 +430,12 @@ public class ChooseLockPassword extends SettingsActivity {
                 }
             } else if (mUiStage == Stage.NeedToConfirm) {
                 if (mFirstPin.equals(pin)) {
-                    final boolean isFallback = getActivity().getIntent().getBooleanExtra(
-                            LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, false);
                     boolean wasSecureBefore = mLockPatternUtils.isSecure();
-                    mLockPatternUtils.clearLock(isFallback);
+                    mLockPatternUtils.clearLock();
                     final boolean required = getActivity().getIntent().getBooleanExtra(
                             EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, true);
                     mLockPatternUtils.setCredentialRequiredToDecrypt(required);
-                    mLockPatternUtils.saveLockPassword(pin, mRequestedQuality, isFallback);
+                    mLockPatternUtils.saveLockPassword(pin, mRequestedQuality);
                     getActivity().setResult(RESULT_FINISHED);
                     getActivity().finish();
                     mDone = true;
index 38f908e..e8f813f 100644 (file)
@@ -69,12 +69,11 @@ public class ChooseLockPattern extends SettingsActivity {
         return modIntent;
     }
 
-    public static Intent createIntent(Context context, final boolean isFallback,
+    public static Intent createIntent(Context context,
             boolean requirePassword, boolean confirmCredentials) {
         Intent intent = new Intent(context, ChooseLockPattern.class);
         intent.putExtra("key_lock_method", "pattern");
         intent.putExtra(ChooseLockGeneric.CONFIRM_CREDENTIALS, confirmCredentials);
-        intent.putExtra(LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, isFallback);
         intent.putExtra(EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, requirePassword);
         return intent;
     }
@@ -563,16 +562,13 @@ public class ChooseLockPattern extends SettingsActivity {
             LockPatternUtils utils = mChooseLockSettingsHelper.utils();
             final boolean lockVirgin = !utils.isPatternEverChosen();
 
-            final boolean isFallback = getActivity().getIntent()
-                .getBooleanExtra(LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, false);
-
             boolean wasSecureBefore = utils.isSecure();
 
             final boolean required = getActivity().getIntent().getBooleanExtra(
                     EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, true);
             utils.setCredentialRequiredToDecrypt(required);
             utils.setLockPatternEnabled(true);
-            utils.saveLockPattern(mChosenPattern, isFallback);
+            utils.saveLockPattern(mChosenPattern);
 
             if (lockVirgin) {
                 utils.setVisiblePatternEnabled(true);
index 2a1fc82..7c45ada 100644 (file)
@@ -72,9 +72,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
 
     // Lock Settings
     private static final String KEY_UNLOCK_SET_OR_CHANGE = "unlock_set_or_change";
-    private static final String KEY_BIOMETRIC_WEAK_IMPROVE_MATCHING =
-            "biometric_weak_improve_matching";
-    private static final String KEY_BIOMETRIC_WEAK_LIVELINESS = "biometric_weak_liveliness";
     private static final String KEY_LOCK_ENABLED = "lockenabled";
     private static final String KEY_VISIBLE_PATTERN = "visiblepattern";
     private static final String KEY_SECURITY_CATEGORY = "security_category";
@@ -85,8 +82,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
     private static final String KEY_MANAGE_TRUST_AGENTS = "manage_trust_agents";
 
     private static final int SET_OR_CHANGE_LOCK_METHOD_REQUEST = 123;
-    private static final int CONFIRM_EXISTING_FOR_BIOMETRIC_WEAK_IMPROVE_REQUEST = 124;
-    private static final int CONFIRM_EXISTING_FOR_BIOMETRIC_WEAK_LIVELINESS_OFF = 125;
     private static final int CHANGE_TRUST_AGENT_SETTINGS = 126;
 
     // Misc Settings
@@ -104,7 +99,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
 
     // These switch preferences need special handling since they're not all stored in Settings.
     private static final String SWITCH_PREFERENCE_KEYS[] = { KEY_LOCK_AFTER_TIMEOUT,
-            KEY_LOCK_ENABLED, KEY_VISIBLE_PATTERN, KEY_BIOMETRIC_WEAK_LIVELINESS,
+            KEY_LOCK_ENABLED, KEY_VISIBLE_PATTERN,
             KEY_POWER_INSTANTLY_LOCKS, KEY_SHOW_PASSWORD, KEY_TOGGLE_INSTALL_APPLICATIONS };
 
     // Only allow one trust agent on the platform.
@@ -117,7 +112,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
     private LockPatternUtils mLockPatternUtils;
     private ListPreference mLockAfter;
 
-    private SwitchPreference mBiometricWeakLiveliness;
     private SwitchPreference mVisiblePattern;
 
     private SwitchPreference mShowPassword;
@@ -165,9 +159,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
             } else {
                 resid = R.xml.security_settings_chooser;
             }
-        } else if (lockPatternUtils.usingBiometricWeak() &&
-                lockPatternUtils.isBiometricWeakInstalled()) {
-            resid = R.xml.security_settings_biometric_weak;
         } else {
             switch (lockPatternUtils.getKeyguardStoredPasswordQuality()) {
                 case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
@@ -265,10 +256,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
             updateLockAfterPreferenceSummary();
         }
 
-        // biometric weak liveliness
-        mBiometricWeakLiveliness =
-                (SwitchPreference) root.findPreference(KEY_BIOMETRIC_WEAK_LIVELINESS);
-
         // visible pattern
         mVisiblePattern = (SwitchPreference) root.findPreference(KEY_VISIBLE_PATTERN);
 
@@ -284,15 +271,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
                     trustAgentPreference.getTitle()));
         }
 
-        // don't display visible pattern if biometric and backup is not pattern
-        if (resid == R.xml.security_settings_biometric_weak &&
-                mLockPatternUtils.getKeyguardStoredPasswordQuality() !=
-                DevicePolicyManager.PASSWORD_QUALITY_SOMETHING) {
-            if (securityCategory != null && mVisiblePattern != null) {
-                securityCategory.removePreference(root.findPreference(KEY_VISIBLE_PATTERN));
-            }
-        }
-
         // Append the rest of the settings
         addPreferencesFromResource(R.xml.security_settings_misc);
 
@@ -562,10 +540,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
         createPreferenceHierarchy();
 
         final LockPatternUtils lockPatternUtils = mChooseLockSettingsHelper.utils();
-        if (mBiometricWeakLiveliness != null) {
-            mBiometricWeakLiveliness.setChecked(
-                    lockPatternUtils.isBiometricWeakLivelinessEnabled());
-        }
         if (mVisiblePattern != null) {
             mVisiblePattern.setChecked(lockPatternUtils.isVisiblePatternEnabled());
         }
@@ -589,17 +563,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
         if (KEY_UNLOCK_SET_OR_CHANGE.equals(key)) {
             startFragment(this, "com.android.settings.ChooseLockGeneric$ChooseLockGenericFragment",
                     R.string.lock_settings_picker_title, SET_OR_CHANGE_LOCK_METHOD_REQUEST, null);
-        } else if (KEY_BIOMETRIC_WEAK_IMPROVE_MATCHING.equals(key)) {
-            ChooseLockSettingsHelper helper =
-                    new ChooseLockSettingsHelper(this.getActivity(), this);
-            if (!helper.launchConfirmationActivity(
-                    CONFIRM_EXISTING_FOR_BIOMETRIC_WEAK_IMPROVE_REQUEST, null, null)) {
-                // If this returns false, it means no password confirmation is required, so
-                // go ahead and start improve.
-                // Note: currently a backup is required for biometric_weak so this code path
-                // can't be reached, but is here in case things change in the future
-                startBiometricWeakImprove();
-            }
         } else if (KEY_TRUST_AGENT.equals(key)) {
             ChooseLockSettingsHelper helper =
                     new ChooseLockSettingsHelper(this.getActivity(), this);
@@ -623,19 +586,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
     @Override
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
         super.onActivityResult(requestCode, resultCode, data);
-        if (requestCode == CONFIRM_EXISTING_FOR_BIOMETRIC_WEAK_IMPROVE_REQUEST &&
-                resultCode == Activity.RESULT_OK) {
-            startBiometricWeakImprove();
-            return;
-        } else if (requestCode == CONFIRM_EXISTING_FOR_BIOMETRIC_WEAK_LIVELINESS_OFF &&
-                resultCode == Activity.RESULT_OK) {
-            final LockPatternUtils lockPatternUtils = mChooseLockSettingsHelper.utils();
-            lockPatternUtils.setBiometricWeakLivelinessEnabled(false);
-            // Setting the mBiometricWeakLiveliness checked value to false is handled when onResume
-            // is called by grabbing the value from lockPatternUtils.  We can't set it here
-            // because mBiometricWeakLiveliness could be null
-            return;
-        } else if (requestCode == CHANGE_TRUST_AGENT_SETTINGS && resultCode == Activity.RESULT_OK) {
+        if (requestCode == CHANGE_TRUST_AGENT_SETTINGS && resultCode == Activity.RESULT_OK) {
             if (mTrustAgentClickIntent != null) {
                 startActivity(mTrustAgentClickIntent);
                 mTrustAgentClickIntent = null;
@@ -663,26 +614,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
             lockPatternUtils.setLockPatternEnabled((Boolean) value);
         } else if (KEY_VISIBLE_PATTERN.equals(key)) {
             lockPatternUtils.setVisiblePatternEnabled((Boolean) value);
-        } else  if (KEY_BIOMETRIC_WEAK_LIVELINESS.equals(key)) {
-            if ((Boolean) value) {
-                lockPatternUtils.setBiometricWeakLivelinessEnabled(true);
-            } else {
-                // In this case the user has just unchecked the checkbox, but this action requires
-                // them to confirm their password.  We need to re-check the checkbox until
-                // they've confirmed their password
-                mBiometricWeakLiveliness.setChecked(true);
-                ChooseLockSettingsHelper helper =
-                        new ChooseLockSettingsHelper(this.getActivity(), this);
-                if (!helper.launchConfirmationActivity(
-                                CONFIRM_EXISTING_FOR_BIOMETRIC_WEAK_LIVELINESS_OFF, null, null)) {
-                    // If this returns false, it means no password confirmation is required, so
-                    // go ahead and uncheck it here.
-                    // Note: currently a backup is required for biometric_weak so this code path
-                    // can't be reached, but is here in case things change in the future
-                    lockPatternUtils.setBiometricWeakLivelinessEnabled(false);
-                    mBiometricWeakLiveliness.setChecked(false);
-                }
-            }
         } else if (KEY_POWER_INSTANTLY_LOCKS.equals(key)) {
             mLockPatternUtils.setPowerButtonInstantlyLocks((Boolean) value);
         } else if (KEY_SHOW_PASSWORD.equals(key)) {
@@ -706,12 +637,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
         return R.string.help_url_security;
     }
 
-    public void startBiometricWeakImprove(){
-        Intent intent = new Intent();
-        intent.setClassName("com.android.facelock", "com.android.facelock.AddToSetup");
-        startActivity(intent);
-    }
-
     /**
      * For Search. Please keep it in sync when updating "createPreferenceHierarchy()"
      */
@@ -832,13 +757,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
             // Add options for lock/unlock screen
             int resId = getResIdForLockUnlockScreen(context, lockPatternUtils);
 
-            // don't display visible pattern if biometric and backup is not pattern
-            if (resId == R.xml.security_settings_biometric_weak &&
-                    lockPatternUtils.getKeyguardStoredPasswordQuality() !=
-                            DevicePolicyManager.PASSWORD_QUALITY_SOMETHING) {
-                keys.add(KEY_VISIBLE_PATTERN);
-            }
-
             // Do not display SIM lock for devices without an Icc card
             TelephonyManager tm = TelephonyManager.getDefault();
             if (!mIsPrimary || !tm.hasIccCard()) {
index 42e2baa..e903985 100644 (file)
@@ -99,11 +99,9 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric
          * screen lock options here.
          *
          * @param quality the requested quality.
-         * @param allowBiometric whether to allow biometic screen lock
          */
         @Override
-        protected void disableUnusablePreferences(final int quality,
-                MutableBoolean allowBiometric) {
+        protected void disableUnusablePreferences(final int quality) {
             // At this part of the flow, the user has already indicated they want to add a pin,
             // pattern or password, so don't show "None" or "Slide". We disable them here and set
             // the HIDE_DISABLED flag to true to hide them. This only happens for setup wizard.
@@ -111,24 +109,23 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric
             // installed with a policy we need to honor.
             final int newQuality = Math.max(quality,
                     DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
-            super.disableUnusablePreferencesImpl(newQuality, allowBiometric,
-                    true /* hideDisabled */);
+            super.disableUnusablePreferencesImpl(newQuality, true /* hideDisabled */);
         }
 
         @Override
-        protected Intent getLockPasswordIntent(Context context, int quality, boolean isFallback,
+        protected Intent getLockPasswordIntent(Context context, int quality,
                 int minLength, int maxLength, boolean requirePasswordToDecrypt,
                 boolean confirmCredentials) {
             final Intent intent = SetupChooseLockPassword.createIntent(context, quality,
-                    isFallback, minLength, maxLength, requirePasswordToDecrypt, confirmCredentials);
+                    minLength, maxLength, requirePasswordToDecrypt, confirmCredentials);
             SetupWizardUtils.copySetupExtras(getActivity().getIntent(), intent);
             return intent;
         }
 
         @Override
-        protected Intent getLockPatternIntent(Context context, boolean isFallback,
+        protected Intent getLockPatternIntent(Context context,
                 boolean requirePassword, boolean confirmCredentials) {
-            final Intent intent = SetupChooseLockPattern.createIntent(context, isFallback,
+            final Intent intent = SetupChooseLockPattern.createIntent(context,
                     requirePassword, confirmCredentials);
             SetupWizardUtils.copySetupExtras(getActivity().getIntent(), intent);
             return intent;
index 4274205..b9f408e 100644 (file)
@@ -38,10 +38,10 @@ import android.view.WindowInsets;
 public class SetupChooseLockPassword extends ChooseLockPassword
         implements SetupWizardNavBar.NavigationBarListener {
 
-    public static Intent createIntent(Context context, int quality, final boolean isFallback,
+    public static Intent createIntent(Context context, int quality,
             int minLength, final int maxLength, boolean requirePasswordToDecrypt,
             boolean confirmCredentials) {
-        Intent intent = ChooseLockPassword.createIntent(context, quality, isFallback, minLength,
+        Intent intent = ChooseLockPassword.createIntent(context, quality, minLength,
                 maxLength, requirePasswordToDecrypt, confirmCredentials);
         intent.setClass(context, SetupChooseLockPassword.class);
         intent.putExtra(EXTRA_PREFS_SHOW_BUTTON_BAR, false);
index 7f2480b..903a207 100644 (file)
@@ -38,9 +38,9 @@ import android.widget.Button;
 public class SetupChooseLockPattern extends ChooseLockPattern
         implements SetupWizardNavBar.NavigationBarListener {
 
-    public static Intent createIntent(Context context, final boolean isFallback,
+    public static Intent createIntent(Context context,
             boolean requirePassword, boolean confirmCredentials) {
-        Intent intent = ChooseLockPattern.createIntent(context, isFallback, requirePassword,
+        Intent intent = ChooseLockPattern.createIntent(context, requirePassword,
                 confirmCredentials);
         intent.setClass(context, SetupChooseLockPattern.class);
         return intent;