From 83a28e6a9d36fa70b122ca05cffd16aed73763ff Mon Sep 17 00:00:00 2001 From: Jared Duke Date: Thu, 3 Mar 2022 13:11:46 -0800 Subject: [PATCH] Prevent optimization of common code between framework/sysui This is a temporary fix to ensure that SystemUI builds code that is consistent with common code that might be referneced in the the bootclasspath. Note that a proper fix would be to entirely eliminate these duplicated classes, but for now this avoids any related issues, and eliminates issues when running coverage tests against optimized builds. Bug: 219615928,222468116 Test: m -j EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true + validate successful coverage test runs Change-Id: I67b7ad1d6f8e1fb2352652d452c620d195d5c0dc --- packages/SystemUI/proguard.flags | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/SystemUI/proguard.flags b/packages/SystemUI/proguard.flags index c97ebe8d55597..e74b6c78ec804 100644 --- a/packages/SystemUI/proguard.flags +++ b/packages/SystemUI/proguard.flags @@ -41,6 +41,14 @@ -keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.Dagger** { !synthetic *; } -keep,allowoptimization,allowaccessmodification class com.android.systemui.tv.Dagger** { !synthetic *; } +# Prevent optimization or access modification of any referenced code that may +# conflict with code in the bootclasspath. +# TODO(b/222468116): Resolve such collisions in the build system. +-keepnames class android.**.nano.** { *; } +-keepnames class com.android.**.nano.** { *; } +-keepnames class com.android.internal.protolog.** { *; } +-keepnames class android.hardware.common.** { *; } + # Allows proguard to make private and protected methods and fields public as # part of optimization. This lets proguard inline trivial getter/setter methods. -allowaccessmodification