Loading src/com/android/launcher3/Workspace.java +10 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ import com.android.launcher3.logging.UserEventDispatcher; import com.android.launcher3.pageindicators.WorkspacePageIndicator; import com.android.launcher3.popup.PopupContainerWithArrow; import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.touch.WorkspaceTouchListener; import com.android.launcher3.userevent.nano.LauncherLogProto.Action; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; Loading Loading @@ -420,6 +421,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator> } // Always enter the spring loaded mode if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.NO_DRAG_TO_WORKSPACE, "Switching to SPRING_LOADED"); } mLauncher.getStateManager().goToState(SPRING_LOADED); } Loading Loading @@ -1741,6 +1745,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator> public void prepareAccessibilityDrop() { } public void onDrop(final DragObject d, DragOptions options) { if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.NO_DRAG_TO_WORKSPACE, "Workspace.onDrop"); } mDragViewVisualCenter = d.getVisualCenter(mDragViewVisualCenter); CellLayout dropTargetLayout = mDropToLayout; Loading Loading @@ -2418,6 +2425,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator> * to add an item to one of the workspace screens. */ private void onDropExternal(final int[] touchXY, final CellLayout cellLayout, DragObject d) { if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.NO_DRAG_TO_WORKSPACE, "Workspace.onDropExternal"); } if (d.dragInfo instanceof PendingAddShortcutInfo) { WorkspaceItemInfo si = ((PendingAddShortcutInfo) d.dragInfo) .activityInfo.createWorkspaceItemInfo(); Loading src/com/android/launcher3/dragndrop/DragController.java +3 −0 Original line number Diff line number Diff line Loading @@ -579,6 +579,9 @@ public class DragController implements DragDriver.EventListener, TouchController } private void drop(DropTarget dropTarget, Runnable flingAnimation) { if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.NO_DRAG_TO_WORKSPACE, "DragController.drop"); } final int[] coordinates = mCoordinatesTemp; mDragObject.x = coordinates[0]; mDragObject.y = coordinates[1]; Loading src/com/android/launcher3/dragndrop/DragDriver.java +5 −0 Original line number Diff line number Diff line Loading @@ -17,10 +17,12 @@ package com.android.launcher3.dragndrop; import android.content.Context; import android.util.Log; import android.view.DragEvent; import android.view.MotionEvent; import com.android.launcher3.DropTarget.DragObject; import com.android.launcher3.testing.TestProtocol; /** * Base class for driving a drag/drop operation. Loading Loading @@ -52,6 +54,9 @@ public abstract class DragDriver { mEventListener.onDriverDragMove(ev.getX(), ev.getY()); break; case MotionEvent.ACTION_UP: if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.NO_DRAG_TO_WORKSPACE, "DragDriver.ACTION_UP"); } mEventListener.onDriverDragMove(ev.getX(), ev.getY()); mEventListener.onDriverDragEnd(ev.getX(), ev.getY()); break; Loading src/com/android/launcher3/testing/TestProtocol.java +1 −0 Original line number Diff line number Diff line Loading @@ -79,4 +79,5 @@ public final class TestProtocol { public static final String REQUEST_DISABLE_DEBUG_TRACING = "disable-debug-tracing"; public static final String NO_BACKGROUND_TO_OVERVIEW_TAG = "b/138251824"; public static final String NO_DRAG_TO_WORKSPACE = "b/138729456"; } tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +6 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { @Test public void testWorkspace() throws Exception { mLauncher.enableDebugTracing(); final Workspace workspace = mLauncher.getWorkspace(); // Test that ensureWorkspaceIsScrollable adds a page by dragging an icon there. Loading Loading @@ -208,6 +209,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { // Test starting a workspace app. final AppIcon app = workspace.getWorkspaceAppIcon("Chrome"); assertNotNull("No Chrome app in workspace", app); mLauncher.disableDebugTracing(); } public static void runIconLaunchFromAllAppsTest(AbstractLauncherUiTest test, AllApps allApps) { Loading Loading @@ -298,6 +300,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { @Test @PortraitLandscape public void testDragAppIcon() throws Throwable { mLauncher.enableDebugTracing(); // 1. Open all apps and wait for load complete. // 2. Drag icon to homescreen. // 3. Verify that the icon works on homescreen. Loading @@ -314,11 +317,13 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { "Launcher activity is the top activity; expecting another activity to be the top " + "one", isInBackground(launcher))); mLauncher.disableDebugTracing(); } @Test @PortraitLandscape public void testDragShortcut() throws Throwable { mLauncher.enableDebugTracing(); // 1. Open all apps and wait for load complete. // 2. Find the app and long press it to show shortcuts. // 3. Press icon center until shortcuts appear Loading @@ -338,6 +343,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { } finally { allApps.unfreeze(); } mLauncher.disableDebugTracing(); } public static String getAppPackageName() { Loading Loading
src/com/android/launcher3/Workspace.java +10 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ import com.android.launcher3.logging.UserEventDispatcher; import com.android.launcher3.pageindicators.WorkspacePageIndicator; import com.android.launcher3.popup.PopupContainerWithArrow; import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.touch.WorkspaceTouchListener; import com.android.launcher3.userevent.nano.LauncherLogProto.Action; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; Loading Loading @@ -420,6 +421,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator> } // Always enter the spring loaded mode if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.NO_DRAG_TO_WORKSPACE, "Switching to SPRING_LOADED"); } mLauncher.getStateManager().goToState(SPRING_LOADED); } Loading Loading @@ -1741,6 +1745,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator> public void prepareAccessibilityDrop() { } public void onDrop(final DragObject d, DragOptions options) { if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.NO_DRAG_TO_WORKSPACE, "Workspace.onDrop"); } mDragViewVisualCenter = d.getVisualCenter(mDragViewVisualCenter); CellLayout dropTargetLayout = mDropToLayout; Loading Loading @@ -2418,6 +2425,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator> * to add an item to one of the workspace screens. */ private void onDropExternal(final int[] touchXY, final CellLayout cellLayout, DragObject d) { if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.NO_DRAG_TO_WORKSPACE, "Workspace.onDropExternal"); } if (d.dragInfo instanceof PendingAddShortcutInfo) { WorkspaceItemInfo si = ((PendingAddShortcutInfo) d.dragInfo) .activityInfo.createWorkspaceItemInfo(); Loading
src/com/android/launcher3/dragndrop/DragController.java +3 −0 Original line number Diff line number Diff line Loading @@ -579,6 +579,9 @@ public class DragController implements DragDriver.EventListener, TouchController } private void drop(DropTarget dropTarget, Runnable flingAnimation) { if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.NO_DRAG_TO_WORKSPACE, "DragController.drop"); } final int[] coordinates = mCoordinatesTemp; mDragObject.x = coordinates[0]; mDragObject.y = coordinates[1]; Loading
src/com/android/launcher3/dragndrop/DragDriver.java +5 −0 Original line number Diff line number Diff line Loading @@ -17,10 +17,12 @@ package com.android.launcher3.dragndrop; import android.content.Context; import android.util.Log; import android.view.DragEvent; import android.view.MotionEvent; import com.android.launcher3.DropTarget.DragObject; import com.android.launcher3.testing.TestProtocol; /** * Base class for driving a drag/drop operation. Loading Loading @@ -52,6 +54,9 @@ public abstract class DragDriver { mEventListener.onDriverDragMove(ev.getX(), ev.getY()); break; case MotionEvent.ACTION_UP: if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.NO_DRAG_TO_WORKSPACE, "DragDriver.ACTION_UP"); } mEventListener.onDriverDragMove(ev.getX(), ev.getY()); mEventListener.onDriverDragEnd(ev.getX(), ev.getY()); break; Loading
src/com/android/launcher3/testing/TestProtocol.java +1 −0 Original line number Diff line number Diff line Loading @@ -79,4 +79,5 @@ public final class TestProtocol { public static final String REQUEST_DISABLE_DEBUG_TRACING = "disable-debug-tracing"; public static final String NO_BACKGROUND_TO_OVERVIEW_TAG = "b/138251824"; public static final String NO_DRAG_TO_WORKSPACE = "b/138729456"; }
tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +6 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { @Test public void testWorkspace() throws Exception { mLauncher.enableDebugTracing(); final Workspace workspace = mLauncher.getWorkspace(); // Test that ensureWorkspaceIsScrollable adds a page by dragging an icon there. Loading Loading @@ -208,6 +209,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { // Test starting a workspace app. final AppIcon app = workspace.getWorkspaceAppIcon("Chrome"); assertNotNull("No Chrome app in workspace", app); mLauncher.disableDebugTracing(); } public static void runIconLaunchFromAllAppsTest(AbstractLauncherUiTest test, AllApps allApps) { Loading Loading @@ -298,6 +300,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { @Test @PortraitLandscape public void testDragAppIcon() throws Throwable { mLauncher.enableDebugTracing(); // 1. Open all apps and wait for load complete. // 2. Drag icon to homescreen. // 3. Verify that the icon works on homescreen. Loading @@ -314,11 +317,13 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { "Launcher activity is the top activity; expecting another activity to be the top " + "one", isInBackground(launcher))); mLauncher.disableDebugTracing(); } @Test @PortraitLandscape public void testDragShortcut() throws Throwable { mLauncher.enableDebugTracing(); // 1. Open all apps and wait for load complete. // 2. Find the app and long press it to show shortcuts. // 3. Press icon center until shortcuts appear Loading @@ -338,6 +343,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { } finally { allApps.unfreeze(); } mLauncher.disableDebugTracing(); } public static String getAppPackageName() { Loading