From 016a8af1bce2a4c20dc6b3c23c82b56394c028c1 Mon Sep 17 00:00:00 2001 From: Massimo Carli Date: Wed, 30 Nov 2022 10:04:36 +0000 Subject: [PATCH] Shows "App isn't installed" while tapping on Home on Tablet 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: Ib7915841c290e82f45a43d20024a6f3d50127ce0 --- .../java/com/android/server/wm/ActivityRecord.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 66992aa79fc27..cf728330e1211 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -8920,9 +8920,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } if (info.isChangeEnabled(OVERRIDE_MIN_ASPECT_RATIO_EXCLUDE_PORTRAIT_FULLSCREEN) - && getParent().getConfiguration().orientation == ORIENTATION_PORTRAIT - && getParent().getWindowConfiguration().getWindowingMode() - == WINDOWING_MODE_FULLSCREEN) { + && isParentFullscreenPortrait()) { // We are using the parent configuration here as this is the most recent one that gets // passed to onConfigurationChanged when a relevant change takes place return info.getMinAspectRatio(); @@ -8945,6 +8943,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return info.getMinAspectRatio(); } + private boolean isParentFullscreenPortrait() { + final WindowContainer parent = getParent(); + return parent != null + && parent.getConfiguration().orientation == ORIENTATION_PORTRAIT + && parent.getWindowConfiguration().getWindowingMode() == WINDOWING_MODE_FULLSCREEN; + } + /** * Returns true if the activity has maximum or minimum aspect ratio. */