diff options
| author | 2023-09-22 16:49:22 +0000 | |
|---|---|---|
| committer | 2023-09-22 17:19:43 +0000 | |
| commit | fb64d4454bccba98897f517dc854c01b72dab0fe (patch) | |
| tree | f192d52f982b609fc610d109b50f761638f666d7 | |
| parent | 0466da7abb1df092c41f8d0d3d67266f1f748a41 (diff) | |
Preserve debug info for unoptimized services.jar
A recent change enabled very basic stripping of services.jar for the
unoptimized path where OPTIMIZE_SYSTEM_JAVA=false, avoiding some
unnecessary bloat from permissions deps. However, by enabling R8
for this path, it implicitly enabled compilation with `--release`,
which strips debug info.
Explicitly set `--debug` for this scenario to ensure debug info is kept.
Also update the associated comments to reflect more recent changes to
this condition.
Test: OPTIMIZE_SYSTEM_JAVA=false m services
Bug: 298311479
Change-Id: If04075c9bb7d4200b26ec8dc622f42500a312f80
| -rw-r--r-- | services/Android.bp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/services/Android.bp b/services/Android.bp index 9264172974e1..f2370955f5bf 100644 --- a/services/Android.bp +++ b/services/Android.bp @@ -34,17 +34,18 @@ java_defaults { }, } -// Opt-in config for optimizing and shrinking the services target using R8. -// Enabled via `export SYSTEM_OPTIMIZE_JAVA=true`, or explicitly in Make via the +// Config to control optimizing and shrinking the services target using R8. +// Set via `export SYSTEM_OPTIMIZE_JAVA=true|false`, or explicitly in Make via the // `SOONG_CONFIG_ANDROID_SYSTEM_OPTIMIZE_JAVA` variable. -// TODO(b/196084106): Enable optimizations by default after stabilizing and -// building out retrace infrastructure. soong_config_module_type { name: "system_optimized_java_defaults", module_type: "java_defaults", config_namespace: "ANDROID", bool_variables: ["SYSTEM_OPTIMIZE_JAVA"], - properties: ["optimize"], + properties: [ + "optimize", + "dxflags", + ], } system_optimized_java_defaults { @@ -75,6 +76,9 @@ system_optimized_java_defaults { // permission subpackage to prune unused jarjar'ed Kotlin dependencies. proguard_flags_files: ["proguard_permission.flags"], }, + // Explicitly configure R8 to preserve debug info, as this path should + // really only allow stripping of permission-specific code and deps. + dxflags: ["--debug"], }, }, }, |