diff options
author | Adrian Roos <roosa@google.com> | 2014-08-15 20:11:38 +0200 |
---|---|---|
committer | Adrian Roos <roosa@google.com> | 2014-08-15 19:09:09 +0000 |
commit | b7ebbded5f1512c5747acc0f06a42399d7710728 (patch) | |
tree | c6b4226a89996ea75abcb4a4aa981417581e59af /packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java | |
parent | 4482e4bb8d1f5fe586b641bc3d6298dc7b8fee80 (diff) | |
download | frameworks_base-b7ebbded5f1512c5747acc0f06a42399d7710728.zip frameworks_base-b7ebbded5f1512c5747acc0f06a42399d7710728.tar.gz frameworks_base-b7ebbded5f1512c5747acc0f06a42399d7710728.tar.bz2 |
Fix errors that could lead to brightness flickering
Ensures that changing the brightness doesn't lead to
another write to settings from SystemUI. Also makes
sure that a BrightnessDialog from a background user
is never showing. While we're in there, fix the obsolete
window flags as well and ensure BrightnessDialog only ever
allocates one BrightnessController.
Bug: 16297345
Change-Id: Id95b598b0fa99680072bc160afb00d2cd49f05ca
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java b/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java index d113139..a1704ff 100644 --- a/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java +++ b/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java @@ -40,35 +40,27 @@ public class BrightnessDialog extends Activity { super.onCreate(savedInstanceState); final Window window = getWindow(); - final WindowManager.LayoutParams lp = window.getAttributes(); - // Offset from the top - lp.y = getResources().getDimensionPixelOffset(R.dimen.volume_panel_top); - lp.type = WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY; - lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS; - - window.setAttributes(lp); window.setGravity(Gravity.TOP); window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND); window.requestFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.quick_settings_brightness_dialog); + + final ImageView icon = (ImageView) findViewById(R.id.brightness_icon); + final ToggleSlider slider = (ToggleSlider) findViewById(R.id.brightness_slider); + mBrightnessController = new BrightnessController(this, icon, slider); } @Override protected void onStart() { super.onStart(); - - final ImageView icon = (ImageView) findViewById(R.id.brightness_icon); - final ToggleSlider slider = (ToggleSlider) findViewById(R.id.brightness_slider); - mBrightnessController = new BrightnessController(this, icon, slider); mBrightnessController.registerCallbacks(); } @Override protected void onStop() { super.onStop(); - mBrightnessController.unregisterCallbacks(); } |