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
diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java
index af65536..842e0b0 100644
--- a/src/com/android/launcher3/LauncherProvider.java
+++ b/src/com/android/launcher3/LauncherProvider.java
@@ -1650,8 +1650,10 @@
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);