summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2014-07-25 01:03:17 +0200
committerAdrian Roos <roosa@google.com>2014-07-25 15:03:26 +0200
commit5a46f8c98a326cf90a12f6505e84722030934a4a (patch)
treeacedfe8a3e11483d470c906f590097048f89cddc /packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java
parent237aecd18d0edf56c038761f570758c310c9e6df (diff)
downloadframeworks_base-5a46f8c98a326cf90a12f6505e84722030934a4a.zip
frameworks_base-5a46f8c98a326cf90a12f6505e84722030934a4a.tar.gz
frameworks_base-5a46f8c98a326cf90a12f6505e84722030934a4a.tar.bz2
Remove brightness dialog timeout
Required to make the dialog accessible. Bug: 14116737 Change-Id: Ib126068672cdafccd4470de47e11e2b1efd90e72
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java')
-rw-r--r--packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java38
1 files changed, 1 insertions, 37 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java b/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java
index ad98168..d113139 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java
@@ -31,30 +31,14 @@ import android.widget.ImageView;
import com.android.systemui.R;
/** A dialog that provides controls for adjusting the screen brightness. */
-public class BrightnessDialog extends Activity implements
- BrightnessController.BrightnessStateChangeCallback {
- private final Handler mHandler = new Handler();
+public class BrightnessDialog extends Activity {
private BrightnessController mBrightnessController;
- private int mBrightnessDialogLongTimeout;
- private int mBrightnessDialogShortTimeout;
-
- private final Runnable mDismissDialogRunnable = new Runnable() {
- public void run() {
- finish();
- };
- };
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- final Resources r = getResources();
- mBrightnessDialogLongTimeout = r.getInteger(
- R.integer.quick_settings_brightness_dialog_long_timeout);
- mBrightnessDialogShortTimeout = r.getInteger(
- R.integer.quick_settings_brightness_dialog_short_timeout);
-
final Window window = getWindow();
final WindowManager.LayoutParams lp = window.getAttributes();
@@ -79,33 +63,13 @@ public class BrightnessDialog extends Activity implements
final ToggleSlider slider = (ToggleSlider) findViewById(R.id.brightness_slider);
mBrightnessController = new BrightnessController(this, icon, slider);
mBrightnessController.registerCallbacks();
- mBrightnessController.addStateChangedCallback(this);
-
- dismissBrightnessDialog(mBrightnessDialogLongTimeout);
}
@Override
protected void onStop() {
super.onStop();
- mBrightnessController.removeStateChangedCallback(this);
mBrightnessController.unregisterCallbacks();
-
- removeAllBrightnessDialogCallbacks();
- }
-
- public void onBrightnessLevelChanged() {
- dismissBrightnessDialog(mBrightnessDialogShortTimeout);
- }
-
- private void dismissBrightnessDialog(int timeout) {
- removeAllBrightnessDialogCallbacks();
-
- mHandler.postDelayed(mDismissDialogRunnable, timeout);
- }
-
- private void removeAllBrightnessDialogCallbacks() {
- mHandler.removeCallbacks(mDismissDialogRunnable);
}
@Override