From 5f94c857bee3ace52c31a5164128b7972c7cb1e2 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Thu, 5 Dec 2019 13:25:46 -0800 Subject: [PATCH] Don't set mLockscreenWallpaper when wallpaper is not supported. Bug: 138939803 Bug: 144862300 Test: a CtsAppTestCases:android.app.cts.WallpaperManagerTest Merged-In: Ibb5dd6097939a5b50244ee3cec5ee09a1f5417cb Change-Id: Ibb5dd6097939a5b50244ee3cec5ee09a1f5417cb (cherry picked from commit e8d7b883b4e30572cd1d6d9655394ef05be93621) --- .../com/android/systemui/statusbar/phone/StatusBar.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 7f11759e4f4e9..91cf89ce1b05c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -344,6 +344,7 @@ public class StatusBar extends SystemUI implements DemoMode, private boolean mBrightnessMirrorVisible; protected BiometricUnlockController mBiometricUnlockController; protected LightBarController mLightBarController; + @Nullable protected LockscreenWallpaper mLockscreenWallpaper; @VisibleForTesting protected AutoHideController mAutoHideController; @@ -891,7 +892,7 @@ public class StatusBar extends SystemUI implements DemoMode, createNavigationBar(result); - if (ENABLE_LOCKSCREEN_WALLPAPER) { + if (ENABLE_LOCKSCREEN_WALLPAPER && mWallpaperSupported) { mLockscreenWallpaper = new LockscreenWallpaper(mContext, this, mHandler); } @@ -2748,7 +2749,9 @@ public class StatusBar extends SystemUI implements DemoMode, @Override public void setLockscreenUser(int newUserId) { - mLockscreenWallpaper.setCurrentUser(newUserId); + if (mLockscreenWallpaper != null) { + mLockscreenWallpaper.setCurrentUser(newUserId); + } mScrimController.setCurrentUser(newUserId); if (mWallpaperSupported) { mWallpaperChangedReceiver.onReceive(mContext, null);