Restore KeyguardBottomAreaView state
KeyguardBottomAreaView will be re-inflated when the theme changes,
it's necessary to also restore some of its internal state, otherwise
we'll have NPEs.
Test: manual
Test: atest KeyguardBottomAreaTest
Fixes: 117121386
Change-Id: Idac8192877b65f8ad00cd60a2bb0c1ce75476cf1
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index 6d53cd3..0736d4c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -446,10 +446,12 @@
// Update keyguard bottom area
index = indexOfChild(mKeyguardBottomArea);
removeView(mKeyguardBottomArea);
+ KeyguardBottomAreaView oldBottomArea = mKeyguardBottomArea;
mKeyguardBottomArea = (KeyguardBottomAreaView) LayoutInflater.from(mContext).inflate(
R.layout.keyguard_bottom_area,
this,
false);
+ mKeyguardBottomArea.initFrom(oldBottomArea);
addView(mKeyguardBottomArea, index);
initBottomArea();
setDarkAmount(mLinearDarkAmount, mInterpolatedDarkAmount);