split the scrolling logging into work,personal, and search

- moved collapse/extend logging with the other scroll logging

bug: 263817965
test: Manual - WW
Change-Id: I9cd57b895c0c2edb7fe39ef98dced574d09a0953
This commit is contained in:
Brandon Dayauon committed 2023-01-11 10:09:27 -08:00
1 parent 485c8777cc
commit f54e016c82
3 files changed
+48 -21

No files matched your search

@@ -17,11 +17,15 @@ package com.android.launcher3.allapps;
import static com.android.launcher3.logger.LauncherAtom.ContainerInfo;
import static com.android.launcher3.logger.LauncherAtom.SearchResultContainer;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_SCROLLED_DOWN;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_PERSONAL_SCROLLED_DOWN;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_PERSONAL_SCROLLED_UP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_SCROLLED_UNKNOWN_DIRECTION;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_SCROLLED_UP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_SEARCH_SCROLLED_DOWN;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_SEARCH_SCROLLED_UP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_VERTICAL_SWIPE_BEGIN;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_VERTICAL_SWIPE_END;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WORK_FAB_BUTTON_COLLAPSE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WORK_FAB_BUTTON_EXTEND;
import static com.android.launcher3.util.LogConfig.SEARCH_LOGGING;
import android.content.Context;
@@ -275,17 +279,37 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
private void logCumulativeVerticalScroll() {
ActivityContext context = ActivityContext.lookupContext(getContext());
StatsLogManager mgr = context.getStatsLogManager();
ExtendedEditText editText = context.getAppsView().getSearchUiManager().getEditText();
ActivityAllAppsContainerView<?> appsView = context.getAppsView();
ExtendedEditText editText = appsView.getSearchUiManager().getEditText();
ContainerInfo containerInfo = ContainerInfo.newBuilder().setSearchResultContainer(
SearchResultContainer
.newBuilder()
.setQueryLength((editText == null) ? -1 : editText.length())).build();
// mCumulativeVerticalScroll == 0 when user comes back to original position, we don't
// know the direction of scrolling.
mgr.logger().withContainerInfo(containerInfo).log(
mCumulativeVerticalScroll == 0 ? LAUNCHER_ALLAPPS_SCROLLED_UNKNOWN_DIRECTION
: (mCumulativeVerticalScroll > 0) ? LAUNCHER_ALLAPPS_SCROLLED_DOWN
: LAUNCHER_ALLAPPS_SCROLLED_UP);
if (mCumulativeVerticalScroll == 0) {
// mCumulativeVerticalScroll == 0 when user comes back to original position, we
// don't know the direction of scrolling.
mgr.logger().withContainerInfo(containerInfo).log(
LAUNCHER_ALLAPPS_SCROLLED_UNKNOWN_DIRECTION);
return;
} else if (appsView.isSearching()) {
// In search results page
mgr.logger().withContainerInfo(containerInfo).log((mCumulativeVerticalScroll > 0)
? LAUNCHER_ALLAPPS_SEARCH_SCROLLED_DOWN
: LAUNCHER_ALLAPPS_SEARCH_SCROLLED_UP);
return;
} else if (appsView.mViewPager != null) {
int currentPage = appsView.mViewPager.getCurrentPage();
if (currentPage == BaseAllAppsContainerView.AdapterHolder.WORK) {
// In work A-Z list
mgr.logger().withContainerInfo(containerInfo).log((mCumulativeVerticalScroll > 0)
? LAUNCHER_WORK_FAB_BUTTON_COLLAPSE
: LAUNCHER_WORK_FAB_BUTTON_EXTEND);
return;
}
}
// In personal A-Z list
mgr.logger().withContainerInfo(containerInfo).log((mCumulativeVerticalScroll > 0)
? LAUNCHER_ALLAPPS_PERSONAL_SCROLLED_DOWN
: LAUNCHER_ALLAPPS_PERSONAL_SCROLLED_UP);
}
}