diff options
author | Todd Kennedy <toddke@google.com> | 2015-07-16 09:44:31 -0700 |
---|---|---|
committer | Todd Kennedy <toddke@google.com> | 2015-07-16 09:44:31 -0700 |
commit | 633f19983182fbcf9479f6d5dd9f5e29e37f4cd0 (patch) | |
tree | 8eac9ab18d56420cae009d5720bb446d66034bde /services/core/java | |
parent | 6a4014104e85bf4154b353cd0be337f7967cdaeb (diff) | |
download | frameworks_base-633f19983182fbcf9479f6d5dd9f5e29e37f4cd0.zip frameworks_base-633f19983182fbcf9479f6d5dd9f5e29e37f4cd0.tar.gz frameworks_base-633f19983182fbcf9479f6d5dd9f5e29e37f4cd0.tar.bz2 |
Verfiy global apps with device owner
Applications installed for a specific user must be verfied as that user. However,
apps that are installed globally [i.e. UserHandle.ALL] should not be verified by
every user on the device. Instead, they should be verified by the device owner.
Bug: 21901423
Change-Id: I5fd3f690d08e7e911a3c86f09bbfcd4eb635b418
Diffstat (limited to 'services/core/java')
-rw-r--r-- | services/core/java/com/android/server/pm/PackageManagerService.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 4b2c1ff..7cc857f 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -10621,6 +10621,12 @@ public class PackageManagerService extends IPackageManager.Stub { final List<ComponentName> sufficientVerifiers = matchVerifiers(pkgLite, receivers, verificationState); + // Apps installed for "all" users use the device owner to verify the app + UserHandle verifierUser = getUser(); + if (verifierUser == UserHandle.ALL) { + verifierUser = UserHandle.OWNER; + } + /* * If any sufficient verifiers were listed in the package * manifest, attempt to ask them. @@ -10636,8 +10642,7 @@ public class PackageManagerService extends IPackageManager.Stub { final Intent sufficientIntent = new Intent(verification); sufficientIntent.setComponent(verifierComponent); - - mContext.sendBroadcastAsUser(sufficientIntent, getUser()); + mContext.sendBroadcastAsUser(sufficientIntent, verifierUser); } } } @@ -10652,7 +10657,7 @@ public class PackageManagerService extends IPackageManager.Stub { * target BroadcastReceivers have run. */ verification.setComponent(requiredVerifierComponent); - mContext.sendOrderedBroadcastAsUser(verification, getUser(), + mContext.sendOrderedBroadcastAsUser(verification, verifierUser, android.Manifest.permission.PACKAGE_VERIFICATION_AGENT, new BroadcastReceiver() { @Override |