Fix hard to touch and stuck navbar rotate icon

Hide rotate button on Quickstep navbar grab. Prior signals
didn't always capture this. Launcher now also changes its
requested orientation on touch, ignore that. Pause callback
made hide animator unexpectedly isRunning=true causing the
icon to never fade out, should be fixed now.

Test: manual
Change-Id: I4bb39d57d9cef5748aadf2f18c640feba3f53775
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 dc400e6..e8d85a8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
@@ -167,6 +167,9 @@
         @Override
         public void onRecentsAnimationStarted() {
             mNavigationBarView.setRecentsAnimationStarted(true);
+
+            // Use navbar dragging as a signal to hide the rotate button
+            setRotateSuggestionButtonState(false);
         }
 
         @Override
@@ -446,10 +449,11 @@
         }
 
         if (visible) { // Appear and change (cannot force)
-            // Stop any currently running hide animations
+            // Stop and clear any currently running hide animations
             if (mRotateHideAnimator != null && mRotateHideAnimator.isRunning()) {
-                mRotateHideAnimator.pause();
+                mRotateHideAnimator.cancel();
             }
+            mRotateHideAnimator = null;
 
             // Reset the alpha if any has changed due to hide animation
             view.setAlpha(1f);
@@ -978,7 +982,10 @@
 
         @Override
         public void onActivityRequestedOrientationChanged(int taskId, int requestedOrientation) {
-            setRotateSuggestionButtonState(false);
+            // Only hide the icon if the top task changes its requestedOrientation
+            // Launcher can alter its requestedOrientation while it's not on top, don't hide on this
+            final boolean top = ActivityManagerWrapper.getInstance().getRunningTask().id == taskId;
+            if (top) setRotateSuggestionButtonState(false);
         }
     }