Loading libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +7 −3 Original line number Diff line number Diff line Loading @@ -206,9 +206,13 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont * {@link BackAnimationController} */ public void onMotionEvent(MotionEvent event, int action, @BackEvent.SwipeEdge int swipeEdge) { if (action == MotionEvent.ACTION_DOWN) { if (action == MotionEvent.ACTION_MOVE) { if (!mBackGestureStarted) { // Let the animation initialized here to make sure the onPointerDownOutsideFocus // could be happened when ACTION_DOWN, it may change the current focus that we // would access it when startBackNavigation. initAnimation(event); } else if (action == MotionEvent.ACTION_MOVE) { } onMove(event, swipeEdge); } else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { ProtoLog.d(WM_SHELL_BACK_PREVIEW, Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +2 −3 Original line number Diff line number Diff line Loading @@ -198,18 +198,17 @@ public class BackAnimationControllerTest { createNavigationInfo(animationTarget, null, null, BackNavigationInfo.TYPE_RETURN_TO_HOME); // Check that back start is dispatched. mController.onMotionEvent( MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, 0, 0, 0), MotionEvent.ACTION_DOWN, BackEvent.EDGE_LEFT); verify(mIOnBackInvokedCallback).onBackStarted(); // Check that back progress is dispatched. // Check that back start and progress is dispatched when first move. mController.onMotionEvent( MotionEvent.obtain(10, 0, MotionEvent.ACTION_MOVE, 100, 100, 0), MotionEvent.ACTION_MOVE, BackEvent.EDGE_LEFT); verify(mIOnBackInvokedCallback).onBackStarted(); ArgumentCaptor<BackEvent> backEventCaptor = ArgumentCaptor.forClass(BackEvent.class); verify(mIOnBackInvokedCallback).onBackProgressed(backEventCaptor.capture()); assertEquals(animationTarget, backEventCaptor.getValue().getDepartingAnimationTarget()); Loading services/core/java/com/android/server/wm/BackNavigationController.java +1 −8 Original line number Diff line number Diff line Loading @@ -124,8 +124,7 @@ class BackNavigationController { LocalServices.getService(WindowManagerInternal.class); IBinder focusedWindowToken = windowManagerInternal.getFocusedWindowToken(); window = wmService.windowForClientLocked(null, focusedWindowToken, false /* throwOnError */); window = wmService.getFocusedWindowLocked(); if (window == null) { EmbeddedWindowController.EmbeddedWindow embeddedWindow = Loading @@ -146,12 +145,6 @@ class BackNavigationController { "Focused window found using getFocusedWindowToken"); } if (window == null) { window = wmService.getFocusedWindowLocked(); ProtoLog.d(WM_DEBUG_BACK_PREVIEW, "Focused window found using wmService.getFocusedWindowLocked()"); } if (window == null) { // We don't have any focused window, fallback ont the top currentTask of the focused // display. Loading services/tests/wmtests/src/com/android/server/wm/BackNavigationControllerTests.java +1 −0 Original line number Diff line number Diff line Loading @@ -306,6 +306,7 @@ public class BackNavigationControllerTests extends WindowTestsBase { if (focus) { doReturn(window.getWindowInfo().token) .when(mWindowManagerInternal).getFocusedWindowToken(); doReturn(window).when(mWm).getFocusedWindowLocked(); } } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +7 −3 Original line number Diff line number Diff line Loading @@ -206,9 +206,13 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont * {@link BackAnimationController} */ public void onMotionEvent(MotionEvent event, int action, @BackEvent.SwipeEdge int swipeEdge) { if (action == MotionEvent.ACTION_DOWN) { if (action == MotionEvent.ACTION_MOVE) { if (!mBackGestureStarted) { // Let the animation initialized here to make sure the onPointerDownOutsideFocus // could be happened when ACTION_DOWN, it may change the current focus that we // would access it when startBackNavigation. initAnimation(event); } else if (action == MotionEvent.ACTION_MOVE) { } onMove(event, swipeEdge); } else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { ProtoLog.d(WM_SHELL_BACK_PREVIEW, Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +2 −3 Original line number Diff line number Diff line Loading @@ -198,18 +198,17 @@ public class BackAnimationControllerTest { createNavigationInfo(animationTarget, null, null, BackNavigationInfo.TYPE_RETURN_TO_HOME); // Check that back start is dispatched. mController.onMotionEvent( MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, 0, 0, 0), MotionEvent.ACTION_DOWN, BackEvent.EDGE_LEFT); verify(mIOnBackInvokedCallback).onBackStarted(); // Check that back progress is dispatched. // Check that back start and progress is dispatched when first move. mController.onMotionEvent( MotionEvent.obtain(10, 0, MotionEvent.ACTION_MOVE, 100, 100, 0), MotionEvent.ACTION_MOVE, BackEvent.EDGE_LEFT); verify(mIOnBackInvokedCallback).onBackStarted(); ArgumentCaptor<BackEvent> backEventCaptor = ArgumentCaptor.forClass(BackEvent.class); verify(mIOnBackInvokedCallback).onBackProgressed(backEventCaptor.capture()); assertEquals(animationTarget, backEventCaptor.getValue().getDepartingAnimationTarget()); Loading
services/core/java/com/android/server/wm/BackNavigationController.java +1 −8 Original line number Diff line number Diff line Loading @@ -124,8 +124,7 @@ class BackNavigationController { LocalServices.getService(WindowManagerInternal.class); IBinder focusedWindowToken = windowManagerInternal.getFocusedWindowToken(); window = wmService.windowForClientLocked(null, focusedWindowToken, false /* throwOnError */); window = wmService.getFocusedWindowLocked(); if (window == null) { EmbeddedWindowController.EmbeddedWindow embeddedWindow = Loading @@ -146,12 +145,6 @@ class BackNavigationController { "Focused window found using getFocusedWindowToken"); } if (window == null) { window = wmService.getFocusedWindowLocked(); ProtoLog.d(WM_DEBUG_BACK_PREVIEW, "Focused window found using wmService.getFocusedWindowLocked()"); } if (window == null) { // We don't have any focused window, fallback ont the top currentTask of the focused // display. Loading
services/tests/wmtests/src/com/android/server/wm/BackNavigationControllerTests.java +1 −0 Original line number Diff line number Diff line Loading @@ -306,6 +306,7 @@ public class BackNavigationControllerTests extends WindowTestsBase { if (focus) { doReturn(window.getWindowInfo().token) .when(mWindowManagerInternal).getFocusedWindowToken(); doReturn(window).when(mWm).getFocusedWindowLocked(); } } }