• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


コミットメタ情報

リビジョンaf48709993faeb0d3665eb6a491aaec701e1ccd5 (tree)
日時2012-01-11 03:28:31
作者Jim Miller <jaggies@goog...>
コミッターAndroid (Google) Code Review

ログメッセージ

Merge "Fix 4560303: Add setting to lock later when power button pressed" into ics-mr1

変更サマリ

差分

--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2226,6 +2226,8 @@
22262226 <string name="lockpattern_settings_enable_visible_pattern_title">Make pattern visible</string>
22272227 <!-- Security & location settings screen, setting check box title. This setting controls whether tactile feedback will be produced when the user draws the pattern.-->
22282228 <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>
22292231 <!-- Security & location settings screen, setting option name when user has never set an unlock pattern -->
22302232 <string name="lockpattern_settings_choose_lock_pattern">Set unlock pattern</string>
22312233 <!-- Security & location settings screen, setting option name when user has previously set an unlock pattern and wants to change to a new pattern -->
--- a/res/xml/security_settings_biometric_weak.xml
+++ b/res/xml/security_settings_biometric_weak.xml
@@ -43,6 +43,10 @@
4343 android:persistent="false"/>
4444
4545 <CheckBoxPreference
46+ android:key="power_button_instantly_locks"
47+ android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
48+
49+ <CheckBoxPreference
4650 android:key="unlock_tactile_feedback"
4751 android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/>
4852
--- a/res/xml/security_settings_password.xml
+++ b/res/xml/security_settings_password.xml
@@ -34,6 +34,10 @@
3434 android:entryValues="@array/lock_after_timeout_values"
3535 android:persistent="false"/>
3636
37+ <CheckBoxPreference
38+ android:key="power_button_instantly_locks"
39+ android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
40+
3741 <PreferenceScreen
3842 android:fragment="com.android.settings.OwnerInfoSettings"
3943 android:key="owner_info_settings"
--- a/res/xml/security_settings_pattern.xml
+++ b/res/xml/security_settings_pattern.xml
@@ -39,6 +39,10 @@
3939 android:persistent="false"/>
4040
4141 <CheckBoxPreference
42+ android:key="power_button_instantly_locks"
43+ android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
44+
45+ <CheckBoxPreference
4246 android:key="unlock_tactile_feedback"
4347 android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/>
4448
--- a/res/xml/security_settings_pin.xml
+++ b/res/xml/security_settings_pin.xml
@@ -35,6 +35,10 @@
3535 android:persistent="false"/>
3636
3737 <CheckBoxPreference
38+ android:key="power_button_instantly_locks"
39+ android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
40+
41+ <CheckBoxPreference
3842 android:key="unlock_tactile_feedback"
3943 android:title="@string/lockpattern_settings_enable_tactile_feedback_title"/>
4044
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -66,6 +66,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
6666 private static final String KEY_SHOW_PASSWORD = "show_password";
6767 private static final String KEY_RESET_CREDENTIALS = "reset_credentials";
6868 private static final String KEY_TOGGLE_INSTALL_APPLICATIONS = "toggle_install_applications";
69+ private static final String KEY_POWER_INSTANTLY_LOCKS = "power_button_instantly_locks";
6970
7071 DevicePolicyManager mDPM;
7172
@@ -82,6 +83,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
8283
8384 private CheckBoxPreference mToggleAppInstallation;
8485 private DialogInterface mWarnInstallApps;
86+ private CheckBoxPreference mPowerButtonInstantlyLocks;
8587
8688 @Override
8789 public void onCreate(Bundle savedInstanceState) {
@@ -156,6 +158,10 @@ public class SecuritySettings extends SettingsPreferenceFragment
156158 // visible pattern
157159 mVisiblePattern = (CheckBoxPreference) root.findPreference(KEY_VISIBLE_PATTERN);
158160
161+ // lock instantly on power key press
162+ mPowerButtonInstantlyLocks = (CheckBoxPreference) root.findPreference(
163+ KEY_POWER_INSTANTLY_LOCKS);
164+
159165 // don't display visible pattern if biometric and backup is not pattern
160166 if (resid == R.xml.security_settings_biometric_weak &&
161167 mLockPatternUtils.getKeyguardStoredPasswordQuality() !=
@@ -322,6 +328,9 @@ public class SecuritySettings extends SettingsPreferenceFragment
322328 if (mTactileFeedback != null) {
323329 mTactileFeedback.setChecked(lockPatternUtils.isTactileFeedbackEnabled());
324330 }
331+ if (mPowerButtonInstantlyLocks != null) {
332+ mPowerButtonInstantlyLocks.setChecked(lockPatternUtils.getPowerButtonInstantlyLocks());
333+ }
325334
326335 mShowPassword.setChecked(Settings.System.getInt(getContentResolver(),
327336 Settings.System.TEXT_SHOW_PASSWORD, 1) != 0);
@@ -351,6 +360,8 @@ public class SecuritySettings extends SettingsPreferenceFragment
351360 lockPatternUtils.setVisiblePatternEnabled(isToggled(preference));
352361 } else if (KEY_TACTILE_FEEDBACK_ENABLED.equals(key)) {
353362 lockPatternUtils.setTactileFeedbackEnabled(isToggled(preference));
363+ } else if (KEY_POWER_INSTANTLY_LOCKS.equals(key)) {
364+ lockPatternUtils.setPowerButtonInstantlyLocks(isToggled(preference));
354365 } else if (preference == mShowPassword) {
355366 Settings.System.putInt(getContentResolver(), Settings.System.TEXT_SHOW_PASSWORD,
356367 mShowPassword.isChecked() ? 1 : 0);