Loading tests/tapl/com/android/launcher3/tapl/AppIcon.java +3 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.launcher3.tapl; import android.graphics.Point; import android.view.MotionEvent; import android.widget.TextView; import androidx.test.uiautomator.By; Loading @@ -40,9 +41,10 @@ public final class AppIcon extends Launchable { */ public AppIconMenu openMenu() { final Point iconCenter = mObject.getVisibleCenter(); mLauncher.longTap(iconCenter.x, iconCenter.y); mLauncher.sendPointer(MotionEvent.ACTION_DOWN, iconCenter); final UiObject2 deepShortcutsContainer = mLauncher.waitForLauncherObject( "deep_shortcuts_container"); mLauncher.sendPointer(MotionEvent.ACTION_UP, iconCenter); return new AppIconMenu(mLauncher, deepShortcutsContainer); } } tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +10 −5 Original line number Diff line number Diff line Loading @@ -21,10 +21,13 @@ import static com.android.systemui.shared.system.SettingsCompat.SWIPE_UP_SETTING import android.app.ActivityManager; import android.app.Instrumentation; import android.app.UiAutomation; import android.graphics.Point; import android.os.Bundle; import android.os.Parcelable; import android.os.SystemClock; import android.provider.Settings; import android.util.Log; import android.view.MotionEvent; import android.view.Surface; import android.view.accessibility.AccessibilityEvent; Loading Loading @@ -403,11 +406,6 @@ public final class LauncherInstrumentation { return mDevice; } void longTap(int x, int y) { mDevice.drag(x, y, x, y, 0); } void swipe(int startX, int startY, int endX, int endY) { executeAndWaitForEvent( () -> mDevice.swipe(startX, startY, endX, endY, 60), Loading @@ -419,4 +417,11 @@ public final class LauncherInstrumentation { void waitForIdle() { mDevice.waitForIdle(); } void sendPointer(int action, Point point) { final MotionEvent event = MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), action, point.x, point.y, 0); mInstrumentation.sendPointerSync(event); event.recycle(); } } No newline at end of file Loading
tests/tapl/com/android/launcher3/tapl/AppIcon.java +3 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.launcher3.tapl; import android.graphics.Point; import android.view.MotionEvent; import android.widget.TextView; import androidx.test.uiautomator.By; Loading @@ -40,9 +41,10 @@ public final class AppIcon extends Launchable { */ public AppIconMenu openMenu() { final Point iconCenter = mObject.getVisibleCenter(); mLauncher.longTap(iconCenter.x, iconCenter.y); mLauncher.sendPointer(MotionEvent.ACTION_DOWN, iconCenter); final UiObject2 deepShortcutsContainer = mLauncher.waitForLauncherObject( "deep_shortcuts_container"); mLauncher.sendPointer(MotionEvent.ACTION_UP, iconCenter); return new AppIconMenu(mLauncher, deepShortcutsContainer); } }
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +10 −5 Original line number Diff line number Diff line Loading @@ -21,10 +21,13 @@ import static com.android.systemui.shared.system.SettingsCompat.SWIPE_UP_SETTING import android.app.ActivityManager; import android.app.Instrumentation; import android.app.UiAutomation; import android.graphics.Point; import android.os.Bundle; import android.os.Parcelable; import android.os.SystemClock; import android.provider.Settings; import android.util.Log; import android.view.MotionEvent; import android.view.Surface; import android.view.accessibility.AccessibilityEvent; Loading Loading @@ -403,11 +406,6 @@ public final class LauncherInstrumentation { return mDevice; } void longTap(int x, int y) { mDevice.drag(x, y, x, y, 0); } void swipe(int startX, int startY, int endX, int endY) { executeAndWaitForEvent( () -> mDevice.swipe(startX, startY, endX, endY, 60), Loading @@ -419,4 +417,11 @@ public final class LauncherInstrumentation { void waitForIdle() { mDevice.waitForIdle(); } void sendPointer(int action, Point point) { final MotionEvent event = MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), action, point.x, point.y, 0); mInstrumentation.sendPointerSync(event); event.recycle(); } } No newline at end of file