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

Commit 5d72a8dd authored by android-build SharedAccount's avatar android-build SharedAccount Committed by Sriram Raman
Browse files

cherry pick d60e2900

Revert "Add null checks when scanning a package."
This reverts commit 9e7ac3ba.
parent 6b178e47
Loading
Loading
Loading
Loading
+0 −13
Original line number Original line Diff line number Diff line
@@ -1977,12 +1977,6 @@ class PackageManagerService extends IPackageManager.Stub {
            }
            }
            PackageParser.Package pkg = scanPackageLI(file, file, resFile,
            PackageParser.Package pkg = scanPackageLI(file, file, resFile,
                    flags|PackageParser.PARSE_MUST_BE_APK, scanMode);
                    flags|PackageParser.PARSE_MUST_BE_APK, scanMode);
            // Don't mess around with apps in system partition.
            if (pkg == null && (flags & PackageParser.PARSE_IS_SYSTEM) == 0) {
                // Delete the apk
                Log.w(TAG, "Cleaning up failed install of " + file);
                file.delete();
            }
        }
        }
    }
    }


@@ -2177,13 +2171,6 @@ class PackageManagerService extends IPackageManager.Stub {
        File scanFile, File destCodeFile, File destResourceFile,
        File scanFile, File destCodeFile, File destResourceFile,
        PackageParser.Package pkg, int parseFlags, int scanMode) {
        PackageParser.Package pkg, int parseFlags, int scanMode) {


        if (scanFile == null || destCodeFile == null ||
                destResourceFile == null) {
            // Bail out. The resource and code paths haven't been set.
            Log.w(TAG, " Code and resource paths haven't been set correctly");
            mLastScanError = PackageManager.INSTALL_FAILED_INVALID_APK;
            return null;
        }
        mScanningPath = scanFile;
        mScanningPath = scanFile;
        if (pkg == null) {
        if (pkg == null) {
            mLastScanError = PackageManager.INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME;
            mLastScanError = PackageManager.INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME;