@@ -51,6 +51,10 @@ public class SpareParts extends PreferenceActivity
51
51
private static final String BATTERY_INFORMATION_PREF = "battery_information_settings" ;
52
52
private static final String USAGE_STATISTICS_PREF = "usage_statistics_settings" ;
53
53
54
+ //extra
55
+ private static final String MENU_UNLOCK_SCREEN_PREF = "menu_unlock_screen" ;
56
+ //end extra
57
+
54
58
private static final String WINDOW_ANIMATIONS_PREF = "window_animations" ;
55
59
private static final String TRANSITION_ANIMATIONS_PREF = "transition_animations" ;
56
60
private static final String FANCY_IME_ANIMATIONS_PREF = "fancy_ime_animations" ;
@@ -61,6 +65,10 @@ public class SpareParts extends PreferenceActivity
61
65
62
66
private final Configuration mCurConfig = new Configuration ();
63
67
68
+ //extra
69
+ private CheckBoxPreference mMenuUnlockScreenPref ;
70
+ //end extra
71
+
64
72
private ListPreference mWindowAnimationsPref ;
65
73
private ListPreference mTransitionAnimationsPref ;
66
74
private CheckBoxPreference mFancyImeAnimationsPref ;
@@ -113,6 +121,10 @@ public void onCreate(Bundle icicle) {
113
121
114
122
PreferenceScreen prefSet = getPreferenceScreen ();
115
123
124
+ //extra
125
+ mMenuUnlockScreenPref = (CheckBoxPreference ) prefSet .findPreference (MENU_UNLOCK_SCREEN_PREF );
126
+ //end extra
127
+
116
128
mWindowAnimationsPref = (ListPreference ) prefSet .findPreference (WINDOW_ANIMATIONS_PREF );
117
129
mWindowAnimationsPref .setOnPreferenceChangeListener (this );
118
130
mTransitionAnimationsPref = (ListPreference ) prefSet .findPreference (TRANSITION_ANIMATIONS_PREF );
@@ -142,6 +154,11 @@ public void onCreate(Bundle icicle) {
142
154
}
143
155
144
156
private void updateToggles () {
157
+ //extra
158
+ mMenuUnlockScreenPref .setChecked (Settings .System .getInt (
159
+ getContentResolver (),
160
+ Settings .System .MENU_UNLOCK_SCREEN , 0 ) != 0 );
161
+ //end extra
145
162
mFancyImeAnimationsPref .setChecked (Settings .System .getInt (
146
163
getContentResolver (),
147
164
Settings .System .FANCY_IME_ANIMATIONS , 0 ) != 0 );
@@ -242,7 +259,13 @@ public void readEndButtonPreference(ListPreference pref) {
242
259
}
243
260
244
261
public void onSharedPreferenceChanged (SharedPreferences preferences , String key ) {
245
- if (FANCY_IME_ANIMATIONS_PREF .equals (key )) {
262
+ //extra
263
+ if (MENU_UNLOCK_SCREEN_PREF .equals (key )) {
264
+ Settings .System .putInt (getContentResolver (),
265
+ Settings .System .MENU_UNLOCK_SCREEN ,
266
+ mMenuUnlockScreenPref .isChecked () ? 1 : 0 );
267
+ //end extra
268
+ } else if (FANCY_IME_ANIMATIONS_PREF .equals (key )) {
246
269
Settings .System .putInt (getContentResolver (),
247
270
Settings .System .FANCY_IME_ANIMATIONS ,
248
271
mFancyImeAnimationsPref .isChecked () ? 1 : 0 );
0 commit comments