From c3009c06d9e09054191a207349e08a2e7660a776 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Wed, 20 Aug 2014 09:41:21 -0400 Subject: [PATCH] Change URI favorite resolving to use launch intents Rather than dropping the user in the middle of the app wherever our intent resolves to, add a shortcut to the launch intent of the app that handles that intent. Bug: 16459162 Change-Id: I58256cdc9dc1b3441815f60cc354b60f91fb1a16 --- src/com/android/launcher3/LauncherProvider.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java index af655367a5..842e0b0ffe 100644 --- a/src/com/android/launcher3/LauncherProvider.java +++ b/src/com/android/launcher3/LauncherProvider.java @@ -1650,8 +1650,10 @@ public class LauncherProvider extends ContentProvider { resolved = systemApp; } final ActivityInfo info = resolved.activityInfo; - final Intent intent = buildMainIntent(); - intent.setComponent(new ComponentName(info.packageName, info.name)); + final Intent intent = mPackageManager.getLaunchIntentForPackage(info.packageName); + if (intent == null) { + return -1; + } intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);