Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0f42bea authored by Hidehiko Tsuchiya's avatar Hidehiko Tsuchiya Committed by Todd Kennedy
Browse files

Fix PackageManagerService crashed due to NPE during debugging installing

Symptom:
PackageManagerService crashed due to NPE during debugging installing
an invalid package. The crash can be observed only when DEBUG_INSTALL
flag is true.

Root cause:
In this case, the null object access occurs during debug output.

Solution:
Avoid directly accessing packageName. Show the package name via
toString() of Package object.

Bug: 140057579
Change-Id: I302903a2a6b29454dbf718a07c82f5583f93097c
parent 0ec249bd
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -13788,8 +13788,7 @@ public class PackageManagerService extends IPackageManager.Stub
    private void restoreAndPostInstall(
            int userId, PackageInstalledInfo res, @Nullable PostInstallData data) {
        if (DEBUG_INSTALL) {
            Log.v(TAG, "restoreAndPostInstall userId=" + userId + " package="
                    + res.pkg.packageName);
            Log.v(TAG, "restoreAndPostInstall userId=" + userId + " package=" + res.pkg);
        }
        // A restore should be performed at this point if (a) the install