diff options
author | Adam Cohen <adamcohen@google.com> | 2013-06-14 15:33:35 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2013-06-14 15:33:47 -0700 |
commit | a0b5749433c66b6fed5c6026414ef438a938089b (patch) | |
tree | 2e92f719dcca4169c27654ec2954fd9a1005cf0a /src/com/android/launcher3/Launcher.java | |
parent | 99894d9bb73fdc4bf9bba8423b5c5d5715a4f5d5 (diff) | |
download | android_packages_apps_Trebuchet-a0b5749433c66b6fed5c6026414ef438a938089b.tar.gz android_packages_apps_Trebuchet-a0b5749433c66b6fed5c6026414ef438a938089b.tar.bz2 android_packages_apps_Trebuchet-a0b5749433c66b6fed5c6026414ef438a938089b.zip |
Easier way to handle shortcuts
Change-Id: I91c4a25e961774de0bed51ba986802a1834173f9
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index db7a2ba76..2634e21de 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -3643,9 +3643,8 @@ public class Launcher extends Activity 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 @@ public class Launcher extends Activity }); } - 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); |