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

Commit 5a9d4af1 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Log split metrics through individual sessions

* Now we log the original source of the first selected app
as soon as the user selects it (previously we only did when user
selected second app)
* We log the item info for the second app to determine second
surface.
* Added new metrics to log after user has started a split session
and ended a split session
* We log different cancellation reasons (cancel button,
home gesture, general other app interruptions, etc).
* One KI/Bug: When the second app is selected via taskbar in
overview, the container will say hotseat because we are using
Launcher's logger and not Taskbar's. Taskbar's logger manually
overwrites the container in TaskbarActivityContext, we may be
able to make something hacky that can allow us to overwrite, but
that'll have to be a separate change

Bug: 322551862
Test: Logged metrics manually with event and itemInfo
Change-Id: I177623fd00ce62acf2d4ee983b58561d8c946d59
parent 9ac91ffa
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -260,7 +260,8 @@ public class TaskbarUIController {
                                    taskAttributes.getThumbnailView(),
                                    taskAttributes.getThumbnailView().getThumbnail(),
                                    null /* intent */,
                                    null /* user */);
                                    null /* user */,
                                    info);
                            return;
                        }
                    }
@@ -273,7 +274,8 @@ public class TaskbarUIController {
                            startingView,
                            null /* thumbnail */,
                            intent,
                            info.user);
                            info.user,
                            info);
                }
        );
    }
