Log number of apps in Private space

Log number of user installed and preinstalled apps
in private profile.

Bug: 328406844
Test: aster-previz https://paste.googleplex.com/5134195153698816
Flag: ACONFIG com.android.launcher3.enable_private_space_launch DEVELOPMENT
Change-Id: Ife8a8ee81dca90fa37dba2f3e719ba8031d2eb49
This commit is contained in:
Anna Zhuravleva committed 2024-03-18 16:32:31 +00:00
1 parent 1a59da4e82
commit b05ceb39b5
2 files changed
+22

No files matched your search

@@ -18,6 +18,8 @@ package com.android.launcher3.allapps;
import static com.android.launcher3.allapps.SectionDecorationInfo.ROUND_BOTTOM_LEFT;
import static com.android.launcher3.allapps.SectionDecorationInfo.ROUND_BOTTOM_RIGHT;
import static com.android.launcher3.allapps.SectionDecorationInfo.ROUND_NOTHING;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_PRIVATE_SPACE_PREINSTALLED_APPS_COUNT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_PRIVATE_SPACE_USER_INSTALLED_APPS_COUNT;
import android.content.Context;
@@ -342,6 +344,20 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
Map<Boolean, List<AppInfo>> split = mPrivateApps.stream()
.collect(Collectors.partitioningBy(mPrivateProviderManager
.splitIntoUserInstalledAndSystemApps()));
// TODO(b/329688630): switch to the pulled LayoutStaticSnapshot atom
mActivityContext
.getStatsLogManager()
.logger()
.withCardinality(split.get(true).size())
.log(LAUNCHER_PRIVATE_SPACE_USER_INSTALLED_APPS_COUNT);
mActivityContext
.getStatsLogManager()
.logger()
.withCardinality(split.get(false).size())
.log(LAUNCHER_PRIVATE_SPACE_PREINSTALLED_APPS_COUNT);
// Add user installed apps
position = addAppsWithSections(split.get(true), position);
// Add system apps separator.