Merge "Avoid sending FirstScreenBroadcast if there is nothing to send."

This commit is contained in:
Jon Miranda
2022-01-31 23:48:24 +00:00
committed by Android (Google) Code Review

View File

@@ -135,6 +135,13 @@ public class FirstScreenBroadcast {
printList(installerPackageName, "Widget item", widgetItems);
}
if (folderItems.isEmpty()
&& workspaceItems.isEmpty()
&& hotseatItems.isEmpty()
&& widgetItems.isEmpty()) {
// Avoid sending broadcast if there is nothing to send.
return;
}
context.sendBroadcast(new Intent(ACTION_FIRST_SCREEN_ACTIVE_INSTALLS)
.setPackage(installerPackageName)
.putStringArrayListExtra(FOLDER_ITEM_EXTRA, new ArrayList<>(folderItems))