diff options
| author | 2023-04-20 15:57:38 +0000 | |
|---|---|---|
| committer | 2023-04-20 15:57:38 +0000 | |
| commit | 232e250f4cb366605092c5321c2502d6a1e70e5d (patch) | |
| tree | 5ab8410e97d0e1f242184f870e7d55fe5d68b78c | |
| parent | 26404c7ca9787fa8516216bf75e9967e7ad0e2cc (diff) | |
| parent | 784a9ec804b9733e60f45f9afcd55a79ed9bca8f (diff) | |
[automerge] Check for nullness in WallpaperService onDestroy 2p: 784a9ec804
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22761496
Bug: 275361339
Change-Id: Ia62bcfe3c87d9f217069bfd359c17990edccf33e
Merged-In: I89076da179493fa282f3e59895cfa4f4bfb6bdfc
| -rw-r--r-- | core/java/android/service/wallpaper/WallpaperService.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index 8f1fc1b9348e..5fab6678b938 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -2610,7 +2610,12 @@ public abstract class WallpaperService extends Service { mActiveEngines.get(i).detach(); } mActiveEngines.clear(); - mBackgroundThread.quitSafely(); + if (mBackgroundThread != null) { + // onDestroy might be called without a previous onCreate if WallpaperService was + // instantiated manually. While this is a misuse of the API, some things break + // if here we don't take into consideration this scenario. + mBackgroundThread.quitSafely(); + } Trace.endSection(); } |