Add WindowOrientationListener log enable/disable checkbox.

Change-Id: I1107eb39a72b42ddc97e611c3fc33c3997ed49cd
This commit is contained in:
Jeff Brown
2011-01-23 14:57:12 -08:00
parent fd6a2b4d25
commit 2559c31618
3 changed files with 32 additions and 1 deletions

View File

@@ -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,