From 0cde81a5d2b9c603df29bdf6eb3bbce2c11997bf Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Mon, 14 Mar 2022 14:44:47 -0700 Subject: [PATCH] Fix failing test TaplTaskbarTest#testHideShowTaskbar Closing the Taskbar all apps page doesn't automatically close any open popup menus. This lead to the popup menu opened in TaplTaskbarTests#testOpenMenu_FromTaskbarAllApps remaining open after going home in setUp (before running TaplTaskbarTest#testHideShowTaskbar). The the workspace is not visible to the tests while the popup menu is open, so this test would consistenly fail. Bug: 215218813 Fixes: 224597087 Test: Ran tests locally and remotely Change-Id: I81d8eb1e99a264611749eb3c508f707988c0fcb1 --- .../taskbar/allapps/TaskbarAllAppsViewController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsViewController.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsViewController.java index 459742290a..32ebbe822e 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsViewController.java @@ -20,6 +20,7 @@ import static com.android.launcher3.taskbar.allapps.TaskbarAllAppsSlideInView.DE import static com.android.launcher3.taskbar.allapps.TaskbarAllAppsSlideInView.DEFAULT_OPEN_DURATION; import static com.android.launcher3.util.OnboardingPrefs.ALL_APPS_VISITED_COUNT; +import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.appprediction.AppsDividerView; import com.android.launcher3.appprediction.PredictionRowView; import com.android.launcher3.taskbar.TaskbarStashController; @@ -83,6 +84,8 @@ final class TaskbarAllAppsViewController { mTaskbarStashController.updateStateForFlag(FLAG_STASHED_IN_APP_ALL_APPS, true); mTaskbarStashController.applyState(DEFAULT_OPEN_DURATION); mSlideInView.setOnCloseBeginListener(() -> { + AbstractFloatingView.closeOpenContainer( + mContext, AbstractFloatingView.TYPE_ACTION_POPUP); mTaskbarStashController.updateStateForFlag( FLAG_STASHED_IN_APP_ALL_APPS, false); mTaskbarStashController.applyState(DEFAULT_CLOSE_DURATION);