Easier way to handle shortcuts
Change-Id: I91c4a25e961774de0bed51ba986802a1834173f9
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index db7a2ba..2634e21 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3643,9 +3643,8 @@
mWorkspaceLoading = false;
if (upgradePath) {
mWorkspace.saveWorkspaceToDb();
- ArrayList<ComponentName> allApps = constructAllAppsComponents();
- mWorkspace.stripDuplicateApps(allApps);
- mIntentsOnWorkspaceFromUpgradePath = mWorkspace.stripDuplicateApps(allApps);
+ mWorkspace.stripDuplicateApps();
+ mIntentsOnWorkspaceFromUpgradePath = mWorkspace.stripDuplicateApps();
}
mWorkspace.post(new Runnable() {
@@ -3656,25 +3655,6 @@
});
}
- private ArrayList<ComponentName> constructAllAppsComponents() {
- // Run through this twice... a little hackleberry, but the right solution is complex.
- final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
- mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
-
- List<ResolveInfo> apps = getPackageManager().queryIntentActivities(mainIntent, 0);
- ArrayList<ComponentName> allApps = new ArrayList<ComponentName>();
-
- int count = apps.size();
- for (int i = 0; i < count; i++) {
- ActivityInfo ai = apps.get(i).activityInfo;
-
- ComponentName cn =
- new ComponentName(ai.applicationInfo.packageName, ai.name);
- allApps.add(cn);
- }
- return allApps;
- }
-
private boolean canRunNewAppsAnimation() {
long diff = System.currentTimeMillis() - mDragController.getLastGestureUpTime();
return diff > (NEW_APPS_ANIMATION_INACTIVE_TIMEOUT_SECONDS * 1000);