diff options
author | Jeff Brown <jeffbrown@google.com> | 2014-09-12 16:11:07 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2014-09-12 17:31:54 -0700 |
commit | 2175e9c366998ed7bd1a4501b94a02f4f49b932c (patch) | |
tree | 6f4dd75376b8a3d1ac4318bd92ea53addd2be878 /packages/SystemUI/src/com/android/systemui/doze | |
parent | 2642357b8223b417019cf072e59257d2c65c3292 (diff) | |
download | frameworks_base-2175e9c366998ed7bd1a4501b94a02f4f49b932c.zip frameworks_base-2175e9c366998ed7bd1a4501b94a02f4f49b932c.tar.gz frameworks_base-2175e9c366998ed7bd1a4501b94a02f4f49b932c.tar.bz2 |
Add support for dozing after screen off.
On some devices, we want the screen off transition to complete before
we start dozing. Added a new config.xml attribute config_dozeAfterScreenOff
to configure this behavior.
Defer starting dreams until the display is ready.
Fixed some minor issues in the system UI doze service when setting the
display state.
Bug: 16187655
Change-Id: Ib1bc60de5457166f4b4880732db5df989dda67a4
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/doze')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/doze/DozeService.java | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java index f411e62..0aa7f352 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java @@ -121,7 +121,7 @@ public class DozeService extends DreamService { new Intent(NOTIFICATION_PULSE_ACTION).setPackage(getPackageName()), PendingIntent.FLAG_UPDATE_CURRENT); mDisplayStateWhenOn = mDisplayStateSupported ? Display.STATE_DOZE : Display.STATE_ON; - setDozeScreenState(mDisplayStateWhenOn); + mDisplayOff.run(); } @Override @@ -160,16 +160,6 @@ public class DozeService extends DreamService { mHandler.postDelayed(mDisplayOff, millis); } - public void startDozing() { - if (DEBUG) Log.d(mTag, "startDozing mDreaming=" + mDreaming); - if (!mDreaming) { - Log.w(mTag, "Not dozing, no longer dreaming"); - return; - } - - super.startDozing(); - } - @Override public void onDreamingStopped() { if (DEBUG) Log.d(mTag, "onDreamingStopped isDozing=" + isDozing()); @@ -180,24 +170,8 @@ public class DozeService extends DreamService { mWakeLock.release(); } listenForPulseSignals(false); - stopDozing(); - dozingStopped(); - } - - @Override - public void onDetachedFromWindow() { - if (DEBUG) Log.d(mTag, "onDetachedFromWindow"); - super.onDetachedFromWindow(); - - dozingStopped(); - } - - @Override - public void onDestroy() { - if (DEBUG) Log.d(mTag, "onDestroy"); - super.onDestroy(); - dozingStopped(); + mHandler.removeCallbacks(mDisplayOff); } private void requestDoze() { |