diff --git a/core/java/android/view/InsetsAnimationControlCallbacks.java b/core/java/android/view/InsetsAnimationControlCallbacks.java index 7696bbbb2d5a7..04bb6091672b3 100644 --- a/core/java/android/view/InsetsAnimationControlCallbacks.java +++ b/core/java/android/view/InsetsAnimationControlCallbacks.java @@ -35,7 +35,7 @@ public interface InsetsAnimationControlCallbacks { *
  • Dispatch {@link WindowInsetsAnimationControlListener#onReady}
  • * */ - + void startAnimation(T runner, WindowInsetsAnimationControlListener listener, int types, WindowInsetsAnimation animation, Bounds bounds); diff --git a/core/java/android/view/InsetsAnimationControlImpl.java b/core/java/android/view/InsetsAnimationControlImpl.java index b92d24f134aa4..7d8d653f5ab3b 100644 --- a/core/java/android/view/InsetsAnimationControlImpl.java +++ b/core/java/android/view/InsetsAnimationControlImpl.java @@ -69,7 +69,7 @@ import java.util.Objects; * @hide */ @VisibleForTesting -public class InsetsAnimationControlImpl implements WindowInsetsAnimationController, +public class InsetsAnimationControlImpl implements InternalInsetsAnimationController, InsetsAnimationControlRunner { private static final String TAG = "InsetsAnimationCtrlImpl"; diff --git a/core/java/android/view/InsetsAnimationThreadControlRunner.java b/core/java/android/view/InsetsAnimationThreadControlRunner.java index c11bde89d966b..fc97541bd34d4 100644 --- a/core/java/android/view/InsetsAnimationThreadControlRunner.java +++ b/core/java/android/view/InsetsAnimationThreadControlRunner.java @@ -54,7 +54,7 @@ public class InsetsAnimationThreadControlRunner implements InsetsAnimationContro @Override @UiThread - public + public void startAnimation(T runner, WindowInsetsAnimationControlListener listener, int types, WindowInsetsAnimation animation, Bounds bounds) { // Animation will be started in constructor already. diff --git a/core/java/android/view/InsetsController.java b/core/java/android/view/InsetsController.java index 5c56baa57bd37..1dd5a1b57c539 100644 --- a/core/java/android/view/InsetsController.java +++ b/core/java/android/view/InsetsController.java @@ -632,7 +632,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation runningAnimations.add(runner.getAnimation()); } - if (((WindowInsetsAnimationController) runner).applyChangeInsets(state)) { + if (((InternalInsetsAnimationController) runner).applyChangeInsets(state)) { finishedAnimations.add(runner.getAnimation()); } } @@ -1513,7 +1513,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation @VisibleForTesting @Override - public + public void startAnimation(T runner, WindowInsetsAnimationControlListener listener, int types, WindowInsetsAnimation animation, Bounds bounds) { mHost.dispatchWindowInsetsAnimationPrepare(animation); diff --git a/core/java/android/view/InsetsResizeAnimationRunner.java b/core/java/android/view/InsetsResizeAnimationRunner.java index 83f51aa92d98e..e1352dd8dd4f7 100644 --- a/core/java/android/view/InsetsResizeAnimationRunner.java +++ b/core/java/android/view/InsetsResizeAnimationRunner.java @@ -43,7 +43,7 @@ import android.view.animation.Interpolator; * @hide */ public class InsetsResizeAnimationRunner implements InsetsAnimationControlRunner, - WindowInsetsAnimationController, WindowInsetsAnimationControlListener { + InternalInsetsAnimationController, WindowInsetsAnimationControlListener { private final InsetsState mFromState; private final InsetsState mToState; diff --git a/core/java/android/view/InternalInsetsAnimationController.java b/core/java/android/view/InternalInsetsAnimationController.java new file mode 100644 index 0000000000000..d7f3e20b80c54 --- /dev/null +++ b/core/java/android/view/InternalInsetsAnimationController.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.view; + +/** + * An internal interface which provides methods that will be only used by the framework. + * @hide + */ +public interface InternalInsetsAnimationController extends WindowInsetsAnimationController { + + /** + * Flags whether {@link WindowInsetsAnimationControlListener#onReady( + * WindowInsetsAnimationController, int)} has been invoked. + * @hide + */ + void setReadyDispatched(boolean dispatched); + + /** + * Returns the {@link InsetsState} based on the current animation progress. + * + * @param outState the insets state which matches the current animation progress. + * @return {@code true} if the animation has been finished; {@code false} otherwise. + * @hide + */ + boolean applyChangeInsets(InsetsState outState); +} + diff --git a/core/java/android/view/WindowInsetsAnimationController.java b/core/java/android/view/WindowInsetsAnimationController.java index bdfeb748fb992..6578e9b6c20ca 100644 --- a/core/java/android/view/WindowInsetsAnimationController.java +++ b/core/java/android/view/WindowInsetsAnimationController.java @@ -188,20 +188,4 @@ public interface WindowInsetsAnimationController { * fullscreen or non-overlapping). */ boolean hasZeroInsetsIme(); - - /** - * Flags whether {@link WindowInsetsAnimationControlListener#onReady( - * WindowInsetsAnimationController, int)} has been invoked. - * @hide - */ - void setReadyDispatched(boolean dispatched); - - /** - * Returns the {@link InsetsState} based on the current animation progress. - * - * @param outState the insets state which matches the current animation progress. - * @return {@code true} if the animation has been finished; {@code false} otherwise. - * @hide - */ - boolean applyChangeInsets(InsetsState outState); } diff --git a/services/core/java/com/android/server/wm/InsetsPolicy.java b/services/core/java/com/android/server/wm/InsetsPolicy.java index 450c2c14bb1c8..cf783398fc8de 100644 --- a/services/core/java/com/android/server/wm/InsetsPolicy.java +++ b/services/core/java/com/android/server/wm/InsetsPolicy.java @@ -43,6 +43,7 @@ import android.view.InsetsSource; import android.view.InsetsSourceControl; import android.view.InsetsState; import android.view.InsetsState.InternalInsetsType; +import android.view.InternalInsetsAnimationController; import android.view.SurfaceControl; import android.view.SyncRtSurfaceTransactionApplier; import android.view.WindowInsetsAnimation; @@ -585,7 +586,7 @@ class InsetsPolicy { } @Override - public + public void startAnimation(T runner, WindowInsetsAnimationControlListener listener, int types, WindowInsetsAnimation animation, Bounds bounds) {