From de551ad9b6878de4c2f22996339f72001837d5a9 Mon Sep 17 00:00:00 2001 From: Chris Li Date: Sun, 14 Feb 2021 17:03:08 -0800 Subject: [PATCH] Allow non-resizable apps in split-screen (12/n) Before, the hint uses PopupWindow to be placed at the bottom right of the Display, which can't be attached to Task. Now, render size compat button hint popup on Task surface with WindowlessWindowManager. Fix: 178327644 Bug: 176061101 Test: atest WMShellUnitTests:SizeCompatUILayoutTest Test: atest WMShellUnitTests:SizeCompatHintPopupTest Change-Id: I6f8d7afc996d7f312516d85deb2bd113eae8bc3f --- .../res/layout/size_compat_mode_hint.xml | 71 +++++---- .../sizecompatui/SizeCompatHintPopup.java | 71 +++++++++ .../sizecompatui/SizeCompatRestartButton.java | 87 +--------- .../sizecompatui/SizeCompatUIController.java | 16 +- .../sizecompatui/SizeCompatUILayout.java | 149 ++++++++++++++---- .../SizeCompatUIWindowManager.java | 33 +++- .../sizecompatui/SizeCompatHintPopupTest.java | 85 ++++++++++ .../SizeCompatRestartButtonTest.java | 34 +--- .../sizecompatui/SizeCompatUILayoutTest.java | 77 +++++++-- 9 files changed, 432 insertions(+), 191 deletions(-) create mode 100644 libs/WindowManager/Shell/src/com/android/wm/shell/sizecompatui/SizeCompatHintPopup.java create mode 100644 libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/sizecompatui/SizeCompatHintPopupTest.java diff --git a/libs/WindowManager/Shell/res/layout/size_compat_mode_hint.xml b/libs/WindowManager/Shell/res/layout/size_compat_mode_hint.xml index 347c2b47767e1..0dea87c6b7fcd 100644 --- a/libs/WindowManager/Shell/res/layout/size_compat_mode_hint.xml +++ b/libs/WindowManager/Shell/res/layout/size_compat_mode_hint.xml @@ -14,35 +14,52 @@ See the License for the specific language governing permissions and limitations under the License. --> - + android:layout_height="wrap_content"> - - -