PackageManagerpublic abstract class PackageManager extends Object Class for retrieving various kinds of information related to the application
packages that are currently installed on the device.
You can find this class through {@link Context#getPackageManager}. |
Fields Summary |
---|
public static final int | GET_ACTIVITIES{@link PackageInfo} flag: return information about
activities in the package in {@link PackageInfo#activities}. | public static final int | GET_RECEIVERS{@link PackageInfo} flag: return information about
intent receivers in the package in
{@link PackageInfo#receivers}. | public static final int | GET_SERVICES{@link PackageInfo} flag: return information about
services in the package in {@link PackageInfo#services}. | public static final int | GET_PROVIDERS{@link PackageInfo} flag: return information about
content providers in the package in
{@link PackageInfo#providers}. | public static final int | GET_INSTRUMENTATION{@link PackageInfo} flag: return information about
instrumentation in the package in
{@link PackageInfo#instrumentation}. | public static final int | GET_INTENT_FILTERS{@link PackageInfo} flag: return information about the
intent filters supported by the activity. | public static final int | GET_SIGNATURES{@link PackageInfo} flag: return information about the
signatures included in the package. | public static final int | GET_RESOLVED_FILTER{@link ResolveInfo} flag: return the IntentFilter that
was matched for a particular ResolveInfo in
{@link ResolveInfo#filter}. | public static final int | GET_META_DATA{@link ComponentInfo} flag: return the {@link ComponentInfo#metaData}
data {@link android.os.Bundle}s that are associated with a component.
This applies for any API returning a ComponentInfo subclass. | public static final int | GET_GIDS{@link PackageInfo} flag: return the
{@link PackageInfo#gids group ids} that are associated with an
application.
This applies for any API returning an PackageInfo class, either
directly or nested inside of another. | public static final int | GET_DISABLED_COMPONENTS{@link PackageInfo} flag: include disabled components in the returned info. | public static final int | GET_SHARED_LIBRARY_FILES{@link ApplicationInfo} flag: return the
{@link ApplicationInfo#sharedLibraryFiles paths to the shared libraries}
that are associated with an application.
This applies for any API returning an ApplicationInfo class, either
directly or nested inside of another. | public static final int | GET_URI_PERMISSION_PATTERNS{@link ProviderInfo} flag: return the
{@link ProviderInfo#uriPermissionPatterns URI permission patterns}
that are associated with a content provider.
This applies for any API returning an ProviderInfo class, either
directly or nested inside of another. | public static final int | GET_PERMISSIONS{@link PackageInfo} flag: return information about
permissions in the package in
{@link PackageInfo#permissions}. | public static final int | GET_UNINSTALLED_PACKAGESFlag parameter to retrieve all applications(even uninstalled ones) with data directories.
This state could have resulted if applications have been deleted with flag
DONT_DELETE_DATA
with a possibility of being replaced or reinstalled in future | public static final int | GET_CONFIGURATIONS{@link PackageInfo} flag: return information about
hardware preferences
{@link PackageInfo#configPreferences} | public static final int | PERMISSION_GRANTEDPermission check result: this is returned by {@link #checkPermission}
if the permission has been granted to the given package. | public static final int | PERMISSION_DENIEDPermission check result: this is returned by {@link #checkPermission}
if the permission has not been granted to the given package. | public static final int | SIGNATURE_MATCHSignature check result: this is returned by {@link #checkSignatures}
if the two packages have a matching signature. | public static final int | SIGNATURE_NEITHER_SIGNEDSignature check result: this is returned by {@link #checkSignatures}
if neither of the two packages is signed. | public static final int | SIGNATURE_FIRST_NOT_SIGNEDSignature check result: this is returned by {@link #checkSignatures}
if the first package is not signed, but the second is. | public static final int | SIGNATURE_SECOND_NOT_SIGNEDSignature check result: this is returned by {@link #checkSignatures}
if the second package is not signed, but the first is. | public static final int | SIGNATURE_NO_MATCHSignature check result: this is returned by {@link #checkSignatures}
if both packages are signed but there is no matching signature. | public static final int | SIGNATURE_UNKNOWN_PACKAGESignature check result: this is returned by {@link #checkSignatures}
if either of the given package names are not valid. | public static final int | MATCH_DEFAULT_ONLYResolution and querying flag: if set, only filters that support the
{@link android.content.Intent#CATEGORY_DEFAULT} will be considered for
matching. This is a synonym for including the CATEGORY_DEFAULT in your
supplied Intent. | public static final int | COMPONENT_ENABLED_STATE_DEFAULT | public static final int | COMPONENT_ENABLED_STATE_ENABLED | public static final int | COMPONENT_ENABLED_STATE_DISABLED | public static final int | FORWARD_LOCK_PACKAGEFlag parameter for {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} to
indicate that this package should be installed as forward locked, i.e. only the app itself
should have access to it's code and non-resource assets. | public static final int | REPLACE_EXISTING_PACKAGEFlag parameter for {@link #installPackage} to indicate that you want to replace an already
installed package, if one exists | public static final int | DONT_KILL_APPFlag parameter for
{@link #setComponentEnabledSetting(android.content.ComponentName, int, int)} to indicate
that you don't want to kill the app containing the component. Be careful when you set this
since changing component states can make the containing application's behavior unpredictable. | public static final int | INSTALL_SUCCEEDEDInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} on success. | public static final int | INSTALL_FAILED_ALREADY_EXISTSInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if the package is
already installed. | public static final int | INSTALL_FAILED_INVALID_APKInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if the package archive
file is invalid. | public static final int | INSTALL_FAILED_INVALID_URIInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if the URI passed in
is invalid. | public static final int | INSTALL_FAILED_INSUFFICIENT_STORAGEInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if the package manager
service found that the device didn't have enough storage space to install the app | public static final int | INSTALL_FAILED_DUPLICATE_PACKAGEInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if a
package is already installed with the same name. | public static final int | INSTALL_FAILED_NO_SHARED_USERInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
the requested shared user does not exist. | public static final int | INSTALL_FAILED_UPDATE_INCOMPATIBLEInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
a previously installed package of the same name has a different signature
than the new package (and the old package's data was not removed). | public static final int | INSTALL_FAILED_SHARED_USER_INCOMPATIBLEInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
the new package is requested a shared user which is already installed on the
device and does not have matching signature. | public static final int | INSTALL_FAILED_MISSING_SHARED_LIBRARYInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
the new package uses a shared library that is not available. | public static final int | INSTALL_FAILED_REPLACE_COULDNT_DELETEInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
the new package uses a shared library that is not available. | public static final int | INSTALL_FAILED_DEXOPTInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
the new package failed while optimizing and validating its dex files,
either because there was not enough storage or the validation failed. | public static final int | INSTALL_FAILED_OLDER_SDKInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
the new package failed because the current SDK version is older than
that required by the package. | public static final int | INSTALL_FAILED_CONFLICTING_PROVIDERInstallation return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
the new package failed because it contains a content provider with the
same authority as a provider already installed in the system. | public static final int | INSTALL_PARSE_FAILED_NOT_APKInstallation parse return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
if the parser was given a path that is not a file, or does not end with the expected
'.apk' extension. | public static final int | INSTALL_PARSE_FAILED_BAD_MANIFESTInstallation parse return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
if the parser was unable to retrieve the AndroidManifest.xml file. | public static final int | INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTIONInstallation parse return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
if the parser encountered an unexpected exception. | public static final int | INSTALL_PARSE_FAILED_NO_CERTIFICATESInstallation parse return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
if the parser did not find any certificates in the .apk. | public static final int | INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATESInstallation parse return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
if the parser found inconsistent certificates on the files in the .apk. | public static final int | INSTALL_PARSE_FAILED_CERTIFICATE_ENCODINGInstallation parse return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
if the parser encountered a CertificateEncodingException in one of the
files in the .apk. | public static final int | INSTALL_PARSE_FAILED_BAD_PACKAGE_NAMEInstallation parse return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
if the parser encountered a bad or missing package name in the manifest. | public static final int | INSTALL_PARSE_FAILED_BAD_SHARED_USER_IDInstallation parse return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
if the parser encountered a bad shared user id name in the manifest. | public static final int | INSTALL_PARSE_FAILED_MANIFEST_MALFORMEDInstallation parse return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
if the parser encountered some structural problem in the manifest. | public static final int | INSTALL_PARSE_FAILED_MANIFEST_EMPTYInstallation parse return code: this is passed to the {@link IPackageInstallObserver} by
{@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
if the parser did not find any actionable tags (instrumentation or application)
in the manifest. | public static final int | PKG_INSTALL_INCOMPLETEIndicates the state of installation. Used by PackageManager to
figure out incomplete installations. Say a package is being installed
(the state is set to PKG_INSTALL_INCOMPLETE) and remains so till
the package installation is successful or unsuccesful lin which case
the PackageManager will no longer maintain state information associated
with the package. If some exception(like device freeze or battery being
pulled out) occurs during installation of a package, the PackageManager
needs this information to clean up the previously failed installation. | public static final int | PKG_INSTALL_COMPLETE | public static final int | DONT_DELETE_DATAFlag parameter for {@link #deletePackage} to indicate that you don't want to delete the
package's data directory. |
Methods Summary |
---|
public abstract void | addPackageToPreferred(java.lang.String packageName)Add a new package to the list of preferred packages. This new package
will be added to the front of the list (removed from its current location
if already listed), meaning it will now be preferred over all other
packages when resolving conflicts.
| public abstract boolean | addPermission(PermissionInfo info)Add a new dynamic permission to the system. For this to work, your
package must have defined a permission tree through the
{@link android.R.styleable#AndroidManifestPermissionTree
<permission-tree>} tag in its manifest. A package can only add
permissions to trees that were defined by either its own package or
another with the same user id; a permission is in a tree if it
matches the name of the permission tree + ".": for example,
"com.foo.bar" is a member of the permission tree "com.foo".
It is good to make your permission tree name descriptive, because you
are taking possession of that entire set of permission names. Thus, it
must be under a domain you control, with a suffix that will not match
any normal permissions that may be declared in any applications that
are part of that domain.
New permissions must be added before
any .apks are installed that use those permissions. Permissions you
add through this method are remembered across reboots of the device.
If the given permission already exists, the info you supply here
will be used to update it.
| public abstract void | addPreferredActivity(android.content.IntentFilter filter, int match, android.content.ComponentName[] set, android.content.ComponentName activity)Add a new preferred activity mapping to the system. This will be used
to automatically select the given activity component when
{@link Context#startActivity(Intent) Context.startActivity()} finds
multiple matching activities and also matches the given filter.
| public abstract int | checkPermission(java.lang.String permName, java.lang.String pkgName)Check whether a particular package has been granted a particular
permission.
| public abstract int | checkSignatures(java.lang.String pkg1, java.lang.String pkg2)Compare the signatures of two packages to determine if the same
signature appears in both of them. If they do contain the same
signature, then they are allowed special privileges when working
with each other: they can share the same user-id, run instrumentation
against each other, etc.
| public abstract void | clearApplicationUserData(java.lang.String packageName, IPackageDataObserver observer)Attempts to clear the user data directory of an application.
Since this may take a little while, the result will
be posted back to the given observer. A deletion will fail if the
named package cannot be found, or if the named package is a "system package".
| public abstract void | clearPackagePreferredActivities(java.lang.String packageName)Remove all preferred activity mappings, previously added with
{@link #addPreferredActivity}, from the
system whose activities are implemented in the given package name.
| public abstract void | deleteApplicationCacheFiles(java.lang.String packageName, IPackageDataObserver observer)Attempts to delete the cache files associated with an application.
Since this may take a little while, the result will
be posted back to the given observer. A deletion will fail if the calling context
lacks the {@link android.Manifest.permission#DELETE_CACHE_FILES} permission, if the
named package cannot be found, or if the named package is a "system package".
| public abstract void | deletePackage(java.lang.String packageName, IPackageDeleteObserver observer, int flags)Attempts to delete a package. Since this may take a little while, the result will
be posted back to the given observer. A deletion will fail if the calling context
lacks the {@link android.Manifest.permission#DELETE_PACKAGES} permission, if the
named package cannot be found, or if the named package is a "system package".
(TODO: include pointer to documentation on "system packages")
| public abstract void | freeStorage(long freeStorageSize, android.app.PendingIntent opFinishedIntent)Free storage by deleting LRU sorted list of cache files across
all applications. If the currently available free storage
on the device is greater than or equal to the requested
free storage, no cache files are cleared. If the currently
available storage on the device is less than the requested
free storage, some or all of the cache files across
all applications are deleted (based on last accessed time)
to increase the free storage space on the device to
the requested value. There is no guarantee that clearing all
the cache files from all applications will clear up
enough storage to achieve the desired value.
| public abstract void | freeStorageAndNotify(long freeStorageSize, IPackageDataObserver observer)Free storage by deleting LRU sorted list of cache files across
all applications. If the currently available free storage
on the device is greater than or equal to the requested
free storage, no cache files are cleared. If the currently
available storage on the device is less than the requested
free storage, some or all of the cache files across
all applications are deleted (based on last accessed time)
to increase the free storage space on the device to
the requested value. There is no guarantee that clearing all
the cache files from all applications will clear up
enough storage to achieve the desired value.
| public abstract android.graphics.drawable.Drawable | getActivityIcon(android.content.ComponentName activityName)Retrieve the icon associated with an activity. Given the full name of
an activity, retrieves the information about it and calls
{@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its icon.
If the activity can not be found, NameNotFoundException is thrown.
| public abstract android.graphics.drawable.Drawable | getActivityIcon(android.content.Intent intent)Retrieve the icon associated with an Intent. If intent.getClassName() is
set, this simply returns the result of
getActivityIcon(intent.getClassName()). Otherwise it resolves the intent's
component and returns the icon associated with the resolved component.
If intent.getClassName() can not be found or the Intent can not be resolved
to a component, NameNotFoundException is thrown.
| public abstract ActivityInfo | getActivityInfo(android.content.ComponentName className, int flags)Retrieve all of the information we know about a particular activity
class.
Throws {@link NameNotFoundException} if an activity with the given
class name can not be found on the system.
| public abstract java.util.List | getAllPermissionGroups(int flags)Retrieve all of the known permission groups in the system.
| public abstract int | getApplicationEnabledSetting(java.lang.String packageName)Return the the enabled setting for an application. This returns
the last value set by
{@link #setApplicationEnabledSetting(String, int, int)}; in most
cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since
the value originally specified in the manifest has not been modified.
| public abstract android.graphics.drawable.Drawable | getApplicationIcon(ApplicationInfo info)Retrieve the icon associated with an application. If it has not defined
an icon, the default app icon is returned. Does not return null.
| public abstract android.graphics.drawable.Drawable | getApplicationIcon(java.lang.String packageName)Retrieve the icon associated with an application. Given the name of the
application's package, retrieves the information about it and calls
getApplicationIcon() to return its icon. If the application can not be
found, NameNotFoundException is thrown.
| public abstract ApplicationInfo | getApplicationInfo(java.lang.String packageName, int flags)Retrieve all of the information we know about a particular
package/application.
Throws {@link NameNotFoundException} if an application with the given
package name can not be found on the system.
| public abstract java.lang.CharSequence | getApplicationLabel(ApplicationInfo info)Return the label to use for this application.
| public abstract int | getComponentEnabledSetting(android.content.ComponentName componentName)Return the the enabled setting for a package component (activity,
receiver, service, provider). This returns the last value set by
{@link #setComponentEnabledSetting(ComponentName, int, int)}; in most
cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since
the value originally specified in the manifest has not been modified.
| public abstract android.graphics.drawable.Drawable | getDefaultActivityIcon()Return the generic icon for an activity that is used when no specific
icon is defined.
| public abstract android.graphics.drawable.Drawable | getDrawable(java.lang.String packageName, int resid, ApplicationInfo appInfo)Retrieve an image from a package. This is a low-level API used by
the various package manager info structures (such as
{@link ComponentInfo} to implement retrieval of their associated
icon.
| public abstract java.util.List | getInstalledApplications(int flags)Return a List of all application packages that are installed on the
device. If flag GET_UNINSTALLED_PACKAGES has been set, a list of all
applications including those deleted with DONT_DELETE_DATA(partially
installed apps with data directory) will be returned.
| public abstract java.util.List | getInstalledPackages(int flags)Return a List of all packages that are installed
on the device.
| public abstract InstrumentationInfo | getInstrumentationInfo(android.content.ComponentName className, int flags)Retrieve all of the information we know about a particular
instrumentation class.
Throws {@link NameNotFoundException} if instrumentation with the
given class name can not be found on the system.
| public abstract android.content.Intent | getLaunchIntentForPackage(java.lang.String packageName)Return a "good" intent to launch a front-door activity in a package,
for use for example to implement an "open" button when browsing through
packages. The current implementation will look first for a main
activity in the category {@link Intent#CATEGORY_INFO}, next for a
main activity in the category {@link Intent#CATEGORY_LAUNCHER}, or return
null if neither are found.
Throws {@link NameNotFoundException} if a package with the given
name can not be found on the system.
| public abstract java.lang.String | getNameForUid(int uid)Retrieve the official name associated with a user id. This name is
guaranteed to never change, though it is possibly for the underlying
user id to be changed. That is, if you are storing information about
user ids in persistent storage, you should use the string returned
by this function instead of the raw user-id.
| public PackageInfo | getPackageArchiveInfo(java.lang.String archiveFilePath, int flags)Retrieve overall information about an application package defined
in a package archive file
PackageParser packageParser = new PackageParser(archiveFilePath);
DisplayMetrics metrics = new DisplayMetrics();
metrics.setToDefaults();
final File sourceFile = new File(archiveFilePath);
PackageParser.Package pkg = packageParser.parsePackage(
sourceFile, archiveFilePath, metrics, 0);
if (pkg == null) {
return null;
}
return PackageParser.generatePackageInfo(pkg, null, flags);
| public abstract int[] | getPackageGids(java.lang.String packageName)Return an array of all of the secondary group-ids that have been
assigned to a package.
Throws {@link NameNotFoundException} if a package with the given
name can not be found on the system.
| public abstract PackageInfo | getPackageInfo(java.lang.String packageName, int flags)Retrieve overall information about an application package that is
installed on the system.
Throws {@link NameNotFoundException} if a package with the given
name can not be found on the system.
| public abstract void | getPackageSizeInfo(java.lang.String packageName, IPackageStatsObserver observer)Retrieve the size information for a package.
Since this may take a little while, the result will
be posted back to the given observer. The calling context
should have the {@link android.Manifest.permission#GET_PACKAGE_SIZE} permission.
| public abstract java.lang.String[] | getPackagesForUid(int uid)Retrieve the names of all packages that are associated with a particular
user id. In most cases, this will be a single package name, the package
that has been assigned that user id. Where there are multiple packages
sharing the same user id through the "sharedUserId" mechanism, all
packages with that id will be returned.
| public abstract PermissionGroupInfo | getPermissionGroupInfo(java.lang.String name, int flags)Retrieve all of the information we know about a particular group of
permissions.
Throws {@link NameNotFoundException} if a permission group with the given
name can not be found on the system.
| public abstract PermissionInfo | getPermissionInfo(java.lang.String name, int flags)Retrieve all of the information we know about a particular permission.
Throws {@link NameNotFoundException} if a permission with the given
name can not be found on the system.
| public abstract int | getPreferredActivities(java.util.List outFilters, java.util.List outActivities, java.lang.String packageName)Retrieve all preferred activities, previously added with
{@link #addPreferredActivity}, that are
currently registered with the system.
| public abstract java.util.List | getPreferredPackages(int flags)Retrieve the list of all currently configured preferred packages. The
first package on the list is the most preferred, the last is the
least preferred.
| public abstract ActivityInfo | getReceiverInfo(android.content.ComponentName className, int flags)Retrieve all of the information we know about a particular receiver
class.
Throws {@link NameNotFoundException} if a receiver with the given
class name can not be found on the system.
| public abstract android.content.res.Resources | getResourcesForActivity(android.content.ComponentName activityName)Retrieve the resources associated with an activity. Given the full
name of an activity, retrieves the information about it and calls
getResources() to return its application's resources. If the activity
can not be found, NameNotFoundException is thrown.
| public abstract android.content.res.Resources | getResourcesForApplication(ApplicationInfo app)Retrieve the resources for an application. Throws NameNotFoundException
if the package is no longer installed.
| public abstract android.content.res.Resources | getResourcesForApplication(java.lang.String appPackageName)Retrieve the resources associated with an application. Given the full
package name of an application, retrieves the information about it and
calls getResources() to return its application's resources. If the
appPackageName can not be found, NameNotFoundException is thrown.
| public abstract ServiceInfo | getServiceInfo(android.content.ComponentName className, int flags)Retrieve all of the information we know about a particular service
class.
Throws {@link NameNotFoundException} if a service with the given
class name can not be found on the system.
| public abstract java.lang.String[] | getSystemSharedLibraryNames()Get a list of shared libraries that are available on the
system.
| public abstract java.lang.CharSequence | getText(java.lang.String packageName, int resid, ApplicationInfo appInfo)Retrieve text from a package. This is a low-level API used by
the various package manager info structures (such as
{@link ComponentInfo} to implement retrieval of their associated
labels and other text.
| public abstract int | getUidForSharedUser(java.lang.String sharedUserName)Return the user id associated with a shared user name. Multiple
applications can specify a shared user name in their manifest and thus
end up using a common uid. This might be used for new applications
that use an existing shared user name and need to know the uid of the
shared user.
| public abstract android.content.res.XmlResourceParser | getXml(java.lang.String packageName, int resid, ApplicationInfo appInfo)Retrieve an XML file from a package. This is a low-level API used to
retrieve XML meta data.
| public abstract void | installPackage(android.net.Uri packageURI, IPackageInstallObserver observer, int flags)Install a package. Since this may take a little while, the result will
be posted back to the given observer. An installation will fail if the calling context
lacks the {@link android.Manifest.permission#INSTALL_PACKAGES} permission, if the
package named in the package file's manifest is already installed, or if there's no space
available on the device.
| public void | installPackage(android.net.Uri packageURI)Install a package.
installPackage(packageURI, null, 0);
| public abstract boolean | isSafeMode()Return whether the device has been booted into safe mode.
| public abstract java.util.List | queryBroadcastReceivers(android.content.Intent intent, int flags)Retrieve all receivers that can handle a broadcast of the given intent.
| public abstract java.util.List | queryContentProviders(java.lang.String processName, int uid, int flags)Retrieve content provider information.
Note: unlike most other methods, an empty result set is indicated
by a null return instead of an empty list.
| public abstract java.util.List | queryInstrumentation(java.lang.String targetPackage, int flags)Retrieve information about available instrumentation code. May be used
to retrieve either all instrumentation code, or only the code targeting
a particular package.
| public abstract java.util.List | queryIntentActivities(android.content.Intent intent, int flags)Retrieve all activities that can be performed for the given intent.
| public abstract java.util.List | queryIntentActivityOptions(android.content.ComponentName caller, android.content.Intent[] specifics, android.content.Intent intent, int flags)Retrieve a set of activities that should be presented to the user as
similar options. This is like {@link #queryIntentActivities}, except it
also allows you to supply a list of more explicit Intents that you would
like to resolve to particular options, and takes care of returning the
final ResolveInfo list in a reasonable order, with no duplicates, based
on those inputs.
| public abstract java.util.List | queryIntentServices(android.content.Intent intent, int flags)Retrieve all services that can match the given intent.
| public abstract java.util.List | queryPermissionsByGroup(java.lang.String group, int flags)Query for all of the permissions associated with a particular group.
Throws {@link NameNotFoundException} if the given group does not
exist.
| public abstract void | removePackageFromPreferred(java.lang.String packageName)Remove a package from the list of preferred packages. If it was on
the list, it will no longer be preferred over other packages.
| public abstract void | removePermission(java.lang.String name)Removes a permission that was previously added with
{@link #addPermission(PermissionInfo)}. The same ownership rules apply
-- you are only allowed to remove permissions that you are allowed
to add.
| public abstract ResolveInfo | resolveActivity(android.content.Intent intent, int flags)Determine the best action to perform for a given Intent. This is how
{@link Intent#resolveActivity} finds an activity if a class has not
been explicitly specified.
| public abstract ProviderInfo | resolveContentProvider(java.lang.String name, int flags)Find a single content provider by its base path name.
| public abstract ResolveInfo | resolveService(android.content.Intent intent, int flags)Determine the best service to handle for a given Intent.
| public abstract void | setApplicationEnabledSetting(java.lang.String packageName, int newState, int flags)Set the enabled setting for an application
This setting will override any enabled state which may have been set by the application in
its manifest. It also overrides the enabled state set in the manifest for any of the
application's components. It does not override any enabled state set by
{@link #setComponentEnabledSetting} for any of the application's components.
| public abstract void | setComponentEnabledSetting(android.content.ComponentName componentName, int newState, int flags)Set the enabled setting for a package component (activity, receiver, service, provider).
This setting will override any enabled state which may have been set by the component in its
manifest.
|
|