From 2c984f16eb4afc3455482cfbf3e8b03c97189bca Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 6 Sep 2016 16:23:17 -0700 Subject: [PATCH] Fixes a crash with a renderthread camera animation Test: double-tap power button when display is off and freshly restarted. Change-Id: I6bad3e75568ba578245dd86f7dd28597c29ae95d Fixes: 31084435 --- .../android/systemui/statusbar/KeyguardAffordanceView.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java index 88f37a320926c..8b4225a8ab0b9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java @@ -174,7 +174,10 @@ public class KeyguardAffordanceView extends ImageView { private void drawBackgroundCircle(Canvas canvas) { if (mCircleRadius > 0 || mFinishing) { - if (mFinishing && mSupportHardware) { + if (mFinishing && mSupportHardware && mHwCenterX != null) { + // Our hardware drawing proparties can be null if the finishing started but we have + // never drawn before. In that case we are not doing a render thread animation + // anyway, so we need to use the normal drawing. DisplayListCanvas displayListCanvas = (DisplayListCanvas) canvas; displayListCanvas.drawCircle(mHwCenterX, mHwCenterY, mHwCircleRadius, mHwCirclePaint);