Skip to content

Commit 633f199

Browse files
author
Todd Kennedy
committed
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
1 parent 6a40141 commit 633f199

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

services/core/java/com/android/server/pm/PackageManagerService.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10621,6 +10621,12 @@ && isVerificationEnabled(userIdentifier, installFlags)) {
1062110621
final List<ComponentName> sufficientVerifiers = matchVerifiers(pkgLite,
1062210622
receivers, verificationState);
1062310623

10624+
// Apps installed for "all" users use the device owner to verify the app
10625+
UserHandle verifierUser = getUser();
10626+
if (verifierUser == UserHandle.ALL) {
10627+
verifierUser = UserHandle.OWNER;
10628+
}
10629+
1062410630
/*
1062510631
* If any sufficient verifiers were listed in the package
1062610632
* manifest, attempt to ask them.
@@ -10636,8 +10642,7 @@ && isVerificationEnabled(userIdentifier, installFlags)) {
1063610642

1063710643
final Intent sufficientIntent = new Intent(verification);
1063810644
sufficientIntent.setComponent(verifierComponent);
10639-
10640-
mContext.sendBroadcastAsUser(sufficientIntent, getUser());
10645+
mContext.sendBroadcastAsUser(sufficientIntent, verifierUser);
1064110646
}
1064210647
}
1064310648
}
@@ -10652,7 +10657,7 @@ && isVerificationEnabled(userIdentifier, installFlags)) {
1065210657
* target BroadcastReceivers have run.
1065310658
*/
1065410659
verification.setComponent(requiredVerifierComponent);
10655-
mContext.sendOrderedBroadcastAsUser(verification, getUser(),
10660+
mContext.sendOrderedBroadcastAsUser(verification, verifierUser,
1065610661
android.Manifest.permission.PACKAGE_VERIFICATION_AGENT,
1065710662
new BroadcastReceiver() {
1065810663
@Override

0 commit comments

Comments
 (0)