Loading quickstep/src/com/android/quickstep/TestInformationProvider.java +16 −5 Original line number Diff line number Diff line Loading @@ -71,6 +71,9 @@ public class TestInformationProvider extends ContentProvider { final Context context = getContext(); final DeviceProfile deviceProfile = InvariantDeviceProfile.INSTANCE. get(context).getDeviceProfile(context); final LauncherAppState launcherAppState = LauncherAppState.getInstanceNoCreate(); final Launcher launcher = launcherAppState != null ? (Launcher) launcherAppState.getModel().getCallback() : null; switch (method) { case TestProtocol.REQUEST_HOME_TO_OVERVIEW_SWIPE_HEIGHT: { Loading @@ -79,18 +82,15 @@ public class TestInformationProvider extends ContentProvider { response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) swipeHeight); break; } case TestProtocol.REQUEST_BACKGROUND_TO_OVERVIEW_SWIPE_HEIGHT: { final float swipeHeight = LayoutUtils.getShelfTrackingDistance(context, deviceProfile); response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) swipeHeight); break; } case TestProtocol.REQUEST_ALL_APPS_TO_OVERVIEW_SWIPE_HEIGHT: { final LauncherAppState launcherAppState = LauncherAppState.getInstanceNoCreate(); if (launcherAppState == null) return null; final Launcher launcher = (Launcher) launcherAppState.getModel().getCallback(); case TestProtocol.REQUEST_ALL_APPS_TO_OVERVIEW_SWIPE_HEIGHT: { if (launcher == null) return null; final float progress = LauncherState.OVERVIEW.getVerticalProgress(launcher) Loading @@ -100,6 +100,17 @@ public class TestInformationProvider extends ContentProvider { response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) distance); break; } case TestProtocol.REQUEST_HOME_TO_ALL_APPS_SWIPE_HEIGHT: { if (launcher == null) return null; final float progress = LauncherState.NORMAL.getVerticalProgress(launcher) - LauncherState.ALL_APPS.getVerticalProgress(launcher); final float distance = launcher.getAllAppsController().getShiftRange() * progress; response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) distance); break; } } return response; } Loading src/com/android/launcher3/TestProtocol.java +2 −0 Original line number Diff line number Diff line Loading @@ -38,4 +38,6 @@ public final class TestProtocol { "background-to-overview-swipe-height"; public static final String REQUEST_ALL_APPS_TO_OVERVIEW_SWIPE_HEIGHT = "all-apps-to-overview-swipe-height"; public static final String REQUEST_HOME_TO_ALL_APPS_SWIPE_HEIGHT = "home-to-all-apps-swipe-height"; } tests/tapl/com/android/launcher3/tapl/Workspace.java +4 −3 Original line number Diff line number Diff line Loading @@ -51,15 +51,16 @@ public final class Workspace extends Home { @NonNull public AllApps switchToAllApps() { verifyActiveContainer(); // Swipe from the hotseat to near the top, e.g. 10% of the screen. final UiObject2 hotseat = mHotseat; final Point start = hotseat.getVisibleCenter(); final int endY = (int) (mLauncher.getDevice().getDisplayHeight() * 0.1f); final int swipeHeight = mLauncher.getTestInfo( TestProtocol.REQUEST_HOME_TO_ALL_APPS_SWIPE_HEIGHT). getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); mLauncher.swipe( start.x, start.y, start.x, endY, start.y - swipeHeight - mLauncher.getTouchSlop(), ALL_APPS_STATE_ORDINAL ); Loading Loading
quickstep/src/com/android/quickstep/TestInformationProvider.java +16 −5 Original line number Diff line number Diff line Loading @@ -71,6 +71,9 @@ public class TestInformationProvider extends ContentProvider { final Context context = getContext(); final DeviceProfile deviceProfile = InvariantDeviceProfile.INSTANCE. get(context).getDeviceProfile(context); final LauncherAppState launcherAppState = LauncherAppState.getInstanceNoCreate(); final Launcher launcher = launcherAppState != null ? (Launcher) launcherAppState.getModel().getCallback() : null; switch (method) { case TestProtocol.REQUEST_HOME_TO_OVERVIEW_SWIPE_HEIGHT: { Loading @@ -79,18 +82,15 @@ public class TestInformationProvider extends ContentProvider { response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) swipeHeight); break; } case TestProtocol.REQUEST_BACKGROUND_TO_OVERVIEW_SWIPE_HEIGHT: { final float swipeHeight = LayoutUtils.getShelfTrackingDistance(context, deviceProfile); response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) swipeHeight); break; } case TestProtocol.REQUEST_ALL_APPS_TO_OVERVIEW_SWIPE_HEIGHT: { final LauncherAppState launcherAppState = LauncherAppState.getInstanceNoCreate(); if (launcherAppState == null) return null; final Launcher launcher = (Launcher) launcherAppState.getModel().getCallback(); case TestProtocol.REQUEST_ALL_APPS_TO_OVERVIEW_SWIPE_HEIGHT: { if (launcher == null) return null; final float progress = LauncherState.OVERVIEW.getVerticalProgress(launcher) Loading @@ -100,6 +100,17 @@ public class TestInformationProvider extends ContentProvider { response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) distance); break; } case TestProtocol.REQUEST_HOME_TO_ALL_APPS_SWIPE_HEIGHT: { if (launcher == null) return null; final float progress = LauncherState.NORMAL.getVerticalProgress(launcher) - LauncherState.ALL_APPS.getVerticalProgress(launcher); final float distance = launcher.getAllAppsController().getShiftRange() * progress; response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) distance); break; } } return response; } Loading
src/com/android/launcher3/TestProtocol.java +2 −0 Original line number Diff line number Diff line Loading @@ -38,4 +38,6 @@ public final class TestProtocol { "background-to-overview-swipe-height"; public static final String REQUEST_ALL_APPS_TO_OVERVIEW_SWIPE_HEIGHT = "all-apps-to-overview-swipe-height"; public static final String REQUEST_HOME_TO_ALL_APPS_SWIPE_HEIGHT = "home-to-all-apps-swipe-height"; }
tests/tapl/com/android/launcher3/tapl/Workspace.java +4 −3 Original line number Diff line number Diff line Loading @@ -51,15 +51,16 @@ public final class Workspace extends Home { @NonNull public AllApps switchToAllApps() { verifyActiveContainer(); // Swipe from the hotseat to near the top, e.g. 10% of the screen. final UiObject2 hotseat = mHotseat; final Point start = hotseat.getVisibleCenter(); final int endY = (int) (mLauncher.getDevice().getDisplayHeight() * 0.1f); final int swipeHeight = mLauncher.getTestInfo( TestProtocol.REQUEST_HOME_TO_ALL_APPS_SWIPE_HEIGHT). getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); mLauncher.swipe( start.x, start.y, start.x, endY, start.y - swipeHeight - mLauncher.getTouchSlop(), ALL_APPS_STATE_ORDINAL ); Loading