From 4c39453f9cff036aa2ba153e7b567c8e42ce8e39 Mon Sep 17 00:00:00 2001 From: Kevin Jeon Date: Tue, 15 Nov 2022 19:00:12 +0000 Subject: [PATCH] Add a keep rule for SystemUIAnimationLib This change adds a keep rule for SystemUIAnimationLib so that animation code can be used by SystemUIClocks at runtime. com.android.systemui.animation.R$ classes are filtered out to avoid including transitive resource dependencies. On panther, this results in these SystemUIGoogle apk/odex size changes: - SystemUIGoogle.apk: 37628192->37670640 (+41.45KB, +0.11%) - SystemUIGoogle.odex: 34143312->34197712 (+43.13KB, +0.16%) - SystemUIClocks.apk: 3867456->1675787 (-2.09MB, -56.67%) - SystemUIClocks.odex: 29616->21424 (-8 KB, -27.66%) Test: Build and flash; presubmit. Bug: 215530220 Change-Id: Ic863d9c788f51132766136a0534d702910f541b8 --- packages/SystemUI/proguard.flags | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/SystemUI/proguard.flags b/packages/SystemUI/proguard.flags index 7538555e1bcdc..1282d771579e3 100644 --- a/packages/SystemUI/proguard.flags +++ b/packages/SystemUI/proguard.flags @@ -22,9 +22,15 @@ -keep class ** extends androidx.preference.PreferenceFragment -keep class com.android.systemui.tuner.* + +# The plugins and animation subpackages both act as shared libraries that might be referenced in +# dynamically-loaded plugin APKs. -keep class com.android.systemui.plugins.** { *; } +-keep class !com.android.systemui.animation.R$**,com.android.systemui.animation.** { + *; +} -keep class com.android.systemui.fragments.FragmentService$FragmentCreator { *; }