diff options
author | Tom Natan <tomnatan@google.com> | 2022-01-13 10:14:47 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-01-13 10:14:47 +0000 |
commit | 44cd0e46644b792cc7a1340b3bcfc86acd5a8502 (patch) | |
tree | 07bed1d71d6c1e3fdc5db312dd874b778881c551 | |
parent | 57cbfe19f1f58440c0953021bb5383676e434d6a (diff) | |
parent | a9df09013424ba0f9bec71c6ccf0e213a4428564 (diff) | |
download | base-44cd0e46644b792cc7a1340b3bcfc86acd5a8502.tar.gz |
Merge "Show Letterbox background without rounded corners for transparent activities" into sc-v2-dev
-rw-r--r-- | services/core/java/com/android/server/wm/LetterboxConfiguration.java | 2 | ||||
-rw-r--r-- | services/core/java/com/android/server/wm/LetterboxUiController.java | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/LetterboxConfiguration.java b/services/core/java/com/android/server/wm/LetterboxConfiguration.java index 212a036f15c2..e8490c5873ef 100644 --- a/services/core/java/com/android/server/wm/LetterboxConfiguration.java +++ b/services/core/java/com/android/server/wm/LetterboxConfiguration.java @@ -174,7 +174,7 @@ final class LetterboxConfiguration { * Overrides corners raidus for activities presented in the letterbox mode. If given value < 0, * both it and a value of {@link * com.android.internal.R.integer.config_letterboxActivityCornersRadius} will be ignored and - * and corners of the activity won't be rounded. + * corners of the activity won't be rounded. */ void setLetterboxActivityCornersRadius(int cornersRadius) { mLetterboxActivityCornersRadius = cornersRadius; diff --git a/services/core/java/com/android/server/wm/LetterboxUiController.java b/services/core/java/com/android/server/wm/LetterboxUiController.java index 7d073573835f..8866343afe03 100644 --- a/services/core/java/com/android/server/wm/LetterboxUiController.java +++ b/services/core/java/com/android/server/wm/LetterboxUiController.java @@ -150,7 +150,7 @@ final class LetterboxUiController { if (mLetterbox == null) { mLetterbox = new Letterbox(() -> mActivityRecord.makeChildSurface(null), mActivityRecord.mWmService.mTransactionFactory, - mLetterboxConfiguration::isLetterboxActivityCornersRounded, + this::shouldLetterboxHaveRoundedCorners, this::getLetterboxBackgroundColor, this::hasWallpaperBackgroudForLetterbox, this::getLetterboxWallpaperBlurRadius, @@ -175,6 +175,13 @@ final class LetterboxUiController { } } + private boolean shouldLetterboxHaveRoundedCorners() { + // TODO(b/214030873): remove once background is drawn for transparent activities + // Letterbox shouldn't have rounded corners if the activity is transparent + return mLetterboxConfiguration.isLetterboxActivityCornersRounded() + && mActivityRecord.fillsParent(); + } + float getHorizontalPositionMultiplier(Configuration parentConfiguration) { // Don't check resolved configuration because it may not be updated yet during // configuration change. @@ -257,8 +264,6 @@ final class LetterboxUiController { @VisibleForTesting boolean shouldShowLetterboxUi(WindowState mainWindow) { return isSurfaceReadyAndVisible(mainWindow) && mainWindow.areAppWindowBoundsLetterboxed() - // Check that an activity isn't transparent. - && mActivityRecord.fillsParent() // Check for FLAG_SHOW_WALLPAPER explicitly instead of using // WindowContainer#showWallpaper because the later will return true when this // activity is using blurred wallpaper for letterbox backgroud. |