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

Commit c32b6009 authored by wilsonshih's avatar wilsonshih
Browse files

Skip close activity transition since no closing app can be visible

The layer of transition animation is usually shift to animation layer,
so when transition controller going to apply a activity close
transition to a bottom activity, the closing animation surface will be
on top of the task, then suddenly occludes the top activity.
An easy fix is to skip the close activity transtion if there is no
closing activity can be visible.

Bug: 186860966
Test: atest AppTransitionTests AppTransitionControllerTest
Change-Id: I3869530fc1eaa87ed1403fed86ff68a1e4de5b23
parent d377bbc2
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -412,9 +412,15 @@ public class AppTransitionController {
                return TRANSIT_OLD_TASK_CLOSE;
            }
            if (isActivityClosing) {
                for (int i = closingApps.size() - 1; i >= 0; i--) {
                    if (closingApps.valueAt(i).visibleIgnoringKeyguard) {
                        return TRANSIT_OLD_ACTIVITY_CLOSE;
                    }
                }
                // Skip close activity transition since no closing app can be visible
                return WindowManager.TRANSIT_OLD_UNSET;
            }
        }
        if (appTransition.containsTransitRequest(TRANSIT_RELAUNCH)
                && !openingWcs.isEmpty() && !openingApps.isEmpty()) {
            return TRANSIT_OLD_ACTIVITY_RELAUNCH;
+18 −0
Original line number Diff line number Diff line
@@ -77,6 +77,24 @@ public class AppTransitionControllerTest extends WindowTestsBase {
        return r;
    }

    @Test
    public void testSkipOccludedActivityCloseTransition() {
        final ActivityRecord behind = createActivityRecord(mDisplayContent,
                WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD);
        final ActivityRecord topOpening = createActivityRecord(behind.getTask());
        topOpening.setOccludesParent(true);
        topOpening.setVisible(true);

        mDisplayContent.prepareAppTransition(TRANSIT_OPEN);
        mDisplayContent.prepareAppTransition(TRANSIT_CLOSE);
        mDisplayContent.mClosingApps.add(behind);

        assertEquals(WindowManager.TRANSIT_OLD_UNSET,
                AppTransitionController.getTransitCompatType(mDisplayContent.mAppTransition,
                        mDisplayContent.mOpeningApps, mDisplayContent.mClosingApps,
                        null, null, false));
    }

    @Test
    @FlakyTest(bugId = 131005232)
    public void testTranslucentOpen() {