From f291e6380028a47317ae2c2f506f80584dd8e86e Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Wed, 21 Jun 2017 15:26:18 -0700 Subject: Always run the intent filter verifier in USER_SYSTEM The temporary whitelisting of the intent filter verifier was not taking effect when an app install was applied to all users, because the USER_ALL userid argument was not applicable downstream in the whitelist-package-within-user code flow. The verifier is located explicitly in the system user anyway; we do not need to try to launch or whitelist it in a per-target-user manner. In addition, the whitelisting operation is now synchronous to avoid any slight race between delivery of the verification broadcast and application of the new whitelist state. Bug 62814249 Test: manual Change-Id: I051277dad6c541d0aa6bcdd824ad3cce4b20b269 --- .../java/com/android/server/pm/PackageManagerService.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 20d0e6c07501..52d471629cda 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -1056,14 +1056,12 @@ public class PackageManagerService extends IPackageManager.Stub scheduleWriteSettingsLocked(); } } - sendVerificationRequest(userId, verificationId, ivs); + sendVerificationRequest(verificationId, ivs); } mCurrentIntentFilterVerifications.clear(); } - private void sendVerificationRequest(int userId, int verificationId, - IntentFilterVerificationState ivs) { - + private void sendVerificationRequest(int verificationId, IntentFilterVerificationState ivs) { Intent verificationIntent = new Intent(Intent.ACTION_INTENT_FILTER_NEEDS_VERIFICATION); verificationIntent.putExtra( PackageManager.EXTRA_INTENT_FILTER_VERIFICATION_ID, @@ -1083,10 +1081,9 @@ public class PackageManagerService extends IPackageManager.Stub DeviceIdleController.LocalService idleController = getDeviceIdleController(); idleController.addPowerSaveTempWhitelistApp(Process.myUid(), mIntentFilterVerifierComponent.getPackageName(), getVerificationTimeout(), - userId, false, "intent filter verifier"); + UserHandle.USER_SYSTEM, true, "intent filter verifier"); - UserHandle user = new UserHandle(userId); - mContext.sendBroadcastAsUser(verificationIntent, user); + mContext.sendBroadcastAsUser(verificationIntent, UserHandle.SYSTEM); if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, "Sending IntentFilter verification broadcast"); } -- cgit v1.2.3-59-g8ed1b