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

Commit ab7ad389 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

The big keyguard transition refactor (5/n)

Also save surface for the home task, so unlocking to the homescreen
is as fast as before. Note that originally it was not possible to
save surface for home task because of artifacts when clicking the
home button. However, we added logic since then to disallow save
surface if it's a different intent, which is the case when pressing
the home button.

Also consolidate some relayout for less overhead.

Bug: 32057734
Change-Id: I53ede527cb1ff438001d4023ee3740283ee302ee
parent 73294b6c
Loading
Loading
Loading
Loading
+17 −12
Original line number Diff line number Diff line
@@ -101,6 +101,8 @@ class KeyguardController {
     */
    void keyguardGoingAway(int flags) {
        if (mKeyguardShowing) {
            mWindowManager.deferSurfaceLayout();
            try {
                mKeyguardGoingAway = true;
                mWindowManager.prepareAppTransition(TRANSIT_KEYGUARD_GOING_AWAY,
                        false /* alwaysKeepCurrent */, convertTransitFlags(flags),
@@ -113,6 +115,9 @@ class KeyguardController {
                mWindowManager.executeAppTransition();
                mService.applyVrModeIfNeededLocked(mStackSupervisor.getResumedActivityLocked(),
                        true /* enable */);
            } finally {
                mWindowManager.continueSurfaceLayout();
            }
        }
    }

+1 −7
Original line number Diff line number Diff line
@@ -2713,13 +2713,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            return false;
        }

        Task task = getTask();
        if (task == null || task.inHomeStack()) {
            // Don't save surfaces for home stack apps. These usually resume and draw
            // first frame very fast. Saving surfaces are mostly a waste of memory.
            return false;
        }

        final Task task = getTask();
        final AppWindowToken taskTop = task.getTopVisibleAppToken();
        if (taskTop != null && taskTop != mAppToken) {
            // Don't save if the window is not the topmost window.