summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-01-23 14:57:12 -0800
committerJeff Brown <jeffbrown@google.com>2011-01-23 14:57:12 -0800
commit2559c3161853586b3e6bd3ab311b7e6a3cbbaf76 (patch)
tree41dfa665f264901f666be0df6f3ba4373fd45785
parentfd6a2b4d2552f4a6179ac6f5f499e48310a8d813 (diff)
downloadandroid_development-2559c3161853586b3e6bd3ab311b7e6a3cbbaf76.tar.gz
android_development-2559c3161853586b3e6bd3ab311b7e6a3cbbaf76.tar.bz2
android_development-2559c3161853586b3e6bd3ab311b7e6a3cbbaf76.zip
Add WindowOrientationListener log enable/disable checkbox.
Change-Id: I1107eb39a72b42ddc97e611c3fc33c3997ed49cd
-rw-r--r--apps/Development/res/layout/development_settings.xml9
-rw-r--r--apps/Development/res/values/strings.xml1
-rw-r--r--apps/Development/src/com/android/development/DevelopmentSettings.java23
3 files changed, 32 insertions, 1 deletions
diff --git a/apps/Development/res/layout/development_settings.xml b/apps/Development/res/layout/development_settings.xml
index fbb6a404f..e9b1dad5d 100644
--- a/apps/Development/res/layout/development_settings.xml
+++ b/apps/Development/res/layout/development_settings.xml
@@ -161,7 +161,14 @@
android:layout_below="@id/font_hinting"
android:layout_alignParentLeft="true"
android:text="@string/development_settings_show_xmpp_text" />
-
+
+ <CheckBox android:id="@+id/window_orientation_listener_log"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/show_xmpp"
+ android:layout_alignParentLeft="true"
+ android:text="@string/development_settings_window_orientation_listener_log" />
+
</RelativeLayout>
</ScrollView>
diff --git a/apps/Development/res/values/strings.xml b/apps/Development/res/values/strings.xml
index 5d8a927ae..0f4763cb1 100644
--- a/apps/Development/res/values/strings.xml
+++ b/apps/Development/res/values/strings.xml
@@ -113,6 +113,7 @@
<string name="development_settings_debug_app_label_text">Debug App:</string>
<string name="development_settings_show_sleep_text">Show sleep state on LED</string>
<string name="development_settings_keep_screen_on_text">Keep screen on while plugged in</string>
+ <string name="development_settings_window_orientation_listener_log">Enable window orientation listener log</string>
<string name="monkey_screen_initialActivity_text"></string>
<string name="monkey_screen_number_of_events_label">Number of Events: </string>
diff --git a/apps/Development/src/com/android/development/DevelopmentSettings.java b/apps/Development/src/com/android/development/DevelopmentSettings.java
index 4cc1c911b..f907a144d 100644
--- a/apps/Development/src/com/android/development/DevelopmentSettings.java
+++ b/apps/Development/src/com/android/development/DevelopmentSettings.java
@@ -64,6 +64,7 @@ public class DevelopmentSettings extends Activity {
private CheckBox mShowBackgroundCB;
private CheckBox mShowSleepCB;
private CheckBox mShowXmppCB;
+ private CheckBox mWindowOrientationListenerLogCB;
private CheckBox mCompatibilityModeCB;
private Spinner mMaxProcsSpinner;
private Spinner mWindowAnimationScaleSpinner;
@@ -74,6 +75,7 @@ public class DevelopmentSettings extends Activity {
private boolean mWaitForDebugger;
private boolean mAlwaysFinish;
private int mPointerLocation;
+ private int mWindowOrientationListenerLog;
private int mProcessLimit;
private boolean mShowSleep;
private boolean mShowXmpp;
@@ -136,6 +138,8 @@ public class DevelopmentSettings extends Activity {
mShowSleepCB.setOnClickListener(mShowSleepClicked);
mShowXmppCB = (CheckBox)findViewById(R.id.show_xmpp);
mShowXmppCB.setOnClickListener(mShowXmppClicked);
+ mWindowOrientationListenerLogCB = (CheckBox)findViewById(R.id.window_orientation_listener_log);
+ mWindowOrientationListenerLogCB.setOnClickListener(mWindowOrientationListenerLogClicked);
mCompatibilityModeCB = (CheckBox)findViewById(R.id.compatibility_mode);
mCompatibilityModeCB.setOnClickListener(mCompatibilityModeClicked);
mMaxProcsSpinner = (Spinner)findViewById(R.id.max_procs);
@@ -203,6 +207,7 @@ public class DevelopmentSettings extends Activity {
updateFlingerOptions();
updateSleepOptions();
updateXmppOptions();
+ updateWindowOrientationListenerLogOptions();
updateCompatibilityOptions();
try {
@@ -261,6 +266,17 @@ public class DevelopmentSettings extends Activity {
mPointerLocationSpinner.setSelection(mPointerLocation);
}
+ private void writeWindowOrientationListenerLogOptions() {
+ Settings.System.putInt(getContentResolver(),
+ Settings.System.WINDOW_ORIENTATION_LISTENER_LOG, mWindowOrientationListenerLog);
+ }
+
+ private void updateWindowOrientationListenerLogOptions() {
+ mWindowOrientationListenerLog = Settings.System.getInt(getContentResolver(),
+ Settings.System.WINDOW_ORIENTATION_LISTENER_LOG, 0);
+ mWindowOrientationListenerLogCB.setChecked(mWindowOrientationListenerLog != 0);
+ }
+
// Returns the current state of the system property that controls
// strictmode flashes. One of:
// 0: not explicitly set one way or another
@@ -478,6 +494,13 @@ public class DevelopmentSettings extends Activity {
}
};
+ private View.OnClickListener mWindowOrientationListenerLogClicked = new View.OnClickListener() {
+ public void onClick(View v) {
+ mWindowOrientationListenerLog = ((CheckBox)v).isChecked() ? 1 : 0;
+ writeWindowOrientationListenerLogOptions();
+ }
+ };
+
private Spinner.OnItemSelectedListener mPointerLocationChanged
= new Spinner.OnItemSelectedListener() {
public void onItemSelected(android.widget.AdapterView av, View v,