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

Commit d2fd802f authored by Mathieu Chartier's avatar Mathieu Chartier
Browse files

Add handling for preferCodeIntegrity

In the case where the app has preferCodeIntegrity, avoid compiling the
views.

Bug: 123511156
Test: make
Change-Id: If6f0862ef380b80efec8db36577394c97045b601
parent 9f5f78af
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -480,8 +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()) {
            if (appInfo.isPrivilegedApp() || appInfo.isCodeIntegrityPreferred()) {
                // Privileged apps prefer to load trusted code so they don't use compiled views.
                // If the app is not privileged but prefers code integrity, also avoid compiling
                // views.
                return false;
            }
            Log.i("PackageManager", "Compiling layouts in " + packageName + " (" + apkPath +