[AA+] Add LAUNCHER_ALLAPPS_SWITCHED_TO_WORK_TAB & LAUNCHER_ALLAPPS_SWITCHED_TO_MAIN_TAB events.

Bug: 178562918
Change-Id: I6ae1e034dc8fbbca6fa046104ab69c1ec9f4e6da
This commit is contained in:
thiruram authored and Thiru Ramasamy committed 2021-02-10 18:02:46 +00:00
1 parent dffbdf861c
commit 9aac07e87d
2 files changed
+16

No files matched your search

@@ -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 {
@@ -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