Loading quickstep/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ filegroup { name: "launcher3-quickstep-oop-tests-src", path: "tests", srcs: [ "tests/src/com/android/quickstep/TaskbarModeSwitchRule.java", "tests/src/com/android/quickstep/NavigationModeSwitchRule.java", "tests/src/com/android/quickstep/AbstractQuickStepTest.java", "tests/src/com/android/quickstep/TaplTestsQuickstep.java", Loading quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +17 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL; import static com.android.launcher3.AbstractFloatingView.TYPE_ALL; import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE; import static com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_FULLSCREEN; Loading Loading @@ -304,7 +305,8 @@ public class TaskbarActivityContext extends BaseTaskbarContext { int windowFlags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_SLIPPERY | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH; if (DisplayController.isTransientTaskbar(this)) { if (DisplayController.isTransientTaskbar(this) && !IS_RUNNING_IN_TEST_HARNESS) { windowFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH; } Loading Loading @@ -857,14 +859,27 @@ public class TaskbarActivityContext extends BaseTaskbarContext { mControllers.taskbarStashController.enableManualStashingDuringTests(enableManualStashing); } /** * Enables the auto timeout for taskbar stashing. This method should only be used for taskbar * testing. */ @VisibleForTesting public void enableBlockingTimeoutDuringTests(boolean enableBlockingTimeout) { mControllers.taskbarStashController.enableBlockingTimeoutDuringTests(enableBlockingTimeout); } /** * Unstashes the Taskbar if it is stashed. This method should only be used to unstash the * taskbar at the end of a test. */ @VisibleForTesting public void unstashTaskbarIfStashed() { if (DisplayController.isTransientTaskbar(this)) { mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(false); } else { mControllers.taskbarStashController.onLongPressToUnstashTaskbar(); } } protected boolean isUserSetupComplete() { return mIsUserSetupComplete; Loading quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +16 −4 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.view.View; import android.view.ViewConfiguration; import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; import com.android.internal.jank.InteractionJankMonitor; import com.android.launcher3.Alarm; Loading Loading @@ -169,6 +170,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba private boolean mEnableManualStashingDuringTests = false; private final Alarm mTimeoutAlarm = new Alarm(); private boolean mEnableBlockingTimeoutDuringTests = false; // Evaluate whether the handle should be stashed private final StatePropertyHolder mStatePropertyHolder = new StatePropertyHolder( Loading Loading @@ -267,10 +269,20 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba * Enables support for manual stashing. This should only be used to add this functionality * to Launcher specific tests. */ @VisibleForTesting public void enableManualStashingDuringTests(boolean enableManualStashing) { mEnableManualStashingDuringTests = enableManualStashing; } /** * Enables the auto timeout for taskbar stashing. This method should only be used for taskbar * testing. */ @VisibleForTesting public void enableBlockingTimeoutDuringTests(boolean enableBlockingTimeout) { mEnableBlockingTimeoutDuringTests = enableBlockingTimeout; } /** * Sets the flag indicating setup UI is visible */ Loading Loading @@ -846,12 +858,12 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba * Attempts to start timer to auto hide the taskbar based on time. */ public void tryStartTaskbarTimeout() { if (!DisplayController.isTransientTaskbar(mActivity)) { return; } if (mIsStashed) { if (!DisplayController.isTransientTaskbar(mActivity) || mIsStashed || mEnableBlockingTimeoutDuringTests) { return; } cancelTimeoutIfExists(); mTimeoutAlarm.setOnAlarmListener(this::onTaskbarTimeout); Loading quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java +19 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,18 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { .getCurrentActivityContext() .getTaskbarAllAppsTopPadding()); } case TestProtocol.REQUEST_ENABLE_BLOCK_TIMEOUT: runOnTISBinder(tisBinder -> { enableBlockingTimeout(tisBinder, true); }); return response; case TestProtocol.REQUEST_DISABLE_BLOCK_TIMEOUT: runOnTISBinder(tisBinder -> { enableBlockingTimeout(tisBinder, false); }); return response; } return super.call(method, arg, extras); Loading Loading @@ -149,6 +161,13 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { enable); } private void enableBlockingTimeout( TouchInteractionService.TISBinder tisBinder, boolean enable) { // Allow null-pointer to catch illegal states. tisBinder.getTaskbarManager().getCurrentActivityContext().enableBlockingTimeoutDuringTests( enable); } /** * Runs the given command on the UI thread, after ensuring we are connected to * TouchInteractionService. Loading quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ public abstract class AbstractQuickStepTest extends AbstractLauncherUiTest { protected TestRule getRulesInsideActivityMonitor() { return RuleChain. outerRule(new NavigationModeSwitchRule(mLauncher)). around(new TaskbarModeSwitchRule(mLauncher)). around(super.getRulesInsideActivityMonitor()); } Loading Loading
quickstep/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ filegroup { name: "launcher3-quickstep-oop-tests-src", path: "tests", srcs: [ "tests/src/com/android/quickstep/TaskbarModeSwitchRule.java", "tests/src/com/android/quickstep/NavigationModeSwitchRule.java", "tests/src/com/android/quickstep/AbstractQuickStepTest.java", "tests/src/com/android/quickstep/TaplTestsQuickstep.java", Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +17 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL; import static com.android.launcher3.AbstractFloatingView.TYPE_ALL; import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE; import static com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_FULLSCREEN; Loading Loading @@ -304,7 +305,8 @@ public class TaskbarActivityContext extends BaseTaskbarContext { int windowFlags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_SLIPPERY | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH; if (DisplayController.isTransientTaskbar(this)) { if (DisplayController.isTransientTaskbar(this) && !IS_RUNNING_IN_TEST_HARNESS) { windowFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH; } Loading Loading @@ -857,14 +859,27 @@ public class TaskbarActivityContext extends BaseTaskbarContext { mControllers.taskbarStashController.enableManualStashingDuringTests(enableManualStashing); } /** * Enables the auto timeout for taskbar stashing. This method should only be used for taskbar * testing. */ @VisibleForTesting public void enableBlockingTimeoutDuringTests(boolean enableBlockingTimeout) { mControllers.taskbarStashController.enableBlockingTimeoutDuringTests(enableBlockingTimeout); } /** * Unstashes the Taskbar if it is stashed. This method should only be used to unstash the * taskbar at the end of a test. */ @VisibleForTesting public void unstashTaskbarIfStashed() { if (DisplayController.isTransientTaskbar(this)) { mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(false); } else { mControllers.taskbarStashController.onLongPressToUnstashTaskbar(); } } protected boolean isUserSetupComplete() { return mIsUserSetupComplete; Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +16 −4 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.view.View; import android.view.ViewConfiguration; import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; import com.android.internal.jank.InteractionJankMonitor; import com.android.launcher3.Alarm; Loading Loading @@ -169,6 +170,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba private boolean mEnableManualStashingDuringTests = false; private final Alarm mTimeoutAlarm = new Alarm(); private boolean mEnableBlockingTimeoutDuringTests = false; // Evaluate whether the handle should be stashed private final StatePropertyHolder mStatePropertyHolder = new StatePropertyHolder( Loading Loading @@ -267,10 +269,20 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba * Enables support for manual stashing. This should only be used to add this functionality * to Launcher specific tests. */ @VisibleForTesting public void enableManualStashingDuringTests(boolean enableManualStashing) { mEnableManualStashingDuringTests = enableManualStashing; } /** * Enables the auto timeout for taskbar stashing. This method should only be used for taskbar * testing. */ @VisibleForTesting public void enableBlockingTimeoutDuringTests(boolean enableBlockingTimeout) { mEnableBlockingTimeoutDuringTests = enableBlockingTimeout; } /** * Sets the flag indicating setup UI is visible */ Loading Loading @@ -846,12 +858,12 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba * Attempts to start timer to auto hide the taskbar based on time. */ public void tryStartTaskbarTimeout() { if (!DisplayController.isTransientTaskbar(mActivity)) { return; } if (mIsStashed) { if (!DisplayController.isTransientTaskbar(mActivity) || mIsStashed || mEnableBlockingTimeoutDuringTests) { return; } cancelTimeoutIfExists(); mTimeoutAlarm.setOnAlarmListener(this::onTaskbarTimeout); Loading
quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java +19 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,18 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { .getCurrentActivityContext() .getTaskbarAllAppsTopPadding()); } case TestProtocol.REQUEST_ENABLE_BLOCK_TIMEOUT: runOnTISBinder(tisBinder -> { enableBlockingTimeout(tisBinder, true); }); return response; case TestProtocol.REQUEST_DISABLE_BLOCK_TIMEOUT: runOnTISBinder(tisBinder -> { enableBlockingTimeout(tisBinder, false); }); return response; } return super.call(method, arg, extras); Loading Loading @@ -149,6 +161,13 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { enable); } private void enableBlockingTimeout( TouchInteractionService.TISBinder tisBinder, boolean enable) { // Allow null-pointer to catch illegal states. tisBinder.getTaskbarManager().getCurrentActivityContext().enableBlockingTimeoutDuringTests( enable); } /** * Runs the given command on the UI thread, after ensuring we are connected to * TouchInteractionService. Loading
quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ public abstract class AbstractQuickStepTest extends AbstractLauncherUiTest { protected TestRule getRulesInsideActivityMonitor() { return RuleChain. outerRule(new NavigationModeSwitchRule(mLauncher)). around(new TaskbarModeSwitchRule(mLauncher)). around(super.getRulesInsideActivityMonitor()); } Loading