commit | e14c475043ee6932f3dc1eddf449ca1c83536418 | [log] [tgz] |
---|---|---|
author | Mike Digman <digman@google.com> | Tue Mar 20 12:14:54 2018 -0700 |
committer | Mike Digman <digman@google.com> | Tue Mar 20 21:42:24 2018 +0000 |
tree | 13bd73065cf304b28250848a2eac17a34c1bdaa8 | |
parent | 4a99e98b48af111b13fa0f2c317a5b095ed74ad4 [diff] |
Ensure rotate disable2 flag can be set on boot SUW sometimes calls disable2 before getView() is non-null. Change-Id: I6a201e05da5e1d72829f469487279d2c607f6eed Fixes: 75291849 Test: manual
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java index b493d7a..a39800d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
@@ -464,7 +464,10 @@ private void onRotationSuggestionsDisabled() { // Immediately hide the rotate button and clear any planned removal setRotateSuggestionButtonState(false, true); - getView().removeCallbacks(mRemoveRotationProposal); + + // This method can be called before view setup is done, ensure getView isn't null + final View v = getView(); + if (v != null) v.removeCallbacks(mRemoveRotationProposal); } private void showAndLogRotationSuggestion() {