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

Commit ff4dd75b authored by Andreas Gampe's avatar Andreas Gampe Committed by android-build-merger
Browse files

Merge "PackageManager: Avoid null access"

am: 9b8008e9

Change-Id: Iabb496c276c250ed8edde6da0fe419925f5426e3
parents f96d9741 9b8008e9
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -3375,6 +3375,13 @@ public class PackageManagerService extends IPackageManager.Stub
        // "/data/system/package_cache/1"
        // "/data/system/package_cache/1"
        File cacheDir = FileUtils.createDir(cacheBaseDir, PACKAGE_PARSER_CACHE_VERSION);
        File cacheDir = FileUtils.createDir(cacheBaseDir, PACKAGE_PARSER_CACHE_VERSION);
        if (cacheDir == null) {
            // Something went wrong. Attempt to delete everything and return.
            Slog.wtf(TAG, "Cache directory cannot be created - wiping base dir " + cacheBaseDir);
            FileUtils.deleteContentsAndDir(cacheBaseDir);
            return null;
        }
        // The following is a workaround to aid development on non-numbered userdebug
        // The following is a workaround to aid development on non-numbered userdebug
        // builds or cases where "adb sync" is used on userdebug builds. If we detect that
        // builds or cases where "adb sync" is used on userdebug builds. If we detect that
        // the system partition is newer.
        // the system partition is newer.