From 559f5557fac41a53359efde1c1724a6423b69674 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 28 May 2019 17:21:26 -0700 Subject: [PATCH] Fix crash when changing navigation modes - The controller is only set on the active button, and when we tear down the nav bar, we try to update the controller from the other button Bug: 132201048 Test: Switch navigation mode, ensure no crash Change-Id: Id324c67946769193a4decab1a3d5e9d3967fc6fb --- .../systemui/statusbar/phone/RotationContextButton.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/RotationContextButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/RotationContextButton.java index f1460a62903db..b117dec44cb4d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/RotationContextButton.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/RotationContextButton.java @@ -66,7 +66,9 @@ public class RotationContextButton extends ContextualButton implements @Override public void onDestroy() { - mRotationButtonController.cleanUp(); + if (mRotationButtonController != null) { + mRotationButtonController.cleanUp(); + } } @Override