summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2018-04-05 22:20:44 -0700
committer Lucas Dupin <dupin@google.com> 2018-04-05 22:20:44 -0700
commitf9583c41dce46321bdcd9cea7045a5bedbe0d59d (patch)
tree35cafd3526673e99bfd7551757c53d82ba261a21
parent271ba383b6bfa07a97e4f5dd65a89679e0270bd7 (diff)
Trigger new frame after display is ready to turn on
Making sure that a frame will be pushed after the display is ready to turn on by invaliding the clock after a delay. Also removed unecessary binder call. Test: cover prox sensor and wait 1 minute. repeat ~10 times Change-Id: Ic1b8006781e5486822a5ab65b71b3c44980f2f16 Fixes: 71913808
-rw-r--r--core/java/android/widget/TextClock.java9
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/doze/DozeUi.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/util/wakelock/DelayedWakeLock.java2
4 files changed, 15 insertions, 3 deletions
diff --git a/core/java/android/widget/TextClock.java b/core/java/android/widget/TextClock.java
index 53318c99ac34..d8a9ccad3f2e 100644
--- a/core/java/android/widget/TextClock.java
+++ b/core/java/android/widget/TextClock.java
@@ -408,6 +408,15 @@ public class TextClock extends TextView {
}
/**
+ * Update the displayed time if necessary and invalidate the view.
+ * @hide
+ */
+ public void refresh() {
+ onTimeChanged();
+ invalidate();
+ }
+
+ /**
* Indicates whether the system is currently using the 24-hour mode.
*
* When the system is in 24-hour mode, this view will use the pattern
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
index ce16efbb311f..ff3af17bb61d 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
@@ -216,8 +216,7 @@ public class KeyguardStatusView extends GridLayout {
}
public void refreshTime() {
- mClockView.setFormat12Hour(Patterns.clockView12);
- mClockView.setFormat24Hour(Patterns.clockView24);
+ mClockView.refresh();
}
private void refresh() {
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeUi.java b/packages/SystemUI/src/com/android/systemui/doze/DozeUi.java
index 778e63092150..c39076499d08 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeUi.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeUi.java
@@ -109,7 +109,11 @@ public class DozeUi implements DozeMachine.Part {
switch (newState) {
case DOZE_AOD:
if (oldState == DOZE_AOD_PAUSED) {
+ // Whenever turning on the display, it's necessary to push a new frame.
+ // The display buffers will be empty and need to be filled.
mHost.dozeTimeTick();
+ // The first frame may arrive when the display isn't ready yet.
+ mHandler.postDelayed(mHost::dozeTimeTick, 100);
}
scheduleTimeTick();
break;
diff --git a/packages/SystemUI/src/com/android/systemui/util/wakelock/DelayedWakeLock.java b/packages/SystemUI/src/com/android/systemui/util/wakelock/DelayedWakeLock.java
index e18140984f0e..a901e88219a5 100644
--- a/packages/SystemUI/src/com/android/systemui/util/wakelock/DelayedWakeLock.java
+++ b/packages/SystemUI/src/com/android/systemui/util/wakelock/DelayedWakeLock.java
@@ -23,7 +23,7 @@ import android.os.Handler;
*/
public class DelayedWakeLock implements WakeLock {
- private static final long RELEASE_DELAY_MS = 240;
+ private static final long RELEASE_DELAY_MS = 140;
private final Handler mHandler;
private final WakeLock mInner;