diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/wallpapers/ImageWallpaper.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/wallpapers/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/wallpapers/ImageWallpaper.java index 20fef927e8d1..e57c0e7f1044 100644 --- a/packages/SystemUI/src/com/android/systemui/wallpapers/ImageWallpaper.java +++ b/packages/SystemUI/src/com/android/systemui/wallpapers/ImageWallpaper.java @@ -210,7 +210,13 @@ public class ImageWallpaper extends WallpaperService { if (DEBUG) { Log.i(TAG, "onSurfaceDestroyed"); } - mSurfaceHolder = null; + mLongExecutor.execute(this::onSurfaceDestroyedSynchronized); + } + + private void onSurfaceDestroyedSynchronized() { + synchronized (mLock) { + mSurfaceHolder = null; + } } @Override @@ -241,7 +247,7 @@ public class ImageWallpaper extends WallpaperService { private void drawFrameInternal() { if (mSurfaceHolder == null) { - Log.e(TAG, "attempt to draw a frame without a valid surface"); + Log.i(TAG, "attempt to draw a frame without a valid surface"); return; } |