Loading core/java/android/app/IActivityTaskManager.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -348,6 +348,7 @@ interface IActivityTaskManager { /** * Prepare the back navigation in the server. This setups the leashed for sysui to animate * the back gesture and returns the data needed for the animation. * @param requestAnimation true if the caller wishes to animate the back navigation */ android.window.BackNavigationInfo startBackNavigation(); android.window.BackNavigationInfo startBackNavigation(in boolean requestAnimation); } core/tests/coretests/src/android/window/BackNavigationTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ public class BackNavigationTest { private void assertCallbackIsCalled(CountDownLatch latch) { try { mInstrumentation.getUiAutomation().waitForIdle(500, 1000); BackNavigationInfo info = ActivityTaskManager.getService().startBackNavigation(); BackNavigationInfo info = ActivityTaskManager.getService().startBackNavigation(true); assertNotNull("BackNavigationInfo is null", info); assertNotNull("OnBackInvokedCallback is null", info.getOnBackInvokedCallback()); info.getOnBackInvokedCallback().onBackInvoked(); Loading libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +2 −2 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont SETTING_VALUE_ON) != SETTING_VALUE_OFF; private static final int PROGRESS_THRESHOLD = SystemProperties .getInt(PREDICTIVE_BACK_PROGRESS_THRESHOLD_PROP, -1); /** * Max duration to wait for a transition to finish before accepting another gesture start * request. Loading Loading @@ -290,7 +289,8 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont mBackGestureStarted = true; try { mBackNavigationInfo = mActivityTaskManager.startBackNavigation(); boolean requestAnimation = mEnableAnimations.get(); mBackNavigationInfo = mActivityTaskManager.startBackNavigation(requestAnimation); onBackNavigationInfoReceived(mBackNavigationInfo); } catch (RemoteException remoteException) { Log.e(TAG, "Failed to initAnimation", remoteException); Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +7 −3 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.window.BackNavigationInfo.KEY_TRIGGER_BACK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.atLeastOnce; Loading Loading @@ -129,7 +130,7 @@ public class BackAnimationControllerTest { new RemoteCallback((bundle) -> {}), onBackInvokedCallback); try { doReturn(navigationInfo).when(mActivityTaskManager).startBackNavigation(); doReturn(navigationInfo).when(mActivityTaskManager).startBackNavigation(anyBoolean()); } catch (RemoteException ex) { ex.rethrowFromSystemServer(); } Loading @@ -137,7 +138,7 @@ public class BackAnimationControllerTest { private void createNavigationInfo(BackNavigationInfo.Builder builder) { try { doReturn(builder.build()).when(mActivityTaskManager).startBackNavigation(); doReturn(builder.build()).when(mActivityTaskManager).startBackNavigation(anyBoolean()); } catch (RemoteException ex) { ex.rethrowFromSystemServer(); } Loading Loading @@ -217,8 +218,11 @@ public class BackAnimationControllerTest { // Check that back start and progress is dispatched when first move. doMotionEvent(MotionEvent.ACTION_MOVE, 100); verify(mIOnBackInvokedCallback).onBackStarted(); // Check that back progress is dispatched. doMotionEvent(MotionEvent.ACTION_MOVE, 100); ArgumentCaptor<BackEvent> backEventCaptor = ArgumentCaptor.forClass(BackEvent.class); verify(mIOnBackInvokedCallback).onBackProgressed(backEventCaptor.capture()); verify(mIOnBackInvokedCallback, atLeastOnce()).onBackProgressed(backEventCaptor.capture()); assertEquals(animationTarget, backEventCaptor.getValue().getDepartingAnimationTarget()); // Check that back invocation is dispatched. Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -1811,13 +1811,13 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } @Override public BackNavigationInfo startBackNavigation() { public BackNavigationInfo startBackNavigation(boolean requestAnimation) { mAmInternal.enforceCallingPermission(START_TASKS_FROM_RECENTS, "startBackNavigation()"); if (mBackNavigationController == null) { return null; } return mBackNavigationController.startBackNavigation(mWindowManager); return mBackNavigationController.startBackNavigation(mWindowManager, requestAnimation); } /** Loading Loading
core/java/android/app/IActivityTaskManager.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -348,6 +348,7 @@ interface IActivityTaskManager { /** * Prepare the back navigation in the server. This setups the leashed for sysui to animate * the back gesture and returns the data needed for the animation. * @param requestAnimation true if the caller wishes to animate the back navigation */ android.window.BackNavigationInfo startBackNavigation(); android.window.BackNavigationInfo startBackNavigation(in boolean requestAnimation); }
core/tests/coretests/src/android/window/BackNavigationTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ public class BackNavigationTest { private void assertCallbackIsCalled(CountDownLatch latch) { try { mInstrumentation.getUiAutomation().waitForIdle(500, 1000); BackNavigationInfo info = ActivityTaskManager.getService().startBackNavigation(); BackNavigationInfo info = ActivityTaskManager.getService().startBackNavigation(true); assertNotNull("BackNavigationInfo is null", info); assertNotNull("OnBackInvokedCallback is null", info.getOnBackInvokedCallback()); info.getOnBackInvokedCallback().onBackInvoked(); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +2 −2 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont SETTING_VALUE_ON) != SETTING_VALUE_OFF; private static final int PROGRESS_THRESHOLD = SystemProperties .getInt(PREDICTIVE_BACK_PROGRESS_THRESHOLD_PROP, -1); /** * Max duration to wait for a transition to finish before accepting another gesture start * request. Loading Loading @@ -290,7 +289,8 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont mBackGestureStarted = true; try { mBackNavigationInfo = mActivityTaskManager.startBackNavigation(); boolean requestAnimation = mEnableAnimations.get(); mBackNavigationInfo = mActivityTaskManager.startBackNavigation(requestAnimation); onBackNavigationInfoReceived(mBackNavigationInfo); } catch (RemoteException remoteException) { Log.e(TAG, "Failed to initAnimation", remoteException); Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +7 −3 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.window.BackNavigationInfo.KEY_TRIGGER_BACK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.atLeastOnce; Loading Loading @@ -129,7 +130,7 @@ public class BackAnimationControllerTest { new RemoteCallback((bundle) -> {}), onBackInvokedCallback); try { doReturn(navigationInfo).when(mActivityTaskManager).startBackNavigation(); doReturn(navigationInfo).when(mActivityTaskManager).startBackNavigation(anyBoolean()); } catch (RemoteException ex) { ex.rethrowFromSystemServer(); } Loading @@ -137,7 +138,7 @@ public class BackAnimationControllerTest { private void createNavigationInfo(BackNavigationInfo.Builder builder) { try { doReturn(builder.build()).when(mActivityTaskManager).startBackNavigation(); doReturn(builder.build()).when(mActivityTaskManager).startBackNavigation(anyBoolean()); } catch (RemoteException ex) { ex.rethrowFromSystemServer(); } Loading Loading @@ -217,8 +218,11 @@ public class BackAnimationControllerTest { // Check that back start and progress is dispatched when first move. doMotionEvent(MotionEvent.ACTION_MOVE, 100); verify(mIOnBackInvokedCallback).onBackStarted(); // Check that back progress is dispatched. doMotionEvent(MotionEvent.ACTION_MOVE, 100); ArgumentCaptor<BackEvent> backEventCaptor = ArgumentCaptor.forClass(BackEvent.class); verify(mIOnBackInvokedCallback).onBackProgressed(backEventCaptor.capture()); verify(mIOnBackInvokedCallback, atLeastOnce()).onBackProgressed(backEventCaptor.capture()); assertEquals(animationTarget, backEventCaptor.getValue().getDepartingAnimationTarget()); // Check that back invocation is dispatched. Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -1811,13 +1811,13 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } @Override public BackNavigationInfo startBackNavigation() { public BackNavigationInfo startBackNavigation(boolean requestAnimation) { mAmInternal.enforceCallingPermission(START_TASKS_FROM_RECENTS, "startBackNavigation()"); if (mBackNavigationController == null) { return null; } return mBackNavigationController.startBackNavigation(mWindowManager); return mBackNavigationController.startBackNavigation(mWindowManager, requestAnimation); } /** Loading