Add the KeyboardQuickSwitchView (2/2)

Adding KeyboardQuickSwitchView and associated flows.

Test: Manually tested alt-tab and alt-shift-tab in and out of overview on a tablet and phone
Bug: 258854035
Change-Id: Ifb48b005067b3a9c66acfd5ecdbae144b359d3be
This commit is contained in:
Schneider Victor-tulias
2023-01-24 15:27:00 -08:00
parent a9e67196e6
commit de7ceba80b
22 changed files with 1464 additions and 8 deletions

View File

@@ -31,7 +31,10 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.taskbar.TaskbarUIController;
import com.android.launcher3.util.RunnableList;
import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener;
import com.android.quickstep.views.RecentsView;
@@ -174,8 +177,25 @@ public class OverviewCommandHelper {
mOverviewComponentObserver.getActivityInterface();
RecentsView recents = activityInterface.getVisibleRecentsView();
if (recents == null) {
T activity = activityInterface.getCreatedActivity();
DeviceProfile dp = activity == null ? null : activity.getDeviceProfile();
TaskbarUIController uiController = activityInterface.getTaskbarController();
boolean allowQuickSwitch = FeatureFlags.ENABLE_KEYBOARD_QUICK_SWITCH.get()
&& uiController != null
&& dp != null
&& (dp.isTablet || dp.isTwoPanels);
if (cmd.type == TYPE_HIDE) {
// already hidden
if (!allowQuickSwitch) {
return true;
}
mTaskFocusIndexOverride = uiController.launchFocusedTask();
if (mTaskFocusIndexOverride == -1) {
return true;
}
}
if (cmd.type == TYPE_KEYBOARD_INPUT && allowQuickSwitch) {
uiController.openQuickSwitchView();
return true;
}
if (cmd.type == TYPE_HOME) {