Merge "Commit wallpaper visibility directly when target token is invisibile" into udc-qpr-dev

This commit is contained in:
Wei Sheng Shih
2023-07-14 01:06:05 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 17 deletions

View File

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

View File

@@ -1191,16 +1191,6 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
hasParticipatedDisplay = true;
continue;
}
final WallpaperWindowToken wt = participant.asWallpaperToken();
if (wt != null) {
final boolean visibleAtTransitionEnd = mVisibleAtTransitionEndTokens.contains(wt);
if (!visibleAtTransitionEnd && !wt.isVisibleRequested()) {
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
" Commit wallpaper becoming invisible: %s", wt);
wt.commitVisibility(false /* visible */);
}
continue;
}
final Task tr = participant.asTask();
if (tr != null && tr.isVisibleRequested() && tr.inPinnedWindowingMode()) {
final ActivityRecord top = tr.getTopNonFinishingActivity();
@@ -1220,6 +1210,20 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
}
}
}
// Commit wallpaper visibility after activity, because usually the wallpaper target token is
// an activity, and wallpaper's visibility is depends on activity's visibility.
for (int i = mParticipants.size() - 1; i >= 0; --i) {
final WallpaperWindowToken wt = mParticipants.valueAt(i).asWallpaperToken();
if (wt == null) continue;
final WindowState target = wt.mDisplayContent.mWallpaperController.getWallpaperTarget();
final boolean isTargetInvisible = target == null || !target.mToken.isVisible();
if (isTargetInvisible || (!wt.isVisibleRequested()
&& !mVisibleAtTransitionEndTokens.contains(wt))) {
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
" Commit wallpaper becoming invisible: %s", wt);
wt.commitVisibility(false /* visible */);
}
}
if (committedSomeInvisible) {
mController.onCommittedInvisibles();
}