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

Commit 80b2cb70 authored by Evan Rosky's avatar Evan Rosky
Browse files

Update visibility in moveTaskToBack if nothing is resumed

If it's possible that nothing will be resumed by moveTaskToBack (ie.
moving a freeform window to back in a multi-resume environment), then
we need to ensure that visibility is updated after re-ordering since
there will be no lifecycle changes to do it.

Bug: 134182971
Test: Open an app in freeform and move it to back. Observe it
      going invisible with a transition.

Change-Id: Iee7457ba7b8a7dc8385bed3a9434ab7c2490f14a
parent 26fdabb9
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -4979,6 +4979,17 @@ class ActivityStack extends ConfigurationContainer {
            return true;
        }

        ActivityRecord topActivity = getDisplay().topRunningActivity();
        ActivityStack topStack = topActivity.getActivityStack();
        if (topStack != null && topStack != this && topActivity.isState(RESUMED)) {
            // The new top activity is already resumed, so there's a good chance that nothing will
            // get resumed below. So, update visibility now in case the transition is closed
            // prematurely.
            mRootActivityContainer.ensureVisibilityAndConfig(null /* starting */,
                    getDisplay().mDisplayId, false /* markFrozenIfConfigChanged */,
                    false /* deferResume */);
        }

        mRootActivityContainer.resumeFocusedStacksTopActivities();
        return true;
    }