diff options
Diffstat (limited to 'core/java/android/view/WindowManagerImpl.java')
| -rw-r--r-- | core/java/android/view/WindowManagerImpl.java | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java index 1c915cb016d4..7631269d9c1c 100644 --- a/core/java/android/view/WindowManagerImpl.java +++ b/core/java/android/view/WindowManagerImpl.java @@ -352,30 +352,33 @@ public final class WindowManagerImpl implements WindowManager { throw e.rethrowFromSystemServer(); } - Set<WindowMetrics> maxMetrics = new HashSet<>(); - WindowInsets windowInsets; + int size = possibleDisplayInfos.size(); DisplayInfo currentDisplayInfo; - final WindowManager.LayoutParams params = new WindowManager.LayoutParams(); - for (int i = 0; i < possibleDisplayInfos.size(); i++) { - currentDisplayInfo = possibleDisplayInfos.get(i); + WindowInsets windowInsets = null; + if (size > 0) { + currentDisplayInfo = possibleDisplayInfos.get(0); - // Calculate max bounds for this rotation and state. - Rect maxBounds = new Rect(0, 0, currentDisplayInfo.logicalWidth, - currentDisplayInfo.logicalHeight); - - // Calculate insets for the rotated max bounds. + final WindowManager.LayoutParams params = new WindowManager.LayoutParams(); final boolean isScreenRound = (currentDisplayInfo.flags & Display.FLAG_ROUND) != 0; - // Initialize insets based upon display rotation. Note any window-provided insets - // will not be set. + // TODO(181127261) not computing insets correctly - need to have underlying + // frame reflect the faked orientation. windowInsets = getWindowInsetsFromServerForDisplay( currentDisplayInfo.displayId, params, new Rect(0, 0, currentDisplayInfo.getNaturalWidth(), currentDisplayInfo.getNaturalHeight()), isScreenRound, WINDOWING_MODE_FULLSCREEN); - // Set the hardware-provided insets. - windowInsets = new WindowInsets.Builder(windowInsets).setRoundedCorners( - currentDisplayInfo.roundedCorners) - .setDisplayCutout(currentDisplayInfo.displayCutout).build(); + } + + Set<WindowMetrics> maxMetrics = new HashSet<>(); + for (int i = 0; i < size; i++) { + currentDisplayInfo = possibleDisplayInfos.get(i); + + // Calculate max bounds for this rotation and state. + Rect maxBounds = new Rect(0, 0, currentDisplayInfo.logicalWidth, + currentDisplayInfo.logicalHeight); + + // Calculate insets for the rotated max bounds. + // TODO(181127261) calculate insets for each display rotation and state. maxMetrics.add(new WindowMetrics(maxBounds, windowInsets)); } |