+2 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static com.android.app.animation.Interpolators.FINAL_FRAME;
import static com.android.app.animation.Interpolators.INSTANT;
import static com.android.app.animation.Interpolators.LINEAR;
import static com.android.launcher3.LauncherState.QUICK_SWITCH_FROM_HOME;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_SELECTION_EXIT_HOME;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_MODAL;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE;
@@ -111,7 +112,7 @@ public abstract class BaseRecentsViewStateController<T extends RecentsView>
        boolean exitingOverview = !FeatureFlags.enableSplitContextually() && !toState.overviewUi;
        if (mRecentsView.isSplitSelectionActive() && exitingOverview) {
            setter.add(mRecentsView.getSplitSelectController().getSplitAnimationController()
                    .createPlaceholderDismissAnim(mLauncher));
                    .createPlaceholderDismissAnim(mLauncher, LAUNCHER_SPLIT_SELECTION_EXIT_HOME));
            setter.setViewAlpha(
                    mRecentsView.getSplitInstructionsView(),
                    0,
+12 −8
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
import static com.android.launcher3.config.FeatureFlags.enableSplitContextually;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_SELECTION_EXIT_INTERRUPTED;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_SELECTION_EXIT_HOME;
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.popup.QuickstepSystemShortcut.getSplitSelectShortcutByPosition;
import static com.android.launcher3.popup.SystemShortcut.APP_INFO;
@@ -596,7 +598,7 @@ public class QuickstepLauncher extends Launcher {
        list.add(getDragController());
        Consumer<AnimatorSet> splitAnimator = animatorSet ->
                animatorSet.play(mSplitSelectStateController.getSplitAnimationController()
                        .createPlaceholderDismissAnim(this));
                        .createPlaceholderDismissAnim(this, LAUNCHER_SPLIT_SELECTION_EXIT_HOME));
        switch (mode) {
            case NO_BUTTON:
                list.add(new NoButtonQuickSwitchTouchController(this));
@@ -767,8 +769,10 @@ public class QuickstepLauncher extends Launcher {
            // If Launcher pauses before both split apps are selected, exit split screen.
            if (!mSplitSelectStateController.isBothSplitAppsConfirmed() &&
                    !mSplitSelectStateController.isLaunchingFirstAppFullscreen()) {
                mSplitSelectStateController
                        .logExitReason(LAUNCHER_SPLIT_SELECTION_EXIT_INTERRUPTED);
                mSplitSelectStateController.getSplitAnimationController()
                        .playPlaceholderDismissAnim(this);
                        .playPlaceholderDismissAnim(this, LAUNCHER_SPLIT_SELECTION_EXIT_INTERRUPTED);
            }
        }
    }
@@ -1042,17 +1046,17 @@ public class QuickstepLauncher extends Launcher {
    }

    @Override
    protected void handleSplitAnimationGoingToHome() {
        super.handleSplitAnimationGoingToHome();
    protected void handleSplitAnimationGoingToHome(StatsLogManager.EventEnum splitDismissReason) {
        super.handleSplitAnimationGoingToHome(splitDismissReason);
        mSplitSelectStateController.getSplitAnimationController()
                .playPlaceholderDismissAnim(this);
                .playPlaceholderDismissAnim(this, splitDismissReason);
    }

    @Override
    public void dismissSplitSelection() {
        super.dismissSplitSelection();
    public void dismissSplitSelection(StatsLogManager.LauncherEvent splitDismissEvent) {
        super.dismissSplitSelection(splitDismissEvent);
        mSplitSelectStateController.getSplitAnimationController()
                .playPlaceholderDismissAnim(this);
                .playPlaceholderDismissAnim(this, splitDismissEvent);
    }

    public <T extends OverviewActionsView> T getActionsView() {
+2 −2
Original line number Diff line number Diff line
@@ -162,10 +162,10 @@ public class AppPairsController {

                    @Nullable Task foundTask2 = foundTasks[1];
                    if (foundTask2 != null) {
                        mSplitSelectStateController.setSecondTask(foundTask2);
                        mSplitSelectStateController.setSecondTask(foundTask2, app2);
                    } else {
                        mSplitSelectStateController.setSecondTask(
                                app2.intent, app2.user);
                                app2.intent, app2.user, app2);
                    }

                    mSplitSelectStateController.setLaunchingIconView(appPairIcon);
+10 −4
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import com.android.launcher3.Utilities
import com.android.launcher3.anim.PendingAnimation
import com.android.launcher3.apppairs.AppPairIcon
import com.android.launcher3.config.FeatureFlags
import com.android.launcher3.logging.StatsLogManager.EventEnum
import com.android.launcher3.statehandlers.DepthController
import com.android.launcher3.statemanager.StateManager
import com.android.launcher3.statemanager.StatefulActivity
@@ -213,17 +214,21 @@ class SplitAnimationController(val splitSelectStateController: SplitSelectStateC
    }

    /** Does not play any animation if user is not currently in split selection state. */
    fun playPlaceholderDismissAnim(launcher: StatefulActivity<*>) {
    fun playPlaceholderDismissAnim(launcher: StatefulActivity<*>, splitDismissEvent: EventEnum) {
        if (!splitSelectStateController.isSplitSelectActive) {
            return
        }

        val anim = createPlaceholderDismissAnim(launcher)
        val anim = createPlaceholderDismissAnim(launcher, splitDismissEvent)
        anim.start()
    }

    /** Returns [AnimatorSet] which slides initial split placeholder view offscreen. */
    fun createPlaceholderDismissAnim(launcher: StatefulActivity<*>) : AnimatorSet {
    /**
     * Returns [AnimatorSet] which slides initial split placeholder view offscreen and logs an event
     * for why split is being dismissed
     */
    fun createPlaceholderDismissAnim(launcher: StatefulActivity<*>,
                                     splitDismissEvent: EventEnum) : AnimatorSet {
        val animatorSet = AnimatorSet()
        val recentsView : RecentsView<*, *> = launcher.getOverviewPanel()
        val floatingTask: FloatingTaskView = splitSelectStateController.firstFloatingTaskView
@@ -260,6 +265,7 @@ class SplitAnimationController(val splitSelectStateController: SplitSelectStateC
                        splitSelectStateController.splitInstructionsView)
            }
        })
        splitSelectStateController.logExitReason(splitDismissEvent)
        return animatorSet
    }

Loading