Fix finishing adjacent TaskFragments occludes activities below

Same as commit 33efd88, the TaskFragment without running activity
should be ignored while calculating activity visibility.

Bug: 200316506
Test: TaskFragmentOrganizerTest TaskFragmentOrganizerPolicyTest
Change-Id: Iad41edfb6055fff29360e6b4b543ff8ae724d2c3
This commit is contained in:
Louis Chang
2021-09-24 18:46:38 +08:00
parent 125ff5d696
commit 232ec86d51

View File

@@ -103,13 +103,12 @@ class EnsureActivitiesVisibleHelper {
ArrayList<TaskFragment> adjacentTaskFragments = null; ArrayList<TaskFragment> adjacentTaskFragments = null;
for (int i = mTaskFragment.mChildren.size() - 1; i >= 0; --i) { for (int i = mTaskFragment.mChildren.size() - 1; i >= 0; --i) {
final WindowContainer child = mTaskFragment.mChildren.get(i); final WindowContainer child = mTaskFragment.mChildren.get(i);
if (child.asTaskFragment() != null) {
final TaskFragment childTaskFragment = child.asTaskFragment(); final TaskFragment childTaskFragment = child.asTaskFragment();
if (childTaskFragment != null && childTaskFragment.topRunningActivity() != null) {
childTaskFragment.updateActivityVisibilities(starting, configChanges, childTaskFragment.updateActivityVisibilities(starting, configChanges,
preserveWindows, notifyClients); preserveWindows, notifyClients);
mBehindFullyOccludedContainer |= mBehindFullyOccludedContainer |=
childTaskFragment.topRunningActivity() != null childTaskFragment.getBounds().equals(mTaskFragment.getBounds());
&& childTaskFragment.getBounds().equals(mTaskFragment.getBounds());
if (mAboveTop && mTop.getTaskFragment() == childTaskFragment) { if (mAboveTop && mTop.getTaskFragment() == childTaskFragment) {
mAboveTop = false; mAboveTop = false;
} }