Fix 3333490,3250193: Update LockScreen settings

This updates LockScreen to conform to the latest UI design.

Change-Id: Ie88a26db7912ddb4331804e347189cc084c481f4
This commit is contained in:
Jim Miller
2011-01-09 18:00:28 -08:00
parent 9bcc69131d
commit c9787070ba
7 changed files with 69 additions and 42 deletions

View File

@@ -554,15 +554,15 @@
<!-- Security Settings --><skip /> <!-- Security Settings --><skip />
<!-- Security settings screen, setting option name to change screen timeout --> <!-- Security settings screen, setting option name to change screen timeout -->
<string name="lock_after_timeout">Lock device after timeout</string> <string name="lock_after_timeout">Timeout</string>
<!-- Security settings screen, setting option summary to change screen timeout --> <!-- Security settings screen, setting option summary to change screen timeout -->
<string name="lock_after_timeout_summary">Adjust the delay before the device automatically locks</string> <string name="lock_after_timeout_summary">Lock screen <xliff:g id="timeout_string">%1$s</xliff:g> after screen automatically turns off</string>
<!-- Text shown next to checkbox for showing owner info on LockScreen [CHAR LIMIT=50]--> <!-- Text shown next to checkbox for showing owner info on LockScreen [CHAR LIMIT=50]-->
<string name="show_owner_info_on_lockscreen_label">Show owner info on lock screen</string> <string name="show_owner_info_on_lockscreen_label">Show owner info on lock screen</string>
<!-- Text shown for title of owner info setting [CHAR LIMIT=20]--> <!-- Text shown for title of owner info setting [CHAR LIMIT=20]-->
<string name="owner_info_settings_title">Owner info</string> <string name="owner_info_settings_title">Owner info</string>
<!-- Text shown for summary of owner info setting [CHAR LIMIT=40]--> <!-- Text shown for summary of owner info setting [CHAR LIMIT=40]-->
<string name="owner_info_settings_summary">Set or disable showing owner info on lock screen</string> <string name="owner_info_settings_summary"></string>
<!-- Hint text shown in owner info edit text [CHAR LIMIT=50] --> <!-- Hint text shown in owner info edit text [CHAR LIMIT=50] -->
<string name="owner_info_settings_edit_text_hint">Enter text to display on the lock screen</string> <string name="owner_info_settings_edit_text_hint">Enter text to display on the lock screen</string>
<!-- Main Settings screen setting option title for the item to take you the security and location screen --> <!-- Main Settings screen setting option title for the item to take you the security and location screen -->
@@ -584,10 +584,7 @@
<!-- Main Security lock settings --><skip /> <!-- Main Security lock settings --><skip />
<!-- Title for PreferenceScreen to launch picker for security method when there is none [CHAR LIMIT=22] --> <!-- Title for PreferenceScreen to launch picker for security method when there is none [CHAR LIMIT=22] -->
<string name="unlock_set_unlock_launch_picker_title">Set up screen lock</string> <string name="unlock_set_unlock_launch_picker_title">Configure lock screen</string>
<!-- Summary for PreferenceScreen to launch picker for security method when there is none [CHAR LIMIT=45] -->
<string name="unlock_set_unlock_launch_picker_summary">Lock screen with a pattern, PIN, or password</string>
<!-- Title for PreferenceScreen to change security method: None/Pattern/PIN/Password [CHAR LIMIT=22] --> <!-- Title for PreferenceScreen to change security method: None/Pattern/PIN/Password [CHAR LIMIT=22] -->
<string name="unlock_set_unlock_launch_picker_change_title">Change screen lock</string> <string name="unlock_set_unlock_launch_picker_change_title">Change screen lock</string>
@@ -595,40 +592,47 @@
<!-- Summary for PreferenceScreen to changeecurity method: None/Pattern/PIN/Password [CHAR LIMIT=45] --> <!-- Summary for PreferenceScreen to changeecurity method: None/Pattern/PIN/Password [CHAR LIMIT=45] -->
<string name="unlock_set_unlock_launch_picker_change_summary">Change or disable pattern, PIN, or password security</string> <string name="unlock_set_unlock_launch_picker_change_summary">Change or disable pattern, PIN, or password security</string>
<!-- Title for PreferenceScreen to enable any lockscreen method: None/Pattern/PIN/Password [CHAR LIMIT=22] -->
<string name="unlock_set_unlock_launch_picker_enable_title">Enable screen lock</string>
<!-- Summary for PreferenceScreen to changeecurity method: None/Pattern/PIN/Password [CHAR LIMIT=45] --> <!-- Summary for PreferenceScreen to changeecurity method: None/Pattern/PIN/Password [CHAR LIMIT=45] -->
<string name="unlock_set_unlock_launch_picker_enable_summary">Choose a method to lock the screen</string> <string name="unlock_set_unlock_launch_picker_enable_summary">Choose a method to lock the screen</string>
<!-- Title for preference that disables unlock security [CHAR LIMIT=22] --> <!-- Title for preference that disables unlock security [CHAR LIMIT=22] -->
<string name="unlock_set_unlock_off_title">Off</string> <string name="unlock_set_unlock_off_title">Off</string>
<!-- Summary for preference that disables unlock security [CHAR LIMIT=45] --> <!-- Summary for preference that disables unlock security [CHAR LIMIT=45] -->
<string name="unlock_set_unlock_off_summary">Don\u0027t show the lock screen</string> <string name="unlock_set_unlock_off_summary">Never lock the screen</string>
<!-- Title for preference that disables unlock security [CHAR LIMIT=22] --> <!-- Title for preference that disables unlock security [CHAR LIMIT=22] -->
<string name="unlock_set_unlock_none_title">None</string> <string name="unlock_set_unlock_none_title">Unsecure</string>
<!-- Summary for preference that disables unlock security [CHAR LIMIT=45]--> <!-- Summary for preference that disables unlock security [CHAR LIMIT=45]-->
<string name="unlock_set_unlock_none_summary">Disable screen unlock security</string> <string name="unlock_set_unlock_none_summary">Don\u0027t require a pattern, PIN, or password to unlock the screen</string>
<!-- Title for preference that guides the user through creating an unlock pattern [CHAR LIMIT=22]--> <!-- Title for preference that guides the user through creating an unlock pattern [CHAR LIMIT=22]-->
<string name="unlock_set_unlock_pattern_title">Pattern</string> <string name="unlock_set_unlock_pattern_title">Pattern</string>
<!-- Summary for preference that guides the user through creating an unlock pattern [CHAR LIMIT=45] --> <!-- Summary for preference that guides the user through creating an unlock pattern [CHAR LIMIT=45] -->
<string name="unlock_set_unlock_pattern_summary">Draw pattern to unlock screen</string> <string name="unlock_set_unlock_pattern_summary">Require a pattern to unlock the screen</string>
<!-- Title for preference that guides the user through creating an unlock PIN (Personal Identification Number) [CHAR LIMIT=22] --> <!-- Title for preference that guides the user through creating an unlock PIN (Personal Identification Number) [CHAR LIMIT=22] -->
<string name="unlock_set_unlock_pin_title">PIN</string> <string name="unlock_set_unlock_pin_title">PIN</string>
<!-- Summary for preference that guides the user through creating an unlock PIN (Personal Identification Number) [CHAR LIMIT=45] --> <!-- Summary for preference that guides the user through creating an unlock PIN (Personal Identification Number) [CHAR LIMIT=45] -->
<string name="unlock_set_unlock_pin_summary">Enter a numeric PIN to unlock screen</string> <string name="unlock_set_unlock_pin_summary">Require a numeric PIN to unlock the screen</string>
<!-- Title for preference that guides the user through creating an unlock password [CHAR LIMIT=22] --> <!-- Title for preference that guides the user through creating an unlock password [CHAR LIMIT=22] -->
<string name="unlock_set_unlock_password_title">Password</string> <string name="unlock_set_unlock_password_title">Password</string>
<!-- Title for preference that guides the user through creating an unlock password [CHAR LIMIT=45] --> <!-- Title for preference that guides the user through creating an unlock password [CHAR LIMIT=45] -->
<string name="unlock_set_unlock_password_summary">Enter a password to unlock screen</string> <string name="unlock_set_unlock_password_summary">Require a password to unlock the screen</string>
<!-- Summary for preference that has been disabled by DevicePolicyAdmin [CHAR LIMIT=45] --> <!-- Summary for preference that has been disabled by DevicePolicyAdmin [CHAR LIMIT=45] -->
<string name="unlock_set_unlock_disabled_summary">Disabled by remote device administrator</string> <string name="unlock_set_unlock_disabled_summary">Disabled by remote device administrator</string>
<!-- Summary for "Configure lockscreen" when lock screen is off [CHAR LIMIT=45] -->
<string name="unlock_set_unlock_mode_off">Off</string>
<!-- Summary for "Configure lockscreen" when security is disabled [CHAR LIMIT=45] -->
<string name="unlock_set_unlock_mode_none">Unsecure</string>
<!-- Summary for "Configure lockscreen" when security pattern is enabled [CHAR LIMIT=45] -->
<string name="unlock_set_unlock_mode_pattern">Secured with pattern</string>
<!-- Summary for "Configure lockscreen" when security PIN is enabled [CHAR LIMIT=45] -->
<string name="unlock_set_unlock_mode_pin">Secured with PIN</string>
<!-- Summary for "Configure lockscreen" when security password is enabled [CHAR LIMIT=45] -->
<string name="unlock_set_unlock_mode_password">Secured with password</string>
<!-- Title for option to turn of password/pin/pattern unlock. [CHAR LIMIT=22] --> <!-- Title for option to turn of password/pin/pattern unlock. [CHAR LIMIT=22] -->
<string name="unlock_disable_lock_title">Turn off screen lock</string> <string name="unlock_disable_lock_title">Turn off screen lock</string>
@@ -1823,7 +1827,7 @@
<!-- Lock Pattern settings --> <!-- Lock Pattern settings -->
<!-- Security & location settings screen, header --> <!-- Security & location settings screen, header -->
<string name="lock_settings_title">Screen unlock</string> <string name="lock_settings_title">Lock screen</string>
<!-- Security & location settings screen, setting option name --> <!-- Security & location settings screen, setting option name -->
<string name="lockpattern_change_lock_pattern_label">Change unlock pattern</string> <string name="lockpattern_change_lock_pattern_label">Change unlock pattern</string>
<!-- Security & location settings screen, change unlock pattern screen instruction when the user chooses "Change unlock pattern". We first ask the user toe nter the current pattern, and this is the message seen --> <!-- Security & location settings screen, change unlock pattern screen instruction when the user chooses "Change unlock pattern". We first ask the user toe nter the current pattern, and this is the message seen -->

