Merge "Trigger new frame after display is ready to turn on" into pi-dev

This commit is contained in:
Lucas Dupin
2018-04-06 15:21:07 +00:00
committed by Android (Google) Code Review
4 changed files with 15 additions and 3 deletions

View File

@@ -407,6 +407,15 @@ public class TextClock extends TextView {
registerObserver();
}
/**
* 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.
*

View File

@@ -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() {

View File

@@ -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;

View File

@@ -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;