summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/view/InsetsAnimationControlCallbacks.java2
-rw-r--r--core/java/android/view/InsetsAnimationControlImpl.java2
-rw-r--r--core/java/android/view/InsetsAnimationThreadControlRunner.java2
-rw-r--r--core/java/android/view/InsetsController.java4
-rw-r--r--core/java/android/view/InsetsResizeAnimationRunner.java2
-rw-r--r--core/java/android/view/InternalInsetsAnimationController.java41
-rw-r--r--core/java/android/view/WindowInsetsAnimationController.java16
-rw-r--r--services/core/java/com/android/server/wm/InsetsPolicy.java3
8 files changed, 49 insertions, 23 deletions
diff --git a/core/java/android/view/InsetsAnimationControlCallbacks.java b/core/java/android/view/InsetsAnimationControlCallbacks.java
index 7696bbbb2d5a..04bb6091672b 100644
--- a/core/java/android/view/InsetsAnimationControlCallbacks.java
+++ b/core/java/android/view/InsetsAnimationControlCallbacks.java
@@ -35,7 +35,7 @@ public interface InsetsAnimationControlCallbacks {
* <li>Dispatch {@link WindowInsetsAnimationControlListener#onReady}</li>
* </ul>
*/
- <T extends InsetsAnimationControlRunner & WindowInsetsAnimationController>
+ <T extends InsetsAnimationControlRunner & InternalInsetsAnimationController>
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 b92d24f134aa..7d8d653f5ab3 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 c11bde89d966..fc97541bd34d 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 <T extends InsetsAnimationControlRunner & WindowInsetsAnimationController>
+ public <T extends InsetsAnimationControlRunner & InternalInsetsAnimationController>
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 c0a1419872d3..adda721e00a4 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 <T extends InsetsAnimationControlRunner & WindowInsetsAnimationController>
+ public <T extends InsetsAnimationControlRunner & InternalInsetsAnimationController>
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 83f51aa92d98..e1352dd8dd4f 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 000000000000..d7f3e20b80c5
--- /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 bdfeb748fb99..6578e9b6c20c 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 e932fc32c861..b7d69a3eaa4a 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;
@@ -571,7 +572,7 @@ class InsetsPolicy {
}
@Override
- public <T extends InsetsAnimationControlRunner & WindowInsetsAnimationController>
+ public <T extends InsetsAnimationControlRunner & InternalInsetsAnimationController>
void startAnimation(T runner, WindowInsetsAnimationControlListener listener, int types,
WindowInsetsAnimation animation,
Bounds bounds) {