Loading services/core/java/com/android/server/wm/ActivityRecord.java +16 −11 Original line number Diff line number Diff line Loading @@ -1834,33 +1834,36 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } } mLetterboxUiController.onMovedToDisplay(mDisplayContent.getDisplayId()); mAppCompatController.getAppCompatLetterboxPolicy() .onMovedToDisplay(mDisplayContent.getDisplayId()); } void layoutLetterboxIfNeeded(WindowState winHint) { mLetterboxUiController.layoutLetterboxIfNeeded(winHint); mAppCompatController.getAppCompatLetterboxPolicy().start(winHint); } boolean hasWallpaperBackgroundForLetterbox() { return mLetterboxUiController.hasWallpaperBackgroundForLetterbox(); return mAppCompatController.getAppCompatLetterboxOverrides() .hasWallpaperBackgroundForLetterbox(); } void updateLetterboxSurfaceIfNeeded(WindowState winHint, Transaction t) { mLetterboxUiController.updateLetterboxSurfaceIfNeeded(winHint, t, getPendingTransaction()); mAppCompatController.getAppCompatLetterboxPolicy() .updateLetterboxSurfaceIfNeeded(winHint, t, getPendingTransaction()); } void updateLetterboxSurfaceIfNeeded(WindowState winHint) { mLetterboxUiController.updateLetterboxSurfaceIfNeeded(winHint); mAppCompatController.getAppCompatLetterboxPolicy().updateLetterboxSurfaceIfNeeded(winHint); } /** Gets the letterbox insets. The insets will be empty if there is no letterbox. */ Rect getLetterboxInsets() { return mLetterboxUiController.getLetterboxInsets(); return mAppCompatController.getAppCompatLetterboxPolicy().getLetterboxInsets(); } /** Gets the inner bounds of letterbox. The bounds will be empty if there is no letterbox. */ void getLetterboxInnerBounds(Rect outBounds) { mLetterboxUiController.getLetterboxInnerBounds(outBounds); mAppCompatController.getAppCompatLetterboxPolicy().getLetterboxInnerBounds(outBounds); } /** Loading @@ -1868,7 +1871,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A * when the current activity is displayed. */ boolean isFullyTransparentBarAllowed(Rect rect) { return mLetterboxUiController.isFullyTransparentBarAllowed(rect); return mAppCompatController.getAppCompatLetterboxPolicy() .isFullyTransparentBarAllowed(rect); } private static class Token extends Binder { Loading Loading @@ -4368,7 +4372,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A mTaskSupervisor.getActivityMetricsLogger().notifyActivityRemoved(this); mTaskSupervisor.mStoppingActivities.remove(this); mLetterboxUiController.destroy(); mAppCompatController.getAppCompatLetterboxPolicy().stop(); mAppCompatController.getTransparentPolicy().stop(); // Defer removal of this activity when either a child is animating, or app transition is on Loading Loading @@ -7688,7 +7693,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A t.setLayer(mAnimationBoundsLayer, getLastLayer()); if (mNeedsLetterboxedAnimation) { final int cornerRadius = mLetterboxUiController final int cornerRadius = mAppCompatController.getAppCompatLetterboxPolicy() .getRoundedCornersRadius(findMainWindow()); final Rect letterboxInnerBounds = new Rect(); Loading Loading @@ -8574,7 +8579,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A * Returns whether activity bounds are letterboxed. * * <p>Note that letterbox UI may not be shown even when this returns {@code true}. See {@link * LetterboxUiController#shouldShowLetterboxUi} for more context. * AppCompatLetterboxOverrides#shouldShowLetterboxUi} for more context. */ boolean areBoundsLetterboxed() { return getAppCompatState(/* ignoreVisibility= */ true) Loading services/core/java/com/android/server/wm/AppCompatLetterboxPolicy.java +3 −3 Original line number Diff line number Diff line Loading @@ -55,8 +55,8 @@ class AppCompatLetterboxPolicy { } /** Cleans up {@link Letterbox} if it exists.*/ void destroy() { mLetterboxPolicyState.destroy(); void stop() { mLetterboxPolicyState.stop(); } /** @return {@value true} if the letterbox policy is running and the activity letterboxed. */ Loading Loading @@ -271,7 +271,7 @@ class AppCompatLetterboxPolicy { } /** Cleans up {@link Letterbox} if it exists.*/ void destroy() { void stop() { if (isRunning()) { mLetterbox.destroy(); mLetterbox = null; Loading services/core/java/com/android/server/wm/AppCompatUtils.java +2 −2 Original line number Diff line number Diff line Loading @@ -138,8 +138,8 @@ final class AppCompatUtils { // Whether the direct top activity is eligible for letterbox education. appCompatTaskInfo.setEligibleForLetterboxEducation( isTopActivityResumed && top.isEligibleForLetterboxEducation()); appCompatTaskInfo.setLetterboxEducationEnabled(top.mLetterboxUiController .isLetterboxEducationEnabled()); appCompatTaskInfo.setLetterboxEducationEnabled(top.mAppCompatController .getAppCompatLetterboxOverrides().isLetterboxEducationEnabled()); final AppCompatAspectRatioOverrides aspectRatioOverrides = top.mAppCompatController.getAppCompatAspectRatioOverrides(); Loading services/core/java/com/android/server/wm/BackNavigationController.java +3 −2 Original line number Diff line number Diff line Loading @@ -273,7 +273,8 @@ class BackNavigationController { customAppTransition.mBackgroundColor); } } infoBuilder.setLetterboxColor(currentActivity.mLetterboxUiController infoBuilder.setLetterboxColor(currentActivity.mAppCompatController .getAppCompatLetterboxOverrides() .getLetterboxBackgroundColor().toArgb()); removedWindowContainer = currentActivity; prevTask = prevActivities.get(0).getTask(); Loading services/core/java/com/android/server/wm/DisplayPolicy.java +1 −1 Original line number Diff line number Diff line Loading @@ -1596,7 +1596,7 @@ public class DisplayPolicy { final ActivityRecord currentActivity = win.getActivityRecord(); if (currentActivity != null) { final LetterboxDetails currentLetterboxDetails = currentActivity .mLetterboxUiController.getLetterboxDetails(); .mAppCompatController.getAppCompatLetterboxPolicy().getLetterboxDetails(); if (currentLetterboxDetails != null) { mLetterboxDetails.add(currentLetterboxDetails); } Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +16 −11 Original line number Diff line number Diff line Loading @@ -1834,33 +1834,36 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } } mLetterboxUiController.onMovedToDisplay(mDisplayContent.getDisplayId()); mAppCompatController.getAppCompatLetterboxPolicy() .onMovedToDisplay(mDisplayContent.getDisplayId()); } void layoutLetterboxIfNeeded(WindowState winHint) { mLetterboxUiController.layoutLetterboxIfNeeded(winHint); mAppCompatController.getAppCompatLetterboxPolicy().start(winHint); } boolean hasWallpaperBackgroundForLetterbox() { return mLetterboxUiController.hasWallpaperBackgroundForLetterbox(); return mAppCompatController.getAppCompatLetterboxOverrides() .hasWallpaperBackgroundForLetterbox(); } void updateLetterboxSurfaceIfNeeded(WindowState winHint, Transaction t) { mLetterboxUiController.updateLetterboxSurfaceIfNeeded(winHint, t, getPendingTransaction()); mAppCompatController.getAppCompatLetterboxPolicy() .updateLetterboxSurfaceIfNeeded(winHint, t, getPendingTransaction()); } void updateLetterboxSurfaceIfNeeded(WindowState winHint) { mLetterboxUiController.updateLetterboxSurfaceIfNeeded(winHint); mAppCompatController.getAppCompatLetterboxPolicy().updateLetterboxSurfaceIfNeeded(winHint); } /** Gets the letterbox insets. The insets will be empty if there is no letterbox. */ Rect getLetterboxInsets() { return mLetterboxUiController.getLetterboxInsets(); return mAppCompatController.getAppCompatLetterboxPolicy().getLetterboxInsets(); } /** Gets the inner bounds of letterbox. The bounds will be empty if there is no letterbox. */ void getLetterboxInnerBounds(Rect outBounds) { mLetterboxUiController.getLetterboxInnerBounds(outBounds); mAppCompatController.getAppCompatLetterboxPolicy().getLetterboxInnerBounds(outBounds); } /** Loading @@ -1868,7 +1871,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A * when the current activity is displayed. */ boolean isFullyTransparentBarAllowed(Rect rect) { return mLetterboxUiController.isFullyTransparentBarAllowed(rect); return mAppCompatController.getAppCompatLetterboxPolicy() .isFullyTransparentBarAllowed(rect); } private static class Token extends Binder { Loading Loading @@ -4368,7 +4372,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A mTaskSupervisor.getActivityMetricsLogger().notifyActivityRemoved(this); mTaskSupervisor.mStoppingActivities.remove(this); mLetterboxUiController.destroy(); mAppCompatController.getAppCompatLetterboxPolicy().stop(); mAppCompatController.getTransparentPolicy().stop(); // Defer removal of this activity when either a child is animating, or app transition is on Loading Loading @@ -7688,7 +7693,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A t.setLayer(mAnimationBoundsLayer, getLastLayer()); if (mNeedsLetterboxedAnimation) { final int cornerRadius = mLetterboxUiController final int cornerRadius = mAppCompatController.getAppCompatLetterboxPolicy() .getRoundedCornersRadius(findMainWindow()); final Rect letterboxInnerBounds = new Rect(); Loading Loading @@ -8574,7 +8579,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A * Returns whether activity bounds are letterboxed. * * <p>Note that letterbox UI may not be shown even when this returns {@code true}. See {@link * LetterboxUiController#shouldShowLetterboxUi} for more context. * AppCompatLetterboxOverrides#shouldShowLetterboxUi} for more context. */ boolean areBoundsLetterboxed() { return getAppCompatState(/* ignoreVisibility= */ true) Loading
services/core/java/com/android/server/wm/AppCompatLetterboxPolicy.java +3 −3 Original line number Diff line number Diff line Loading @@ -55,8 +55,8 @@ class AppCompatLetterboxPolicy { } /** Cleans up {@link Letterbox} if it exists.*/ void destroy() { mLetterboxPolicyState.destroy(); void stop() { mLetterboxPolicyState.stop(); } /** @return {@value true} if the letterbox policy is running and the activity letterboxed. */ Loading Loading @@ -271,7 +271,7 @@ class AppCompatLetterboxPolicy { } /** Cleans up {@link Letterbox} if it exists.*/ void destroy() { void stop() { if (isRunning()) { mLetterbox.destroy(); mLetterbox = null; Loading
services/core/java/com/android/server/wm/AppCompatUtils.java +2 −2 Original line number Diff line number Diff line Loading @@ -138,8 +138,8 @@ final class AppCompatUtils { // Whether the direct top activity is eligible for letterbox education. appCompatTaskInfo.setEligibleForLetterboxEducation( isTopActivityResumed && top.isEligibleForLetterboxEducation()); appCompatTaskInfo.setLetterboxEducationEnabled(top.mLetterboxUiController .isLetterboxEducationEnabled()); appCompatTaskInfo.setLetterboxEducationEnabled(top.mAppCompatController .getAppCompatLetterboxOverrides().isLetterboxEducationEnabled()); final AppCompatAspectRatioOverrides aspectRatioOverrides = top.mAppCompatController.getAppCompatAspectRatioOverrides(); Loading
services/core/java/com/android/server/wm/BackNavigationController.java +3 −2 Original line number Diff line number Diff line Loading @@ -273,7 +273,8 @@ class BackNavigationController { customAppTransition.mBackgroundColor); } } infoBuilder.setLetterboxColor(currentActivity.mLetterboxUiController infoBuilder.setLetterboxColor(currentActivity.mAppCompatController .getAppCompatLetterboxOverrides() .getLetterboxBackgroundColor().toArgb()); removedWindowContainer = currentActivity; prevTask = prevActivities.get(0).getTask(); Loading
services/core/java/com/android/server/wm/DisplayPolicy.java +1 −1 Original line number Diff line number Diff line Loading @@ -1596,7 +1596,7 @@ public class DisplayPolicy { final ActivityRecord currentActivity = win.getActivityRecord(); if (currentActivity != null) { final LetterboxDetails currentLetterboxDetails = currentActivity .mLetterboxUiController.getLetterboxDetails(); .mAppCompatController.getAppCompatLetterboxPolicy().getLetterboxDetails(); if (currentLetterboxDetails != null) { mLetterboxDetails.add(currentLetterboxDetails); } Loading