diff --git a/res/values/strings.xml b/res/values/strings.xml index 2e1477a0d1e..8eb0f7a8750 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -718,13 +718,6 @@ - - Improve face matching - - Liveness check - - Require eye blink while unlocking - Automatically lock @@ -938,11 +931,6 @@ No security - - Face Unlock - - Low security, experimental - Pattern @@ -968,8 +956,6 @@ None Swipe - - Face Unlock Pattern diff --git a/res/xml/security_settings_biometric_weak.xml b/res/xml/security_settings_biometric_weak.xml deleted file mode 100644 index 4879fe6f62e..00000000000 --- a/res/xml/security_settings_biometric_weak.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/res/xml/security_settings_picker.xml b/res/xml/security_settings_picker.xml index fda44e18f9d..e0c518577a5 100644 --- a/res/xml/security_settings_picker.xml +++ b/res/xml/security_settings_picker.xml @@ -28,11 +28,6 @@ android:title="@string/unlock_set_unlock_none_title" android:persistent="false"/> - - = 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); - } - } else if (quality == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING) { - Intent intent = getLockPatternIntent(context, isFallback, 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_SOMETHING) { + Intent intent = getLockPatternIntent(context, mRequirePassword, + /* confirm credentials */false); + 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); diff --git a/src/com/android/settings/ChooseLockPassword.java b/src/com/android/settings/ChooseLockPassword.java index fa1c678a2c6..bbe3bbbc040 100644 --- a/src/com/android/settings/ChooseLockPassword.java +++ b/src/com/android/settings/ChooseLockPassword.java @@ -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; diff --git a/src/com/android/settings/ChooseLockPattern.java b/src/com/android/settings/ChooseLockPattern.java index 38f908e2748..e8f813f455f 100644 --- a/src/com/android/settings/ChooseLockPattern.java +++ b/src/com/android/settings/ChooseLockPattern.java @@ -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); diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index 2a1fc826ad4..7c45adac896 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -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()) { diff --git a/src/com/android/settings/SetupChooseLockGeneric.java b/src/com/android/settings/SetupChooseLockGeneric.java index 42e2baaa820..e903985ce74 100644 --- a/src/com/android/settings/SetupChooseLockGeneric.java +++ b/src/com/android/settings/SetupChooseLockGeneric.java @@ -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; diff --git a/src/com/android/settings/SetupChooseLockPassword.java b/src/com/android/settings/SetupChooseLockPassword.java index 427420597e3..b9f408e38b4 100644 --- a/src/com/android/settings/SetupChooseLockPassword.java +++ b/src/com/android/settings/SetupChooseLockPassword.java @@ -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); diff --git a/src/com/android/settings/SetupChooseLockPattern.java b/src/com/android/settings/SetupChooseLockPattern.java index 7f2480b1e2a..903a2076ced 100644 --- a/src/com/android/settings/SetupChooseLockPattern.java +++ b/src/com/android/settings/SetupChooseLockPattern.java @@ -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;