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

Commit 8852010e authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Create separate fullscreen launch type for shortcuts

Bug: 283045822
Test: Verified via debugger the right API is called,
still have issues on split side
Flag: none

Change-Id: Ic2fcbf4ffe05503b0c2e1fade3e3e990498cf6cf
parent 57eaf86f
Loading
Loading
Loading
Loading
+20 −3
Original line number Original line Diff line number Diff line
@@ -62,7 +62,8 @@ class SplitSelectDataHolder(
    companion object {
    companion object {
        @IntDef(SPLIT_TASK_TASK, SPLIT_TASK_PENDINGINTENT, SPLIT_TASK_SHORTCUT,
        @IntDef(SPLIT_TASK_TASK, SPLIT_TASK_PENDINGINTENT, SPLIT_TASK_SHORTCUT,
                SPLIT_PENDINGINTENT_TASK, SPLIT_PENDINGINTENT_PENDINGINTENT, SPLIT_SHORTCUT_TASK,
                SPLIT_PENDINGINTENT_TASK, SPLIT_PENDINGINTENT_PENDINGINTENT, SPLIT_SHORTCUT_TASK,
                SPLIT_SINGLE_TASK_FULLSCREEN, SPLIT_SINGLE_INTENT_FULLSCREEN)
                SPLIT_SINGLE_TASK_FULLSCREEN, SPLIT_SINGLE_INTENT_FULLSCREEN,
                SPLIT_SINGLE_SHORTCUT_FULLSCREEN)
        @Retention(AnnotationRetention.SOURCE)
        @Retention(AnnotationRetention.SOURCE)
        annotation class SplitLaunchType
        annotation class SplitLaunchType


@@ -76,6 +77,7 @@ class SplitSelectDataHolder(
        // Non-split edge case of launching the initial selected task as a fullscreen task
        // Non-split edge case of launching the initial selected task as a fullscreen task
        const val SPLIT_SINGLE_TASK_FULLSCREEN = 6
        const val SPLIT_SINGLE_TASK_FULLSCREEN = 6
        const val SPLIT_SINGLE_INTENT_FULLSCREEN = 7
        const val SPLIT_SINGLE_INTENT_FULLSCREEN = 7
        const val SPLIT_SINGLE_SHORTCUT_FULLSCREEN = 8
    }
    }




@@ -217,8 +219,7 @@ class SplitSelectDataHolder(
    fun getFullscreenLaunchData() : SplitLaunchData {
    fun getFullscreenLaunchData() : SplitLaunchData {
        // Convert all intents to shortcut infos to see if determine if we launch shortcut or intent
        // Convert all intents to shortcut infos to see if determine if we launch shortcut or intent
        convertIntentsToFinalTypes()
        convertIntentsToFinalTypes()
        val splitLaunchType = if (initialTaskId != INVALID_TASK_ID) SPLIT_SINGLE_TASK_FULLSCREEN
        val splitLaunchType = getFullscreenLaunchType()
        else SPLIT_SINGLE_INTENT_FULLSCREEN


        return generateSplitLaunchData(splitLaunchType)
        return generateSplitLaunchData(splitLaunchType)
    }
    }
@@ -309,6 +310,22 @@ class SplitSelectDataHolder(
        throw IllegalStateException("Unidentified split launch type")
        throw IllegalStateException("Unidentified split launch type")
    }
    }


    @SplitLaunchType
    private fun getFullscreenLaunchType(): Int {
        if (initialTaskId != INVALID_TASK_ID) {
            return SPLIT_SINGLE_TASK_FULLSCREEN
        }

        if (initialShortcut != null) {
            return SPLIT_SINGLE_SHORTCUT_FULLSCREEN
        }

        if (initialIntent != null) {
            return SPLIT_SINGLE_INTENT_FULLSCREEN
        }
        throw IllegalStateException("Unidentified fullscreen launch type")
    }

    data class SplitLaunchData(
    data class SplitLaunchData(
            @SplitLaunchType
            @SplitLaunchType
            val splitLaunchType: Int,
            val splitLaunchType: Int,
+14 −6
Original line number Original line Diff line number Diff line
@@ -28,6 +28,7 @@ import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_PENDINGINTE
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_PENDINGINTENT_TASK;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_PENDINGINTENT_TASK;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_SHORTCUT_TASK;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_SHORTCUT_TASK;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_SINGLE_INTENT_FULLSCREEN;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_SINGLE_INTENT_FULLSCREEN;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_SINGLE_SHORTCUT_FULLSCREEN;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_SINGLE_TASK_FULLSCREEN;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_SINGLE_TASK_FULLSCREEN;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_TASK_PENDINGINTENT;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_TASK_PENDINGINTENT;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_TASK_SHORTCUT;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_TASK_SHORTCUT;
@@ -524,6 +525,7 @@ public class SplitSelectStateController {
        PendingIntent firstPI = launchData.getInitialPendingIntent();
        PendingIntent firstPI = launchData.getInitialPendingIntent();
        int firstUserId = launchData.getInitialUserId();
        int firstUserId = launchData.getInitialUserId();
        int initialStagePosition = launchData.getInitialStagePosition();
        int initialStagePosition = launchData.getInitialStagePosition();
        ShortcutInfo initialShortcut = launchData.getInitialShortcut();
        Bundle optionsBundle = options1.toBundle();
        Bundle optionsBundle = options1.toBundle();


        final RemoteSplitLaunchTransitionRunner animationRunner =
        final RemoteSplitLaunchTransitionRunner animationRunner =
@@ -531,17 +533,19 @@ public class SplitSelectStateController {
        final RemoteTransition remoteTransition = new RemoteTransition(animationRunner,
        final RemoteTransition remoteTransition = new RemoteTransition(animationRunner,
                ActivityThread.currentActivityThread().getApplicationThread(),
                ActivityThread.currentActivityThread().getApplicationThread(),
                "LaunchSplitPair");
                "LaunchSplitPair");
        Pair<InstanceId, com.android.launcher3.logging.InstanceId> instanceIds =
        InstanceId instanceId = LogUtils.getShellShareableInstanceId().first;
                LogUtils.getShellShareableInstanceId();
        if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
        if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
            switch (launchData.getSplitLaunchType()) {
            switch (launchData.getSplitLaunchType()) {
                case SPLIT_SINGLE_TASK_FULLSCREEN -> mSystemUiProxy.startTasks(firstTaskId,
                case SPLIT_SINGLE_TASK_FULLSCREEN -> mSystemUiProxy.startTasks(firstTaskId,
                        optionsBundle, secondTaskId, null /* options2 */, initialStagePosition,
                        optionsBundle, secondTaskId, null /* options2 */, initialStagePosition,
                        DEFAULT_SPLIT_RATIO, remoteTransition, instanceIds.first);
                        DEFAULT_SPLIT_RATIO, remoteTransition, instanceId);
                case SPLIT_SINGLE_INTENT_FULLSCREEN -> mSystemUiProxy.startIntentAndTask(firstPI,
                case SPLIT_SINGLE_INTENT_FULLSCREEN -> mSystemUiProxy.startIntentAndTask(firstPI,
                        firstUserId, optionsBundle, secondTaskId, null /*options2*/,
                        firstUserId, optionsBundle, secondTaskId, null /*options2*/,
                        initialStagePosition, DEFAULT_SPLIT_RATIO, remoteTransition,
                        initialStagePosition, DEFAULT_SPLIT_RATIO, remoteTransition,
                        instanceIds.first);
                        instanceId);
                case SPLIT_SINGLE_SHORTCUT_FULLSCREEN -> mSystemUiProxy.startShortcutAndTask(
                        initialShortcut, optionsBundle, firstTaskId, null /* options2 */,
                        initialStagePosition, DEFAULT_SPLIT_RATIO, remoteTransition, instanceId);
            }
            }
        } else {
        } else {
            final RemoteAnimationAdapter adapter = getLegacyRemoteAdapter(firstTaskId,
            final RemoteAnimationAdapter adapter = getLegacyRemoteAdapter(firstTaskId,
@@ -549,12 +553,16 @@ public class SplitSelectStateController {
            switch (launchData.getSplitLaunchType()) {
            switch (launchData.getSplitLaunchType()) {
                case SPLIT_SINGLE_TASK_FULLSCREEN -> mSystemUiProxy.startTasksWithLegacyTransition(
                case SPLIT_SINGLE_TASK_FULLSCREEN -> mSystemUiProxy.startTasksWithLegacyTransition(
                        firstTaskId, optionsBundle, secondTaskId, null /* options2 */,
                        firstTaskId, optionsBundle, secondTaskId, null /* options2 */,
                        initialStagePosition, DEFAULT_SPLIT_RATIO, adapter, instanceIds.first);
                        initialStagePosition, DEFAULT_SPLIT_RATIO, adapter, instanceId);
                case SPLIT_SINGLE_INTENT_FULLSCREEN ->
                case SPLIT_SINGLE_INTENT_FULLSCREEN ->
                        mSystemUiProxy.startIntentAndTaskWithLegacyTransition(firstPI, firstUserId,
                        mSystemUiProxy.startIntentAndTaskWithLegacyTransition(firstPI, firstUserId,
                                optionsBundle, secondTaskId, null /*options2*/,
                                optionsBundle, secondTaskId, null /*options2*/,
                                initialStagePosition, DEFAULT_SPLIT_RATIO, adapter,
                                initialStagePosition, DEFAULT_SPLIT_RATIO, adapter,
                                instanceIds.first);
                                instanceId);
                case SPLIT_SINGLE_SHORTCUT_FULLSCREEN ->
                        mSystemUiProxy.startShortcutAndTaskWithLegacyTransition(
                                initialShortcut, optionsBundle, firstTaskId, null /* options2 */,
                                initialStagePosition, DEFAULT_SPLIT_RATIO, adapter, instanceId);
            }
            }
        }
        }
    }
    }