Remove usages of LPU.savedPatternExists
The correct method to call is isLockPatternEnabled, which also checks whether we've actually selected a pattern. Also removes the code for the obsolete pattern enabled setting. Bug: 18931518 Change-Id: I6f369eb60f8f6bb1e33384cd06534c713ab52e79
This commit is contained in:
@@ -567,7 +567,6 @@ public class ChooseLockPattern extends SettingsActivity {
|
|||||||
final boolean required = getActivity().getIntent().getBooleanExtra(
|
final boolean required = getActivity().getIntent().getBooleanExtra(
|
||||||
EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, true);
|
EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, true);
|
||||||
utils.setCredentialRequiredToDecrypt(required);
|
utils.setCredentialRequiredToDecrypt(required);
|
||||||
utils.setLockPatternEnabled(true);
|
|
||||||
utils.saveLockPattern(mChosenPattern);
|
utils.saveLockPattern(mChosenPattern);
|
||||||
|
|
||||||
if (lockVirgin) {
|
if (lockVirgin) {
|
||||||
|
@@ -95,7 +95,7 @@ public final class ChooseLockSettingsHelper {
|
|||||||
*/
|
*/
|
||||||
private boolean confirmPattern(int request, CharSequence message,
|
private boolean confirmPattern(int request, CharSequence message,
|
||||||
CharSequence details, boolean returnCredentials) {
|
CharSequence details, boolean returnCredentials) {
|
||||||
if (!mLockPatternUtils.isLockPatternEnabled() || !mLockPatternUtils.savedPatternExists()) {
|
if (!mLockPatternUtils.isLockPatternEnabled()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final Intent intent = new Intent();
|
final Intent intent = new Intent();
|
||||||
|
@@ -148,7 +148,7 @@ public class ConfirmLockPattern extends SettingsActivity {
|
|||||||
// on first launch, if no lock pattern is set, then finish with
|
// on first launch, if no lock pattern is set, then finish with
|
||||||
// success (don't want user to get stuck confirming something that
|
// success (don't want user to get stuck confirming something that
|
||||||
// doesn't exist).
|
// doesn't exist).
|
||||||
if (!mLockPatternUtils.savedPatternExists()) {
|
if (!mLockPatternUtils.isLockPatternEnabled()) {
|
||||||
getActivity().setResult(Activity.RESULT_OK);
|
getActivity().setResult(Activity.RESULT_OK);
|
||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
}
|
}
|
||||||
|
@@ -72,7 +72,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
// Lock Settings
|
// Lock Settings
|
||||||
private static final String KEY_UNLOCK_SET_OR_CHANGE = "unlock_set_or_change";
|
private static final String KEY_UNLOCK_SET_OR_CHANGE = "unlock_set_or_change";
|
||||||
private static final String KEY_LOCK_ENABLED = "lockenabled";
|
|
||||||
private static final String KEY_VISIBLE_PATTERN = "visiblepattern";
|
private static final String KEY_VISIBLE_PATTERN = "visiblepattern";
|
||||||
private static final String KEY_SECURITY_CATEGORY = "security_category";
|
private static final String KEY_SECURITY_CATEGORY = "security_category";
|
||||||
private static final String KEY_DEVICE_ADMIN_CATEGORY = "device_admin_category";
|
private static final String KEY_DEVICE_ADMIN_CATEGORY = "device_admin_category";
|
||||||
@@ -99,8 +98,8 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
// These switch preferences need special handling since they're not all stored in Settings.
|
// 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,
|
private static final String SWITCH_PREFERENCE_KEYS[] = { KEY_LOCK_AFTER_TIMEOUT,
|
||||||
KEY_LOCK_ENABLED, KEY_VISIBLE_PATTERN,
|
KEY_VISIBLE_PATTERN, KEY_POWER_INSTANTLY_LOCKS, KEY_SHOW_PASSWORD,
|
||||||
KEY_POWER_INSTANTLY_LOCKS, KEY_SHOW_PASSWORD, KEY_TOGGLE_INSTALL_APPLICATIONS };
|
KEY_TOGGLE_INSTALL_APPLICATIONS };
|
||||||
|
|
||||||
// Only allow one trust agent on the platform.
|
// Only allow one trust agent on the platform.
|
||||||
private static final boolean ONLY_ONE_TRUST_AGENT = true;
|
private static final boolean ONLY_ONE_TRUST_AGENT = true;
|
||||||
@@ -610,8 +609,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
Log.e("SecuritySettings", "could not persist lockAfter timeout setting", e);
|
Log.e("SecuritySettings", "could not persist lockAfter timeout setting", e);
|
||||||
}
|
}
|
||||||
updateLockAfterPreferenceSummary();
|
updateLockAfterPreferenceSummary();
|
||||||
} else if (KEY_LOCK_ENABLED.equals(key)) {
|
|
||||||
lockPatternUtils.setLockPatternEnabled((Boolean) value);
|
|
||||||
} else if (KEY_VISIBLE_PATTERN.equals(key)) {
|
} else if (KEY_VISIBLE_PATTERN.equals(key)) {
|
||||||
lockPatternUtils.setVisiblePatternEnabled((Boolean) value);
|
lockPatternUtils.setVisiblePatternEnabled((Boolean) value);
|
||||||
} else if (KEY_POWER_INSTANTLY_LOCKS.equals(key)) {
|
} else if (KEY_POWER_INSTANTLY_LOCKS.equals(key)) {
|
||||||
|
Reference in New Issue
Block a user