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
This commit is contained in:
Vinit Nayak
2024-01-31 12:49:05 -08:00
parent 9ac91ffa63
commit 5a9d4af170
17 changed files with 182 additions and 62 deletions
@@ -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() {