View File

@@ -23,7 +23,7 @@
<PreferenceScreen <PreferenceScreen
android:key="unlock_set_or_change" android:key="unlock_set_or_change"
android:title="@string/unlock_set_unlock_launch_picker_title" android:title="@string/unlock_set_unlock_launch_picker_title"
android:summary="@string/unlock_set_unlock_launch_picker_summary" android:summary="@string/unlock_set_unlock_mode_none"
android:persistent="false"/> android:persistent="false"/>
<PreferenceScreen <PreferenceScreen

View File

@@ -22,8 +22,8 @@
<PreferenceScreen <PreferenceScreen
android:key="unlock_set_or_change" android:key="unlock_set_or_change"
android:title="@string/unlock_set_unlock_launch_picker_enable_title" android:title="@string/unlock_set_unlock_launch_picker_title"
android:summary="@string/unlock_set_unlock_launch_picker_enable_summary" android:summary="@string/unlock_set_unlock_mode_off"
android:persistent="false"/> android:persistent="false"/>
</PreferenceCategory> </PreferenceCategory>

View File

@@ -20,6 +20,12 @@
android:key="security_category" android:key="security_category"
android:title="@string/lock_settings_title"> 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_password"
android:persistent="false"/>
<ListPreference <ListPreference
android:key="lock_after_timeout" android:key="lock_after_timeout"
android:title="@string/lock_after_timeout" android:title="@string/lock_after_timeout"
@@ -28,12 +34,6 @@
android:entryValues="@array/lock_after_timeout_values" android:entryValues="@array/lock_after_timeout_values"
android:persistent="false"/> android:persistent="false"/>
<PreferenceScreen
android:key="unlock_set_or_change"
android:title="@string/unlock_set_unlock_launch_picker_change_title"
android:summary="@string/unlock_set_unlock_launch_picker_change_summary"
android:persistent="false"/>
<CheckBoxPreference <CheckBoxPreference
android:key="unlock_tactile_feedback" android:key="unlock_tactile_feedback"
android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/> android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/>

