diff options
| author | 2021-11-05 04:45:31 +0000 | |
|---|---|---|
| committer | 2021-11-05 04:45:31 +0000 | |
| commit | efa0f1cdb601b7d227695b39d798d215a617aa2b (patch) | |
| tree | 5fb2070cf1ed656ae9d3e964b4a193187d79a30a | |
| parent | 6edd10849f766b39bb9da5ffb1028453b378e8ed (diff) | |
| parent | 3e9d86d9e7d1199ff4956a4e96c70f2cd3ba57cb (diff) | |
Merge "Making activity invisible when occluded by one of the adjacent TF" into sc-v2-dev am: e6a32faf86 am: 3e9d86d9e7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16128317
Change-Id: Ib8e29cdd6b36eff26b7fd1ff1e90a65576ec6fad
| -rw-r--r-- | services/core/java/com/android/server/wm/TaskFragment.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java index a1057f47a44e..659179c96369 100644 --- a/services/core/java/com/android/server/wm/TaskFragment.java +++ b/services/core/java/com/android/server/wm/TaskFragment.java @@ -774,6 +774,7 @@ class TaskFragment extends WindowContainer<WindowContainer> { boolean gotOpaqueSplitScreenPrimary = false; boolean gotOpaqueSplitScreenSecondary = false; boolean gotTranslucentFullscreen = false; + boolean gotTranslucentAdjacent = false; boolean gotTranslucentSplitScreenPrimary = false; boolean gotTranslucentSplitScreenSecondary = false; boolean shouldBeVisible = true; @@ -802,6 +803,18 @@ class TaskFragment extends WindowContainer<WindowContainer> { final boolean hasRunningActivities = hasRunningActivity(other); if (other == this) { + if (!adjacentTaskFragments.isEmpty() && !gotTranslucentAdjacent) { + // 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 + // is fully occluding this one. + for (int j = adjacentTaskFragments.size() - 1; j >= 0; --j) { + final TaskFragment taskFragment = adjacentTaskFragments.get(j); + if (!taskFragment.isTranslucent(starting) + && taskFragment.getBounds().contains(this.getBounds())) { + return TASK_FRAGMENT_VISIBILITY_INVISIBLE; + } + } + } // Should be visible if there is no other fragment occluding it, unless it doesn't // have any running activities, not starting one and not home stack. shouldBeVisible = hasRunningActivities @@ -871,6 +884,7 @@ class TaskFragment extends WindowContainer<WindowContainer> { || otherTaskFrag.mAdjacentTaskFragment.isTranslucent(starting)) { // Can be visible behind a translucent adjacent TaskFragments. gotTranslucentFullscreen = true; + gotTranslucentAdjacent = true; continue; } // Can not be visible behind adjacent TaskFragments. |