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

Commit 06689ad1 authored by Jared Duke's avatar Jared Duke
Browse files

Treat R8 warnings as failures for system_server

Treating warnings as failures avoids unexpected issues at build and
runtime, particularly for missing class references. Unblock this by
adding explicit top-level references to several stub classes, and
suppressing a warning for optional jacococ class references (guarded
by a runtime check in CoverageService).

Test: m services (also w/ EMMA_INSTRUMENT(_FRAMEWORK)=true)
Bug: 242088131
Change-Id: Iee02a30eeccdcf785e90438d1557867ffda659e7
parent 2e933599
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ system_optimized_java_defaults {
                // retracing infra.
                optimize: false,
                shrink: true,
                ignore_warnings: false,
                proguard_flags_files: ["proguard.flags"],
            },
            // Note: Optimizations are disabled by default if unspecified in
@@ -174,6 +175,8 @@ java_library {
        "android.hidl.manager-V1.0-java",
        "framework-tethering.stubs.module_lib",
        "service-art.stubs.system_server",
        "service-permission.stubs.system_server",
        "service-sdksandbox.stubs.system_server",
    ],

    // Uncomment to enable output of certain warnings (deprecated, unchecked)
+4 −0
Original line number Diff line number Diff line
@@ -118,3 +118,7 @@
-keep,allowoptimization,allowaccessmodification class com.android.server.usage.StorageStatsManagerLocal { *; }
-keep,allowoptimization,allowaccessmodification class com.android.internal.util.** { *; }
-keep,allowoptimization,allowaccessmodification class android.os.** { *; }

# CoverageService guards optional jacoco class references with a runtime guard, so we can safely
# suppress build-time warnings.
-dontwarn org.jacoco.agent.rt.*