Loading quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java→quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java +31 −0 Original line number Diff line number Diff line Loading @@ -3,11 +3,15 @@ package com.android.quickstep; import android.content.Context; import android.os.Bundle; import com.android.launcher3.MainThreadExecutor; import com.android.launcher3.testing.TestInformationHandler; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.uioverrides.states.OverviewState; import com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController; import com.android.quickstep.util.LayoutUtils; import com.android.quickstep.views.RecentsView; import java.util.concurrent.ExecutionException; public class QuickstepTestInformationHandler extends TestInformationHandler { Loading Loading @@ -45,6 +49,33 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { PortraitStatesTouchController.getHotseatTop(mLauncher)); return response; } case TestProtocol.REQUEST_OVERVIEW_LEFT_GESTURE_MARGIN: { try { final int leftMargin = new MainThreadExecutor().submit(() -> mLauncher.<RecentsView>getOverviewPanel().getLeftGestureMargin()).get(); response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, leftMargin); } catch (ExecutionException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } return response; } case TestProtocol.REQUEST_OVERVIEW_RIGHT_GESTURE_MARGIN: { try { final int rightMargin = new MainThreadExecutor().submit(() -> mLauncher.<RecentsView>getOverviewPanel().getRightGestureMargin()). get(); response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, rightMargin); } catch (ExecutionException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } return response; } } return super.call(method); Loading quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +11 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewDebug; import android.view.ViewGroup; import android.view.WindowInsets; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.ListView; Loading Loading @@ -1742,4 +1743,14 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl updateEnabledOverlays(); } } public int getLeftGestureMargin() { final WindowInsets insets = getRootWindowInsets(); return Math.max(insets.getSystemGestureInsets().left, insets.getSystemWindowInsetLeft()); } public int getRightGestureMargin() { final WindowInsets insets = getRootWindowInsets(); return Math.max(insets.getSystemGestureInsets().right, insets.getSystemWindowInsetRight()); } } src/com/android/launcher3/testing/TestProtocol.java +2 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,8 @@ public final class TestProtocol { public static final String REQUEST_FREEZE_APP_LIST = "freeze-app-list"; public static final String REQUEST_UNFREEZE_APP_LIST = "unfreeze-app-list"; public static final String REQUEST_APP_LIST_FREEZE_FLAGS = "app-list-freeze-flags"; public static final String REQUEST_OVERVIEW_LEFT_GESTURE_MARGIN = "overview-left-margin"; public static final String REQUEST_OVERVIEW_RIGHT_GESTURE_MARGIN = "overview-right-margin"; public static boolean sDebugTracing = false; public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing"; Loading tests/tapl/com/android/launcher3/tapl/BaseOverview.java +10 −5 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ import androidx.test.uiautomator.BySelector; import androidx.test.uiautomator.Direction; import androidx.test.uiautomator.UiObject2; import com.android.launcher3.testing.TestProtocol; import java.util.Collections; import java.util.List; Loading @@ -30,7 +32,6 @@ import java.util.List; * Common overview pane for both Launcher and fallback recents */ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { private static final int FLING_SPEED = LauncherInstrumentation.isAvd() ? 500 : 1500; private static final int FLINGS_FOR_DISMISS_LIMIT = 40; BaseOverview(LauncherInstrumentation launcher) { Loading @@ -51,8 +52,10 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { mLauncher.addContextLayer("want to fling forward in overview")) { LauncherInstrumentation.log("Overview.flingForward before fling"); final UiObject2 overview = verifyActiveContainer(); mLauncher.scroll(overview, Direction.LEFT, 1, new Rect(mLauncher.getEdgeSensitivityWidth(), 0, 0, 0), 20); final int leftMargin = mLauncher.getTestInfo( TestProtocol.REQUEST_OVERVIEW_LEFT_GESTURE_MARGIN). getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); mLauncher.scroll(overview, Direction.LEFT, 1, new Rect(leftMargin, 0, 0, 0), 20); verifyActiveContainer(); } } Loading Loading @@ -87,8 +90,10 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { mLauncher.addContextLayer("want to fling backward in overview")) { LauncherInstrumentation.log("Overview.flingBackward before fling"); final UiObject2 overview = verifyActiveContainer(); mLauncher.scroll(overview, Direction.RIGHT, 1, new Rect(0, 0, mLauncher.getEdgeSensitivityWidth(), 0), 20); final int rightMargin = mLauncher.getTestInfo( TestProtocol.REQUEST_OVERVIEW_RIGHT_GESTURE_MARGIN). getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); mLauncher.scroll(overview, Direction.RIGHT, 1, new Rect(0, 0, rightMargin, 0), 20); verifyActiveContainer(); } } Loading Loading
quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java→quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java +31 −0 Original line number Diff line number Diff line Loading @@ -3,11 +3,15 @@ package com.android.quickstep; import android.content.Context; import android.os.Bundle; import com.android.launcher3.MainThreadExecutor; import com.android.launcher3.testing.TestInformationHandler; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.uioverrides.states.OverviewState; import com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController; import com.android.quickstep.util.LayoutUtils; import com.android.quickstep.views.RecentsView; import java.util.concurrent.ExecutionException; public class QuickstepTestInformationHandler extends TestInformationHandler { Loading Loading @@ -45,6 +49,33 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { PortraitStatesTouchController.getHotseatTop(mLauncher)); return response; } case TestProtocol.REQUEST_OVERVIEW_LEFT_GESTURE_MARGIN: { try { final int leftMargin = new MainThreadExecutor().submit(() -> mLauncher.<RecentsView>getOverviewPanel().getLeftGestureMargin()).get(); response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, leftMargin); } catch (ExecutionException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } return response; } case TestProtocol.REQUEST_OVERVIEW_RIGHT_GESTURE_MARGIN: { try { final int rightMargin = new MainThreadExecutor().submit(() -> mLauncher.<RecentsView>getOverviewPanel().getRightGestureMargin()). get(); response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, rightMargin); } catch (ExecutionException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } return response; } } return super.call(method); Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +11 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewDebug; import android.view.ViewGroup; import android.view.WindowInsets; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.ListView; Loading Loading @@ -1742,4 +1743,14 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl updateEnabledOverlays(); } } public int getLeftGestureMargin() { final WindowInsets insets = getRootWindowInsets(); return Math.max(insets.getSystemGestureInsets().left, insets.getSystemWindowInsetLeft()); } public int getRightGestureMargin() { final WindowInsets insets = getRootWindowInsets(); return Math.max(insets.getSystemGestureInsets().right, insets.getSystemWindowInsetRight()); } }
src/com/android/launcher3/testing/TestProtocol.java +2 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,8 @@ public final class TestProtocol { public static final String REQUEST_FREEZE_APP_LIST = "freeze-app-list"; public static final String REQUEST_UNFREEZE_APP_LIST = "unfreeze-app-list"; public static final String REQUEST_APP_LIST_FREEZE_FLAGS = "app-list-freeze-flags"; public static final String REQUEST_OVERVIEW_LEFT_GESTURE_MARGIN = "overview-left-margin"; public static final String REQUEST_OVERVIEW_RIGHT_GESTURE_MARGIN = "overview-right-margin"; public static boolean sDebugTracing = false; public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing"; Loading
tests/tapl/com/android/launcher3/tapl/BaseOverview.java +10 −5 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ import androidx.test.uiautomator.BySelector; import androidx.test.uiautomator.Direction; import androidx.test.uiautomator.UiObject2; import com.android.launcher3.testing.TestProtocol; import java.util.Collections; import java.util.List; Loading @@ -30,7 +32,6 @@ import java.util.List; * Common overview pane for both Launcher and fallback recents */ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { private static final int FLING_SPEED = LauncherInstrumentation.isAvd() ? 500 : 1500; private static final int FLINGS_FOR_DISMISS_LIMIT = 40; BaseOverview(LauncherInstrumentation launcher) { Loading @@ -51,8 +52,10 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { mLauncher.addContextLayer("want to fling forward in overview")) { LauncherInstrumentation.log("Overview.flingForward before fling"); final UiObject2 overview = verifyActiveContainer(); mLauncher.scroll(overview, Direction.LEFT, 1, new Rect(mLauncher.getEdgeSensitivityWidth(), 0, 0, 0), 20); final int leftMargin = mLauncher.getTestInfo( TestProtocol.REQUEST_OVERVIEW_LEFT_GESTURE_MARGIN). getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); mLauncher.scroll(overview, Direction.LEFT, 1, new Rect(leftMargin, 0, 0, 0), 20); verifyActiveContainer(); } } Loading Loading @@ -87,8 +90,10 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { mLauncher.addContextLayer("want to fling backward in overview")) { LauncherInstrumentation.log("Overview.flingBackward before fling"); final UiObject2 overview = verifyActiveContainer(); mLauncher.scroll(overview, Direction.RIGHT, 1, new Rect(0, 0, mLauncher.getEdgeSensitivityWidth(), 0), 20); final int rightMargin = mLauncher.getTestInfo( TestProtocol.REQUEST_OVERVIEW_RIGHT_GESTURE_MARGIN). getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); mLauncher.scroll(overview, Direction.RIGHT, 1, new Rect(0, 0, rightMargin, 0), 20); verifyActiveContainer(); } } Loading