Updating window manager estimation logic:

> Moving the code from ApiWrapper to Resource overlays for better maintainability
> Accounting for display cutouts in insets estimation
> Using same logic in display controller and view inset dispatching

Test: Verified on device
Bug: 221961069
Change-Id: I78466353563692ce3f7512b0146ef8b61ef14bc0
This commit is contained in:
Sunny Goyal committed 2022-03-09 11:15:58 -08:00
1 parent a33117ddb3
commit 187b16cb91
25 files changed
+683 -431

No files matched your search

+4 -2
View File
@@ -75,6 +75,7 @@ public class DeviceProfile {
public final int heightPx;
public final int availableWidthPx;
public final int availableHeightPx;
public final int rotationHint;
public final float aspectRatio;
@@ -239,6 +240,7 @@ public class DeviceProfile {
this.isGestureMode = isGestureMode;
windowX = windowBounds.bounds.left;
windowY = windowBounds.bounds.top;
this.rotationHint = windowBounds.rotationHint;
isScalableGrid = inv.isScalable && !isVerticalBarLayout() && !isMultiWindowMode;
@@ -543,8 +545,8 @@ public class DeviceProfile {
}
public Builder toBuilder(Context context) {
WindowBounds bounds =
new WindowBounds(widthPx, heightPx, availableWidthPx, availableHeightPx);
WindowBounds bounds = new WindowBounds(
widthPx, heightPx, availableWidthPx, availableHeightPx, rotationHint);
bounds.bounds.offsetTo(windowX, windowY);
return new Builder(context, inv, mInfo)
.setWindowBounds(bounds)