summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2012-01-10 10:28:31 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-01-10 10:28:31 -0800
commitaf48709993faeb0d3665eb6a491aaec701e1ccd5 (patch)
tree38ea171a6a6a65f38bf32c45a57643226eef80cc
parentaaff44c84f4e88184276064dff9e36eefde3ffcb (diff)
parent071742d838f9b0c312af309c87eaf2c444aeeab8 (diff)
downloadpackages_apps_Settings-af48709993faeb0d3665eb6a491aaec701e1ccd5.tar.gz
packages_apps_Settings-af48709993faeb0d3665eb6a491aaec701e1ccd5.tar.bz2
packages_apps_Settings-af48709993faeb0d3665eb6a491aaec701e1ccd5.zip
Merge "Fix 4560303: Add setting to lock later when power button pressed" into ics-mr1
-rw-r--r--res/values/strings.xml2
-rw-r--r--res/xml/security_settings_biometric_weak.xml4
-rw-r--r--res/xml/security_settings_password.xml4
-rw-r--r--res/xml/security_settings_pattern.xml4
-rw-r--r--res/xml/security_settings_pin.xml4
-rw-r--r--src/com/android/settings/SecuritySettings.java11
6 files changed, 29 insertions, 0 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 9a2912207..90b1446fc 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2226,6 +2226,8 @@
<string name="lockpattern_settings_enable_visible_pattern_title">Make pattern visible</string>
<!-- Security & location settings screen, setting check box title. This setting controls whether tactile feedback will be produced when the user draws the pattern.-->
<string name="lockpattern_settings_enable_tactile_feedback_title">Vibrate on touch</string>
+ <!-- Security & location settings screen, setting check box title. This controls whether the device locks immediately when the power button is pressed. [CHAR LIMIT=28]-->
+ <string name="lockpattern_settings_enable_power_button_instantly_locks">Power button instantly locks</string>
<!-- Security & location settings screen, setting option name when user has never set an unlock pattern -->
<string name="lockpattern_settings_choose_lock_pattern">Set unlock pattern</string>
<!-- Security & location settings screen, setting option name when user has previously set an unlock pattern and wants to change to a new pattern -->
diff --git a/res/xml/security_settings_biometric_weak.xml b/res/xml/security_settings_biometric_weak.xml
index 7d832e44a..080fbc9a5 100644
--- a/res/xml/security_settings_biometric_weak.xml
+++ b/res/xml/security_settings_biometric_weak.xml
@@ -43,6 +43,10 @@
android:persistent="false"/>
<CheckBoxPreference
+ android:key="power_button_instantly_locks"
+ android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
+
+ <CheckBoxPreference
android:key="unlock_tactile_feedback"
android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/>
diff --git a/res/xml/security_settings_password.xml b/res/xml/security_settings_password.xml
index 9ddc18e8a..0e9c71d5a 100644
--- a/res/xml/security_settings_password.xml
+++ b/res/xml/security_settings_password.xml
@@ -34,6 +34,10 @@
android:entryValues="@array/lock_after_timeout_values"
android:persistent="false"/>
+ <CheckBoxPreference
+ android:key="power_button_instantly_locks"
+ android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
+
<PreferenceScreen
android:fragment="com.android.settings.OwnerInfoSettings"
android:key="owner_info_settings"
diff --git a/res/xml/security_settings_pattern.xml b/res/xml/security_settings_pattern.xml
index 4cfc360ad..b91b2b6b2 100644
--- a/res/xml/security_settings_pattern.xml
+++ b/res/xml/security_settings_pattern.xml
@@ -39,6 +39,10 @@
android:persistent="false"/>
<CheckBoxPreference
+ android:key="power_button_instantly_locks"
+ android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
+
+ <CheckBoxPreference
android:key="unlock_tactile_feedback"
android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/>
diff --git a/res/xml/security_settings_pin.xml b/res/xml/security_settings_pin.xml
index 0c8ff974d..4562a9a91 100644
--- a/res/xml/security_settings_pin.xml
+++ b/res/xml/security_settings_pin.xml
@@ -35,6 +35,10 @@
android:persistent="false"/>
<CheckBoxPreference
+ android:key="power_button_instantly_locks"
+ android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
+
+ <CheckBoxPreference
android:key="unlock_tactile_feedback"
android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/>
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index 7ca58152c..adf8c3776 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -66,6 +66,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
private static final String KEY_SHOW_PASSWORD = "show_password";
private static final String KEY_RESET_CREDENTIALS = "reset_credentials";
private static final String KEY_TOGGLE_INSTALL_APPLICATIONS = "toggle_install_applications";
+ private static final String KEY_POWER_INSTANTLY_LOCKS = "power_button_instantly_locks";
DevicePolicyManager mDPM;
@@ -82,6 +83,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
private CheckBoxPreference mToggleAppInstallation;
private DialogInterface mWarnInstallApps;
+ private CheckBoxPreference mPowerButtonInstantlyLocks;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -156,6 +158,10 @@ public class SecuritySettings extends SettingsPreferenceFragment
// visible pattern
mVisiblePattern = (CheckBoxPreference) root.findPreference(KEY_VISIBLE_PATTERN);
+ // lock instantly on power key press
+ mPowerButtonInstantlyLocks = (CheckBoxPreference) root.findPreference(
+ KEY_POWER_INSTANTLY_LOCKS);
+
// don't display visible pattern if biometric and backup is not pattern
if (resid == R.xml.security_settings_biometric_weak &&
mLockPatternUtils.getKeyguardStoredPasswordQuality() !=
@@ -322,6 +328,9 @@ public class SecuritySettings extends SettingsPreferenceFragment
if (mTactileFeedback != null) {
mTactileFeedback.setChecked(lockPatternUtils.isTactileFeedbackEnabled());
}
+ if (mPowerButtonInstantlyLocks != null) {
+ mPowerButtonInstantlyLocks.setChecked(lockPatternUtils.getPowerButtonInstantlyLocks());
+ }
mShowPassword.setChecked(Settings.System.getInt(getContentResolver(),
Settings.System.TEXT_SHOW_PASSWORD, 1) != 0);
@@ -351,6 +360,8 @@ public class SecuritySettings extends SettingsPreferenceFragment
lockPatternUtils.setVisiblePatternEnabled(isToggled(preference));
} else if (KEY_TACTILE_FEEDBACK_ENABLED.equals(key)) {
lockPatternUtils.setTactileFeedbackEnabled(isToggled(preference));
+ } else if (KEY_POWER_INSTANTLY_LOCKS.equals(key)) {
+ lockPatternUtils.setPowerButtonInstantlyLocks(isToggled(preference));
} else if (preference == mShowPassword) {
Settings.System.putInt(getContentResolver(), Settings.System.TEXT_SHOW_PASSWORD,
mShowPassword.isChecked() ? 1 : 0);