Revert "Listen for hover events over stashed taskbar."
This reverts commit c5882bcdfc713aa04aac18dd509d72f306ad8a96.
Reason for revert: b/281068877
Change-Id: I431678658fc464c995df0df5e3cac5491d91b052
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index 4e8c321..959fea7 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -292,8 +292,6 @@
<dimen name="taskbar_stashed_small_screen">108dp</dimen>
<dimen name="taskbar_unstash_input_area">316dp</dimen>
<dimen name="taskbar_stashed_handle_height">4dp</dimen>
- <dimen name="taskbar_stashed_screen_edge_hover_deadzone_height">10dp</dimen>
- <dimen name="taskbar_stashed_below_hover_deadzone_height">1dp</dimen>
<dimen name="taskbar_edu_horizontal_margin">112dp</dimen>
<dimen name="taskbar_nav_buttons_width_kids">88dp</dimen>
<dimen name="taskbar_nav_buttons_height_kids">40dp</dimen>
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index 37f6284..7e0530b 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -929,13 +929,6 @@
}
/**
- * Returns whether the taskbar is currently visually stashed.
- */
- public boolean isTaskbarStashed() {
- return mControllers.taskbarStashController.isStashed();
- }
-
- /**
* Called when we detect a long press in the nav region before passing the gesture slop.
* @return Whether taskbar handled the long press, and thus should cancel the gesture.
*/
@@ -979,23 +972,10 @@
/**
* Called when we detect a motion down or up/cancel in the nav region while stashed.
- *
* @param animateForward Whether to animate towards the unstashed hint state or back to stashed.
*/
public void startTaskbarUnstashHint(boolean animateForward) {
- // TODO(b/270395798): Clean up forceUnstash after removing long-press unstashing code.
- startTaskbarUnstashHint(animateForward, /* forceUnstash = */ false);
- }
-
- /**
- * Called when we detect a motion down or up/cancel in the nav region while stashed.
- *
- * @param animateForward Whether to animate towards the unstashed hint state or back to stashed.
- * @param forceUnstash Whether we force the unstash hint.
- */
- public void startTaskbarUnstashHint(boolean animateForward, boolean forceUnstash) {
- // TODO(b/270395798): Clean up forceUnstash after removing long-press unstashing code.
- mControllers.taskbarStashController.startUnstashHint(animateForward, forceUnstash);
+ mControllers.taskbarStashController.startUnstashHint(animateForward);
}
/**
@@ -1143,9 +1123,4 @@
public int getTaskbarAllAppsScroll() {
return mControllers.taskbarAllAppsController.getTaskbarAllAppsScroll();
}
-
- @VisibleForTesting
- public float getStashedTaskbarScale() {
- return mControllers.stashedHandleViewController.getStashedHandleHintScale().value;
- }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index 5de5904..b2f9378 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -856,18 +856,15 @@
/**
* Creates and starts a partial unstash animation, hinting at the new state that will trigger
* when long press is detected.
- *
* @param animateForward Whether we are going towards the new unstashed state or returning to
* the stashed state.
- * @param forceUnstash Whether we force the unstash hint to animate.
*/
- protected void startUnstashHint(boolean animateForward, boolean forceUnstash) {
+ public void startUnstashHint(boolean animateForward) {
if (!isStashed()) {
// Already unstashed, no need to hint in that direction.
return;
}
- // TODO(b/270395798): Clean up after removing long-press unstashing code path.
- if (!canCurrentlyManuallyUnstash() && !forceUnstash) {
+ if (!canCurrentlyManuallyUnstash()) {
// If any other flags are causing us to be stashed, long press won't cause us to
// unstash, so don't hint that it will.
return;
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashViaTouchController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashViaTouchController.kt
index 1cc6672..2373142 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashViaTouchController.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashViaTouchController.kt
@@ -25,7 +25,7 @@
import com.android.launcher3.touch.SingleAxisSwipeDetector.VERTICAL
import com.android.launcher3.util.DisplayController
import com.android.launcher3.util.TouchController
-import com.android.quickstep.inputconsumers.TaskbarUnstashInputConsumer
+import com.android.quickstep.inputconsumers.TaskbarStashInputConsumer
/**
* A helper [TouchController] for [TaskbarDragLayerController], specifically to handle touch events
@@ -34,7 +34,7 @@
* or [MotionEvent.ACTION_OUTSIDE].
* - Touches inside Transient Taskbar bounds will stash if it is detected as a swipe down gesture.
*
- * Note: touches to *unstash* Taskbar are handled by [TaskbarUnstashInputConsumer].
+ * Note: touches to *unstash* Taskbar are handled by [TaskbarStashInputConsumer].
*/
class TaskbarStashViaTouchController(val controllers: TaskbarControllers) : TouchController {
diff --git a/quickstep/src/com/android/quickstep/InputConsumer.java b/quickstep/src/com/android/quickstep/InputConsumer.java
index 6b189cf..64c9295 100644
--- a/quickstep/src/com/android/quickstep/InputConsumer.java
+++ b/quickstep/src/com/android/quickstep/InputConsumer.java
@@ -41,7 +41,6 @@
int TYPE_ONE_HANDED = 1 << 11;
int TYPE_TASKBAR_STASH = 1 << 12;
int TYPE_STATUS_BAR = 1 << 13;
- int TYPE_CURSOR_HOVER = 1 << 14;
String[] NAMES = new String[] {
"TYPE_NO_OP", // 0
@@ -58,7 +57,6 @@
"TYPE_ONE_HANDED", // 11
"TYPE_TASKBAR_STASH", // 12
"TYPE_STATUS_BAR", // 13
- "TYPE_CURSOR_HOVER", // 14
};
InputConsumer NO_OP = () -> TYPE_NO_OP;
diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
index 8247035..4e892e2 100644
--- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
+++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
@@ -116,16 +116,6 @@
return response;
}
- case TestProtocol.REQUEST_STASHED_TASKBAR_SCALE: {
- runOnTISBinder(tisBinder -> {
- response.putFloat(TestProtocol.TEST_INFO_RESPONSE_FIELD,
- tisBinder.getTaskbarManager()
- .getCurrentActivityContext()
- .getStashedTaskbarScale());
- });
- return response;
- }
-
case TestProtocol.REQUEST_TASKBAR_ALL_APPS_TOP_PADDING: {
return getTISBinderUIProperty(Bundle::putInt, tisBinder ->
tisBinder.getTaskbarManager()
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index 8246d26..038c674 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -29,7 +29,6 @@
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.quickstep.GestureState.DEFAULT_STATE;
import static com.android.quickstep.GestureState.TrackpadGestureType.getTrackpadGestureType;
-import static com.android.quickstep.InputConsumer.TYPE_CURSOR_HOVER;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.FLAG_USING_OTHER_ACTIVITY_INPUT_CONSUMER;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_DOWN;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_MOVE;
@@ -110,7 +109,7 @@
import com.android.quickstep.inputconsumers.ScreenPinnedInputConsumer;
import com.android.quickstep.inputconsumers.StatusBarInputConsumer;
import com.android.quickstep.inputconsumers.SysUiOverlayInputConsumer;
-import com.android.quickstep.inputconsumers.TaskbarUnstashInputConsumer;
+import com.android.quickstep.inputconsumers.TaskbarStashInputConsumer;
import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.util.ActiveGestureLog.CompoundString;
import com.android.quickstep.util.ProtoTracer;
@@ -638,17 +637,12 @@
TraceHelper.FLAG_ALLOW_BINDER_TRACKING);
final int action = event.getActionMasked();
- // Note this will create a new consumer every mouse click, as after ACTION_UP from the click
- // an ACTION_HOVER_ENTER will fire as well.
- boolean isHoverActionWithoutConsumer =
- event.isHoverEvent() && (mUncheckedConsumer.getType() & TYPE_CURSOR_HOVER) == 0;
- if (action == ACTION_DOWN || isHoverActionWithoutConsumer) {
+ if (action == ACTION_DOWN) {
mRotationTouchHelper.setOrientationTransformIfNeeded(event);
- if ((!mDeviceState.isOneHandedModeActive()
+ if (!mDeviceState.isOneHandedModeActive()
&& mRotationTouchHelper.isInSwipeUpTouchRegion(event,
- mOverviewComponentObserver.getActivityInterface()))
- || isHoverActionWithoutConsumer) {
+ mOverviewComponentObserver.getActivityInterface())) {
// Clone the previous gesture state since onConsumerAboutToBeSwitched might trigger
// onConsumerInactive and wipe the previous gesture state
GestureState prevGestureState = new GestureState(mGestureState);
@@ -725,8 +719,6 @@
if (action == ACTION_POINTER_DOWN) {
mGestureState.setTrackpadGestureType(getTrackpadGestureType(event));
}
- } else if (event.isHoverEvent()) {
- mUncheckedConsumer.onHoverEvent(event);
} else {
mUncheckedConsumer.onMotionEvent(event);
}
@@ -850,7 +842,7 @@
base = tryCreateAssistantInputConsumer(base, newGestureState, event, reasonString);
}
- // If Taskbar is present, we listen for long press or cursor hover events to unstash it.
+ // If Taskbar is present, we listen for long press to unstash it.
TaskbarActivityContext tac = mTaskbarManager.getCurrentActivityContext();
if (tac != null) {
// Present always on large screen or on small screen w/ flag
@@ -861,8 +853,8 @@
.append(reasonPrefix)
.append(SUBSTRING_PREFIX)
.append("TaskbarActivityContext != null, "
- + "using TaskbarUnstashInputConsumer");
- base = new TaskbarUnstashInputConsumer(this, base, mInputMonitorCompat, tac);
+ + "using TaskbarStashInputConsumer");
+ base = new TaskbarStashInputConsumer(this, base, mInputMonitorCompat, tac);
}
}
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/TaskbarStashInputConsumer.java
similarity index 69%
rename from quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java
rename to quickstep/src/com/android/quickstep/inputconsumers/TaskbarStashInputConsumer.java
index 65c825c..51c2b48 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/TaskbarStashInputConsumer.java
@@ -19,20 +19,17 @@
import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent;
import static com.android.launcher3.Utilities.squaredHypot;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_CURSOR_HOVER_STATES;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_TOUCHING;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.PointF;
-import android.graphics.Rect;
import android.view.GestureDetector;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
import androidx.annotation.Nullable;
-import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.taskbar.TaskbarActivityContext;
@@ -43,11 +40,9 @@
import com.android.systemui.shared.system.InputMonitorCompat;
/**
- * Listens for touch and hover events to unstash the Taskbar.
- *
- * <p>Cancels the current gesture if the long press causes the Taskbar to be unstashed.
+ * Listens for a long press, and cancels the current gesture if that causes Taskbar to be unstashed.
*/
-public class TaskbarUnstashInputConsumer extends DelegateInputConsumer {
+public class TaskbarStashInputConsumer extends DelegateInputConsumer {
private final TaskbarActivityContext mTaskbarActivityContext;
private final GestureDetector mLongPressDetector;
@@ -69,15 +64,9 @@
private final boolean mIsTransientTaskbar;
- private boolean mIsStashedTaskbarHovered = false;
- private final Rect mStashedTaskbarHandleBounds = new Rect();
- private final Rect mBottomEdgeBounds = new Rect();
- private final int mBottomScreenEdge;
- private final int mStashedTaskbarBottomEdge;
-
private final @Nullable TransitionCallback mTransitionCallback;
- public TaskbarUnstashInputConsumer(Context context, InputConsumer delegate,
+ public TaskbarStashInputConsumer(Context context, InputConsumer delegate,
InputMonitorCompat inputMonitor, TaskbarActivityContext taskbarActivityContext) {
super(delegate, inputMonitor);
mTaskbarActivityContext = taskbarActivityContext;
@@ -101,11 +90,6 @@
}
});
- mBottomScreenEdge = res.getDimensionPixelSize(
- R.dimen.taskbar_stashed_screen_edge_hover_deadzone_height);
- mStashedTaskbarBottomEdge =
- res.getDimensionPixelSize(R.dimen.taskbar_stashed_below_hover_deadzone_height);
-
mTransitionCallback = mIsTransientTaskbar
? taskbarActivityContext.getTranslationCallbacks()
: null;
@@ -113,7 +97,7 @@
@Override
public int getType() {
- return TYPE_TASKBAR_STASH | TYPE_CURSOR_HOVER | mDelegate.getType();
+ return TYPE_TASKBAR_STASH | mDelegate.getType();
}
@Override
@@ -229,73 +213,4 @@
}
}
}
-
- /**
- * Listen for hover events for the stashed taskbar.
- *
- * <p>When hovered over the stashed taskbar handle, show the unstash hint.
- * <p>When the cursor is touching the bottom edge below the stashed taskbar, unstash it.
- * <p>When the cursor is within a defined threshold of the screen's bottom edge outside of
- * the stashed taskbar, unstash it.
- */
- @Override
- public void onHoverEvent(MotionEvent ev) {
- if (!ENABLE_CURSOR_HOVER_STATES.get() || mTaskbarActivityContext == null
- || !mTaskbarActivityContext.isTaskbarStashed()) {
- return;
- }
-
- if (mIsStashedTaskbarHovered) {
- updateHoveredTaskbarState((int) ev.getX(), (int) ev.getY());
- } else {
- updateUnhoveredTaskbarState((int) ev.getX(), (int) ev.getY());
- }
- }
-
- private void updateHoveredTaskbarState(int x, int y) {
- DeviceProfile dp = mTaskbarActivityContext.getDeviceProfile();
- mStashedTaskbarHandleBounds.set(
- (dp.widthPx - (int) mUnstashArea) / 2,
- dp.heightPx - dp.stashedTaskbarHeight,
- (int) (((dp.widthPx - mUnstashArea) / 2) + mUnstashArea),
- dp.heightPx);
- mBottomEdgeBounds.set(mStashedTaskbarHandleBounds);
- mBottomEdgeBounds.top = dp.heightPx - mStashedTaskbarBottomEdge;
-
- if (mBottomEdgeBounds.contains(x, y)) {
- // If hovering stashed taskbar and then hover screen bottom edge, unstash it.
- mTaskbarActivityContext.onSwipeToUnstashTaskbar();
- mIsStashedTaskbarHovered = false;
- } else if (!mStashedTaskbarHandleBounds.contains(x, y)) {
- // If exit hovering stashed taskbar, remove hint.
- startStashedTaskbarHover(/* isHovered = */ false);
- }
- }
-
- private void updateUnhoveredTaskbarState(int x, int y) {
- DeviceProfile dp = mTaskbarActivityContext.getDeviceProfile();
- mStashedTaskbarHandleBounds.set(
- (dp.widthPx - (int) mUnstashArea) / 2,
- dp.heightPx - dp.stashedTaskbarHeight,
- (int) (((dp.widthPx - mUnstashArea) / 2) + mUnstashArea),
- dp.heightPx);
- mBottomEdgeBounds.set(
- 0,
- dp.heightPx - mBottomScreenEdge,
- dp.widthPx,
- dp.heightPx);
-
- if (mStashedTaskbarHandleBounds.contains(x, y)) {
- // If enter hovering stashed taskbar, start hint.
- startStashedTaskbarHover(/* isHovered = */ true);
- } else if (mBottomEdgeBounds.contains(x, y)) {
- // If hover screen's bottom edge not below the stashed taskbar, unstash it.
- mTaskbarActivityContext.onSwipeToUnstashTaskbar();
- }
- }
-
- private void startStashedTaskbarHover(boolean isHovered) {
- mTaskbarActivityContext.startTaskbarUnstashHint(isHovered, /* forceUnstash = */ true);
- mIsStashedTaskbarHovered = isHovered;
- }
}
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java b/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java
index 39fe6b5..4540eee 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java
@@ -17,7 +17,6 @@
import static androidx.test.InstrumentationRegistry.getInstrumentation;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_CURSOR_HOVER_STATES;
import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT;
import static com.android.quickstep.TaskbarModeSwitchRule.Mode.TRANSIENT;
@@ -270,39 +269,6 @@
.dragToSplitscreen(TEST_APP_PACKAGE, CALCULATOR_APP_PACKAGE);
}
- @Test
- @TaskbarModeSwitch(mode = TRANSIENT)
- public void testShowTaskbarUnstashHintOnHover() {
- try (AutoCloseable flag = TestUtil.overrideFlag(ENABLE_CURSOR_HOVER_STATES, true)) {
- getTaskbar().getAppIcon(TEST_APP_NAME).launch(TEST_APP_PACKAGE);
- mLauncher.getLaunchedAppState().hoverToShowTaskbarUnstashHint();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- @Test
- @TaskbarModeSwitch(mode = TRANSIENT)
- public void testUnstashTaskbarOnScreenBottomEdgeHover() {
- try (AutoCloseable flag = TestUtil.overrideFlag(ENABLE_CURSOR_HOVER_STATES, true)) {
- getTaskbar().getAppIcon(TEST_APP_NAME).launch(TEST_APP_PACKAGE);
- mLauncher.getLaunchedAppState().hoverScreenBottomEdgeToUnstashTaskbar();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- @Test
- @TaskbarModeSwitch(mode = TRANSIENT)
- public void testHoverBelowHintedTaskbarToUnstash() {
- try (AutoCloseable flag = TestUtil.overrideFlag(ENABLE_CURSOR_HOVER_STATES, true)) {
- getTaskbar().getAppIcon(TEST_APP_NAME).launch(TEST_APP_PACKAGE);
- mLauncher.getLaunchedAppState().hoverBelowHintedTaskbarToUnstash();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
private Taskbar getTaskbar() {
Taskbar taskbar = mLauncher.getLaunchedAppState().getTaskbar();
List<String> taskbarIconNames = taskbar.getIconNames();
diff --git a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
index 2c3ea34..36255b4 100644
--- a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
+++ b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
@@ -90,7 +90,6 @@
public static final String REQUEST_DISABLE_TRANSIENT_TASKBAR = "disable-transient-taskbar";
public static final String REQUEST_UNSTASH_TASKBAR_IF_STASHED = "unstash-taskbar-if-stashed";
public static final String REQUEST_STASHED_TASKBAR_HEIGHT = "stashed-taskbar-height";
- public static final String REQUEST_STASHED_TASKBAR_SCALE = "taskbar-stash-handle-scale";
public static final String REQUEST_RECREATE_TASKBAR = "recreate-taskbar";
public static final String REQUEST_APP_LIST_FREEZE_FLAGS = "app-list-freeze-flags";
public static final String REQUEST_APPS_LIST_SCROLL_Y = "apps-list-scroll-y";
diff --git a/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java b/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
index d1a2704..4a3507e 100644
--- a/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
+++ b/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
@@ -22,17 +22,13 @@
import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_ENABLE_BLOCK_TIMEOUT;
import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING;
import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_STASHED_TASKBAR_HEIGHT;
-import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_STASHED_TASKBAR_SCALE;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.SystemClock;
import android.view.MotionEvent;
-import android.view.ViewConfiguration;
import androidx.test.uiautomator.By;
-import androidx.test.uiautomator.Condition;
-import androidx.test.uiautomator.UiDevice;
import com.android.launcher3.testing.shared.TestProtocol;
@@ -44,18 +40,6 @@
// More drag steps than Launchables to give the window manager time to register the drag.
private static final int DEFAULT_DRAG_STEPS = 35;
- // UNSTASHED_TASKBAR_HANDLE_HINT_SCALE value from TaskbarStashController.
- private static final float UNSTASHED_TASKBAR_HANDLE_HINT_SCALE = 1.1f;
-
- private final Condition<UiDevice, Boolean> mStashedTaskbarHintScaleCondition =
- device -> mLauncher.getTestInfo(REQUEST_STASHED_TASKBAR_SCALE).getFloat(
- TestProtocol.TEST_INFO_RESPONSE_FIELD) - UNSTASHED_TASKBAR_HANDLE_HINT_SCALE
- < 0.00001f;
-
- private final Condition<UiDevice, Boolean> mStashedTaskbarDefaultScaleCondition =
- device -> mLauncher.getTestInfo(REQUEST_STASHED_TASKBAR_SCALE).getFloat(
- TestProtocol.TEST_INFO_RESPONSE_FIELD) - 1f < 0.00001f;
-
LaunchedAppState(LauncherInstrumentation launcher) {
super(launcher);
}
@@ -194,86 +178,4 @@
}
}
}
-
- /**
- * Emulate the cursor hovering the screen edge to unstash the taskbar.
- *
- * <p>This unstashing occurs when not actively hovering the taskbar.
- */
- public void hoverScreenBottomEdgeToUnstashTaskbar() {
- try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
- LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
- "cursor hover entering screen edge to unstash taskbar")) {
- mLauncher.getDevice().wait(mStashedTaskbarDefaultScaleCondition,
- ViewConfiguration.DEFAULT_LONG_PRESS_TIMEOUT);
-
- long downTime = SystemClock.uptimeMillis();
- int leftEdge = 10;
- Point taskbarUnstashArea = new Point(leftEdge, mLauncher.getRealDisplaySize().y - 1);
- mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_HOVER_ENTER,
- new Point(taskbarUnstashArea.x, taskbarUnstashArea.y), null);
-
- mLauncher.waitForSystemLauncherObject(TASKBAR_RES_ID);
- }
- }
-
- /**
- * Emulate the cursor hovering the taskbar to get unstash hint, then hovering below to unstash.
- */
- public void hoverBelowHintedTaskbarToUnstash() {
- try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
- LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
- "cursor hover entering stashed taskbar")) {
- long downTime = SystemClock.uptimeMillis();
- Point stashedTaskbarHintArea = new Point(mLauncher.getRealDisplaySize().x / 2,
- mLauncher.getRealDisplaySize().y - 1);
- mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_HOVER_ENTER,
- new Point(stashedTaskbarHintArea.x, stashedTaskbarHintArea.y), null);
-
- mLauncher.getDevice().wait(mStashedTaskbarHintScaleCondition,
- LauncherInstrumentation.WAIT_TIME_MS);
-
- try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
- "cursor hover enter below taskbar to unstash")) {
- downTime = SystemClock.uptimeMillis();
- Point taskbarUnstashArea = new Point(mLauncher.getRealDisplaySize().x / 2,
- mLauncher.getRealDisplaySize().y - 1);
- mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_HOVER_EXIT,
- new Point(taskbarUnstashArea.x, taskbarUnstashArea.y), null);
-
- mLauncher.waitForSystemLauncherObject(TASKBAR_RES_ID);
- }
- }
- }
-
- /**
- * Emulate the cursor entering and exiting a hover over the taskbar.
- */
- public void hoverToShowTaskbarUnstashHint() {
- try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
- LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
- "cursor hover entering stashed taskbar")) {
- long downTime = SystemClock.uptimeMillis();
- Point stashedTaskbarHintArea = new Point(mLauncher.getRealDisplaySize().x / 2,
- mLauncher.getRealDisplaySize().y - 1);
- mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_HOVER_ENTER,
- new Point(stashedTaskbarHintArea.x, stashedTaskbarHintArea.y), null);
-
- mLauncher.getDevice().wait(mStashedTaskbarHintScaleCondition,
- LauncherInstrumentation.WAIT_TIME_MS);
-
- try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
- "cursor hover exiting stashed taskbar")) {
- Point outsideStashedTaskbarHintArea = new Point(
- mLauncher.getRealDisplaySize().x / 2,
- mLauncher.getRealDisplaySize().y - 500);
- mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_HOVER_EXIT,
- new Point(outsideStashedTaskbarHintArea.x, outsideStashedTaskbarHintArea.y),
- null);
-
- mLauncher.getDevice().wait(mStashedTaskbarDefaultScaleCondition,
- LauncherInstrumentation.WAIT_TIME_MS);
- }
- }
- }
}
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 80fded5..c4f8269 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -107,8 +107,6 @@
static final Pattern EVENT_TOUCH_DOWN_TIS = getTouchEventPatternTIS("ACTION_DOWN");
static final Pattern EVENT_TOUCH_UP_TIS = getTouchEventPatternTIS("ACTION_UP");
static final Pattern EVENT_TOUCH_CANCEL_TIS = getTouchEventPatternTIS("ACTION_CANCEL");
- static final Pattern EVENT_HOVER_ENTER_TIS = getTouchEventPatternTIS("ACTION_HOVER_ENTER");
- static final Pattern EVENT_HOVER_EXIT_TIS = getTouchEventPatternTIS("ACTION_HOVER_EXIT");
private static final Pattern EVENT_KEY_BACK_DOWN =
getKeyEventPattern("ACTION_DOWN", "KEYCODE_BACK");
@@ -142,9 +140,7 @@
* Represents a point in the code at which a callback can run.
*/
public enum CALLBACK_RUN_POINT {
- CALLBACK_HOLD_BEFORE_DROP,
- CALLBACK_HOVER_ENTER,
- CALLBACK_HOVER_EXIT,
+ CALLBACK_HOLD_BEFORE_DROP
}
private Consumer<CALLBACK_RUN_POINT> mCallbackAtRunPoint = null;
@@ -1686,12 +1682,6 @@
? EVENT_TOUCH_CANCEL_TIS : EVENT_TOUCH_UP_TIS);
}
break;
- case MotionEvent.ACTION_HOVER_ENTER:
- expectEvent(TestProtocol.SEQUENCE_TIS, EVENT_HOVER_ENTER_TIS);
- break;
- case MotionEvent.ACTION_HOVER_EXIT:
- expectEvent(TestProtocol.SEQUENCE_TIS, EVENT_HOVER_EXIT_TIS);
- break;
}
final MotionEvent event = getMotionEvent(downTime, currentTime, action, point.x, point.y);