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
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 496cb4e..39b3fbf 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -77,6 +77,7 @@
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_EXIT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ONRESUME;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ONSTOP;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_SELECTION_EXIT_HOME;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SWIPELEFT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SWIPERIGHT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WIDGET_RECONFIGURED;
@@ -1580,7 +1581,7 @@
}
if (FeatureFlags.enableSplitContextually()) {
- handleSplitAnimationGoingToHome();
+ handleSplitAnimationGoingToHome(LAUNCHER_SPLIT_SELECTION_EXIT_HOME);
}
mOverlayManager.hideOverlay(isStarted() && !isForceInvisible());
handleGestureContract(intent);
@@ -1596,7 +1597,7 @@
}
/** Handle animating away split placeholder view when user taps on home button */
- protected void handleSplitAnimationGoingToHome() {
+ protected void handleSplitAnimationGoingToHome(EventEnum splitDismissReason) {
// Overridden
}
@@ -2667,7 +2668,7 @@
}
/** Call to dismiss the intermediary split selection state. */
- public void dismissSplitSelection() {
+ public void dismissSplitSelection(StatsLogManager.LauncherEvent splitDismissEvent) {
// Overridden; move this into ActivityContext if necessary for Taskbar
}
diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java
index 2a0f030..1447d05 100644
--- a/src/com/android/launcher3/logging/StatsLogManager.java
+++ b/src/com/android/launcher3/logging/StatsLogManager.java
@@ -199,6 +199,11 @@
@UiEvent(doc = "User tapped on app info system shortcut.")
LAUNCHER_SYSTEM_SHORTCUT_APP_INFO_TAP(515),
+ /**
+ * @deprecated Use {@link #LAUNCHER_APP_ICON_MENU_SPLIT_LEFT_TOP} or
+ * {@link #LAUNCHER_APP_ICON_MENU_SPLIT_RIGHT_BOTTOM}
+ */
+ @Deprecated
@UiEvent(doc = "User tapped on split screen icon on a task menu.")
LAUNCHER_SYSTEM_SHORTCUT_SPLIT_SCREEN_TAP(518),
@@ -722,6 +727,27 @@
@UiEvent(doc = "User tapped on private space uninstall system shortcut.")
LAUNCHER_PRIVATE_SPACE_UNINSTALL_SYSTEM_SHORTCUT_TAP(1608),
+ @UiEvent(doc = "User initiated split selection")
+ LAUNCHER_SPLIT_SELECTION_INITIATED(1618),
+
+ @UiEvent(doc = "User finished a split selection session")
+ LAUNCHER_SPLIT_SELECTION_COMPLETE(1619),
+
+ @UiEvent(doc = "User selected both apps for split screen")
+ LAUNCHER_SPLIT_SELECTED_SECOND_APP(1609),
+
+ @UiEvent(doc = "User exited split selection by going home via swipe, button, or state "
+ + "transition")
+ LAUNCHER_SPLIT_SELECTION_EXIT_HOME(1610),
+
+ @UiEvent(doc = "User exited split selection by tapping cancel in split instructions view")
+ LAUNCHER_SPLIT_SELECTION_EXIT_CANCEL_BUTTON(1611),
+
+ @UiEvent(doc = "User exited split selection when another activity/app came to foreground"
+ + " after first app had been selected OR if user long-pressed on home. Default exit"
+ + " metric.")
+ LAUNCHER_SPLIT_SELECTION_EXIT_INTERRUPTED(1612),
+
// ADD MORE
;
diff --git a/src/com/android/launcher3/touch/WorkspaceTouchListener.java b/src/com/android/launcher3/touch/WorkspaceTouchListener.java
index 8c43f75..0ff10c2 100644
--- a/src/com/android/launcher3/touch/WorkspaceTouchListener.java
+++ b/src/com/android/launcher3/touch/WorkspaceTouchListener.java
@@ -24,6 +24,7 @@
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_CLOSE_TAP_OUTSIDE;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_SELECTION_EXIT_INTERRUPTED;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WORKSPACE_LONGPRESS;
import android.graphics.PointF;
@@ -207,7 +208,7 @@
mLauncher.getStatsLogManager().logger().log(LAUNCHER_WORKSPACE_LONGPRESS);
mLauncher.showDefaultOptions(mTouchDownPoint.x, mTouchDownPoint.y);
if (FeatureFlags.enableSplitContextually() && mLauncher.isSplitSelectionActive()) {
- mLauncher.dismissSplitSelection();
+ mLauncher.dismissSplitSelection(LAUNCHER_SPLIT_SELECTION_EXIT_INTERRUPTED);
}
} else {
cancelLongPress();