diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/doze/DozeWallpaperState.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeWallpaperState.java b/packages/SystemUI/src/com/android/systemui/doze/DozeWallpaperState.java index 7f1b35678867..7aeb7851bbd1 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeWallpaperState.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeWallpaperState.java @@ -16,6 +16,7 @@ package com.android.systemui.doze; +import android.annotation.Nullable; import android.app.IWallpaperManager; import android.os.RemoteException; import android.util.Log; @@ -34,6 +35,7 @@ public class DozeWallpaperState implements DozeMachine.Part { private static final String TAG = "DozeWallpaperState"; private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); + @Nullable private final IWallpaperManager mWallpaperManagerService; private final DozeParameters mDozeParameters; private final BiometricUnlockController mBiometricUnlockController; @@ -79,16 +81,18 @@ public class DozeWallpaperState implements DozeMachine.Part { if (isAmbientMode != mIsAmbientMode) { mIsAmbientMode = isAmbientMode; - try { - long duration = animated ? StackStateAnimator.ANIMATION_DURATION_WAKEUP : 0L; - if (DEBUG) { - Log.i(TAG, "AOD wallpaper state changed to: " + mIsAmbientMode + if (mWallpaperManagerService != null) { + try { + long duration = animated ? StackStateAnimator.ANIMATION_DURATION_WAKEUP : 0L; + if (DEBUG) { + Log.i(TAG, "AOD wallpaper state changed to: " + mIsAmbientMode + ", animationDuration: " + duration); + } + mWallpaperManagerService.setInAmbientMode(mIsAmbientMode, duration); + } catch (RemoteException e) { + // Cannot notify wallpaper manager service, but it's fine, let's just skip it. + Log.w(TAG, "Cannot notify state to WallpaperManagerService: " + mIsAmbientMode); } - mWallpaperManagerService.setInAmbientMode(mIsAmbientMode, duration); - } catch (RemoteException e) { - // Cannot notify wallpaper manager service, but it's fine, let's just skip it. - Log.w(TAG, "Cannot notify state to WallpaperManagerService: " + mIsAmbientMode); } } } @@ -97,5 +101,6 @@ public class DozeWallpaperState implements DozeMachine.Part { public void dump(PrintWriter pw) { pw.println("DozeWallpaperState:"); pw.println(" isAmbientMode: " + mIsAmbientMode); + pw.println(" hasWallpaperService: " + (mWallpaperManagerService != null)); } } |