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

Commit bda6cb25 authored by Evan Rosky's avatar Evan Rosky
Browse files

Don't set client visibility to false while resumed

Some apps seem to break if they don't receive pause before
their main window loses client-visibility. This means apps which
tie their rendering state to lifecycle instead of whether
the destination surface exists.

To keep these apps working, Prevent setting client-visibility
to false while the app is in resumed state.

Bug: 277725896
Bug: 296994396
Test: Open an app, enter recents, stop recents transition (eg.
      by long-pressing the livetile). Observe app receive pause
      before client-visibility change.
Change-Id: Ifea1a9ebfe3583a73e7693520c628b6da791fee1
parent 9d1f61ff
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -5651,9 +5651,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // to be some edge cases where we change our visibility but client visibility never gets
        // updated.
        // If we're becoming invisible, update the client visibility if we are not running an
        // animation. Otherwise, we'll update client visibility in onAnimationFinished.
        if (visible || usingShellTransitions
                || !isAnimating(PARENTS, ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_RECENTS)) {
        // animation and aren't in RESUMED state. Otherwise, we'll update client visibility in
        // onAnimationFinished or activityStopped.
        if (visible || (mState != RESUMED && (usingShellTransitions || !isAnimating(
                PARENTS, ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_RECENTS)))) {
            setClientVisible(visible);
        }