diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-11-18 22:26:40 -0800 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-11-19 13:21:08 -0800 |
commit | 880119bf43d738ca632b5d3861eb52d655c1c0fc (patch) | |
tree | 684a13f821e570aee075c77bde7f5fc28191015f /core/java/android/content | |
parent | 7ffd0871e6b8d7ab9443bef6e8b2a31674d1f623 (diff) | |
download | frameworks_base-880119bf43d738ca632b5d3861eb52d655c1c0fc.zip frameworks_base-880119bf43d738ca632b5d3861eb52d655c1c0fc.tar.gz frameworks_base-880119bf43d738ca632b5d3861eb52d655c1c0fc.tar.bz2 |
Implement issue #2367442: Please add API for manipulating installer
package names
Change-Id: I0563e896a47ae1a6e77aebc2d624fb1bde52ffbc
Diffstat (limited to 'core/java/android/content')
-rw-r--r-- | core/java/android/content/pm/IPackageManager.aidl | 2 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageManager.java | 18 |
2 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl index 4cff3bb..d01a68a 100644 --- a/core/java/android/content/pm/IPackageManager.aidl +++ b/core/java/android/content/pm/IPackageManager.aidl @@ -158,6 +158,8 @@ interface IPackageManager { void finishPackageInstall(int token); + void setInstallerPackageName(in String targetPackage, in String installerPackageName); + /** * Delete a package. * diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index b5d1653..ac7a95a 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -1918,6 +1918,24 @@ public abstract class PackageManager { String installerPackageName); /** + * Change the installer associated with a given package. There are limitations + * on how the installer package can be changed; in particular: + * <ul> + * <li> A SecurityException will be thrown if <var>installerPackageName</var> + * is not signed with the same certificate as the calling application. + * <li> A SecurityException will be thrown if <var>targetPackage</var> already + * has an installer package, and that installer package is not signed with + * the same certificate as the calling application. + * </ul> + * + * @param targetPackage The installed package whose installer will be changed. + * @param installerPackageName The package name of the new installer. May be + * null to clear the association. + */ + public abstract void setInstallerPackageName(String targetPackage, + String installerPackageName); + + /** * 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 |