Fix 2579224: Add a separate timeout for lockscreen vs display
This change adds a second timeout to the SecuritySettings page
separate from the standard display timeout.
Change-Id: I033a3578d876148bd723dee5d1a2531be5d6b51d
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 1a8e17b..0b44edd 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -72,7 +72,7 @@
<item>11</item>
</string-array>
- <!-- Display settings. The delay in inactivity before the screen is turned off. These are shown ain a list dialog. -->
+ <!-- Display settings. The delay in inactivity before the screen is turned off. These are shown in a list dialog. -->
<string-array name="screen_timeout_entries">
<item>15 seconds</item>
<item>30 seconds</item>
@@ -97,7 +97,40 @@
<!-- Do not translate. -->
<item>1800000</item>
</string-array>
+
+ <!-- Security settings. The delay after screen is turned off until device locks.
+ These are shown in a list dialog. -->
+ <string-array name="lock_after_timeout_entries">
+ <item>immediately</item>
+ <item>5 seconds</item>
+ <item>15 seconds</item>
+ <item>30 seconds</item>
+ <item>1 minute</item>
+ <item>2 minutes</item>
+ <item>10 minutes</item>
+ <item>30 minutes</item>
+ </string-array>
+ <!-- Do not translate. -->
+ <string-array name="lock_after_timeout_values" translatable="false">
+ <!-- Do not translate. -->
+ <item>0</item>
+ <!-- Do not translate. -->
+ <item>5000</item>
+ <!-- Do not translate. -->
+ <item>15000</item>
+ <!-- Do not translate. -->
+ <item>30000</item>
+ <!-- Do not translate. -->
+ <item>60000</item>
+ <!-- Do not translate. -->
+ <item>120000</item>
+ <!-- Do not translate. -->
+ <item>600000</item>
+ <!-- Do not translate. -->
+ <item>1800000</item>
+ </string-array>
+
<!-- TTS settings -->
<!-- Default speech rate choices -->
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6e8082d..495608e 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -520,6 +520,11 @@
<!-- Security Settings --><skip />
+ <!-- Security settings screen, setting option name to change screen timeout -->
+ <string name="lock_after_timeout">Lock device after timeout</string>
+ <!-- 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>
+
<!-- Main Settings screen setting option title for the item to take you the security and location screen -->
<string name="security_settings_title">Location & security</string>
<!-- Location & security settings screen title -->
diff --git a/res/xml/security_settings_password.xml b/res/xml/security_settings_password.xml
index ac06711..6411091 100644
--- a/res/xml/security_settings_password.xml
+++ b/res/xml/security_settings_password.xml
@@ -20,6 +20,14 @@
android:key="security_category"
android:title="@string/lock_settings_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"/>
+
<PreferenceScreen
android:key="unlock_set_or_change"
android:title="@string/unlock_set_unlock_launch_picker_change_title"
diff --git a/res/xml/security_settings_pattern.xml b/res/xml/security_settings_pattern.xml
index 095828a..200c260 100644
--- a/res/xml/security_settings_pattern.xml
+++ b/res/xml/security_settings_pattern.xml
@@ -20,6 +20,14 @@
android:key="security_category"
android:title="@string/lock_settings_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"/>
+
<PreferenceScreen
android:key="unlock_set_or_change"
android:title="@string/unlock_set_unlock_launch_picker_change_title"
diff --git a/res/xml/security_settings_pin.xml b/res/xml/security_settings_pin.xml
index ac06711..31fa110 100644
--- a/res/xml/security_settings_pin.xml
+++ b/res/xml/security_settings_pin.xml
@@ -20,6 +20,14 @@
android:key="security_category"
android:title="@string/lock_settings_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"/>
+
<PreferenceScreen
android:key="unlock_set_or_change"
android:title="@string/unlock_set_unlock_launch_picker_change_title"