packages/apps/Settings
Revisión | af48709993faeb0d3665eb6a491aaec701e1ccd5 (tree) |
---|---|
Tiempo | 2012-01-11 03:28:31 |
Autor | Jim Miller <jaggies@goog...> |
Commiter | Android (Google) Code Review |
Merge "Fix 4560303: Add setting to lock later when power button pressed" into ics-mr1
@@ -2226,6 +2226,8 @@ | ||
2226 | 2226 | <string name="lockpattern_settings_enable_visible_pattern_title">Make pattern visible</string> |
2227 | 2227 | <!-- Security & location settings screen, setting check box title. This setting controls whether tactile feedback will be produced when the user draws the pattern.--> |
2228 | 2228 | <string name="lockpattern_settings_enable_tactile_feedback_title">Vibrate on touch</string> |
2229 | + <!-- Security & location settings screen, setting check box title. This controls whether the device locks immediately when the power button is pressed. [CHAR LIMIT=28]--> | |
2230 | + <string name="lockpattern_settings_enable_power_button_instantly_locks">Power button instantly locks</string> | |
2229 | 2231 | <!-- Security & location settings screen, setting option name when user has never set an unlock pattern --> |
2230 | 2232 | <string name="lockpattern_settings_choose_lock_pattern">Set unlock pattern</string> |
2231 | 2233 | <!-- Security & location settings screen, setting option name when user has previously set an unlock pattern and wants to change to a new pattern --> |
@@ -43,6 +43,10 @@ | ||
43 | 43 | android:persistent="false"/> |
44 | 44 | |
45 | 45 | <CheckBoxPreference |
46 | + android:key="power_button_instantly_locks" | |
47 | + android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/> | |
48 | + | |
49 | + <CheckBoxPreference | |
46 | 50 | android:key="unlock_tactile_feedback" |
47 | 51 | android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/> |
48 | 52 |
@@ -34,6 +34,10 @@ | ||
34 | 34 | android:entryValues="@array/lock_after_timeout_values" |
35 | 35 | android:persistent="false"/> |
36 | 36 | |
37 | + <CheckBoxPreference | |
38 | + android:key="power_button_instantly_locks" | |
39 | + android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/> | |
40 | + | |
37 | 41 | <PreferenceScreen |
38 | 42 | android:fragment="com.android.settings.OwnerInfoSettings" |
39 | 43 | android:key="owner_info_settings" |
@@ -39,6 +39,10 @@ | ||
39 | 39 | android:persistent="false"/> |
40 | 40 | |
41 | 41 | <CheckBoxPreference |
42 | + android:key="power_button_instantly_locks" | |
43 | + android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/> | |
44 | + | |
45 | + <CheckBoxPreference | |
42 | 46 | android:key="unlock_tactile_feedback" |
43 | 47 | android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/> |
44 | 48 |
@@ -35,6 +35,10 @@ | ||
35 | 35 | android:persistent="false"/> |
36 | 36 | |
37 | 37 | <CheckBoxPreference |
38 | + android:key="power_button_instantly_locks" | |
39 | + android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/> | |
40 | + | |
41 | + <CheckBoxPreference | |
38 | 42 | android:key="unlock_tactile_feedback" |
39 | 43 | android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/> |
40 | 44 |
@@ -66,6 +66,7 @@ public class SecuritySettings extends SettingsPreferenceFragment | ||
66 | 66 | private static final String KEY_SHOW_PASSWORD = "show_password"; |
67 | 67 | private static final String KEY_RESET_CREDENTIALS = "reset_credentials"; |
68 | 68 | private static final String KEY_TOGGLE_INSTALL_APPLICATIONS = "toggle_install_applications"; |
69 | + private static final String KEY_POWER_INSTANTLY_LOCKS = "power_button_instantly_locks"; | |
69 | 70 | |
70 | 71 | DevicePolicyManager mDPM; |
71 | 72 |
@@ -82,6 +83,7 @@ public class SecuritySettings extends SettingsPreferenceFragment | ||
82 | 83 | |
83 | 84 | private CheckBoxPreference mToggleAppInstallation; |
84 | 85 | private DialogInterface mWarnInstallApps; |
86 | + private CheckBoxPreference mPowerButtonInstantlyLocks; | |
85 | 87 | |
86 | 88 | @Override |
87 | 89 | public void onCreate(Bundle savedInstanceState) { |
@@ -156,6 +158,10 @@ public class SecuritySettings extends SettingsPreferenceFragment | ||
156 | 158 | // visible pattern |
157 | 159 | mVisiblePattern = (CheckBoxPreference) root.findPreference(KEY_VISIBLE_PATTERN); |
158 | 160 | |
161 | + // lock instantly on power key press | |
162 | + mPowerButtonInstantlyLocks = (CheckBoxPreference) root.findPreference( | |
163 | + KEY_POWER_INSTANTLY_LOCKS); | |
164 | + | |
159 | 165 | // don't display visible pattern if biometric and backup is not pattern |
160 | 166 | if (resid == R.xml.security_settings_biometric_weak && |
161 | 167 | mLockPatternUtils.getKeyguardStoredPasswordQuality() != |
@@ -322,6 +328,9 @@ public class SecuritySettings extends SettingsPreferenceFragment | ||
322 | 328 | if (mTactileFeedback != null) { |
323 | 329 | mTactileFeedback.setChecked(lockPatternUtils.isTactileFeedbackEnabled()); |
324 | 330 | } |
331 | + if (mPowerButtonInstantlyLocks != null) { | |
332 | + mPowerButtonInstantlyLocks.setChecked(lockPatternUtils.getPowerButtonInstantlyLocks()); | |
333 | + } | |
325 | 334 | |
326 | 335 | mShowPassword.setChecked(Settings.System.getInt(getContentResolver(), |
327 | 336 | Settings.System.TEXT_SHOW_PASSWORD, 1) != 0); |
@@ -351,6 +360,8 @@ public class SecuritySettings extends SettingsPreferenceFragment | ||
351 | 360 | lockPatternUtils.setVisiblePatternEnabled(isToggled(preference)); |
352 | 361 | } else if (KEY_TACTILE_FEEDBACK_ENABLED.equals(key)) { |
353 | 362 | lockPatternUtils.setTactileFeedbackEnabled(isToggled(preference)); |
363 | + } else if (KEY_POWER_INSTANTLY_LOCKS.equals(key)) { | |
364 | + lockPatternUtils.setPowerButtonInstantlyLocks(isToggled(preference)); | |
354 | 365 | } else if (preference == mShowPassword) { |
355 | 366 | Settings.System.putInt(getContentResolver(), Settings.System.TEXT_SHOW_PASSWORD, |
356 | 367 | mShowPassword.isChecked() ? 1 : 0); |