Search in sources :

Example 1 with LAUNCHER_THEMED_ICON_ENABLED

use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_ENABLED in project android_packages_apps_404Launcher by P-404.

the class SettingsChangeLogger method logSnapshot.

/**
 * Takes snapshot of all eligible launcher settings and log them with the provided instance ID.
 */
public void logSnapshot(InstanceId snapshotInstanceId) {
    StatsLogger logger = mStatsLogManager.logger().withInstanceId(snapshotInstanceId);
    Optional.ofNullable(mNotificationDotsEvent).ifPresent(logger::log);
    Optional.ofNullable(mNavMode).map(mode -> mode.launcherEvent).ifPresent(logger::log);
    Optional.ofNullable(mHomeScreenSuggestionEvent).ifPresent(logger::log);
    Optional.ofNullable(new DeviceGridState(mContext).getWorkspaceSizeEvent()).ifPresent(logger::log);
    SharedPreferences prefs = getPrefs(mContext);
    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));
}
Also used : Context(android.content.Context) SettingsCache(com.android.launcher3.util.SettingsCache) LAUNCHER_NOTIFICATION_DOT_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_ENABLED) OnSharedPreferenceChangeListener(android.content.SharedPreferences.OnSharedPreferenceChangeListener) LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED) TypedArray(android.content.res.TypedArray) Utilities.getDevicePrefs(com.android.launcher3.Utilities.getDevicePrefs) NavigationModeChangeListener(com.android.quickstep.SysUINavigationMode.NavigationModeChangeListener) LAUNCHER_NOTIFICATION_DOT_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_DISABLED) LAUNCHER_THEMED_ICON_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_DISABLED) LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED) AutoInstallsLayout(com.android.launcher3.AutoInstallsLayout) LAST_PREDICTION_ENABLED_STATE(com.android.launcher3.model.QuickstepModelDelegate.LAST_PREDICTION_ENABLED_STATE) LAUNCHER_THEMED_ICON_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_ENABLED) Log(android.util.Log) ArrayMap(android.util.ArrayMap) StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) XmlPullParser(org.xmlpull.v1.XmlPullParser) MainThreadInitializedObject(com.android.launcher3.util.MainThreadInitializedObject) SysUINavigationMode(com.android.quickstep.SysUINavigationMode) NOTIFICATION_BADGING_URI(com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI) Xml(android.util.Xml) InstanceId(com.android.launcher3.logging.InstanceId) Mode(com.android.quickstep.SysUINavigationMode.Mode) FeatureFlags(com.android.launcher3.config.FeatureFlags) IOException(java.io.IOException) DeviceGridState(com.android.launcher3.model.DeviceGridState) XmlPullParserException(org.xmlpull.v1.XmlPullParserException) Utilities.getPrefs(com.android.launcher3.Utilities.getPrefs) SharedPreferences(android.content.SharedPreferences) StatsLogManager(com.android.launcher3.logging.StatsLogManager) R(com.android.launcher3.R) KEY_WORKSPACE_SIZE(com.android.launcher3.model.DeviceGridState.KEY_WORKSPACE_SIZE) Optional(java.util.Optional) KEY_THEMED_ICONS(com.android.launcher3.util.Themes.KEY_THEMED_ICONS) StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) DeviceGridState(com.android.launcher3.model.DeviceGridState) SharedPreferences(android.content.SharedPreferences)

Example 2 with LAUNCHER_THEMED_ICON_ENABLED

use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_ENABLED 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));
}
Also used : StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) InstanceIdSequence(com.android.launcher3.logging.InstanceIdSequence) SharedPreferences(android.content.SharedPreferences) StatsLogManager(com.android.launcher3.logging.StatsLogManager)

Example 3 with LAUNCHER_THEMED_ICON_ENABLED

use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_ENABLED in project android_packages_apps_Launcher3 by ArrowOS.

the class SettingsChangeLogger method logSnapshot.

/**
 * Takes snapshot of all eligible launcher settings and log them with the provided instance ID.
 */
