From 187babdf03194ec9308a33bfcb60371e269d0e56 Mon Sep 17 00:00:00 2001 From: Massimo Carli Date: Mon, 28 Nov 2022 11:24:58 +0000 Subject: [PATCH] Shows "App isn't installed" while tapping on Home Fixes the problem about launching a letterboxed app from home having the "App isn't installed" message. Fixes: 260188035 Test: Launch apps from Home and check they all start without the "App isn't installed" message Change-Id: I2cd2059933b33b13a0958ed410757373ca77611d --- .../com/android/server/wm/LetterboxUiController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/wm/LetterboxUiController.java b/services/core/java/com/android/server/wm/LetterboxUiController.java index 74a236bd862c7..7b75fc61842bf 100644 --- a/services/core/java/com/android/server/wm/LetterboxUiController.java +++ b/services/core/java/com/android/server/wm/LetterboxUiController.java @@ -285,14 +285,17 @@ final class LetterboxUiController { } float getSplitScreenAspectRatio() { + // Getting the same aspect ratio that apps get in split screen. + final DisplayContent displayContent = mActivityRecord.getDisplayContent(); + if (displayContent == null) { + return getDefaultMinAspectRatioForUnresizableApps(); + } int dividerWindowWidth = getResources().getDimensionPixelSize(R.dimen.docked_stack_divider_thickness); int dividerInsets = getResources().getDimensionPixelSize(R.dimen.docked_stack_divider_insets); int dividerSize = dividerWindowWidth - dividerInsets * 2; - - // Getting the same aspect ratio that apps get in split screen. - Rect bounds = new Rect(mActivityRecord.getDisplayContent().getBounds()); + final Rect bounds = new Rect(displayContent.getBounds()); if (bounds.width() >= bounds.height()) { bounds.inset(/* dx */ dividerSize / 2, /* dy */ 0); bounds.right = bounds.centerX();