diff options
| author | 2021-03-02 10:35:56 -0800 | |
|---|---|---|
| committer | 2021-03-02 10:41:54 -0800 | |
| commit | ca5fb2f2a666966c6879274f59fbc97306d5c564 (patch) | |
| tree | ba245a55fe877042eb37c55d8eeba5e59ae89060 | |
| parent | 95ca3989aaaf52acf2dc8e528ad56f61da8abfd2 (diff) | |
Set size compat UI to max layer
Before, the size compat UI is reparent to Task with its original layer
(likely 1), which may not be the higheset layer when the Task contains
more than one children.
Fix: 181541449
Bug: 178327644
Test: verify with launching a non-resizable activity from another
Change-Id: I9e812ca8c0c1fd5b93a6e074a5e4df164c8fa03b
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/sizecompatui/SizeCompatUILayout.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/sizecompatui/SizeCompatUILayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/sizecompatui/SizeCompatUILayout.java index 32f3648be19a..c6d994ecde8d 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/sizecompatui/SizeCompatUILayout.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/sizecompatui/SizeCompatUILayout.java @@ -280,7 +280,7 @@ class SizeCompatUILayout { : stableBounds.right - taskBounds.left - mButtonSize; final int positionY = stableBounds.bottom - taskBounds.top - mButtonSize; - mSyncQueue.runInSync(t -> t.setPosition(leash, positionX, positionY)); + updateSurfacePosition(leash, positionX, positionY); } void updateHintSurfacePosition() { @@ -303,7 +303,16 @@ class SizeCompatUILayout { final int positionY = stableBounds.bottom - taskBounds.top - mPopupOffsetY - mHint.getMeasuredHeight(); - mSyncQueue.runInSync(t -> t.setPosition(leash, positionX, positionY)); + updateSurfacePosition(leash, positionX, positionY); + } + + private void updateSurfacePosition(SurfaceControl leash, int positionX, int positionY) { + mSyncQueue.runInSync(t -> { + t.setPosition(leash, positionX, positionY); + // The size compat UI should be the topmost child of the Task in case there can be more + // than one children. + t.setLayer(leash, Integer.MAX_VALUE); + }); } int getDisplayId() { |