[view compilation] Add separate compilation property

Add separate compilation pm.precompile_layouts property for
precompiled layouts that controls compilation. Previously
this was controlled by view.precompiled_layout_enabled.

Movitation:
Enable view compilation without loading to get extra coverage.

Exempt-From-Owner-Approval: Cherry-pick from AOSP
Bug: 111895153
Test: manual
Change-Id: Ica79ec076714f76d6ae75d398a2f62d7dd85a6a6
This commit is contained in:
Mathieu Chartier
2019-01-24 11:13:35 -08:00
parent 97b0ca1ea9
commit 9e7a5f6078

View File

@@ -449,8 +449,7 @@ public class PackageManagerService extends IPackageManager.Stub
private static final long BACKUP_TIMEOUT_MILLIS = TimeUnit.SECONDS.toMillis(60);
private static final boolean PRECOMPILED_LAYOUT_ENABLED =
SystemProperties.getBoolean("view.precompiled_layout_enabled", false);
private static final String PRECOMPILE_LAYOUTS = "pm.precompile_layouts";
private static final int RADIO_UID = Process.PHONE_UID;
private static final int LOG_UID = Process.LOG_UID;
@@ -9119,7 +9118,7 @@ public class PackageManagerService extends IPackageManager.Stub
pkgCompilationReason = PackageManagerService.REASON_BACKGROUND_DEXOPT;
}
if (PRECOMPILED_LAYOUT_ENABLED) {
if (SystemProperties.getBoolean(PRECOMPILE_LAYOUTS, false)) {
mArtManagerService.compileLayouts(pkg);
}
@@ -16211,7 +16210,7 @@ public class PackageManagerService extends IPackageManager.Stub
if (performDexopt) {
// Compile the layout resources.
if (PRECOMPILED_LAYOUT_ENABLED) {
if (SystemProperties.getBoolean(PRECOMPILE_LAYOUTS, false)) {
Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "compileLayouts");
mViewCompiler.compileLayouts(pkg);
Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);