diff options
author | Selim Cinek <cinek@google.com> | 2015-10-06 02:11:51 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-10-06 02:11:51 +0000 |
commit | ab8616cf183cd408039be394fee709f4e0ee1303 (patch) | |
tree | 4645c6298951be56937bf8afe2199394909461bb | |
parent | 42efe5b333c1f28127da57a44b39bd72cfbe81b2 (diff) | |
parent | 235a6911b0939adc598e4135e1f1c6fcda9ff169 (diff) | |
download | frameworks_base-ab8616cf183cd408039be394fee709f4e0ee1303.zip frameworks_base-ab8616cf183cd408039be394fee709f4e0ee1303.tar.gz frameworks_base-ab8616cf183cd408039be394fee709f4e0ee1303.tar.bz2 |
am 235a6911: am 714a61cd: Merge "Ambient display now comes up immediately when a notification comes in" into mnc-dr-dev
* commit '235a6911b0939adc598e4135e1f1c6fcda9ff169':
Ambient display now comes up immediately when a notification comes in
-rw-r--r-- | packages/SystemUI/res/values/config.xml | 2 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/doze/DozeService.java | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 123ff78..5d06768 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -243,7 +243,7 @@ <bool name="doze_pulse_on_notifications">true</bool> <!-- Doze: when to pulse after a buzzworthy notification arrives --> - <string name="doze_pulse_schedule" translatable="false">1s,10s,30s,60s</string> + <string name="doze_pulse_schedule" translatable="false">10s,30s,60s</string> <!-- Doze: maximum number of times the notification pulse schedule can be reset --> <integer name="doze_pulse_schedule_resets">2</integer> diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java index 630d735..39423f2 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java @@ -88,6 +88,7 @@ public class DozeService extends DreamService { private boolean mPowerSaveActive; private boolean mCarMode; private long mNotificationPulseTime; + private long mLastScheduleResetTime; private long mEarliestPulseDueToLight; private int mScheduleResetsRemaining; @@ -356,13 +357,21 @@ public class DozeService extends DreamService { return; } final long pulseDuration = mDozeParameters.getPulseDuration(false /*pickup*/); - if ((notificationTimeMs - mNotificationPulseTime) < pulseDuration) { + boolean pulseImmediately = System.currentTimeMillis() >= notificationTimeMs; + if ((notificationTimeMs - mLastScheduleResetTime) >= pulseDuration) { + mScheduleResetsRemaining--; + mLastScheduleResetTime = notificationTimeMs; + } else if (!pulseImmediately){ if (DEBUG) Log.d(mTag, "Recently updated, not resetting schedule"); return; } - mScheduleResetsRemaining--; if (DEBUG) Log.d(mTag, "mScheduleResetsRemaining = " + mScheduleResetsRemaining); mNotificationPulseTime = notificationTimeMs; + if (pulseImmediately) { + DozeLog.traceNotificationPulse(0); + requestPulse(DozeLog.PULSE_REASON_NOTIFICATION); + } + // schedule the rest of the pulses rescheduleNotificationPulse(true /*predicate*/); } |