Merge "If y velocity > x velocity in 2-button mode, go to recents" into ub-launcher3-qt-dev
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
index 7563c3f..294a997 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
@@ -58,6 +58,8 @@
import android.view.Surface;
import android.view.WindowManager;
+import androidx.annotation.BinderThread;
+
import com.android.launcher3.MainThreadExecutor;
import com.android.launcher3.R;
import com.android.launcher3.ResourceUtils;
@@ -84,6 +86,7 @@
import com.android.systemui.shared.system.InputMonitorCompat;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
+import com.android.systemui.shared.system.SystemGestureExclusionListenerCompat;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -268,6 +271,9 @@
private final RectF mSwipeTouchRegion = new RectF();
private ComponentName mGestureBlockingActivity;
+ private Region mExclusionRegion;
+ private SystemGestureExclusionListenerCompat mExclusionListener;
+
@Override
public void onCreate() {
super.onCreate();
@@ -284,14 +290,23 @@
mIsUserUnlocked = false;
registerReceiver(mUserUnlockedReceiver, new IntentFilter(Intent.ACTION_USER_UNLOCKED));
}
- onNavigationModeChanged(SysUINavigationMode.INSTANCE.get(this).addModeChangeListener(this));
mDefaultDisplayId = getSystemService(WindowManager.class).getDefaultDisplay()
.getDisplayId();
-
String blockingActivity = getString(R.string.gesture_blocking_activity);
mGestureBlockingActivity = TextUtils.isEmpty(blockingActivity) ? null :
ComponentName.unflattenFromString(blockingActivity);
+
+ mExclusionListener = new SystemGestureExclusionListenerCompat(mDefaultDisplayId) {
+ @Override
+ @BinderThread
+ public void onExclusionChanged(Region region) {
+ // Assignments are atomic, it should be safe on binder thread
+ mExclusionRegion = region;
+ }
+ };
+
+ onNavigationModeChanged(SysUINavigationMode.INSTANCE.get(this).addModeChangeListener(this));
sConnected = true;
}
@@ -370,6 +385,12 @@
disposeEventHandlers();
initInputMonitor();
+
+ if (mMode == Mode.NO_BUTTON) {
+ mExclusionListener.register();
+ } else {
+ mExclusionListener.unregister();
+ }
}
@Override
@@ -437,6 +458,7 @@
sConnected = false;
Utilities.unregisterReceiverSafely(this, mUserUnlockedReceiver);
SysUINavigationMode.INSTANCE.get(this).removeModeChangeListener(this);
+ mExclusionListener.unregister();
super.onDestroy();
}
@@ -557,10 +579,15 @@
final ActivityControlHelper activityControl =
mOverviewComponentObserver.getActivityControlHelper();
boolean shouldDefer = activityControl.deferStartingActivity(mActiveNavBarRegion, event);
+
+ // mExclusionRegion can change on binder thread, use a local instance here.
+ Region exclusionRegion = mExclusionRegion;
+ boolean disableHorizontalSwipe = mMode == Mode.NO_BUTTON && exclusionRegion != null
+ && exclusionRegion.contains((int) event.getX(), (int) event.getY());
return new OtherActivityInputConsumer(this, runningTaskInfo, mRecentsModel,
mOverviewComponentObserver.getOverviewIntent(), activityControl,
shouldDefer, mOverviewCallbacks, mInputConsumer, this::onConsumerInactive,
- mSwipeSharedState, mInputMonitorCompat, mSwipeTouchRegion);
+ mSwipeSharedState, mInputMonitorCompat, mSwipeTouchRegion, disableHorizontalSwipe);
}
private InputConsumer createDeviceLockedInputConsumer(RunningTaskInfo taskInfo) {
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
index b0acffa..0ed4c99 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
@@ -111,6 +111,7 @@
private final float mDragSlop;
private final float mSquaredTouchSlop;
+ private final boolean mDisableHorizontalSwipe;
// Slop used to check when we start moving window.
private boolean mPassedDragSlop;
@@ -132,7 +133,7 @@
InputConsumerController inputConsumer,
Consumer<OtherActivityInputConsumer> onCompleteCallback,
SwipeSharedState swipeSharedState, InputMonitorCompat inputMonitorCompat,
- RectF swipeTouchRegion) {
+ RectF swipeTouchRegion, boolean disableHorizontalSwipe) {
super(base);
mMainThreadHandler = new Handler(Looper.getMainLooper());
@@ -162,6 +163,7 @@
mSquaredTouchSlop = slop * slop;
mPassedTouchSlop = mPassedDragSlop = continuingPreviousGesture;
+ mDisableHorizontalSwipe = !mPassedTouchSlop && disableHorizontalSwipe;
}
@Override
@@ -169,6 +171,13 @@
return TYPE_OTHER_ACTIVITY;
}
+ private void forceCancelGesture(MotionEvent ev) {
+ int action = ev.getAction();
+ ev.setAction(ACTION_CANCEL);
+ finishTouchTracking(ev);
+ ev.setAction(action);
+ }
+
@Override
public void onMotionEvent(MotionEvent ev) {
if (mVelocityTracker == null) {
@@ -216,10 +225,7 @@
// Cancel interaction in case of multi-touch interaction
int ptrIdx = ev.getActionIndex();
if (!mSwipeTouchRegion.contains(ev.getX(ptrIdx), ev.getY(ptrIdx))) {
- int action = ev.getAction();
- ev.setAction(ACTION_CANCEL);
- finishTouchTracking(ev);
- ev.setAction(action);
+ forceCancelGesture(ev);
}
}
break;
@@ -258,7 +264,15 @@
}
if (!mPassedTouchSlop) {
- if (squaredHypot(displacementX, mLastPos.y - mDownPos.y) >= mSquaredTouchSlop) {
+ float displacementY = mLastPos.y - mDownPos.y;
+ if (squaredHypot(displacementX, displacementY) >= mSquaredTouchSlop) {
+ if (mDisableHorizontalSwipe
+ && Math.abs(displacementX) > Math.abs(displacementY)) {
+ // Horizontal gesture is not allowed in this region
+ forceCancelGesture(ev);
+ break;
+ }
+
mPassedTouchSlop = true;
if (mIsDeferredDownTarget) {
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
index 917465f..f8d454f 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
@@ -52,6 +52,7 @@
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.logging.UserEventDispatcher;
+import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
@@ -182,6 +183,9 @@
super(context, attrs, defStyleAttr);
mActivity = BaseDraggingActivity.fromContext(context);
setOnClickListener((view) -> {
+ if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
+ android.util.Log.d(TestProtocol.NO_START_TASK_TAG, "TaskView onClick");
+ }
if (getTask() == null) {
return;
}
@@ -285,6 +289,9 @@
public void launchTask(boolean animate, boolean freezeTaskList, Consumer<Boolean> resultCallback,
Handler resultCallbackHandler) {
+ if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
+ android.util.Log.d(TestProtocol.NO_START_TASK_TAG, "launchTask");
+ }
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
if (isRunningTask()) {
getRecentsView().finishRecentsAnimation(false /* toRecents */,
@@ -299,6 +306,9 @@
private void launchTaskInternal(boolean animate, boolean freezeTaskList,
Consumer<Boolean> resultCallback, Handler resultCallbackHandler) {
+ if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
+ android.util.Log.d(TestProtocol.NO_START_TASK_TAG, "launchTaskInternal");
+ }
if (mTask != null) {
final ActivityOptions opts;
if (animate) {
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 711cfd2..ed0b90f 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -490,9 +490,7 @@
mDeviceProfile = mDeviceProfile.getMultiWindowProfile(this, mwSize);
}
- if (supportsFakeLandscapeUI()
- && mDeviceProfile.isVerticalBarLayout()
- && !mDeviceProfile.isMultiWindowMode) {
+ if (supportsFakeLandscapeUI() && mDeviceProfile.isVerticalBarLayout()) {
mStableDeviceProfile = mDeviceProfile.inv.portraitProfile;
mRotationMode = UiFactory.getRotationMode(mDeviceProfile);
} else {
@@ -500,6 +498,7 @@
mRotationMode = RotationMode.NORMAL;
}
+ mRotationHelper.updateRotationAnimation();
onDeviceProfileInitiated();
mModelWriter = mModel.getWriter(getWallpaperDeviceProfile().isVerticalBarLayout(), true);
}
diff --git a/src/com/android/launcher3/compat/AccessibilityManagerCompat.java b/src/com/android/launcher3/compat/AccessibilityManagerCompat.java
index 81c95cb..43ae651 100644
--- a/src/com/android/launcher3/compat/AccessibilityManagerCompat.java
+++ b/src/com/android/launcher3/compat/AccessibilityManagerCompat.java
@@ -53,6 +53,9 @@
}
public static void sendStateEventToTest(Context context, int stateOrdinal) {
+ if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
+ android.util.Log.e(TestProtocol.NO_ALLAPPS_EVENT_TAG, "sendStateEventToTest");
+ }
final AccessibilityManager accessibilityManager = getAccessibilityManagerForTest(context);
if (accessibilityManager == null) return;
diff --git a/src/com/android/launcher3/popup/RemoteActionShortcut.java b/src/com/android/launcher3/popup/RemoteActionShortcut.java
index f8b6242..41ab4df 100644
--- a/src/com/android/launcher3/popup/RemoteActionShortcut.java
+++ b/src/com/android/launcher3/popup/RemoteActionShortcut.java
@@ -33,6 +33,7 @@
public class RemoteActionShortcut extends SystemShortcut<BaseDraggingActivity> {
private static final String TAG = "RemoteActionShortcut";
+ private static final boolean DEBUG = false;
private final RemoteAction mAction;
@@ -48,7 +49,10 @@
return view -> {
AbstractFloatingView.closeAllOpenViews(activity);
+ final String actionIdentity = mAction.getTitle() + ", " +
+ itemInfo.getTargetComponent().getPackageName();
try {
+ if (DEBUG) Log.d(TAG, "Sending action: " + actionIdentity);
mAction.getActionIntent().send(
activity,
0,
@@ -56,15 +60,16 @@
Intent.EXTRA_PACKAGE_NAME,
itemInfo.getTargetComponent().getPackageName()),
(pendingIntent, intent, resultCode, resultData, resultExtras) -> {
+ if (DEBUG) Log.d(TAG, "Action is complete: " + actionIdentity);
if (resultData != null && !resultData.isEmpty()) {
- Log.e(TAG, "Remote action returned result: " + mAction.getTitle()
+ Log.e(TAG, "Remote action returned result: " + actionIdentity
+ " : " + resultData);
Toast.makeText(activity, resultData, Toast.LENGTH_SHORT).show();
}
},
new Handler(Looper.getMainLooper()));
} catch (PendingIntent.CanceledException e) {
- Log.e(TAG, "Remote action canceled: " + mAction.getTitle(), e);
+ Log.e(TAG, "Remote action canceled: " + actionIdentity, e);
Toast.makeText(activity, activity.getString(
R.string.remote_action_failed,
mAction.getTitle()),
diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java
index b6c3c35..cd96d6e 100644
--- a/src/com/android/launcher3/states/RotationHelper.java
+++ b/src/com/android/launcher3/states/RotationHelper.java
@@ -94,16 +94,20 @@
public boolean homeScreenCanRotate() {
return mIgnoreAutoRotateSettings || mAutoRotateEnabled
- || mStateHandlerRequest != REQUEST_NONE;
+ || mStateHandlerRequest != REQUEST_NONE
+ || mLauncher.getDeviceProfile().isMultiWindowMode;
}
- private void updateRotationAnimation() {
+ public void updateRotationAnimation() {
if (FeatureFlags.FAKE_LANDSCAPE_UI.get()) {
WindowManager.LayoutParams lp = mLauncher.getWindow().getAttributes();
+ int oldAnim = lp.rotationAnimation;
lp.rotationAnimation = homeScreenCanRotate()
? WindowManager.LayoutParams.ROTATION_ANIMATION_ROTATE
: WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLESS;
- mLauncher.getWindow().setAttributes(lp);
+ if (oldAnim != lp.rotationAnimation) {
+ mLauncher.getWindow().setAttributes(lp);
+ }
}
}
@@ -123,6 +127,7 @@
public void setStateHandlerRequest(int request) {
if (mStateHandlerRequest != request) {
mStateHandlerRequest = request;
+ updateRotationAnimation();
notifyChange();
}
}
diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/TestProtocol.java
index a678ef2..99efb22 100644
--- a/src/com/android/launcher3/testing/TestProtocol.java
+++ b/src/com/android/launcher3/testing/TestProtocol.java
@@ -68,6 +68,8 @@
public static boolean sDebugTracing = false;
public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing";
public static final String REQUEST_DISABLE_DEBUG_TRACING = "disable-debug-tracing";
+ public static final String NO_ALLAPPS_EVENT_TAG = "b/133867119";
public static final String NO_DRAG_TAG = "b/133009122";
public static final String NO_START_TAG = "b/132900132";
+ public static final String NO_START_TASK_TAG = "b/133765434";
}
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
index 35fc873..9703aa6 100644
--- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
+++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
@@ -43,6 +43,7 @@
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.compat.AccessibilityManagerCompat;
+import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
@@ -363,6 +364,9 @@
@Override
public void onDragEnd(float velocity, boolean fling) {
+ if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
+ android.util.Log.e(TestProtocol.NO_ALLAPPS_EVENT_TAG, "onDragEnd");
+ }
final int logAction = fling ? Touch.FLING : Touch.SWIPE;
boolean blockedFling = fling && mFlingBlockCheck.isBlocked();
@@ -499,6 +503,9 @@
}
protected void onSwipeInteractionCompleted(LauncherState targetState, int logAction) {
+ if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
+ android.util.Log.e(TestProtocol.NO_ALLAPPS_EVENT_TAG, "onSwipeInteractionCompleted 1");
+ }
if (mAtomicComponentsController != null) {
mAtomicComponentsController.getAnimationPlayer().end();
mAtomicComponentsController = null;
@@ -517,6 +524,10 @@
}
mLauncher.getStateManager().goToState(targetState, false /* animated */);
+ if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
+ android.util.Log.e(
+ TestProtocol.NO_ALLAPPS_EVENT_TAG, "onSwipeInteractionCompleted 2");
+ }
AccessibilityManagerCompat.sendStateEventToTest(mLauncher, targetState.ordinal);
}
}
diff --git a/src/com/android/launcher3/touch/SwipeDetector.java b/src/com/android/launcher3/touch/SwipeDetector.java
index 4e3dcf8..4616e58 100644
--- a/src/com/android/launcher3/touch/SwipeDetector.java
+++ b/src/com/android/launcher3/touch/SwipeDetector.java
@@ -25,6 +25,7 @@
import android.view.ViewConfiguration;
import com.android.launcher3.Utilities;
+import com.android.launcher3.testing.TestProtocol;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
@@ -174,6 +175,11 @@
}
mState = newState;
+ if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
+ android.util.Log.e(TestProtocol.NO_ALLAPPS_EVENT_TAG,
+ "setState: " + newState + " @ " + android.util.Log.getStackTraceString(
+ new Throwable()));
+ }
}
public boolean isDraggingOrSettling() {
diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java
index cf0ee62..7a6da3e 100644
--- a/src/com/android/launcher3/views/FloatingIconView.java
+++ b/src/com/android/launcher3/views/FloatingIconView.java
@@ -641,6 +641,11 @@
view.setVisibility(VISIBLE);
originalView.setVisibility(INVISIBLE);
};
+ if (!isOpening) {
+ // Hide immediately since the floating view starts at a different location.
+ originalView.setVisibility(INVISIBLE);
+ view.mLoadIconSignal.setOnCancelListener(() -> originalView.setVisibility(VISIBLE));
+ }
CancellationSignal loadIconSignal = view.mLoadIconSignal;
new Handler(LauncherModel.getWorkerLooper()).postAtFrontOfQueue(() -> {
view.getIcon(originalView, (ItemInfo) originalView.getTag(), isOpening,
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index 44401c7..c7c36b0 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -192,6 +192,14 @@
", track trace is below, UI object dump is further below:\n" +
Log.getStackTraceString(e));
dumpViewHierarchy();
+
+ try {
+ final String dumpsysResult = mDevice.executeShellCommand(
+ "dumpsys activity service TouchInteractionService");
+ Log.d(TAG, "TouchInteractionService: " + dumpsysResult);
+ } catch (IOException ex) {
+ }
+
mDevice.takeScreenshot(new File(pathname));
}
};
diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java
index 18a8f27..d03035a 100644
--- a/tests/tapl/com/android/launcher3/tapl/AllApps.java
+++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java
@@ -20,8 +20,10 @@
import android.graphics.Point;
import android.graphics.Rect;
+import android.widget.TextView;
import androidx.annotation.NonNull;
+import androidx.test.uiautomator.By;
import androidx.test.uiautomator.BySelector;
import androidx.test.uiautomator.Direction;
import androidx.test.uiautomator.UiObject2;
@@ -42,6 +44,10 @@
super(launcher);
final UiObject2 allAppsContainer = verifyActiveContainer();
mHeight = allAppsContainer.getVisibleBounds().height();
+ final UiObject2 appListRecycler = mLauncher.waitForObjectInContainer(allAppsContainer,
+ "apps_list_view");
+ // Wait for the recycler to populate.
+ mLauncher.waitForObjectInContainer(appListRecycler, By.clazz(TextView.class));
}
@Override
@@ -115,7 +121,7 @@
verifyActiveContainer();
}
- final UiObject2 appIcon = mLauncher.getObjectInContainer(allAppsContainer,
+ final UiObject2 appIcon = mLauncher.getObjectInContainer(appListRecycler,
appIconSelector);
ensureIconVisible(appIcon, allAppsContainer, appListRecycler);
return new AppIcon(mLauncher, appIcon);
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index f7befd1..443bc1a 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -21,9 +21,9 @@
import static android.content.pm.PackageManager.MATCH_ALL;
import static android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS;
+import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName;
import static com.android.launcher3.testing.TestProtocol.BACKGROUND_APP_STATE_ORDINAL;
import static com.android.launcher3.testing.TestProtocol.NORMAL_STATE_ORDINAL;
-import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName;
import android.app.ActivityManager;
import android.app.Instrumentation;
@@ -570,6 +570,16 @@
return object;
}
+ @NonNull
+ UiObject2 waitForObjectInContainer(UiObject2 container, BySelector selector) {
+ final UiObject2 object = container.wait(
+ Until.findObject(selector),
+ WAIT_TIME_MS);
+ assertNotNull("Can't find a launcher object id: " + selector + " in container: " +
+ container.getResourceName(), object);
+ return object;
+ }
+
@Nullable
private boolean hasLauncherObject(String resId) {
return mDevice.hasObject(getLauncherObjectSelector(resId));
@@ -581,11 +591,6 @@
}
@NonNull
- UiObject2 waitForLauncherObjectByClass(String clazz) {
- return waitForObjectBySelector(getLauncherObjectSelectorByClass(clazz));
- }
-
- @NonNull
UiObject2 waitForFallbackLauncherObject(String resName) {
return waitForObjectBySelector(getFallbackLauncherObjectSelector(resName));
}
@@ -600,10 +605,6 @@
return By.res(getLauncherPackageName(), resName);
}
- BySelector getLauncherObjectSelectorByClass(String clazz) {
- return By.pkg(getLauncherPackageName()).clazz(clazz);
- }
-
BySelector getFallbackLauncherObjectSelector(String resName) {
return By.res(getOverviewPackageName(), resName);
}
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
index 2ea7618..8b12464 100644
--- a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
@@ -20,6 +20,8 @@
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
+import com.android.launcher3.testing.TestProtocol;
+
/**
* A recent task in the overview panel carousel.
*/
@@ -59,9 +61,14 @@
*/
public Background open() {
verifyActiveContainer();
- mLauncher.assertTrue("Launching task didn't open a new window: " +
- mTask.getParent().getContentDescription(),
- mTask.clickAndWait(Until.newWindow(), WAIT_TIME_MS));
+ mLauncher.getTestInfo(TestProtocol.REQUEST_ENABLE_DEBUG_TRACING);
+ try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
+ "clicking an overview task")) {
+ mLauncher.assertTrue("Launching task didn't open a new window: " +
+ mTask.getParent().getContentDescription(),
+ mTask.clickAndWait(Until.newWindow(), WAIT_TIME_MS));
+ }
+ mLauncher.getTestInfo(TestProtocol.REQUEST_DISABLE_DEBUG_TRACING);
return new Background(mLauncher);
}
}
diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java
index 7dcc426..33754c1 100644
--- a/tests/tapl/com/android/launcher3/tapl/Workspace.java
+++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java
@@ -66,6 +66,7 @@
"switchToAllApps: swipeHeight = " + swipeHeight + ", slop = "
+ mLauncher.getTouchSlop());
+ mLauncher.getTestInfo(TestProtocol.REQUEST_ENABLE_DEBUG_TRACING);
mLauncher.swipeToState(
start.x,
start.y,
@@ -73,6 +74,7 @@
start.y - swipeHeight - mLauncher.getTouchSlop(),
60,
ALL_APPS_STATE_ORDINAL);
+ mLauncher.getTestInfo(TestProtocol.REQUEST_DISABLE_DEBUG_TRACING);
try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
"swiped to all apps")) {