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

Commit d4739840 authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Fixing activity visibility when occluded by translucent TaskFragment"...

Merge "Fixing activity visibility when occluded by translucent TaskFragment" into tm-dev am: de9e5b56

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17181723

Change-Id: I61265b59f59c87831b3e7fe31a703fd3a5938b85
parents e7e65c76 de9e5b56
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -108,8 +108,11 @@ class EnsureActivitiesVisibleHelper {
                    && childTaskFragment.getTopNonFinishingActivity() != null) {
                childTaskFragment.updateActivityVisibilities(starting, configChanges,
                        preserveWindows, notifyClients);
                // The TaskFragment should fully occlude the activities below if the bounds
                // equals to its parent task, unless it is translucent.
                mBehindFullyOccludedContainer |=
                        childTaskFragment.getBounds().equals(mTaskFragment.getBounds());
                        (childTaskFragment.getBounds().equals(mTaskFragment.getBounds())
                                && !childTaskFragment.isTranslucent(starting));
                if (mAboveTop && mTop.getTaskFragment() == childTaskFragment) {
                    mAboveTop = false;
                }
+21 −0
Original line number Diff line number Diff line
@@ -149,4 +149,25 @@ public class TaskFragmentTest extends WindowTestsBase {
        assertEquals(false, info.isEmpty());
        assertEquals(activity.token, info.getActivities().get(0));
    }

    @Test
    public void testActivityVisibilityBehindTranslucentTaskFragment() {
        // Having an activity covered by a translucent TaskFragment:
        // Task
        //   - TaskFragment
        //      - Activity (Translucent)
        //   - Activity
        ActivityRecord translucentActivity = new ActivityBuilder(mAtm)
                .setUid(DEFAULT_TASK_FRAGMENT_ORGANIZER_UID).build();
        mTaskFragment.addChild(translucentActivity);
        doReturn(true).when(mTaskFragment).isTranslucent(any());

        ActivityRecord activityBelow = new ActivityBuilder(mAtm).build();
        mTaskFragment.getTask().addChild(activityBelow, 0);

        // Ensure the activity below is visible
        mTaskFragment.getTask().ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
                false /* preserveWindows */);
        assertEquals(true, activityBelow.isVisibleRequested());
    }
}