diff options
| author | Dianne Hackborn <hackbod@google.com> | 2009-06-17 18:02:12 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2009-06-17 21:48:14 -0700 |
| commit | c14b9ccdf13163cae5ce5d21bcf377010b37594b (patch) | |
| tree | 45c2309b18ff4e56aef65e0c7d66f8800492e33e /core/java/android/app | |
| parent | e64bb1dd9ed68281af9968cf2cd23b4e49ead76c (diff) | |
| download | frameworks_base-c14b9ccdf13163cae5ce5d21bcf377010b37594b.zip frameworks_base-c14b9ccdf13163cae5ce5d21bcf377010b37594b.tar.gz frameworks_base-c14b9ccdf13163cae5ce5d21bcf377010b37594b.tar.bz2 | |
Extend Intent/Uri conversion for use by Browser
This introduces a new Uri form of Intent with an "intent:" scheme, and a
corresponding update to the parser to handle these, so that the browser
can use this generic facility for starting activities based on the links
that are clicked and allow for web pages to link to arbitrary intents.
There is also a new "package" field on Intent which allows you to limit
the components it finds to a given package. This replaces the new method
that was added to PackageManger for doing this when resolving activities,
and implements it for all Intent queries against the package manager.
Diffstat (limited to 'core/java/android/app')
| -rw-r--r-- | core/java/android/app/ApplicationContext.java | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/core/java/android/app/ApplicationContext.java b/core/java/android/app/ApplicationContext.java index fa3d5c2..23daf12 100644 --- a/core/java/android/app/ApplicationContext.java +++ b/core/java/android/app/ApplicationContext.java @@ -1519,14 +1519,16 @@ class ApplicationContext extends Context { // overall package (such as if it has multiple launcher entries). Intent intentToResolve = new Intent(Intent.ACTION_MAIN); intentToResolve.addCategory(Intent.CATEGORY_INFO); - ResolveInfo resolveInfo = resolveActivity(intentToResolve, 0, packageName); + intentToResolve.setPackage(packageName); + ResolveInfo resolveInfo = resolveActivity(intentToResolve, 0); // Otherwise, try to find a main launcher activity. if (resolveInfo == null) { // reuse the intent instance intentToResolve.removeCategory(Intent.CATEGORY_INFO); intentToResolve.addCategory(Intent.CATEGORY_LAUNCHER); - resolveInfo = resolveActivity(intentToResolve, 0, packageName); + intentToResolve.setPackage(packageName); + resolveInfo = resolveActivity(intentToResolve, 0); } if (resolveInfo == null) { return null; @@ -1774,19 +1776,6 @@ class ApplicationContext extends Context { } @Override - public ResolveInfo resolveActivity(Intent intent, int flags, String packageName) { - try { - return mPM.resolveIntentForPackage( - intent, - intent.resolveTypeIfNeeded(mContext.getContentResolver()), - flags, - packageName); - } catch (RemoteException e) { - throw new RuntimeException("Package manager has died", e); - } - } - - @Override public List<ResolveInfo> queryIntentActivities(Intent intent, int flags) { try { |