View File

@@ -20,6 +20,16 @@
android:key="security_category" android:key="security_category"
android:title="@string/lock_settings_title"> 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_pattern"
android:persistent="false"/>
<CheckBoxPreference
android:key="visiblepattern"
android:title="@string/lockpattern_settings_enable_visible_pattern_title"/>
<ListPreference <ListPreference
android:key="lock_after_timeout" android:key="lock_after_timeout"
android:title="@string/lock_after_timeout" android:title="@string/lock_after_timeout"
@@ -28,16 +38,6 @@
android:entryValues="@array/lock_after_timeout_values" android:entryValues="@array/lock_after_timeout_values"
android:persistent="false"/> android:persistent="false"/>
<PreferenceScreen
android:key="unlock_set_or_change"
android:title="@string/unlock_set_unlock_launch_picker_change_title"
android:summary="@string/unlock_set_unlock_launch_picker_change_summary"
android:persistent="false"/>
<CheckBoxPreference
android:key="visiblepattern"
android:title="@string/lockpattern_settings_enable_visible_pattern_title"/>
<CheckBoxPreference <CheckBoxPreference
android:key="unlock_tactile_feedback" android:key="unlock_tactile_feedback"
android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/> android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/>

View File

@@ -20,6 +20,12 @@
android:key="security_category" android:key="security_category"
android:title="@string/lock_settings_title"> 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_pin"
android:persistent="false"/>
<ListPreference <ListPreference
android:key="lock_after_timeout" android:key="lock_after_timeout"
android:title="@string/lock_after_timeout" android:title="@string/lock_after_timeout"
@@ -28,12 +34,6 @@
android:entryValues="@array/lock_after_timeout_values" android:entryValues="@array/lock_after_timeout_values"
android:persistent="false"/> android:persistent="false"/>
<PreferenceScreen
android:key="unlock_set_or_change"
android:title="@string/unlock_set_unlock_launch_picker_change_title"
android:summary="@string/unlock_set_unlock_launch_picker_change_summary"
android:persistent="false"/>
<CheckBoxPreference <CheckBoxPreference
android:key="unlock_tactile_feedback" android:key="unlock_tactile_feedback"
android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/> android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/>

