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

Commit 3d7b7d59 authored by Craig Mautner's avatar Craig Mautner
Browse files

Redraw all windows earlier in power on sequence.

Send a message to all windows to redraw before notifying
PhoneWindowManager of screen on. This minimizes the delay in
screen update that causes the keyguard clock to display the old time
before displaying the current time.

Fixes bug 6381021.

Change-Id: Ida7071e7dac2284540f101c5d004511b52133b91
parent 6385ff51
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3506,6 +3506,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }
        if (screenOnListener != null) {
            if (mKeyguardMediator != null) {
                try {
                    mWindowManager.setEventDispatching(true);
                } catch (RemoteException unhandled) {
                }
                mKeyguardMediator.onScreenTurnedOn(new KeyguardViewManager.ShowListener() {
                    @Override public void onShown(IBinder windowToken) {
                        if (windowToken != null) {
+3 −4
Original line number Diff line number Diff line
@@ -6621,15 +6621,14 @@ public class WindowManagerService extends IWindowManager.Stub

    public void setEventDispatching(boolean enabled) {
        if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
                "resumeKeyDispatching()")) {
                "setEventDispatching()")) {
            throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
        }

        synchronized (mWindowMap) {
            mInputMonitor.setEventDispatchingLw(enabled);
            sendScreenStatusToClientsLocked();
        }

        sendScreenStatusToClients();
    }

    public IBinder getFocusedWindowClientToken() {
@@ -6735,7 +6734,7 @@ public class WindowManagerService extends IWindowManager.Stub
        mPolicy.systemReady();
    }

    private void sendScreenStatusToClients() {
    private void sendScreenStatusToClientsLocked() {
        final ArrayList<WindowState> windows = mWindows;
        final int count = windows.size();
        boolean on = mPowerManager.isScreenOn();