diff options
| author | 2025-02-25 00:47:32 +0000 | |
|---|---|---|
| committer | 2025-02-26 20:40:49 -0800 | |
| commit | 151e5b832697b28a6325568b6b0effb3fca093a0 (patch) | |
| tree | 4092278202e7f5e12d9f23c58c7f37af5da52686 | |
| parent | 59c660c413b10486cb9d5d8215712900559ffaca (diff) | |
Ensure SurfaceControl is valid before applying transform hint
Bug: b/395874537
Test: presubmits
Flag: NONE exempt trivial guard
Change-Id: Iab6421e3756157e6a3b3c06146fc57d329b04daa
| -rw-r--r-- | core/java/android/service/wallpaper/WallpaperService.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index 41a64e22e058..744cdf6629e7 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -1323,14 +1323,13 @@ public abstract class WallpaperService extends Service { redrawNeeded ? 1 : 0)); return; } - - final int transformHint = SurfaceControl.rotationToBufferTransform( - (mDisplay.getInstallOrientation() + mDisplay.getRotation()) % 4); - mSurfaceControl.setTransformHint(transformHint); WindowLayout.computeSurfaceSize(mLayout, maxBounds, mWidth, mHeight, mWinFrames.frame, false /* dragResizing */, mSurfaceSize); if (mSurfaceControl.isValid()) { + final int transformHint = SurfaceControl.rotationToBufferTransform( + (mDisplay.getInstallOrientation() + mDisplay.getRotation()) % 4); + mSurfaceControl.setTransformHint(transformHint); if (mBbqSurfaceControl == null) { mBbqSurfaceControl = new SurfaceControl.Builder() .setName("Wallpaper BBQ wrapper") |