From c9787070bab332b80676b745a44dd8ee4d72073d Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Sun, 9 Jan 2011 18:00:28 -0800 Subject: [PATCH] Fix 3333490,3250193: Update LockScreen settings This updates LockScreen to conform to the latest UI design. Change-Id: Ie88a26db7912ddb4331804e347189cc084c481f4 --- res/values/strings.xml | 38 ++++++++++--------- res/xml/security_settings_chooser.xml | 2 +- res/xml/security_settings_lockscreen.xml | 4 +- res/xml/security_settings_password.xml | 12 +++--- res/xml/security_settings_pattern.xml | 20 +++++----- res/xml/security_settings_pin.xml | 12 +++--- .../android/settings/SecuritySettings.java | 23 +++++++++++ 7 files changed, 69 insertions(+), 42 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 25e54997788..a3580706f05 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -554,15 +554,15 @@ - Lock device after timeout + Timeout - Adjust the delay before the device automatically locks + Lock screen %1$s after screen automatically turns off Show owner info on lock screen Owner info - Set or disable showing owner info on lock screen + Enter text to display on the lock screen @@ -584,10 +584,7 @@ - Set up screen lock - - - Lock screen with a pattern, PIN, or password + Configure lock screen Change screen lock @@ -595,40 +592,47 @@ Change or disable pattern, PIN, or password security - - Enable screen lock - Choose a method to lock the screen Off - Don\u0027t show the lock screen + Never lock the screen - None + Unsecure - Disable screen unlock security + Don\u0027t require a pattern, PIN, or password to unlock the screen Pattern - Draw pattern to unlock screen + Require a pattern to unlock the screen PIN - Enter a numeric PIN to unlock screen + Require a numeric PIN to unlock the screen Password - Enter a password to unlock screen + Require a password to unlock the screen Disabled by remote device administrator + + Off + + Unsecure + + Secured with pattern + + Secured with PIN + + Secured with password Turn off screen lock @@ -1823,7 +1827,7 @@ - Screen unlock + Lock screen Change unlock pattern diff --git a/res/xml/security_settings_chooser.xml b/res/xml/security_settings_chooser.xml index 7b5d9c93bb5..60d3a9f1ad4 100644 --- a/res/xml/security_settings_chooser.xml +++ b/res/xml/security_settings_chooser.xml @@ -23,7 +23,7 @@ diff --git a/res/xml/security_settings_password.xml b/res/xml/security_settings_password.xml index 369f9ce5373..936f1816d26 100644 --- a/res/xml/security_settings_password.xml +++ b/res/xml/security_settings_password.xml @@ -20,6 +20,12 @@ android:key="security_category" android:title="@string/lock_settings_title"> + + - - diff --git a/res/xml/security_settings_pattern.xml b/res/xml/security_settings_pattern.xml index 4ff9214df7e..4cfc360ade2 100644 --- a/res/xml/security_settings_pattern.xml +++ b/res/xml/security_settings_pattern.xml @@ -20,6 +20,16 @@ android:key="security_category" android:title="@string/lock_settings_title"> + + + + - - - - diff --git a/res/xml/security_settings_pin.xml b/res/xml/security_settings_pin.xml index 369f9ce5373..0c8ff974daf 100644 --- a/res/xml/security_settings_pin.xml +++ b/res/xml/security_settings_pin.xml @@ -20,6 +20,12 @@ android:key="security_category" android:title="@string/lock_settings_title"> + + - - diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index eea98b4cef8..704eacd146d 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -212,6 +212,7 @@ public class SecuritySettings extends SettingsPreferenceFragment // lock after preference mLockAfter = setupLockAfterPreference(pm); + updateLockAfterPreferenceSummary(); // visible pattern mVisiblePattern = (CheckBoxPreference) pm.findPreference(KEY_VISIBLE_PATTERN); @@ -303,6 +304,27 @@ public class SecuritySettings extends SettingsPreferenceFragment return result; } + private void updateLockAfterPreferenceSummary() { + // Not all security types have a "lock after" preference, so ignore those that don't. + if (mLockAfter == null) return; + + // Update summary message with current value + long currentTimeout = Settings.Secure.getLong(getContentResolver(), + Settings.Secure.LOCK_SCREEN_LOCK_AFTER_TIMEOUT, 0); + final CharSequence[] entries = mLockAfter.getEntries(); + final CharSequence[] values = mLockAfter.getEntryValues(); + int best = 0; + for (int i = 0; i < values.length; i++) { + long timeout = Long.valueOf(values[i].toString()); + if (currentTimeout >= timeout) { + best = i; + } + } + String summary = mLockAfter.getContext() + .getString(R.string.lock_after_timeout_summary, entries[best]); + mLockAfter.setSummary(summary); + } + private static void disableUnusableTimeouts(ListPreference pref, long maxTimeout) { final CharSequence[] entries = pref.getEntries(); final CharSequence[] values = pref.getEntryValues(); @@ -788,6 +810,7 @@ public class SecuritySettings extends SettingsPreferenceFragment } catch (NumberFormatException e) { Log.e("SecuritySettings", "could not persist lockAfter timeout setting", e); } + updateLockAfterPreferenceSummary(); } else if (preference == mUseLocation) { boolean newValue = value == null ? false : (Boolean) value; GoogleLocationSettingHelper.setUseLocationForServices(getActivity(), newValue);