OSDN Git Service

Fix bug #35673706 - null verifier component...
authorChristopher Tate <ctate@google.com>
Sat, 4 Mar 2017 01:18:20 +0000 (17:18 -0800)
committerChristopher Tate <ctate@google.com>
Sat, 4 Mar 2017 01:31:19 +0000 (17:31 -0800)
...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

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

index 1fe4ccc..d127e23 100644 (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,