Remove getState from InsetsAnimationControlCallbacks

No longer needed since we either show or hide all the types when
finishing an animation.

Test: WindowInsetsActivity
Bug: 118118435
Change-Id: I2323403d375cdf781b34b4d2107d3151299eb995
diff --git a/core/java/android/view/InsetsAnimationControlCallbacks.java b/core/java/android/view/InsetsAnimationControlCallbacks.java
index 27edb0b..0645c98 100644
--- a/core/java/android/view/InsetsAnimationControlCallbacks.java
+++ b/core/java/android/view/InsetsAnimationControlCallbacks.java
@@ -52,12 +52,6 @@
     void notifyFinished(InsetsAnimationControlImpl controller, boolean shown);
 
     /**
-     * Get the description of the insets state.
-     * @return {@link InsetsState} for adjusting corresponding {@link InsetsSource}.
-     */
-    InsetsState getState();
-
-    /**
      * Apply the new params to the surface.
      * @param params The {@link android.view.SyncRtSurfaceTransactionApplier.SurfaceParams} to
      *               apply.
diff --git a/core/java/android/view/InsetsAnimationControlImpl.java b/core/java/android/view/InsetsAnimationControlImpl.java
index 405eccd..e863aa0 100644
--- a/core/java/android/view/InsetsAnimationControlImpl.java
+++ b/core/java/android/view/InsetsAnimationControlImpl.java
@@ -191,13 +191,7 @@
         if (mCancelled) {
             return;
         }
-        InsetsState state = new InsetsState(mController.getState());
-        for (int i = mControls.size() - 1; i >= 0; i--) {
-            InsetsSourceControl control = mControls.valueAt(i);
-            state.getSource(control.getType()).setVisible(shown);
-        }
-        Insets insets = getInsetsFromState(state, mFrame, null /* typeSideMap */);
-        setInsetsAndAlpha(insets, 1f /* alpha */, 1f /* fraction */);
+        setInsetsAndAlpha(shown ? mShownInsets : mHiddenInsets, 1f /* alpha */, 1f /* fraction */);
         mFinished = true;
         mShownOnFinish = shown;
     }
diff --git a/core/tests/coretests/src/android/view/InsetsAnimationControlImplTest.java b/core/tests/coretests/src/android/view/InsetsAnimationControlImplTest.java
index bcf0b8c..169716f 100644
--- a/core/tests/coretests/src/android/view/InsetsAnimationControlImplTest.java
+++ b/core/tests/coretests/src/android/view/InsetsAnimationControlImplTest.java
@@ -176,8 +176,6 @@
         when(mMockController.getState()).thenReturn(mInsetsState);
         mController.finish(true /* shown */);
         mController.applyChangeInsets(mInsetsState);
-        assertTrue(mInsetsState.getSource(ITYPE_STATUS_BAR).isVisible());
-        assertTrue(mInsetsState.getSource(ITYPE_NAVIGATION_BAR).isVisible());
         assertEquals(Insets.of(0, 100, 100, 0), mController.getCurrentInsets());
         verify(mMockController).notifyFinished(eq(mController), eq(true /* shown */));
     }