use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE in project android_packages_apps_Launcher3 by crdroidandroid.
the class WorkTabTest method toggleWorks.
@Ignore("b/182844465")
@Test
public void toggleWorks() {
mDevice.pressHome();
waitForLauncherCondition("Launcher didn't start", Objects::nonNull);
executeOnLauncher(launcher -> launcher.getStateManager().goToState(ALL_APPS));
waitForState("Launcher internal state didn't switch to All Apps", () -> ALL_APPS);
getOnceNotNull("Apps view did not bind", launcher -> launcher.getAppsView().getWorkModeSwitch(), 60000);
UserManager userManager = getFromLauncher(l -> l.getSystemService(UserManager.class));
assertEquals(2, userManager.getUserProfiles().size());
UserHandle workProfile = getFromLauncher(l -> {
UserHandle myHandle = Process.myUserHandle();
List<UserHandle> userProfiles = userManager.getUserProfiles();
return userProfiles.get(0) == myHandle ? userProfiles.get(1) : userProfiles.get(0);
});
waitForLauncherCondition("work profile can't be turned off", l -> userManager.requestQuietModeEnabled(true, workProfile));
assertTrue(userManager.isQuietModeEnabled(workProfile));
executeOnLauncher(launcher -> {
WorkModeSwitch wf = launcher.getAppsView().getWorkModeSwitch();
((AllAppsPagedView) launcher.getAppsView().getContentView()).snapToPageImmediately(AllAppsContainerView.AdapterHolder.WORK);
wf.toggle();
});
waitForLauncherCondition("Work toggle did not work", l -> l.getSystemService(UserManager.class).isQuietModeEnabled(workProfile));
}
use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE in project android_packages_apps_Launcher3 by crdroidandroid.
the class WorkTabTest method testWorkEduIntermittent.
@Ignore("b/182844465")
@Test
public void testWorkEduIntermittent() {
mDevice.pressHome();
waitForLauncherCondition("Launcher didn't start", Objects::nonNull);
executeOnLauncher(launcher -> launcher.getSharedPrefs().edit().remove(WorkEduView.KEY_WORK_EDU_STEP).remove(WorkEduView.KEY_LEGACY_WORK_EDU_SEEN).commit());
waitForLauncherCondition("Work tab not setup", launcher -> launcher.getAppsView().getContentView() instanceof AllAppsPagedView, 60000);
executeOnLauncher(launcher -> launcher.getStateManager().goToState(ALL_APPS));
// verify personal app edu is seen
getEduView();
// dismiss personal edu
mDevice.pressHome();
waitForState("Launcher did not go home", () -> NORMAL);
// open work tab
executeOnLauncher(launcher -> launcher.getStateManager().goToState(ALL_APPS));
waitForState("Launcher did not switch to all apps", () -> ALL_APPS);
waitForLauncherCondition("Work tab not setup", launcher -> launcher.getAppsView().getContentView() instanceof AllAppsPagedView, 60000);
executeOnLauncher(launcher -> {
AllAppsPagedView pagedView = (AllAppsPagedView) launcher.getAppsView().getContentView();
pagedView.setCurrentPage(WORK_PAGE);
});
WorkEduView workEduView = getEduView();
// verify work tab edu is shown
waitForLauncherCondition("Launcher did not show the next edu screen", l -> ((TextView) workEduView.findViewById(R.id.content_text)).getText().equals(l.getResources().getString(R.string.work_profile_edu_work_apps)));
}
use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE in project android_packages_apps_Launcher3 by crdroidandroid.
the class SettingsChangeLogger method dispatchUserEvent.
private void dispatchUserEvent() {
StatsLogger logger = StatsLogManager.newInstance(mContext).logger().withInstanceId(new InstanceIdSequence().newInstanceId());
logger.log(mNotificationDotsEnabled ? LAUNCHER_NOTIFICATION_DOT_ENABLED : LAUNCHER_NOTIFICATION_DOT_DISABLED);
logger.log(mNavMode.launcherEvent);
logger.log(getDevicePrefs(mContext).getBoolean(LAST_PREDICTION_ENABLED_STATE, true) ? LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED : LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED);
SharedPreferences prefs = getPrefs(mContext);
StatsLogManager.LauncherEvent gridSizeChangedEvent = null;
// TODO(b/184981523): This doesn't work for 2-panel grid, which has 6 hotseat icons
switch(prefs.getInt(KEY_MIGRATION_SRC_HOTSEAT_COUNT, -1)) {
case 5:
gridSizeChangedEvent = LAUNCHER_GRID_SIZE_5;
break;
case 4:
gridSizeChangedEvent = LAUNCHER_GRID_SIZE_4;
break;
case 3:
gridSizeChangedEvent = LAUNCHER_GRID_SIZE_3;
break;
case 2:
gridSizeChangedEvent = LAUNCHER_GRID_SIZE_2;
break;
default:
// Ignore illegal input.
break;
}
if (gridSizeChangedEvent != null) {
logger.log(gridSizeChangedEvent);
}
if (FeatureFlags.ENABLE_THEMED_ICONS.get()) {
logger.log(prefs.getBoolean(KEY_THEMED_ICONS, false) ? LAUNCHER_THEMED_ICON_ENABLED : LAUNCHER_THEMED_ICON_DISABLED);
}
mLoggablePrefs.forEach((key, lp) -> logger.log(() -> prefs.getBoolean(key, lp.defaultValue) ? lp.eventIdOn : lp.eventIdOff));
}
use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE in project Neo-Launcher by NeoApplications.
the class LoaderTask method run.
public void run() {
synchronized (this) {
// Skip fast if we are already stopped.
if (mStopped) {
return;
}
}
TraceHelper.beginSection(TAG);
try (LauncherModel.LoaderTransaction transaction = mApp.getModel().beginLoader(this)) {
TraceHelper.partitionSection(TAG, "step 1.1: loading workspace");
loadWorkspace();
verifyNotStopped();
TraceHelper.partitionSection(TAG, "step 1.2: bind workspace workspace");
mResults.bindWorkspace();
// Notify the installer packages of packages with active installs on the first screen.
TraceHelper.partitionSection(TAG, "step 1.3: send first screen broadcast");
sendFirstScreenActiveInstallsBroadcast();
// Take a break
TraceHelper.partitionSection(TAG, "step 1 completed, wait for idle");
waitForIdle();
verifyNotStopped();
// second step
TraceHelper.partitionSection(TAG, "step 2.1: loading all apps");
List<LauncherActivityInfo> allActivityList = loadAllApps();
TraceHelper.partitionSection(TAG, "step 2.2: Binding all apps");
verifyNotStopped();
mResults.bindAllApps();
verifyNotStopped();
TraceHelper.partitionSection(TAG, "step 2.3: Update icon cache");
IconCacheUpdateHandler updateHandler = mIconCache.getUpdateHandler();
setIgnorePackages(updateHandler);
updateHandler.updateIcons(allActivityList, LauncherActivityCachingLogic.newInstance(mApp.getContext()), mApp.getModel()::onPackageIconsUpdated);
// Take a break
TraceHelper.partitionSection(TAG, "step 2 completed, wait for idle");
waitForIdle();
verifyNotStopped();
// third step
TraceHelper.partitionSection(TAG, "step 3.1: loading deep shortcuts");
loadDeepShortcuts();
verifyNotStopped();
TraceHelper.partitionSection(TAG, "step 3.2: bind deep shortcuts");
mResults.bindDeepShortcuts();
// Take a break
TraceHelper.partitionSection(TAG, "step 3 completed, wait for idle");
waitForIdle();
verifyNotStopped();
// fourth step
TraceHelper.partitionSection(TAG, "step 4.1: loading widgets");
List<ComponentWithLabel> allWidgetsList = mBgDataModel.widgetsModel.update(mApp, null);
verifyNotStopped();
TraceHelper.partitionSection(TAG, "step 4.2: Binding widgets");
mResults.bindWidgets();
verifyNotStopped();
TraceHelper.partitionSection(TAG, "step 4.3: save widgets in icon cache");
updateHandler.updateIcons(allWidgetsList, new ComponentCachingLogic(mApp.getContext(), true), mApp.getModel()::onWidgetLabelsUpdated);
verifyNotStopped();
TraceHelper.partitionSection(TAG, "step 5: Finish icon cache update");
updateHandler.finish();
transaction.commit();
} catch (CancellationException e) {
// Loader stopped, ignore
TraceHelper.partitionSection(TAG, "Cancelled");
}
TraceHelper.endSection(TAG);
}
use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE in project Neo-Launcher by NeoApplications.
the class LoaderTask method setIgnorePackages.
private void setIgnorePackages(IconCacheUpdateHandler updateHandler) {
// Ignore packages which have a promise icon.
HashSet<String> packagesToIgnore = new HashSet<>();
synchronized (mBgDataModel) {
for (ItemInfo info : mBgDataModel.itemsIdMap) {
if (info instanceof WorkspaceItemInfo) {
WorkspaceItemInfo si = (WorkspaceItemInfo) info;
if (si.isPromise() && si.getTargetComponent() != null) {
packagesToIgnore.add(si.getTargetComponent().getPackageName());
}
} else if (info instanceof LauncherAppWidgetInfo) {
LauncherAppWidgetInfo lawi = (LauncherAppWidgetInfo) info;
if (lawi.hasRestoreFlag(LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY)) {
packagesToIgnore.add(lawi.providerName.getPackageName());
}
}
}
}
updateHandler.setPackagesToIgnore(Process.myUserHandle(), packagesToIgnore);
}
Aggregations