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

Commit 94e220d8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update the ensure activities visible condition for activity home stack."

parents 0ddb292c 24b0bf62
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -156,7 +156,8 @@ class EnsureActivitiesVisibleHelper {
            // determined individually unlike other stacks where the visibility or fullscreen
            // status of an activity in a previous task affects other.
            mBehindFullscreenActivity = !mContainerShouldBeVisible;
        } else if (mContiner.isActivityTypeHome()) {
        } else if (!mBehindFullscreenActivity && mContiner.isActivityTypeHome()
                && r.isRootOfTask()) {
            if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "Home task: at " + mContiner
                    + " stackShouldBeVisible=" + mContainerShouldBeVisible
                    + " behindFullscreenActivity=" + mBehindFullscreenActivity);
+21 −0
Original line number Diff line number Diff line
@@ -573,6 +573,27 @@ public class ActivityStackTests extends ActivityTestsBase {
        assertFalse(translucentStack.shouldBeVisible(null /* starting */));
    }

    @Test
    public void testShouldBeVisible_FullscreenBehindTranslucentInHomeStack() {
        final ActivityStack homeStack = createStackForShouldBeVisibleTest(mDefaultDisplay,
                WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_HOME, true /* onTop */);

        final ActivityRecord firstActivity = new ActivityBuilder(mService)
                    .setStack(homeStack)
                    .setCreateTask(true)
                    .build();
        final Task task = firstActivity.getTask();
        final ActivityRecord secondActivity = new ActivityBuilder(mService)
                .setTask(task)
                .build();

        doReturn(false).when(secondActivity).occludesParent();
        homeStack.ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
                false /* preserveWindows */);

        assertTrue(firstActivity.shouldBeVisible());
    }

    @Test
    public void testMoveHomeStackBehindBottomMostVisibleStack_NoMoveHomeBehindFullscreen() {
        mDefaultDisplay.removeStack(mStack);