Merge "Shows "App isn't installed" while tapping on Home" into tm-qpr-dev am: ce6fe0e50f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20580386

Change-Id: I9c1087bbdad891a0845e4bd9b1b49da33b86f49b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Mariia Sandrikova
2022-11-29 16:08:57 +00:00
committed by Automerger Merge Worker

View File

@@ -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();