mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
add metrics for when db grid migration fails
Flag: ACONFIG enable_launcher_br_metrics TEAMFOOD Test: locally verified Bug: 307527314 Change-Id: Iab84a337d76d63bb3bc2ed81fdf4b6fd50dc5661
This commit is contained in:
@@ -18,6 +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.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;
|
||||
@@ -232,8 +233,11 @@ public class LoaderTask implements Runnable {
|
||||
LoaderMemoryLogger memoryLogger = new LoaderMemoryLogger();
|
||||
mIsRestoreFromBackup =
|
||||
(Boolean) LauncherPrefs.get(mApp.getContext()).get(IS_FIRST_LOAD_AFTER_RESTORE);
|
||||
LauncherRestoreEventLogger restoreEventLogger = LauncherRestoreEventLogger
|
||||
.Companion.newInstance(mApp.getContext());
|
||||
LauncherRestoreEventLogger restoreEventLogger = null;
|
||||
if (enableLauncherBrMetrics()) {
|
||||
restoreEventLogger = LauncherRestoreEventLogger.Companion
|
||||
.newInstance(mApp.getContext());
|
||||
}
|
||||
try (LauncherModel.LoaderTransaction transaction = mApp.getModel().beginLoader(this)) {
|
||||
|
||||
List<ShortcutInfo> allShortcuts = new ArrayList<>();
|
||||
@@ -364,9 +368,11 @@ public class LoaderTask implements Runnable {
|
||||
transaction.commit();
|
||||
memoryLogger.clearLogs();
|
||||
if (mIsRestoreFromBackup) {
|
||||
restoreEventLogger.reportLauncherRestoreResults();
|
||||
mIsRestoreFromBackup = false;
|
||||
LauncherPrefs.get(mApp.getContext()).putSync(IS_FIRST_LOAD_AFTER_RESTORE.to(false));
|
||||
if (restoreEventLogger != null) {
|
||||
restoreEventLogger.reportLauncherRestoreResults();
|
||||
}
|
||||
}
|
||||
} catch (CancellationException e) {
|
||||
// Loader stopped, ignore
|
||||
@@ -421,7 +427,7 @@ public class LoaderTask implements Runnable {
|
||||
final WidgetManagerHelper widgetHelper = new WidgetManagerHelper(context);
|
||||
|
||||
ModelDbController dbController = mApp.getModel().getModelDbController();
|
||||
dbController.tryMigrateDB();
|
||||
dbController.tryMigrateDB(restoreEventLogger);
|
||||
Log.d(TAG, "loadWorkspace: loading default favorites");
|
||||
dbController.loadDefaultFavoritesIfNecessary();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user