From 2c2265c3458445c39d30dd6bc4596fcdec91f852 Mon Sep 17 00:00:00 2001 From: Shan Huang Date: Thu, 29 Dec 2022 01:12:33 +0000 Subject: [PATCH] DO NOT MERGE Split BackEvent into an internal BackMotionEvent and public BackEvent. The constructor of BackEvent has diverged on QPR and master, which will create merge conflicts for all subsequent SysUI back animations to be added from QPR. This cherry-picks ag/20445076 minus the public API changes to solve this problem. Test: atest BackAnimationControllerTest Test: atest BackNavigationControllerTests Test: atest WindowOnBackInvokedDispatcherTest Test: atest TouchTrackerTest Test: m -j Bug: 238475284 Change-Id: Ib9100a9d667a9a17e8f357a1bfc3ee2b52ec17c7 --- core/java/android/window/BackEvent.java | 23 +-- core/java/android/window/BackMotionEvent.aidl | 22 +++ core/java/android/window/BackMotionEvent.java | 150 ++++++++++++++++++ .../android/window/BackProgressAnimator.java | 13 +- .../window/IOnBackInvokedCallback.aidl | 13 +- .../window/WindowOnBackInvokedDispatcher.java | 8 +- .../WindowOnBackInvokedDispatcherTest.java | 13 +- .../shell/back/BackAnimationController.java | 13 +- .../android/wm/shell/back/TouchTracker.java | 11 +- .../back/BackAnimationControllerTest.java | 19 ++- .../wm/shell/back/TouchTrackerTest.java | 3 +- .../wm/BackNavigationControllerTests.java | 6 +- 12 files changed, 227 insertions(+), 67 deletions(-) create mode 100644 core/java/android/window/BackMotionEvent.aidl create mode 100644 core/java/android/window/BackMotionEvent.java diff --git a/core/java/android/window/BackEvent.java b/core/java/android/window/BackEvent.java index 1024e2e50c3e2..4a4f561c71ede 100644 --- a/core/java/android/window/BackEvent.java +++ b/core/java/android/window/BackEvent.java @@ -18,10 +18,8 @@ package android.window; import android.annotation.IntDef; import android.annotation.NonNull; -import android.annotation.Nullable; import android.os.Parcel; import android.os.Parcelable; -import android.view.RemoteAnimationTarget; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -52,8 +50,6 @@ public class BackEvent implements Parcelable { @SwipeEdge private final int mSwipeEdge; - @Nullable - private final RemoteAnimationTarget mDepartingAnimationTarget; /** * Creates a new {@link BackEvent} instance. @@ -62,16 +58,12 @@ public class BackEvent implements Parcelable { * @param touchY Absolute Y location of the touch point of this event. * @param progress Value between 0 and 1 on how far along the back gesture is. * @param swipeEdge Indicates which edge the swipe starts from. - * @param departingAnimationTarget The remote animation target of the departing application - * window. */ - public BackEvent(float touchX, float touchY, float progress, @SwipeEdge int swipeEdge, - @Nullable RemoteAnimationTarget departingAnimationTarget) { + public BackEvent(float touchX, float touchY, float progress, @SwipeEdge int swipeEdge) { mTouchX = touchX; mTouchY = touchY; mProgress = progress; mSwipeEdge = swipeEdge; - mDepartingAnimationTarget = departingAnimationTarget; } private BackEvent(@NonNull Parcel in) { @@ -79,7 +71,6 @@ public class BackEvent implements Parcelable { mTouchY = in.readFloat(); mProgress = in.readFloat(); mSwipeEdge = in.readInt(); - mDepartingAnimationTarget = in.readTypedObject(RemoteAnimationTarget.CREATOR); } public static final Creator CREATOR = new Creator() { @@ -105,7 +96,6 @@ public class BackEvent implements Parcelable { dest.writeFloat(mTouchY); dest.writeFloat(mProgress); dest.writeInt(mSwipeEdge); - dest.writeTypedObject(mDepartingAnimationTarget, flags); } /** @@ -136,16 +126,6 @@ public class BackEvent implements Parcelable { return mSwipeEdge; } - /** - * Returns the {@link RemoteAnimationTarget} of the top departing application window, - * or {@code null} if the top window should not be moved for the current type of back - * destination. - */ - @Nullable - public RemoteAnimationTarget getDepartingAnimationTarget() { - return mDepartingAnimationTarget; - } - @Override public String toString() { return "BackEvent{" @@ -153,7 +133,6 @@ public class BackEvent implements Parcelable { + ", mTouchY=" + mTouchY + ", mProgress=" + mProgress + ", mSwipeEdge" + mSwipeEdge - + ", mDepartingAnimationTarget" + mDepartingAnimationTarget + "}"; } } diff --git a/core/java/android/window/BackMotionEvent.aidl b/core/java/android/window/BackMotionEvent.aidl new file mode 100644 index 0000000000000..7c675c35c073e --- /dev/null +++ b/core/java/android/window/BackMotionEvent.aidl @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2022 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.window; + +/** + * @hide + */ +parcelable BackMotionEvent; diff --git a/core/java/android/window/BackMotionEvent.java b/core/java/android/window/BackMotionEvent.java new file mode 100644 index 0000000000000..8012a1c26baca --- /dev/null +++ b/core/java/android/window/BackMotionEvent.java @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2022 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.window; + +import android.annotation.FloatRange; +import android.annotation.NonNull; +import android.annotation.Nullable; +import android.os.Parcel; +import android.os.Parcelable; +import android.view.RemoteAnimationTarget; + +/** + * Object used to report back gesture progress. Holds information about a {@link BackEvent} plus + * any {@link RemoteAnimationTarget} the gesture manipulates. + * + * @see BackEvent + * @hide + */ +public final class BackMotionEvent implements Parcelable { + private final float mTouchX; + private final float mTouchY; + private final float mProgress; + + @BackEvent.SwipeEdge + private final int mSwipeEdge; + @Nullable + private final RemoteAnimationTarget mDepartingAnimationTarget; + + /** + * Creates a new {@link BackMotionEvent} instance. + * + * @param touchX Absolute X location of the touch point of this event. + * @param touchY Absolute Y location of the touch point of this event. + * @param progress Value between 0 and 1 on how far along the back gesture is. + * @param swipeEdge Indicates which edge the swipe starts from. + * @param departingAnimationTarget The remote animation target of the departing + * application window. + */ + public BackMotionEvent(float touchX, float touchY, float progress, + @BackEvent.SwipeEdge int swipeEdge, + @Nullable RemoteAnimationTarget departingAnimationTarget) { + mTouchX = touchX; + mTouchY = touchY; + mProgress = progress; + mSwipeEdge = swipeEdge; + mDepartingAnimationTarget = departingAnimationTarget; + } + + private BackMotionEvent(@NonNull Parcel in) { + mTouchX = in.readFloat(); + mTouchY = in.readFloat(); + mProgress = in.readFloat(); + mSwipeEdge = in.readInt(); + mDepartingAnimationTarget = in.readTypedObject(RemoteAnimationTarget.CREATOR); + } + + @NonNull + public static final Creator CREATOR = new Creator() { + @Override + public BackMotionEvent createFromParcel(Parcel in) { + return new BackMotionEvent(in); + } + + @Override + public BackMotionEvent[] newArray(int size) { + return new BackMotionEvent[size]; + } + }; + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(@NonNull Parcel dest, int flags) { + dest.writeFloat(mTouchX); + dest.writeFloat(mTouchY); + dest.writeFloat(mProgress); + dest.writeInt(mSwipeEdge); + dest.writeTypedObject(mDepartingAnimationTarget, flags); + } + + /** + * Returns the progress of a {@link BackEvent}. + * + * @see BackEvent#getProgress() + */ + @FloatRange(from = 0, to = 1) + public float getProgress() { + return mProgress; + } + + /** + * Returns the absolute X location of the touch point. + */ + public float getTouchX() { + return mTouchX; + } + + /** + * Returns the absolute Y location of the touch point. + */ + public float getTouchY() { + return mTouchY; + } + + /** + * Returns the screen edge that the swipe starts from. + */ + @BackEvent.SwipeEdge + public int getSwipeEdge() { + return mSwipeEdge; + } + + /** + * Returns the {@link RemoteAnimationTarget} of the top departing application window, + * or {@code null} if the top window should not be moved for the current type of back + * destination. + */ + @Nullable + public RemoteAnimationTarget getDepartingAnimationTarget() { + return mDepartingAnimationTarget; + } + + @Override + public String toString() { + return "BackMotionEvent{" + + "mTouchX=" + mTouchX + + ", mTouchY=" + mTouchY + + ", mProgress=" + mProgress + + ", mSwipeEdge" + mSwipeEdge + + ", mDepartingAnimationTarget" + mDepartingAnimationTarget + + "}"; + } +} diff --git a/core/java/android/window/BackProgressAnimator.java b/core/java/android/window/BackProgressAnimator.java index dd4385c8f50c3..38c52e7473f1d 100644 --- a/core/java/android/window/BackProgressAnimator.java +++ b/core/java/android/window/BackProgressAnimator.java @@ -40,7 +40,7 @@ public class BackProgressAnimator { private final SpringAnimation mSpring; private ProgressCallback mCallback; private float mProgress = 0; - private BackEvent mLastBackEvent; + private BackMotionEvent mLastBackEvent; private boolean mStarted = false; private void setProgress(float progress) { @@ -82,9 +82,9 @@ public class BackProgressAnimator { /** * Sets a new target position for the back progress. * - * @param event the {@link BackEvent} containing the latest target progress. + * @param event the {@link BackMotionEvent} containing the latest target progress. */ - public void onBackProgressed(BackEvent event) { + public void onBackProgressed(BackMotionEvent event) { if (!mStarted) { return; } @@ -95,11 +95,11 @@ public class BackProgressAnimator { /** * Starts the back progress animation. * - * @param event the {@link BackEvent} that started the gesture. + * @param event the {@link BackMotionEvent} that started the gesture. * @param callback the back callback to invoke for the gesture. It will receive back progress * dispatches as the progress animation updates. */ - public void onBackStarted(BackEvent event, ProgressCallback callback) { + public void onBackStarted(BackMotionEvent event, ProgressCallback callback) { reset(); mLastBackEvent = event; mCallback = callback; @@ -129,8 +129,7 @@ public class BackProgressAnimator { } mCallback.onProgressUpdate( new BackEvent(mLastBackEvent.getTouchX(), mLastBackEvent.getTouchY(), - progress / SCALE_FACTOR, mLastBackEvent.getSwipeEdge(), - mLastBackEvent.getDepartingAnimationTarget())); + progress / SCALE_FACTOR, mLastBackEvent.getSwipeEdge())); } } diff --git a/core/java/android/window/IOnBackInvokedCallback.aidl b/core/java/android/window/IOnBackInvokedCallback.aidl index 6af8ddda3a62e..159c0e8afed00 100644 --- a/core/java/android/window/IOnBackInvokedCallback.aidl +++ b/core/java/android/window/IOnBackInvokedCallback.aidl @@ -17,7 +17,7 @@ package android.window; -import android.window.BackEvent; +import android.window.BackMotionEvent; /** * Interface that wraps a {@link OnBackInvokedCallback} object, to be stored in window manager @@ -30,18 +30,19 @@ oneway interface IOnBackInvokedCallback { * Called when a back gesture has been started, or back button has been pressed down. * Wraps {@link OnBackInvokedCallback#onBackStarted(BackEvent)}. * - * @param backEvent The {@link BackEvent} containing information about the touch or button press. + * @param backMotionEvent The {@link BackMotionEvent} containing information about the touch + * or button press. */ - void onBackStarted(in BackEvent backEvent); + void onBackStarted(in BackMotionEvent backMotionEvent); /** * Called on back gesture progress. * Wraps {@link OnBackInvokedCallback#onBackProgressed(BackEvent)}. * - * @param backEvent The {@link BackEvent} containing information about the latest touch point - * and the progress that the back animation should seek to. + * @param backMotionEvent The {@link BackMotionEvent} containing information about the latest + * touch point and the progress that the back animation should seek to. */ - void onBackProgressed(in BackEvent backEvent); + void onBackProgressed(in BackMotionEvent backMotionEvent); /** * Called when a back gesture or back button press has been cancelled. diff --git a/core/java/android/window/WindowOnBackInvokedDispatcher.java b/core/java/android/window/WindowOnBackInvokedDispatcher.java index fda39c14dac74..dd9483a9c759e 100644 --- a/core/java/android/window/WindowOnBackInvokedDispatcher.java +++ b/core/java/android/window/WindowOnBackInvokedDispatcher.java @@ -229,19 +229,21 @@ public class WindowOnBackInvokedDispatcher implements OnBackInvokedDispatcher { } @Override - public void onBackStarted(BackEvent backEvent) { + public void onBackStarted(BackMotionEvent backEvent) { Handler.getMain().post(() -> { final OnBackAnimationCallback callback = getBackAnimationCallback(); if (callback != null) { mProgressAnimator.onBackStarted(backEvent, event -> callback.onBackProgressed(event)); - callback.onBackStarted(backEvent); + callback.onBackStarted(new BackEvent( + backEvent.getTouchX(), backEvent.getTouchY(), + backEvent.getProgress(), backEvent.getSwipeEdge())); } }); } @Override - public void onBackProgressed(BackEvent backEvent) { + public void onBackProgressed(BackMotionEvent backEvent) { Handler.getMain().post(() -> { final OnBackAnimationCallback callback = getBackAnimationCallback(); if (callback != null) { diff --git a/core/tests/coretests/src/android/window/WindowOnBackInvokedDispatcherTest.java b/core/tests/coretests/src/android/window/WindowOnBackInvokedDispatcherTest.java index f370ebd945455..9d6b29e5c072a 100644 --- a/core/tests/coretests/src/android/window/WindowOnBackInvokedDispatcherTest.java +++ b/core/tests/coretests/src/android/window/WindowOnBackInvokedDispatcherTest.java @@ -17,6 +17,7 @@ package android.window; import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.isNull; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.times; @@ -60,8 +61,8 @@ public class WindowOnBackInvokedDispatcherTest { private OnBackAnimationCallback mCallback1; @Mock private OnBackAnimationCallback mCallback2; - @Mock - private BackEvent mBackEvent; + private final BackMotionEvent mBackEvent = new BackMotionEvent( + 0, 0, 0, BackEvent.EDGE_LEFT, null); @Before public void setUp() throws Exception { @@ -89,12 +90,12 @@ public class WindowOnBackInvokedDispatcherTest { captor.capture()); captor.getAllValues().get(0).getCallback().onBackStarted(mBackEvent); waitForIdle(); - verify(mCallback1).onBackStarted(mBackEvent); + verify(mCallback1).onBackStarted(any(BackEvent.class)); verifyZeroInteractions(mCallback2); captor.getAllValues().get(1).getCallback().onBackStarted(mBackEvent); waitForIdle(); - verify(mCallback2).onBackStarted(mBackEvent); + verify(mCallback2).onBackStarted(any(BackEvent.class)); verifyNoMoreInteractions(mCallback1); } @@ -114,7 +115,7 @@ public class WindowOnBackInvokedDispatcherTest { assertEquals(captor.getValue().getPriority(), OnBackInvokedDispatcher.PRIORITY_OVERLAY); captor.getValue().getCallback().onBackStarted(mBackEvent); waitForIdle(); - verify(mCallback1).onBackStarted(mBackEvent); + verify(mCallback1).onBackStarted(any(BackEvent.class)); } @Test @@ -152,6 +153,6 @@ public class WindowOnBackInvokedDispatcherTest { verify(mWindowSession).setOnBackInvokedCallbackInfo(Mockito.eq(mWindow), captor.capture()); captor.getValue().getCallback().onBackStarted(mBackEvent); waitForIdle(); - verify(mCallback2).onBackStarted(mBackEvent); + verify(mCallback2).onBackStarted(any(BackEvent.class)); } } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java index cbcd9498fe55e..236309207b4f0 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java @@ -51,6 +51,7 @@ import android.view.RemoteAnimationTarget; import android.view.SurfaceControl; import android.window.BackAnimationAdaptor; import android.window.BackEvent; +import android.window.BackMotionEvent; import android.window.BackNavigationInfo; import android.window.IBackAnimationRunner; import android.window.IBackNaviAnimationController; @@ -173,11 +174,11 @@ public class BackAnimationController implements RemoteCallable= 0 ? PROGRESS_THRESHOLD : mProgressThreshold; progressThreshold = progressThreshold == 0 ? 1 : progressThreshold; @@ -109,8 +110,8 @@ class TouchTracker { return createProgressEvent(progress); } - BackEvent createProgressEvent(float progress) { - return new BackEvent(mLatestTouchX, mLatestTouchY, progress, mSwipeEdge, null); + BackMotionEvent createProgressEvent(float progress) { + return new BackMotionEvent(mLatestTouchX, mLatestTouchY, progress, mSwipeEdge, null); } public void setProgressThreshold(float progressThreshold) { diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java index 2e328b0736ddd..2754496a6f3f5 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java @@ -53,6 +53,7 @@ import android.view.MotionEvent; import android.view.RemoteAnimationTarget; import android.view.SurfaceControl; import android.window.BackEvent; +import android.window.BackMotionEvent; import android.window.BackNavigationInfo; import android.window.IBackNaviAnimationController; import android.window.IOnBackInvokedCallback; @@ -246,10 +247,11 @@ public class BackAnimationControllerTest extends ShellTestCase { // Check that back start and progress is dispatched when first move. doMotionEvent(MotionEvent.ACTION_MOVE, 100); simulateRemoteAnimationStart(BackNavigationInfo.TYPE_RETURN_TO_HOME, animationTarget); - ArgumentCaptor backEventCaptor = ArgumentCaptor.forClass(BackEvent.class); + ArgumentCaptor backEventCaptor = + ArgumentCaptor.forClass(BackMotionEvent.class); verify(mIOnBackInvokedCallback).onBackStarted(backEventCaptor.capture()); assertEquals(animationTarget, backEventCaptor.getValue().getDepartingAnimationTarget()); - verify(mIOnBackInvokedCallback, atLeastOnce()).onBackProgressed(any(BackEvent.class)); + verify(mIOnBackInvokedCallback, atLeastOnce()).onBackProgressed(any(BackMotionEvent.class)); // Check that back invocation is dispatched. mController.setTriggerBack(true); // Fake trigger back @@ -271,17 +273,18 @@ public class BackAnimationControllerTest extends ShellTestCase { RemoteAnimationTarget animationTarget = createAnimationTarget(); IOnBackInvokedCallback appCallback = mock(IOnBackInvokedCallback.class); - ArgumentCaptor backEventCaptor = ArgumentCaptor.forClass(BackEvent.class); + ArgumentCaptor backEventCaptor = + ArgumentCaptor.forClass(BackMotionEvent.class); createNavigationInfo(animationTarget, null, null, BackNavigationInfo.TYPE_RETURN_TO_HOME, appCallback, false); triggerBackGesture(); - verify(appCallback, never()).onBackStarted(any(BackEvent.class)); + verify(appCallback, never()).onBackStarted(any(BackMotionEvent.class)); verify(appCallback, never()).onBackProgressed(backEventCaptor.capture()); verify(appCallback, times(1)).onBackInvoked(); - verify(mIOnBackInvokedCallback, never()).onBackStarted(any(BackEvent.class)); + verify(mIOnBackInvokedCallback, never()).onBackStarted(any(BackMotionEvent.class)); verify(mIOnBackInvokedCallback, never()).onBackProgressed(backEventCaptor.capture()); verify(mIOnBackInvokedCallback, never()).onBackInvoked(); } @@ -314,7 +317,7 @@ public class BackAnimationControllerTest extends ShellTestCase { doMotionEvent(MotionEvent.ACTION_DOWN, 0); doMotionEvent(MotionEvent.ACTION_MOVE, 100); simulateRemoteAnimationStart(BackNavigationInfo.TYPE_RETURN_TO_HOME, animationTarget); - verify(mIOnBackInvokedCallback).onBackStarted(any(BackEvent.class)); + verify(mIOnBackInvokedCallback).onBackStarted(any(BackMotionEvent.class)); } @Test @@ -333,7 +336,7 @@ public class BackAnimationControllerTest extends ShellTestCase { doMotionEvent(MotionEvent.ACTION_DOWN, 0); doMotionEvent(MotionEvent.ACTION_MOVE, 100); simulateRemoteAnimationStart(BackNavigationInfo.TYPE_RETURN_TO_HOME, animationTarget); - verify(mIOnBackInvokedCallback).onBackStarted(any(BackEvent.class)); + verify(mIOnBackInvokedCallback).onBackStarted(any(BackMotionEvent.class)); } @@ -349,7 +352,7 @@ public class BackAnimationControllerTest extends ShellTestCase { // Check that back start and progress is dispatched when first move. doMotionEvent(MotionEvent.ACTION_MOVE, 100); simulateRemoteAnimationStart(BackNavigationInfo.TYPE_RETURN_TO_HOME, animationTarget); - verify(mIOnBackInvokedCallback).onBackStarted(any(BackEvent.class)); + verify(mIOnBackInvokedCallback).onBackStarted(any(BackMotionEvent.class)); // Check that back invocation is dispatched. mController.setTriggerBack(true); // Fake trigger back diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/TouchTrackerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/TouchTrackerTest.java index 3aefc3f03a8aa..ba9c159bad284 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/TouchTrackerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/TouchTrackerTest.java @@ -19,6 +19,7 @@ package com.android.wm.shell.back; import static org.junit.Assert.assertEquals; import android.window.BackEvent; +import android.window.BackMotionEvent; import org.junit.Before; import org.junit.Test; @@ -38,7 +39,7 @@ public class TouchTrackerTest { @Test public void generatesProgress_onStart() { mTouchTracker.setGestureStartLocation(INITIAL_X_LEFT_EDGE, 0, BackEvent.EDGE_LEFT); - BackEvent event = mTouchTracker.createStartEvent(null); + BackMotionEvent event = mTouchTracker.createStartEvent(null); assertEquals(event.getProgress(), 0f, 0f); } diff --git a/services/tests/wmtests/src/com/android/server/wm/BackNavigationControllerTests.java b/services/tests/wmtests/src/com/android/server/wm/BackNavigationControllerTests.java index e30e5dbcaf46f..74ea7d7687edb 100644 --- a/services/tests/wmtests/src/com/android/server/wm/BackNavigationControllerTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/BackNavigationControllerTests.java @@ -40,7 +40,7 @@ import android.hardware.HardwareBuffer; import android.os.RemoteException; import android.platform.test.annotations.Presubmit; import android.view.WindowManager; -import android.window.BackEvent; +import android.window.BackMotionEvent; import android.window.BackNavigationInfo; import android.window.IOnBackInvokedCallback; import android.window.OnBackInvokedCallback; @@ -242,11 +242,11 @@ public class BackNavigationControllerTests extends WindowTestsBase { private IOnBackInvokedCallback createOnBackInvokedCallback() { return new IOnBackInvokedCallback.Stub() { @Override - public void onBackStarted(BackEvent backEvent) { + public void onBackStarted(BackMotionEvent backEvent) { } @Override - public void onBackProgressed(BackEvent backEvent) { + public void onBackProgressed(BackMotionEvent backEvent) { } @Override