[automerge] [DO NOT MERGE] ActivityEmbedding: hide embedded TaskFragment between 2p: 906689084a

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

Change-Id: I1a2a659de3e97b76cd36258401c05213179fdd6c
This commit is contained in:
Presubmit Automerger Backend
2022-03-17 12:05:58 +00:00

View File

@@ -822,11 +822,17 @@ class TaskFragment extends WindowContainer<WindowContainer> {
if (!adjacentTaskFragments.isEmpty() && !gotTranslucentAdjacent) { if (!adjacentTaskFragments.isEmpty() && !gotTranslucentAdjacent) {
// The z-order of this TaskFragment is in middle of two adjacent TaskFragments // The z-order of this TaskFragment is in middle of two adjacent TaskFragments
// and it cannot be visible if the TaskFragment on top is not translucent and // and it cannot be visible if the TaskFragment on top is not translucent and
// is fully occluding this one. // is occluding this one.
mTmpRect.set(getBounds());
for (int j = adjacentTaskFragments.size() - 1; j >= 0; --j) { for (int j = adjacentTaskFragments.size() - 1; j >= 0; --j) {
final TaskFragment taskFragment = adjacentTaskFragments.get(j); final TaskFragment taskFragment = adjacentTaskFragments.get(j);
if (!taskFragment.isTranslucent(starting) final TaskFragment adjacentTaskFragment =
&& taskFragment.getBounds().contains(this.getBounds())) { taskFragment.mAdjacentTaskFragment;
if (adjacentTaskFragment == this) {
continue;
}
if (mTmpRect.intersect(taskFragment.getBounds())
|| mTmpRect.intersect(adjacentTaskFragment.getBounds())) {
return TASK_FRAGMENT_VISIBILITY_INVISIBLE; return TASK_FRAGMENT_VISIBILITY_INVISIBLE;
} }
} }