Fix bug #35673706 - null verifier component...

...causing an NPE when we attempted to call getPackageName() on it.

This patch avoids the NPE, but does not address the underlying
question of why the component we're attempting to target is coming
back null.  This new approach guarantees the security of the broadcast,
though, so we needn't worry further about that.

Test: install app & note verifier action

Change-Id: I0d316e0815210ba1fbb14da6b76d5c23a85c96a4
This commit is contained in:
Christopher Tate
2017-03-03 17:18:20 -08:00
parent 227bdecf02
commit 0fdb3a84cf

View File

@@ -14767,7 +14767,7 @@ public class PackageManagerService extends IPackageManager.Stub {
*/
verification.setComponent(requiredVerifierComponent);
idleController.addPowerSaveTempWhitelistApp(Process.myUid(),
requiredVerifierComponent.getPackageName(), idleDuration,
mRequiredVerifierPackage, idleDuration,
verifierUser.getIdentifier(), false, "package verifier");
mContext.sendOrderedBroadcastAsUser(verification, verifierUser,
android.Manifest.permission.PACKAGE_VERIFICATION_AGENT,