public void logSnapshot(InstanceId snapshotInstanceId) {
    StatsLogger logger = mStatsLogManager.logger().withInstanceId(snapshotInstanceId);
    Optional.ofNullable(mNotificationDotsEvent).ifPresent(logger::log);
    Optional.ofNullable(mNavMode).map(mode -> mode.launcherEvent).ifPresent(logger::log);
    Optional.ofNullable(mHomeScreenSuggestionEvent).ifPresent(logger::log);
    Optional.ofNullable(new DeviceGridState(mContext).getWorkspaceSizeEvent()).ifPresent(logger::log);
    SharedPreferences prefs = getPrefs(mContext);
    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));
}
Also used : Context(android.content.Context) SettingsCache(com.android.launcher3.util.SettingsCache) LAUNCHER_NOTIFICATION_DOT_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_ENABLED) OnSharedPreferenceChangeListener(android.content.SharedPreferences.OnSharedPreferenceChangeListener) LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED) TypedArray(android.content.res.TypedArray) Utilities.getDevicePrefs(com.android.launcher3.Utilities.getDevicePrefs) NavigationModeChangeListener(com.android.quickstep.SysUINavigationMode.NavigationModeChangeListener) LAUNCHER_NOTIFICATION_DOT_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_DISABLED) LAUNCHER_THEMED_ICON_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_DISABLED) LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED) AutoInstallsLayout(com.android.launcher3.AutoInstallsLayout) LAST_PREDICTION_ENABLED_STATE(com.android.launcher3.model.QuickstepModelDelegate.LAST_PREDICTION_ENABLED_STATE) LAUNCHER_THEMED_ICON_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_ENABLED) Log(android.util.Log) ArrayMap(android.util.ArrayMap) StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) XmlPullParser(org.xmlpull.v1.XmlPullParser) MainThreadInitializedObject(com.android.launcher3.util.MainThreadInitializedObject) SysUINavigationMode(com.android.quickstep.SysUINavigationMode) NOTIFICATION_BADGING_URI(com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI) Xml(android.util.Xml) InstanceId(com.android.launcher3.logging.InstanceId) Mode(com.android.quickstep.SysUINavigationMode.Mode) FeatureFlags(com.android.launcher3.config.FeatureFlags) IOException(java.io.IOException) DeviceGridState(com.android.launcher3.model.DeviceGridState) XmlPullParserException(org.xmlpull.v1.XmlPullParserException) Utilities.getPrefs(com.android.launcher3.Utilities.getPrefs) SharedPreferences(android.content.SharedPreferences) StatsLogManager(com.android.launcher3.logging.StatsLogManager) R(com.android.launcher3.R) KEY_WORKSPACE_SIZE(com.android.launcher3.model.DeviceGridState.KEY_WORKSPACE_SIZE) Optional(java.util.Optional) KEY_THEMED_ICONS(com.android.launcher3.util.Themes.KEY_THEMED_ICONS) StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) DeviceGridState(com.android.launcher3.model.DeviceGridState) SharedPreferences(android.content.SharedPreferences)

Example 4 with LAUNCHER_THEMED_ICON_ENABLED

use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_ENABLED in project android_packages_apps_Launcher3 by ProtonAOSP.

the class SettingsChangeLogger method logSnapshot.

/**
 * Takes snapshot of all eligible launcher settings and log them with the provided instance ID.
 */
public void logSnapshot(InstanceId snapshotInstanceId) {
    StatsLogger logger = mStatsLogManager.logger().withInstanceId(snapshotInstanceId);
    Optional.ofNullable(mNotificationDotsEvent).ifPresent(logger::log);
    Optional.ofNullable(mNavMode).map(mode -> mode.launcherEvent).ifPresent(logger::log);
    Optional.ofNullable(mHomeScreenSuggestionEvent).ifPresent(logger::log);
    Optional.ofNullable(new DeviceGridState(mContext).getWorkspaceSizeEvent()).ifPresent(logger::log);
    SharedPreferences prefs = getPrefs(mContext);
    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));
}
Also used : Context(android.content.Context) SettingsCache(com.android.launcher3.util.SettingsCache) LAUNCHER_NOTIFICATION_DOT_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_ENABLED) OnSharedPreferenceChangeListener(android.content.SharedPreferences.OnSharedPreferenceChangeListener) LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED) TypedArray(android.content.res.TypedArray) Utilities.getDevicePrefs(com.android.launcher3.Utilities.getDevicePrefs) NavigationModeChangeListener(com.android.quickstep.SysUINavigationMode.NavigationModeChangeListener) LAUNCHER_NOTIFICATION_DOT_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_DISABLED) LAUNCHER_THEMED_ICON_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_DISABLED) LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED) AutoInstallsLayout(com.android.launcher3.AutoInstallsLayout) LAST_PREDICTION_ENABLED_STATE(com.android.launcher3.model.QuickstepModelDelegate.LAST_PREDICTION_ENABLED_STATE) LAUNCHER_THEMED_ICON_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_ENABLED) Log(android.util.Log) ArrayMap(android.util.ArrayMap) StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) XmlPullParser(org.xmlpull.v1.XmlPullParser) MainThreadInitializedObject(com.android.launcher3.util.MainThreadInitializedObject) SysUINavigationMode(com.android.quickstep.SysUINavigationMode) NOTIFICATION_BADGING_URI(com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI) Xml(android.util.Xml) InstanceId(com.android.launcher3.logging.InstanceId) Mode(com.android.quickstep.SysUINavigationMode.Mode) FeatureFlags(com.android.launcher3.config.FeatureFlags) IOException(java.io.IOException) DeviceGridState(com.android.launcher3.model.DeviceGridState) XmlPullParserException(org.xmlpull.v1.XmlPullParserException) Utilities.getPrefs(com.android.launcher3.Utilities.getPrefs) SharedPreferences(android.content.SharedPreferences) StatsLogManager(com.android.launcher3.logging.StatsLogManager) R(com.android.launcher3.R) KEY_WORKSPACE_SIZE(com.android.launcher3.model.DeviceGridState.KEY_WORKSPACE_SIZE) Optional(java.util.Optional) KEY_THEMED_ICONS(com.android.launcher3.util.Themes.KEY_THEMED_ICONS) StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) DeviceGridState(com.android.launcher3.model.DeviceGridState) SharedPreferences(android.content.SharedPreferences)

