Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0397781 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Show Taskbar education when launching an app pair." into main

parents 50051adc e7d9e9f6
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1409,8 +1409,14 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
     * Launches two apps as an app pair.
     */
    public void launchAppPair(AppPairIcon appPairIcon) {
        // Potentially show the Taskbar education once the app pair launch finishes
        mSplitSelectStateController.getAppPairsController().launchAppPair(appPairIcon,
                CUJ_LAUNCHER_LAUNCH_APP_PAIR_FROM_WORKSPACE);
                CUJ_LAUNCHER_LAUNCH_APP_PAIR_FROM_WORKSPACE,
                (success) -> {
                    if (success && mTaskbarUIController != null) {
                        mTaskbarUIController.showEduOnAppLaunch();
                    }
                });
    }

    public boolean canStartHomeSafely() {
+13 −2
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ import com.android.wm.shell.common.split.SplitScreenConstants.PersistentSnapPosi

import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;

/**
 * Controller class that handles app pair interactions: saving, modifying, deleting, etc.
@@ -232,8 +233,11 @@ public class AppPairsController {
     *
     * @param cuj Should be an integer from {@link Cuj} or -1 if no CUJ needs to be logged for jank
     *            monitoring
     * @param callback Called after the app pair launch finishes animating, or null if no method is
     *                 to be called
     */
    public void launchAppPair(AppPairIcon appPairIcon, int cuj) {
    public void launchAppPair(AppPairIcon appPairIcon, int cuj,
            @Nullable Consumer<Boolean> callback) {
        WorkspaceItemInfo app1 = appPairIcon.getInfo().getFirstApp();
        WorkspaceItemInfo app2 = appPairIcon.getInfo().getSecondApp();
        ComponentKey app1Key = new ComponentKey(app1.getTargetComponent(), app1.user);
@@ -273,11 +277,18 @@ public class AppPairsController {
                    mSplitSelectStateController.setLaunchingIconView(appPairIcon);

                    mSplitSelectStateController.launchSplitTasks(
                            AppPairsController.convertRankToSnapPosition(app1.rank));
                            AppPairsController.convertRankToSnapPosition(app1.rank), callback);
                }
        );
    }

    /**
     * Launches an app pair but does not specify a callback
     */
    public void launchAppPair(AppPairIcon appPairIcon, int cuj) {
        launchAppPair(appPairIcon, cuj, null);
    }

    /**
     * Returns an AppInfo associated with the app for the given ComponentKey, or null if no such
     * package exists in the AllAppsStore.