Loading aconfig/launcher.aconfig +8 −7 Original line number Diff line number Diff line Loading @@ -70,13 +70,6 @@ flag { bug: "296231746" } flag { name: "enable_launcher_br_metrics" namespace: "launcher" description: "Enables logging of Launcher restore metrics to the Backup & Restore team" bug: "307527314" } flag { name: "enable_unfolded_two_pane_picker" namespace: "launcher" Loading Loading @@ -104,3 +97,11 @@ flag { description: "Enables long-press shortcut to install a copy of an app to Private space" bug: "316118005" } flag { name: "enable_launcher_br_metrics_fixed" namespace: "launcher" description: "Enables logging of Launcher restore metrics to the Backup & Restore team" bug: "307527314" is_fixed_read_only: true } quickstep/src/com/android/quickstep/LauncherRestoreEventLoggerImpl.kt +8 −9 Original line number Diff line number Diff line Loading @@ -5,10 +5,9 @@ import android.app.backup.BackupRestoreEventLogger import android.app.backup.BackupRestoreEventLogger.BackupRestoreDataType import android.app.backup.BackupRestoreEventLogger.BackupRestoreError import android.content.Context import com.android.launcher3.Flags.enableLauncherBrMetrics import com.android.launcher3.Flags.enableLauncherBrMetricsFixed import com.android.launcher3.LauncherSettings.Favorites import com.android.launcher3.backuprestore.LauncherRestoreEventLogger import com.android.launcher3.config.FeatureFlags.ENABLE_LAUNCHER_BR_METRICS /** * Concrete implementation for wrapper to log Restore event metrics for both success and failure to Loading Loading @@ -45,7 +44,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven count: Int, @BackupRestoreError error: String? ) { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger.logItemsRestoreFailed(dataType, count, error) } } Loading @@ -57,7 +56,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven * @param count the number of data items restored. */ override fun logLauncherItemsRestored(@BackupRestoreDataType dataType: String, count: Int) { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger.logItemsRestored(dataType, count) } } Loading @@ -68,7 +67,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven * @param favoritesId The id of the item type from [Favorites] that was restored. */ override fun logSingleFavoritesItemRestored(favoritesId: Int) { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger.logItemsRestored(favoritesIdToDataType(favoritesId), 1) } } Loading @@ -80,7 +79,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven * @param count number of items that restored. */ override fun logFavoritesItemsRestored(favoritesId: Int, count: Int) { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger.logItemsRestored(favoritesIdToDataType(favoritesId), count) } } Loading @@ -95,7 +94,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven favoritesId: Int, @BackupRestoreError error: String? ) { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger.logItemsRestoreFailed(favoritesIdToDataType(favoritesId), 1, error) } } Loading @@ -112,7 +111,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven count: Int, @BackupRestoreError error: String? ) { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger.logItemsRestoreFailed( favoritesIdToDataType(favoritesId), count, Loading @@ -126,7 +125,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven * done restoring items for Launcher. */ override fun reportLauncherRestoreResults() { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { BackupManager(context).reportDelayedRestoreResult(restoreEventLogger) } } Loading src/com/android/launcher3/config/FeatureFlags.java +0 −2 Original line number Diff line number Diff line Loading @@ -167,8 +167,6 @@ public final class FeatureFlags { "Enable the ability to generate monochromatic icons, if it is not provided by the app"); // TODO(Block 8): Clean up flags public static final BooleanFlag ENABLE_LAUNCHER_BR_METRICS = getDebugFlag(305984208, "ENABLE_LAUNCHER_BR_METRICS", TEAMFOOD, "Enable metrics for Launcher restore"); // TODO(Block 9): Clean up flags public static final BooleanFlag MULTI_SELECT_EDIT_MODE = getDebugFlag(270709220, Loading src/com/android/launcher3/model/LoaderTask.java +2 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package com.android.launcher3.model; import static com.android.launcher3.BuildConfig.WIDGET_ON_FIRST_SCREEN; import static com.android.launcher3.Flags.enableSupportForArchiving; import static com.android.launcher3.Flags.enableLauncherBrMetrics; import static com.android.launcher3.Flags.enableLauncherBrMetricsFixed; import static com.android.launcher3.LauncherPrefs.IS_FIRST_LOAD_AFTER_RESTORE; import static com.android.launcher3.LauncherPrefs.SHOULD_SHOW_SMARTSPACE; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APP_PAIR; Loading Loading @@ -234,7 +234,7 @@ public class LoaderTask implements Runnable { mIsRestoreFromBackup = (Boolean) LauncherPrefs.get(mApp.getContext()).get(IS_FIRST_LOAD_AFTER_RESTORE); LauncherRestoreEventLogger restoreEventLogger = null; if (enableLauncherBrMetrics()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger = LauncherRestoreEventLogger.Companion .newInstance(mApp.getContext()); } Loading src/com/android/launcher3/provider/RestoreDbTask.java +3 −4 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package com.android.launcher3.provider; import static android.os.Process.myUserHandle; import static com.android.launcher3.Flags.enableLauncherBrMetrics; import static com.android.launcher3.Flags.enableLauncherBrMetricsFixed; import static com.android.launcher3.InvariantDeviceProfile.TYPE_MULTI_DISPLAY; import static com.android.launcher3.LauncherPrefs.APP_WIDGET_IDS; import static com.android.launcher3.LauncherPrefs.IS_FIRST_LOAD_AFTER_RESTORE; Loading @@ -30,7 +30,6 @@ import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPWIDG import static com.android.launcher3.backuprestore.LauncherRestoreEventLogger.RESTORE_ERROR_PROFILE_NOT_RESTORED; import static com.android.launcher3.backuprestore.LauncherRestoreEventLogger.RESTORE_ERROR_WIDGETS_DISABLED; import static com.android.launcher3.backuprestore.LauncherRestoreEventLogger.RESTORE_ERROR_WIDGET_REMOVED; import static com.android.launcher3.config.FeatureFlags.ENABLE_LAUNCHER_BR_METRICS; import static com.android.launcher3.provider.LauncherDbUtils.dropTable; import static com.android.launcher3.widget.LauncherWidgetHolder.APPWIDGET_HOST_ID; Loading Loading @@ -199,7 +198,7 @@ public class RestoreDbTask { Arrays.fill(args, "?"); final String where = "profileId NOT IN (" + TextUtils.join(", ", Arrays.asList(args)) + ")"; logFavoritesTable(db, "items to delete from unrestored profiles:", where, profileIds); if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { reportUnrestoredProfiles(db, where, profileIds, restoreEventLogger); } int itemsDeletedCount = db.delete(Favorites.TABLE_NAME, where, profileIds); Loading Loading @@ -361,7 +360,7 @@ public class RestoreDbTask { DeviceGridState deviceGridState = new DeviceGridState(context); FileLog.d(TAG, "restore initiated from backup: DeviceGridState=" + deviceGridState); LauncherPrefs.get(context).putSync(RESTORE_DEVICE.to(deviceGridState.getDeviceType())); if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { LauncherPrefs.get(context).putSync(IS_FIRST_LOAD_AFTER_RESTORE.to(true)); } } Loading Loading
aconfig/launcher.aconfig +8 −7 Original line number Diff line number Diff line Loading @@ -70,13 +70,6 @@ flag { bug: "296231746" } flag { name: "enable_launcher_br_metrics" namespace: "launcher" description: "Enables logging of Launcher restore metrics to the Backup & Restore team" bug: "307527314" } flag { name: "enable_unfolded_two_pane_picker" namespace: "launcher" Loading Loading @@ -104,3 +97,11 @@ flag { description: "Enables long-press shortcut to install a copy of an app to Private space" bug: "316118005" } flag { name: "enable_launcher_br_metrics_fixed" namespace: "launcher" description: "Enables logging of Launcher restore metrics to the Backup & Restore team" bug: "307527314" is_fixed_read_only: true }
quickstep/src/com/android/quickstep/LauncherRestoreEventLoggerImpl.kt +8 −9 Original line number Diff line number Diff line Loading @@ -5,10 +5,9 @@ import android.app.backup.BackupRestoreEventLogger import android.app.backup.BackupRestoreEventLogger.BackupRestoreDataType import android.app.backup.BackupRestoreEventLogger.BackupRestoreError import android.content.Context import com.android.launcher3.Flags.enableLauncherBrMetrics import com.android.launcher3.Flags.enableLauncherBrMetricsFixed import com.android.launcher3.LauncherSettings.Favorites import com.android.launcher3.backuprestore.LauncherRestoreEventLogger import com.android.launcher3.config.FeatureFlags.ENABLE_LAUNCHER_BR_METRICS /** * Concrete implementation for wrapper to log Restore event metrics for both success and failure to Loading Loading @@ -45,7 +44,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven count: Int, @BackupRestoreError error: String? ) { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger.logItemsRestoreFailed(dataType, count, error) } } Loading @@ -57,7 +56,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven * @param count the number of data items restored. */ override fun logLauncherItemsRestored(@BackupRestoreDataType dataType: String, count: Int) { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger.logItemsRestored(dataType, count) } } Loading @@ -68,7 +67,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven * @param favoritesId The id of the item type from [Favorites] that was restored. */ override fun logSingleFavoritesItemRestored(favoritesId: Int) { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger.logItemsRestored(favoritesIdToDataType(favoritesId), 1) } } Loading @@ -80,7 +79,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven * @param count number of items that restored. */ override fun logFavoritesItemsRestored(favoritesId: Int, count: Int) { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger.logItemsRestored(favoritesIdToDataType(favoritesId), count) } } Loading @@ -95,7 +94,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven favoritesId: Int, @BackupRestoreError error: String? ) { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger.logItemsRestoreFailed(favoritesIdToDataType(favoritesId), 1, error) } } Loading @@ -112,7 +111,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven count: Int, @BackupRestoreError error: String? ) { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger.logItemsRestoreFailed( favoritesIdToDataType(favoritesId), count, Loading @@ -126,7 +125,7 @@ class LauncherRestoreEventLoggerImpl(val context: Context) : LauncherRestoreEven * done restoring items for Launcher. */ override fun reportLauncherRestoreResults() { if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { BackupManager(context).reportDelayedRestoreResult(restoreEventLogger) } } Loading
src/com/android/launcher3/config/FeatureFlags.java +0 −2 Original line number Diff line number Diff line Loading @@ -167,8 +167,6 @@ public final class FeatureFlags { "Enable the ability to generate monochromatic icons, if it is not provided by the app"); // TODO(Block 8): Clean up flags public static final BooleanFlag ENABLE_LAUNCHER_BR_METRICS = getDebugFlag(305984208, "ENABLE_LAUNCHER_BR_METRICS", TEAMFOOD, "Enable metrics for Launcher restore"); // TODO(Block 9): Clean up flags public static final BooleanFlag MULTI_SELECT_EDIT_MODE = getDebugFlag(270709220, Loading
src/com/android/launcher3/model/LoaderTask.java +2 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package com.android.launcher3.model; import static com.android.launcher3.BuildConfig.WIDGET_ON_FIRST_SCREEN; import static com.android.launcher3.Flags.enableSupportForArchiving; import static com.android.launcher3.Flags.enableLauncherBrMetrics; import static com.android.launcher3.Flags.enableLauncherBrMetricsFixed; import static com.android.launcher3.LauncherPrefs.IS_FIRST_LOAD_AFTER_RESTORE; import static com.android.launcher3.LauncherPrefs.SHOULD_SHOW_SMARTSPACE; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APP_PAIR; Loading Loading @@ -234,7 +234,7 @@ public class LoaderTask implements Runnable { mIsRestoreFromBackup = (Boolean) LauncherPrefs.get(mApp.getContext()).get(IS_FIRST_LOAD_AFTER_RESTORE); LauncherRestoreEventLogger restoreEventLogger = null; if (enableLauncherBrMetrics()) { if (enableLauncherBrMetricsFixed()) { restoreEventLogger = LauncherRestoreEventLogger.Companion .newInstance(mApp.getContext()); } Loading
src/com/android/launcher3/provider/RestoreDbTask.java +3 −4 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package com.android.launcher3.provider; import static android.os.Process.myUserHandle; import static com.android.launcher3.Flags.enableLauncherBrMetrics; import static com.android.launcher3.Flags.enableLauncherBrMetricsFixed; import static com.android.launcher3.InvariantDeviceProfile.TYPE_MULTI_DISPLAY; import static com.android.launcher3.LauncherPrefs.APP_WIDGET_IDS; import static com.android.launcher3.LauncherPrefs.IS_FIRST_LOAD_AFTER_RESTORE; Loading @@ -30,7 +30,6 @@ import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPWIDG import static com.android.launcher3.backuprestore.LauncherRestoreEventLogger.RESTORE_ERROR_PROFILE_NOT_RESTORED; import static com.android.launcher3.backuprestore.LauncherRestoreEventLogger.RESTORE_ERROR_WIDGETS_DISABLED; import static com.android.launcher3.backuprestore.LauncherRestoreEventLogger.RESTORE_ERROR_WIDGET_REMOVED; import static com.android.launcher3.config.FeatureFlags.ENABLE_LAUNCHER_BR_METRICS; import static com.android.launcher3.provider.LauncherDbUtils.dropTable; import static com.android.launcher3.widget.LauncherWidgetHolder.APPWIDGET_HOST_ID; Loading Loading @@ -199,7 +198,7 @@ public class RestoreDbTask { Arrays.fill(args, "?"); final String where = "profileId NOT IN (" + TextUtils.join(", ", Arrays.asList(args)) + ")"; logFavoritesTable(db, "items to delete from unrestored profiles:", where, profileIds); if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { reportUnrestoredProfiles(db, where, profileIds, restoreEventLogger); } int itemsDeletedCount = db.delete(Favorites.TABLE_NAME, where, profileIds); Loading Loading @@ -361,7 +360,7 @@ public class RestoreDbTask { DeviceGridState deviceGridState = new DeviceGridState(context); FileLog.d(TAG, "restore initiated from backup: DeviceGridState=" + deviceGridState); LauncherPrefs.get(context).putSync(RESTORE_DEVICE.to(deviceGridState.getDeviceType())); if (enableLauncherBrMetrics() || ENABLE_LAUNCHER_BR_METRICS.get()) { if (enableLauncherBrMetricsFixed()) { LauncherPrefs.get(context).putSync(IS_FIRST_LOAD_AFTER_RESTORE.to(true)); } } Loading