summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2017-08-15 15:56:50 -0700
committer Lucas Dupin <dupin@google.com> 2017-08-16 09:37:54 -0700
commita84952bc74b6de7923f4f2717b07b2a235eb91bf (patch)
tree4988eec8562c3940b6676b4495518fb741ea6ffd
parent73e3d9f58c9edd2db254f072bd82bcecb2c13275 (diff)
Fix null pointer when mColorFadeEnabled is false
mColorFadeOffAnimator and mColorFadeOnAnimator won't ever be initialized if mColorFadeEnabled is set to false. This means that we can't assume that these animators always exist. Test: Manual, lock, unlock device Change-Id: I0cb7a10f7d311bc992c4a3e1b4943b454e39ec1a Fixes: 64726143
-rw-r--r--services/core/java/com/android/server/display/DisplayPowerController.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
index fb8ae1247796..e316fff884a5 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
@@ -1010,7 +1010,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
// contents of the screen.
mPowerState.prepareColorFade(mContext,
mColorFadeFadesConfig ? ColorFade.MODE_FADE : ColorFade.MODE_WARM_UP);
- mColorFadeOffAnimator.end();
+ if (mColorFadeOffAnimator != null) {
+ mColorFadeOffAnimator.end();
+ }
// Some display hardware will blank itself on the transition between doze and non-doze
// but still on display states. In this case we want to report to policy that the
// display has turned off so it can prepare the appropriate power on animation, but we