View File

@@ -212,6 +212,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
// lock after preference // lock after preference
mLockAfter = setupLockAfterPreference(pm); mLockAfter = setupLockAfterPreference(pm);
updateLockAfterPreferenceSummary();
// visible pattern // visible pattern
mVisiblePattern = (CheckBoxPreference) pm.findPreference(KEY_VISIBLE_PATTERN); mVisiblePattern = (CheckBoxPreference) pm.findPreference(KEY_VISIBLE_PATTERN);
@@ -303,6 +304,27 @@ public class SecuritySettings extends SettingsPreferenceFragment
return result; 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) { private static void disableUnusableTimeouts(ListPreference pref, long maxTimeout) {
final CharSequence[] entries = pref.getEntries(); final CharSequence[] entries = pref.getEntries();
final CharSequence[] values = pref.getEntryValues(); final CharSequence[] values = pref.getEntryValues();
@@ -788,6 +810,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
Log.e("SecuritySettings", "could not persist lockAfter timeout setting", e); Log.e("SecuritySettings", "could not persist lockAfter timeout setting", e);
} }
updateLockAfterPreferenceSummary();
} else if (preference == mUseLocation) { } else if (preference == mUseLocation) {
boolean newValue = value == null ? false : (Boolean) value; boolean newValue = value == null ? false : (Boolean) value;
GoogleLocationSettingHelper.setUseLocationForServices(getActivity(), newValue); GoogleLocationSettingHelper.setUseLocationForServices(getActivity(), newValue);