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

Commit e7d9e9f6 authored by Saumya Prakash's avatar Saumya Prakash
Browse files

Show Taskbar education when launching an app pair.

This change ensures that the Taskbar education shows up when a saved app
pair is launched and the education had not been seen before. This
matches the expected behavior as well as transient taskbar's behavior.

Fix: 323298512
Test: Create an app pair, reset taskbar education and launch the app
pair from home. Repeat for 3 button nav and pinned taskbar.
Flag: EXEMPT bugfix

Change-Id: I5ca68424f846f25beb1390c2dc50dfac3ba8e8d9
parent fb7028c0
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1403,8 +1403,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.