Merge "Reduce unnecessary redraw of wallpaper when switching orientation" into udc-dev am: 72d126cd8d

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

Change-Id: I6c1c4f21acc3383eedaa41d6e1938870813c8886
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Riddle Hsu
2023-05-29 06:24:15 +00:00
committed by Automerger Merge Worker
2 changed files with 9 additions and 3 deletions

View File

@@ -5630,11 +5630,18 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
setClientVisible(visible); setClientVisible(visible);
} }
final DisplayContent displayContent = getDisplayContent();
if (!visible) { if (!visible) {
mImeInsetsFrozenUntilStartInput = true; mImeInsetsFrozenUntilStartInput = true;
if (usingShellTransitions) {
final WindowState wallpaperTarget =
displayContent.mWallpaperController.getWallpaperTarget();
if (wallpaperTarget != null && wallpaperTarget.mActivityRecord == this) {
displayContent.mWallpaperController.hideWallpapers(wallpaperTarget);
}
}
} }
final DisplayContent displayContent = getDisplayContent();
if (!displayContent.mClosingApps.contains(this) if (!displayContent.mClosingApps.contains(this)
&& !displayContent.mOpeningApps.contains(this) && !displayContent.mOpeningApps.contains(this)
&& !fromTransition) { && !fromTransition) {

View File

@@ -146,11 +146,10 @@ class WallpaperController {
} }
} else { } else {
final ActivityRecord ar = w.mActivityRecord; final ActivityRecord ar = w.mActivityRecord;
final TransitionController tc = w.mTransitionController;
// The animating window can still be visible on screen if it is in transition, so we // The animating window can still be visible on screen if it is in transition, so we
// should check whether this window can be wallpaper target even when visibleRequested // should check whether this window can be wallpaper target even when visibleRequested
// is false. // is false.
if (ar != null && !ar.isVisibleRequested() && !tc.inTransition(ar)) { if (ar != null && !ar.isVisibleRequested() && !ar.isVisible()) {
// An activity that is not going to remain visible shouldn't be the target. // An activity that is not going to remain visible shouldn't be the target.
return false; return false;
} }