Allow visual stashing when going to overview in tests
- Seprate out supportsStashing() into supportsVisualStashing() and supportsManualStashing().
- Manual stashing is when user explicitly long presses to stash, which we disable for tests.
Test: testStressSwipeToOverview
Fixes: 200273854
Change-Id: Ib07efa31a1b073de45fdcfac26215129b1b1985b
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index a9ff03b..02170ab 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -107,7 +107,7 @@
// Evaluate whether the handle should be stashed
private final StatePropertyHolder mStatePropertyHolder = new StatePropertyHolder(
flags -> {
- if (!supportsStashing()) {
+ if (!supportsVisualStashing()) {
return false;
}
boolean inApp = (flags & FLAG_IN_APP) != 0;
@@ -141,7 +141,7 @@
mTaskbarStashedHandleAlpha = stashedHandleController.getStashedHandleAlpha();
mTaskbarStashedHandleHintScale = stashedHandleController.getStashedHandleHintScale();
- mIsStashedInApp = supportsStashing()
+ mIsStashedInApp = supportsManualStashing()
&& mPrefs.getBoolean(SHARED_PREFS_STASHED_KEY, DEFAULT_STASHED_PREF);
updateStateForFlag(FLAG_STASHED_IN_APP, mIsStashedInApp);
@@ -150,10 +150,18 @@
}
/**
+ * Returns whether the taskbar can visually stash into a handle based on the current device
+ * state.
+ */
+ private boolean supportsVisualStashing() {
+ return !mActivity.isThreeButtonNav();
+ }
+
+ /**
* Returns whether the user can manually stash the taskbar based on the current device state.
*/
- private boolean supportsStashing() {
- return !mActivity.isThreeButtonNav()
+ private boolean supportsManualStashing() {
+ return supportsVisualStashing()
&& (!Utilities.IS_RUNNING_IN_TEST_HARNESS || supportsStashingForTests());
}
@@ -206,7 +214,7 @@
* @return Whether we started an animation to either be newly stashed or unstashed.
*/
public boolean updateAndAnimateIsStashedInApp(boolean isStashedInApp) {
- if (!supportsStashing()) {
+ if (!supportsManualStashing()) {
return false;
}
if (mIsStashedInApp != isStashedInApp) {
@@ -307,7 +315,7 @@
* unstashed state.
*/
public void startStashHint(boolean animateForward) {
- if (isStashed() || !supportsStashing()) {
+ if (isStashed() || !supportsManualStashing()) {
// Already stashed, no need to hint in that direction.
return;
}