diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 1d1958943e94e..bae801716c19f 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -222,7 +222,7 @@ true - 1s,10s,30s,60s + 10s,30s,60s 2 diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java index 36efeaddd004b..3370091f53c26 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*/); }