diff --git a/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java b/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java index 03ce594731..bb1a4c07cf 100644 --- a/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java @@ -16,6 +16,8 @@ package com.android.launcher3.allapps; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_KEYBOARD_CLOSED; +import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_SWITCHED_TO_MAIN_TAB; +import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_SWITCHED_TO_WORK_TAB; import android.content.Context; import android.graphics.Rect; @@ -88,6 +90,14 @@ public class LauncherAllAppsContainerView extends AllAppsContainerView { public void onTabChanged(int pos) { super.onTabChanged(pos); if (mUsingTabs) { + + // Log tab switches only when the launcher is in AllApps state + if (mLauncher.getStateManager().getCurrentStableState() == LauncherState.ALL_APPS) { + mLauncher.getLiveSearchManager().allAppsLogger() + .log(pos == AdapterHolder.WORK ? LAUNCHER_ALLAPPS_SWITCHED_TO_WORK_TAB + : LAUNCHER_ALLAPPS_SWITCHED_TO_MAIN_TAB); + } + if (pos == AdapterHolder.WORK) { WorkEduView.showWorkEduIfNeeded(mLauncher); } else { diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java index 0d07e0d171..071b2634a1 100644 --- a/src/com/android/launcher3/logging/StatsLogManager.java +++ b/src/com/android/launcher3/logging/StatsLogManager.java @@ -353,6 +353,12 @@ public class StatsLogManager implements ResourceBasedOverride { @UiEvent(doc = "User closed the AllApps keyboard.") LAUNCHER_ALLAPPS_KEYBOARD_CLOSED(694), + + @UiEvent(doc = "User switched to Main tab in AllApps screen.") + LAUNCHER_ALLAPPS_SWITCHED_TO_MAIN_TAB(695), + + @UiEvent(doc = "User switched to Work tab in AllApps screen.") + LAUNCHER_ALLAPPS_SWITCHED_TO_WORK_TAB(696), ; // ADD MORE