summaryrefslogtreecommitdiffstats
path: root/core/java/android/content
diff options
context:
space:
mode:
authorMihai Preda <preda@google.com>2009-05-13 10:13:48 +0200
committerMihai Preda <preda@google.com>2009-05-15 12:32:07 +0200
commiteae850cefe7e149f396c9e8ca1f34ec02b20a3f0 (patch)
treea4e19d75aeef5529a0a8084d513638890afac2cd /core/java/android/content
parent75986cf9bc57ef11ad70f36fb77fbbf5d63af6ec (diff)
downloadframeworks_base-eae850cefe7e149f396c9e8ca1f34ec02b20a3f0.zip
frameworks_base-eae850cefe7e149f396c9e8ca1f34ec02b20a3f0.tar.gz
frameworks_base-eae850cefe7e149f396c9e8ca1f34ec02b20a3f0.tar.bz2
Allow intent resolution to be constrained by package name.
Diffstat (limited to 'core/java/android/content')
-rw-r--r--core/java/android/content/pm/IPackageManager.aidl3
-rw-r--r--core/java/android/content/pm/PackageManager.java22
2 files changed, 22 insertions, 3 deletions
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index c199619..bb913cd 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -81,6 +81,9 @@ interface IPackageManager {
ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags);
+ ResolveInfo resolveIntentForPackage(in Intent intent, String resolvedType, int flags,
+ String packageName);
+
List<ResolveInfo> queryIntentActivities(in Intent intent,
String resolvedType, int flags);
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 3a192f7..eecbce4 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -563,9 +563,8 @@ public abstract class PackageManager {
* launch the main activity in the package, or null if the package does
* not contain such an activity.
*/
- public abstract Intent getLaunchIntentForPackage(String packageName)
- throws NameNotFoundException;
-
+ public abstract Intent getLaunchIntentForPackage(String packageName);
+
/**
* Return an array of all of the secondary group-ids that have been
* assigned to a package.
@@ -971,6 +970,23 @@ public abstract class PackageManager {
public abstract ResolveInfo resolveActivity(Intent intent, int flags);
/**
+ * Resolve the intent restricted to a package.
+ * {@see #resolveActivity}
+ *
+ * @param intent An intent containing all of the desired specification
+ * (action, data, type, category, and/or component).
+ * @param flags Additional option flags. The most important is
+ * MATCH_DEFAULT_ONLY, to limit the resolution to only
+ * those activities that support the CATEGORY_DEFAULT.
+ * @param packageName Restrict the intent resolution to this package.
+ *
+ * @return Returns a ResolveInfo containing the final activity intent that
+ * was determined to be the best action. Returns null if no
+ * matching activity was found.
+ */
+ public abstract ResolveInfo resolveActivity(Intent intent, int flags, String packageName);
+
+ /**
* Retrieve all activities that can be performed for the given intent.
*
* @param intent The desired intent as per resolveActivity().