Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9583c41 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

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
parent 271ba383
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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.
     *
+1 −2
Original line number Diff line number Diff line
@@ -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() {
+4 −0
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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;