development
Revision | 4b7c4677642eb3d446924de5a52fc035c72eb7eb (tree) |
---|---|
Time | 2011-01-25 08:33:40 |
Author | Jeff Brown <jeffbrown@goog...> |
Commiter | Android Git Automerger |
am 24e38f1b: Merge "Add WindowOrientationListener log enable/disable checkbox." into honeycomb
* commit '24e38f1bef4d8600c64029ce20f9ee7d9d6201a5':
@@ -161,7 +161,14 @@ | ||
161 | 161 | android:layout_below="@id/font_hinting" |
162 | 162 | android:layout_alignParentLeft="true" |
163 | 163 | android:text="@string/development_settings_show_xmpp_text" /> |
164 | - | |
164 | + | |
165 | + <CheckBox android:id="@+id/window_orientation_listener_log" | |
166 | + android:layout_width="wrap_content" | |
167 | + android:layout_height="wrap_content" | |
168 | + android:layout_below="@id/show_xmpp" | |
169 | + android:layout_alignParentLeft="true" | |
170 | + android:text="@string/development_settings_window_orientation_listener_log" /> | |
171 | + | |
165 | 172 | </RelativeLayout> |
166 | 173 | |
167 | 174 | </ScrollView> |
@@ -113,6 +113,7 @@ | ||
113 | 113 | <string name="development_settings_debug_app_label_text">Debug App:</string> |
114 | 114 | <string name="development_settings_show_sleep_text">Show sleep state on LED</string> |
115 | 115 | <string name="development_settings_keep_screen_on_text">Keep screen on while plugged in</string> |
116 | + <string name="development_settings_window_orientation_listener_log">Enable window orientation listener log</string> | |
116 | 117 | |
117 | 118 | <string name="monkey_screen_initialActivity_text"></string> |
118 | 119 | <string name="monkey_screen_number_of_events_label">Number of Events: </string> |
@@ -64,6 +64,7 @@ public class DevelopmentSettings extends Activity { | ||
64 | 64 | private CheckBox mShowBackgroundCB; |
65 | 65 | private CheckBox mShowSleepCB; |
66 | 66 | private CheckBox mShowXmppCB; |
67 | + private CheckBox mWindowOrientationListenerLogCB; | |
67 | 68 | private CheckBox mCompatibilityModeCB; |
68 | 69 | private Spinner mMaxProcsSpinner; |
69 | 70 | private Spinner mWindowAnimationScaleSpinner; |
@@ -74,6 +75,7 @@ public class DevelopmentSettings extends Activity { | ||
74 | 75 | private boolean mWaitForDebugger; |
75 | 76 | private boolean mAlwaysFinish; |
76 | 77 | private int mPointerLocation; |
78 | + private int mWindowOrientationListenerLog; | |
77 | 79 | private int mProcessLimit; |
78 | 80 | private boolean mShowSleep; |
79 | 81 | private boolean mShowXmpp; |
@@ -136,6 +138,8 @@ public class DevelopmentSettings extends Activity { | ||
136 | 138 | mShowSleepCB.setOnClickListener(mShowSleepClicked); |
137 | 139 | mShowXmppCB = (CheckBox)findViewById(R.id.show_xmpp); |
138 | 140 | mShowXmppCB.setOnClickListener(mShowXmppClicked); |
141 | + mWindowOrientationListenerLogCB = (CheckBox)findViewById(R.id.window_orientation_listener_log); | |
142 | + mWindowOrientationListenerLogCB.setOnClickListener(mWindowOrientationListenerLogClicked); | |
139 | 143 | mCompatibilityModeCB = (CheckBox)findViewById(R.id.compatibility_mode); |
140 | 144 | mCompatibilityModeCB.setOnClickListener(mCompatibilityModeClicked); |
141 | 145 | mMaxProcsSpinner = (Spinner)findViewById(R.id.max_procs); |
@@ -203,6 +207,7 @@ public class DevelopmentSettings extends Activity { | ||
203 | 207 | updateFlingerOptions(); |
204 | 208 | updateSleepOptions(); |
205 | 209 | updateXmppOptions(); |
210 | + updateWindowOrientationListenerLogOptions(); | |
206 | 211 | updateCompatibilityOptions(); |
207 | 212 | |
208 | 213 | try { |
@@ -261,6 +266,17 @@ public class DevelopmentSettings extends Activity { | ||
261 | 266 | mPointerLocationSpinner.setSelection(mPointerLocation); |
262 | 267 | } |
263 | 268 | |
269 | + private void writeWindowOrientationListenerLogOptions() { | |
270 | + Settings.System.putInt(getContentResolver(), | |
271 | + Settings.System.WINDOW_ORIENTATION_LISTENER_LOG, mWindowOrientationListenerLog); | |
272 | + } | |
273 | + | |
274 | + private void updateWindowOrientationListenerLogOptions() { | |
275 | + mWindowOrientationListenerLog = Settings.System.getInt(getContentResolver(), | |
276 | + Settings.System.WINDOW_ORIENTATION_LISTENER_LOG, 0); | |
277 | + mWindowOrientationListenerLogCB.setChecked(mWindowOrientationListenerLog != 0); | |
278 | + } | |
279 | + | |
264 | 280 | // Returns the current state of the system property that controls |
265 | 281 | // strictmode flashes. One of: |
266 | 282 | // 0: not explicitly set one way or another |
@@ -478,6 +494,13 @@ public class DevelopmentSettings extends Activity { | ||
478 | 494 | } |
479 | 495 | }; |
480 | 496 | |
497 | + private View.OnClickListener mWindowOrientationListenerLogClicked = new View.OnClickListener() { | |
498 | + public void onClick(View v) { | |
499 | + mWindowOrientationListenerLog = ((CheckBox)v).isChecked() ? 1 : 0; | |
500 | + writeWindowOrientationListenerLogOptions(); | |
501 | + } | |
502 | + }; | |
503 | + | |
481 | 504 | private Spinner.OnItemSelectedListener mPointerLocationChanged |
482 | 505 | = new Spinner.OnItemSelectedListener() { |
483 | 506 | public void onItemSelected(android.widget.AdapterView av, View v, |