summaryrefslogtreecommitdiff
path: root/core/java/android/view/PendingInsetsController.java
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2020-03-11 13:39:29 +0100
committerAdrian Roos <roosa@google.com>2020-03-11 17:23:31 +0100
commitc549e19c5efd37494dac75e4b372d126f1d2bf19 (patch)
treee8259dcdaabea8d3d3c79930d6f99ec18cdfceda /core/java/android/view/PendingInsetsController.java
parent929401b59064780829d49a7859348deb72909f7b (diff)
WindowInsetsController: Address API feedback
Change CancellationSignal to parameter instead of return value. Fixes: 150472709 Test: atest InsetsControllerTest Change-Id: Id4cb53fddcecac17b7926068046760df5130dc39
Diffstat (limited to 'core/java/android/view/PendingInsetsController.java')
-rw-r--r--core/java/android/view/PendingInsetsController.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/core/java/android/view/PendingInsetsController.java b/core/java/android/view/PendingInsetsController.java
index 7f3641803770..e8d9bb50c290 100644
--- a/core/java/android/view/PendingInsetsController.java
+++ b/core/java/android/view/PendingInsetsController.java
@@ -16,6 +16,8 @@
package android.view;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.os.CancellationSignal;
import android.view.WindowInsets.Type.InsetsType;
import android.view.animation.Interpolator;
@@ -60,21 +62,6 @@ public class PendingInsetsController implements WindowInsetsController {
}
@Override
- public CancellationSignal controlWindowInsetsAnimation(int types, long durationMillis,
- Interpolator interpolator,
- WindowInsetsAnimationControlListener listener) {
- if (mReplayedInsetsController != null) {
- return mReplayedInsetsController.controlWindowInsetsAnimation(types, durationMillis,
- interpolator, listener);
- } else {
- listener.onCancelled();
- CancellationSignal cancellationSignal = new CancellationSignal();
- cancellationSignal.cancel();
- return cancellationSignal;
- }
- }
-
- @Override
public void setSystemBarsAppearance(int appearance, int mask) {
if (mReplayedInsetsController != null) {
mReplayedInsetsController.setSystemBarsAppearance(appearance, mask);
@@ -176,6 +163,19 @@ public class PendingInsetsController implements WindowInsetsController {
mReplayedInsetsController = null;
}
+ @Override
+ public void controlWindowInsetsAnimation(@InsetsType int types, long durationMillis,
+ @Nullable Interpolator interpolator,
+ CancellationSignal cancellationSignal,
+ @NonNull WindowInsetsAnimationControlListener listener) {
+ if (mReplayedInsetsController != null) {
+ mReplayedInsetsController.controlWindowInsetsAnimation(types, durationMillis,
+ interpolator, cancellationSignal, listener);
+ } else {
+ listener.onCancelled();
+ }
+ }
+
private interface PendingRequest {
void replay(InsetsController controller);
}