Add new failsafe to disable new archiving broadcast

Bug: 322314760
Test: presubmit and LoaderTaskTest
Flag: com.android.launcher3.enable_first_screen_broadcast_archiving_extras

Change-Id: I7c7b94a81dd717ed6f32de2ae986616b93dbbcc0
This commit is contained in:
Charlie Anderson committed 2024-12-11 18:59:05 -05:00
1 parent 72fe47d329
commit 2885a6639c
2 files changed
+65 -86

No files matched your search

@@ -213,13 +213,13 @@ public class LoaderTask implements Runnable {
ArrayList<ItemInfo> firstScreenItems = new ArrayList<>();
filterCurrentWorkspaceItems(firstScreens, allItems, firstScreenItems,
new ArrayList<>() /* otherScreenItems are ignored */);
final int launcherBroadcastInstalledApps = Settings.Secure.getInt(
final int disableArchivingLauncherBroadcast = Settings.Secure.getInt(
mApp.getContext().getContentResolver(),
"launcher_broadcast_installed_apps",
/* def= */ 0);
"disable_launcher_broadcast_installed_apps",
/* default */ 0);
boolean shouldAttachArchivingExtras = mIsRestoreFromBackup
&& (launcherBroadcastInstalledApps == 1
|| Flags.enableFirstScreenBroadcastArchivingExtras());
&& disableArchivingLauncherBroadcast == 0
&& Flags.enableFirstScreenBroadcastArchivingExtras();
if (shouldAttachArchivingExtras) {
List<FirstScreenBroadcastModel> broadcastModels =
FirstScreenBroadcastHelper.createModelsForFirstScreenBroadcast(
@@ -231,6 +231,7 @@ public class LoaderTask implements Runnable {
logASplit("Sending first screen broadcast with additional archiving Extras");
FirstScreenBroadcastHelper.sendBroadcastsForModels(mApp.getContext(), broadcastModels);
} else {
logASplit("Sending first screen broadcast");
mFirstScreenBroadcast.sendBroadcasts(mApp.getContext(), firstScreenItems);
}
}
@@ -276,7 +277,6 @@ public class LoaderTask implements Runnable {
mModelDelegate.workspaceLoadComplete();
// Notify the installer packages of packages with active installs on the first screen.
sendFirstScreenActiveInstallsBroadcast();
logASplit("sendFirstScreenBroadcast finished");
// Take a break
waitForIdle();