From a474a9bcf5d533ac942c58409e45e5ec6d8b4893 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 4 May 2017 16:47:11 -0700 Subject: Simplifying logic for managed for icon addition > Checking for duplicate icons before adding new icons For O and above, icon addition is controlled using SessionCommitReceiver. As long as the Launcher is the default app, it will keep adding icons on the homescreen. Apps installed while launcher was not the default homescreen, no icons will be added. For below O, icons are added based on package event. As long as the Launcher process is running, it will keep adding icons on the homescreen. Apps installed while the launcher app was dead, no icons will be added. Bug: 37528649 Bug: 37082950 Bug: 34112546 Change-Id: Ic99501fa476c00474a479f2a36c24614bfa3f4bf --- .../src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.java b/tests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.java index 883be5aa3..4c80902f0 100644 --- a/tests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.java +++ b/tests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.java @@ -21,6 +21,7 @@ import org.mockito.ArgumentCaptor; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import static org.mockito.Mockito.any; import static org.mockito.Mockito.verify; @@ -50,7 +51,11 @@ public class AddWorkspaceItemsTaskTest extends BaseModelUpdateTaskTestCase { } private AddWorkspaceItemsTask newTask(ItemInfo... items) { - return new AddWorkspaceItemsTask(Provider.of(Arrays.asList(items))) { + List> list = new ArrayList<>(); + for (ItemInfo item : items) { + list.add(Pair.create(item, null)); + } + return new AddWorkspaceItemsTask(Provider.of(list)) { @Override protected void updateScreens(Context context, ArrayList workspaceScreens) { } -- cgit v1.2.3