summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/ContextImpl.java15
-rw-r--r--core/java/android/content/pm/IPackageManager.aidl2
-rw-r--r--core/java/android/content/pm/PackageManager.java46
3 files changed, 51 insertions, 12 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index f6ce19d..879670e 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -1845,6 +1845,21 @@ class ContextImpl extends Context {
}
@Override
+ public ProviderInfo getProviderInfo(ComponentName className, int flags)
+ throws NameNotFoundException {
+ try {
+ ProviderInfo pi = mPM.getProviderInfo(className, flags);
+ if (pi != null) {
+ return pi;
+ }
+ } catch (RemoteException e) {
+ throw new RuntimeException("Package manager has died", e);
+ }
+
+ throw new NameNotFoundException(className.toString());
+ }
+
+ @Override
public String[] getSystemSharedLibraryNames() {
try {
return mPM.getSystemSharedLibraryNames();
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index 160a481..4cff3bb 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -68,6 +68,8 @@ interface IPackageManager {
ServiceInfo getServiceInfo(in ComponentName className, int flags);
+ ProviderInfo getProviderInfo(in ComponentName className, int flags);
+
int checkPermission(String permName, String pkgName);
int checkUidPermission(String permName, int uid);
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index b14555a..7f166cf 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -996,9 +996,9 @@ public abstract class PackageManager {
* <p>Throws {@link NameNotFoundException} if an activity with the given
* class name can not be found on the system.
*
- * @param className The full name (i.e.
- * com.google.apps.contacts.ContactsList) of an Activity
- * class.
+ * @param component The full component name (i.e.
+ * com.google.apps.contacts/com.google.apps.contacts.ContactsList) of an Activity
+ * class.
* @param flags Additional option flags. Use any combination of
* {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES},
* to modify the data (in ApplicationInfo) returned.
@@ -1009,7 +1009,7 @@ public abstract class PackageManager {
* @see #GET_META_DATA
* @see #GET_SHARED_LIBRARY_FILES
*/
- public abstract ActivityInfo getActivityInfo(ComponentName className,
+ public abstract ActivityInfo getActivityInfo(ComponentName component,
int flags) throws NameNotFoundException;
/**
@@ -1019,9 +1019,9 @@ public abstract class PackageManager {
* <p>Throws {@link NameNotFoundException} if a receiver with the given
* class name can not be found on the system.
*
- * @param className The full name (i.e.
- * com.google.apps.contacts.CalendarAlarm) of a Receiver
- * class.
+ * @param component The full component name (i.e.
+ * com.google.apps.calendar/com.google.apps.calendar.CalendarAlarm) of a Receiver
+ * class.
* @param flags Additional option flags. Use any combination of
* {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES},
* to modify the data returned.
@@ -1032,7 +1032,7 @@ public abstract class PackageManager {
* @see #GET_META_DATA
* @see #GET_SHARED_LIBRARY_FILES
*/
- public abstract ActivityInfo getReceiverInfo(ComponentName className,
+ public abstract ActivityInfo getReceiverInfo(ComponentName component,
int flags) throws NameNotFoundException;
/**
@@ -1042,9 +1042,9 @@ public abstract class PackageManager {
* <p>Throws {@link NameNotFoundException} if a service with the given
* class name can not be found on the system.
*
- * @param className The full name (i.e.
- * com.google.apps.media.BackgroundPlayback) of a Service
- * class.
+ * @param component The full component name (i.e.
+ * com.google.apps.media/com.google.apps.media.BackgroundPlayback) of a Service
+ * class.
* @param flags Additional option flags. Use any combination of
* {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES},
* to modify the data returned.
@@ -1054,7 +1054,29 @@ public abstract class PackageManager {
* @see #GET_META_DATA
* @see #GET_SHARED_LIBRARY_FILES
*/
- public abstract ServiceInfo getServiceInfo(ComponentName className,
+ public abstract ServiceInfo getServiceInfo(ComponentName component,
+ int flags) throws NameNotFoundException;
+
+ /**
+ * Retrieve all of the information we know about a particular content
+ * provider class.
+ *
+ * <p>Throws {@link NameNotFoundException} if a provider with the given
+ * class name can not be found on the system.
+ *
+ * @param component The full component name (i.e.
+ * com.google.providers.media/com.google.providers.media.MediaProvider) of a
+ * ContentProvider class.
+ * @param flags Additional option flags. Use any combination of
+ * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES},
+ * to modify the data returned.
+ *
+ * @return ProviderInfo containing information about the service.
+ *
+ * @see #GET_META_DATA
+ * @see #GET_SHARED_LIBRARY_FILES
+ */
+ public abstract ProviderInfo getProviderInfo(ComponentName component,
int flags) throws NameNotFoundException;
/**