Merge "Ensure rotate disable2 flag can be set on boot" into pi-dev
am: 65808f3210

Change-Id: I094118c829df08c7dbd6db7a1bf38faedf013450
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() {