Merge "Add the KeyboardQuickSwitchView (2/2)" into tm-qpr-dev am: 25656568e3 am: 74ffb0ba89

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21087436

Change-Id: Ie6f0b30af20e5905fc10105bbf2fcf8a0db028b0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Schneider Victor-tulias
2023-02-15 06:15:48 +00:00
committed by Automerger Merge Worker
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) {