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

Commit 42691648 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

pm: Prevent a system_server crash is package name is null

 * If an app is placed on the system partition and it doesn't specify a
   valid package name, system_server will crash forever. Just skip it.

Change-Id: I9b911d40b3c4d7cf6fac8cc0166a2ba359329b7b
parent fe5e368d
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -4452,6 +4452,12 @@ public class PackageManagerService extends IPackageManager.Stub {

        final String pkgName = pkg.packageName;

        if (pkgName == null) {
            Slog.e(TAG, "NULL package name found in " + pkg.mScanPath + ", skipping!");
            mLastScanError = PackageManager.INSTALL_FAILED_INTERNAL_ERROR;
            return null;
        }

        final long scanFileTime = scanFile.lastModified();
        final boolean forceDex = (scanMode&SCAN_FORCE_DEX) != 0;
        pkg.applicationInfo.processName = fixProcessName(