Example 5 with LAUNCHER_THEMED_ICON_ENABLED

use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_ENABLED in project android_packages_apps_Launcher3 by AOSPA.

the class SettingsChangeLogger method logSnapshot.

/**
 * Takes snapshot of all eligible launcher settings and log them with the provided instance ID.
 */
public void logSnapshot(InstanceId snapshotInstanceId) {
    StatsLogger logger = mStatsLogManager.logger().withInstanceId(snapshotInstanceId);
    Optional.ofNullable(mNotificationDotsEvent).ifPresent(logger::log);
    Optional.ofNullable(mNavMode).map(mode -> mode.launcherEvent).ifPresent(logger::log);
    Optional.ofNullable(mHomeScreenSuggestionEvent).ifPresent(logger::log);
    Optional.ofNullable(new DeviceGridState(mContext).getWorkspaceSizeEvent()).ifPresent(logger::log);
    SharedPreferences prefs = getPrefs(mContext);
    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));
}
Also used : Context(android.content.Context) SettingsCache(com.android.launcher3.util.SettingsCache) LAUNCHER_NOTIFICATION_DOT_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_ENABLED) OnSharedPreferenceChangeListener(android.content.SharedPreferences.OnSharedPreferenceChangeListener) LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED) TypedArray(android.content.res.TypedArray) Utilities.getDevicePrefs(com.android.launcher3.Utilities.getDevicePrefs) NavigationModeChangeListener(com.android.quickstep.SysUINavigationMode.NavigationModeChangeListener) LAUNCHER_NOTIFICATION_DOT_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_DISABLED) LAUNCHER_THEMED_ICON_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_DISABLED) LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED) AutoInstallsLayout(com.android.launcher3.AutoInstallsLayout) LAST_PREDICTION_ENABLED_STATE(com.android.launcher3.model.QuickstepModelDelegate.LAST_PREDICTION_ENABLED_STATE) LAUNCHER_THEMED_ICON_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_ENABLED) Log(android.util.Log) ArrayMap(android.util.ArrayMap) StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) XmlPullParser(org.xmlpull.v1.XmlPullParser) MainThreadInitializedObject(com.android.launcher3.util.MainThreadInitializedObject) SysUINavigationMode(com.android.quickstep.SysUINavigationMode) NOTIFICATION_BADGING_URI(com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI) Xml(android.util.Xml) InstanceId(com.android.launcher3.logging.InstanceId) Mode(com.android.quickstep.SysUINavigationMode.Mode) FeatureFlags(com.android.launcher3.config.FeatureFlags) IOException(java.io.IOException) DeviceGridState(com.android.launcher3.model.DeviceGridState) XmlPullParserException(org.xmlpull.v1.XmlPullParserException) Utilities.getPrefs(com.android.launcher3.Utilities.getPrefs) SharedPreferences(android.content.SharedPreferences) StatsLogManager(com.android.launcher3.logging.StatsLogManager) R(com.android.launcher3.R) KEY_WORKSPACE_SIZE(com.android.launcher3.model.DeviceGridState.KEY_WORKSPACE_SIZE) Optional(java.util.Optional) KEY_THEMED_ICONS(com.android.launcher3.util.Themes.KEY_THEMED_ICONS) StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) DeviceGridState(com.android.launcher3.model.DeviceGridState) SharedPreferences(android.content.SharedPreferences)

Aggregations

SharedPreferences (android.content.SharedPreferences)5 StatsLogManager (com.android.launcher3.logging.StatsLogManager)5 StatsLogger (com.android.launcher3.logging.StatsLogManager.StatsLogger)5 Context (android.content.Context)4 OnSharedPreferenceChangeListener (android.content.SharedPreferences.OnSharedPreferenceChangeListener)4 TypedArray (android.content.res.TypedArray)4 ArrayMap (android.util.ArrayMap)4 Log (android.util.Log)4 Xml (android.util.Xml)4 AutoInstallsLayout (com.android.launcher3.AutoInstallsLayout)4 R (com.android.launcher3.R)4 Utilities.getDevicePrefs (com.android.launcher3.Utilities.getDevicePrefs)4 Utilities.getPrefs (com.android.launcher3.Utilities.getPrefs)4 FeatureFlags (com.android.launcher3.config.FeatureFlags)4 InstanceId (com.android.launcher3.logging.InstanceId)4 LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED (com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED)4 LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED (com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED)4 LAUNCHER_NOTIFICATION_DOT_DISABLED (com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_DISABLED)4 LAUNCHER_NOTIFICATION_DOT_ENABLED (com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_ENABLED)4 LAUNCHER_THEMED_ICON_DISABLED (com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_DISABLED)4