From 36dea102342f686b6caad89a358745d9f2e72071 Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Wed, 16 Dec 2015 01:44:34 -0500 Subject: pm: Don't try to create oat dirs for prebundled apps on system * Because it's obviously not possible. Add a special case for these. * Eliminates the persistent "Starting Android..." on every boot. Change-Id: I7d3005e1093d5c5854357b7fd9c2676b089ebb83 --- services/core/java/com/android/server/pm/PackageDexOptimizer.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'services') diff --git a/services/core/java/com/android/server/pm/PackageDexOptimizer.java b/services/core/java/com/android/server/pm/PackageDexOptimizer.java index b692def..f73cb0a 100644 --- a/services/core/java/com/android/server/pm/PackageDexOptimizer.java +++ b/services/core/java/com/android/server/pm/PackageDexOptimizer.java @@ -20,6 +20,7 @@ import android.annotation.Nullable; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageParser; +import android.os.Environment; import android.os.PowerManager; import android.os.UserHandle; import android.os.WorkSource; @@ -224,6 +225,11 @@ final class PackageDexOptimizer { File codePath = new File(pkg.codePath); if (codePath.isDirectory()) { File oatDir = getOatDir(codePath); + // skip the prebundled apps dir since it's actually read-only + if (oatDir.getAbsolutePath().startsWith( + Environment.getPrebundledDirectory().getAbsolutePath())) { + return null; + } mPackageManagerService.mInstaller.createOatDir(oatDir.getAbsolutePath(), dexInstructionSet); return oatDir.getAbsolutePath(); -- cgit v1.1