From 9aac07e87dc5acb86f05d973381096e5c0e1634f Mon Sep 17 00:00:00 2001 From: thiruram Date: Fri, 5 Feb 2021 12:53:55 -0800 Subject: [PATCH] [AA+] Add LAUNCHER_ALLAPPS_SWITCHED_TO_WORK_TAB & LAUNCHER_ALLAPPS_SWITCHED_TO_MAIN_TAB events. Bug: 178562918 Change-Id: I6ae1e034dc8fbbca6fa046104ab69c1ec9f4e6da --- .../allapps/LauncherAllAppsContainerView.java | 10 ++++++++++ src/com/android/launcher3/logging/StatsLogManager.java | 6 ++++++ 2 files changed, 16 insertions(+) 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