From 60f568127df466dc1cb262204d2052117678c5ca Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 25 Jan 2019 13:05:34 -0800 Subject: [PATCH] Disable view compilation for privileged apps Bug: 111895153 Test: look that there are no selinux denials Change-Id: Id759171654888f8172d46fd05094f58842442a81 --- .../java/com/android/server/pm/dex/ArtManagerService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/pm/dex/ArtManagerService.java b/services/core/java/com/android/server/pm/dex/ArtManagerService.java index 863bfd5ea3910..a8be07d76b588 100644 --- a/services/core/java/com/android/server/pm/dex/ArtManagerService.java +++ b/services/core/java/com/android/server/pm/dex/ArtManagerService.java @@ -480,6 +480,10 @@ public class ArtManagerService extends android.content.pm.dex.IArtManager.Stub { final String apkPath = pkg.baseCodePath; final ApplicationInfo appInfo = pkg.applicationInfo; final String outDexFile = appInfo.dataDir + "/code_cache/compiled_view.dex"; + if (appInfo.isPrivilegedApp()) { + // Privileged apps prefer to load trusted code so they don't use compiled views. + return false; + } Log.i("PackageManager", "Compiling layouts in " + packageName + " (" + apkPath + ") to " + outDexFile); long callingId = Binder.clearCallingIdentity();