Merge "Do not force relayout for wallpaper visibility change" into tm-qpr-dev am: 9496a69d0b

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

Change-Id: I1a766bf368614232573bbb565db6a6a6eaeeb850
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Riddle Hsu
2022-05-25 06:39:54 +00:00
committed by Automerger Merge Worker
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) {