Merge "Do not force relayout for wallpaper visibility change" into tm-qpr-dev

This commit is contained in:
Riddle Hsu
2022-05-25 06:20:23 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 2 deletions

View File

@@ -1536,8 +1536,9 @@ public abstract class WallpaperService extends Service {
// may have been destroyed so now we need to make
// sure it is re-created.
doOffsetsChanged(false);
// force relayout to get new surface
updateSurface(true, false, false);
// It will check mSurfaceCreated so no need to force relayout.
updateSurface(false /* forceRelayout */, false /* forceReport */,
false /* redrawNeeded */);
}
onVisibilityChanged(visible);
if (mReportedVisible && mFrozenRequested) {

View File

@@ -139,6 +139,12 @@ class WindowSurfaceController {
"Destroying surface %s called by %s", this, Debug.getCallers(8));
try {
if (mSurfaceControl != null) {
if (mAnimator.mIsWallpaper && !mAnimator.mWin.mWindowRemovalAllowed
&& !mAnimator.mWin.mRemoveOnExit) {
// The wallpaper surface should have the same lifetime as its window.
Slog.e(TAG, "Unexpected removing wallpaper surface of " + mAnimator.mWin
+ " by " + Debug.getCallers(8));
}
t.remove(mSurfaceControl);
}
} catch (RuntimeException e) {