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

Commit 590ccb4e authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Skip close activity transition since no closing app can be visible" into sc-dev

parents 12ded203 c32b6009
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -412,9 +412,15 @@ public class AppTransitionController {
                return TRANSIT_OLD_TASK_CLOSE;
                return TRANSIT_OLD_TASK_CLOSE;
            }
            }
            if (isActivityClosing) {
            if (isActivityClosing) {
                for (int i = closingApps.size() - 1; i >= 0; i--) {
                    if (closingApps.valueAt(i).visibleIgnoringKeyguard) {
                        return TRANSIT_OLD_ACTIVITY_CLOSE;
                        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)
        if (appTransition.containsTransitRequest(TRANSIT_RELAUNCH)
                && !openingWcs.isEmpty() && !openingApps.isEmpty()) {
                && !openingWcs.isEmpty() && !openingApps.isEmpty()) {
            return TRANSIT_OLD_ACTIVITY_RELAUNCH;
            return TRANSIT_OLD_ACTIVITY_RELAUNCH;
+18 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,24 @@ public class AppTransitionControllerTest extends WindowTestsBase {
        return r;
        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
    @Test
    @FlakyTest(bugId = 131005232)
    @FlakyTest(bugId = 131005232)
    public void testTranslucentOpen() {
    public void testTranslucentOpen() {