Files
frameworks_base/packages/SystemUI/proguard.flags
Jared Duke 2fee7409a2 Allow flag-guarded Java optimizations for SystemUI
Introduce a set of optional Java optimization settings for
SystemUI, based on the Soong variable added in aosp/1896612.

Opting in to optimizations can be achieved with either:
  * Env:
export SYSTEM_OPTIMIZE_JAVA=true
  * Make:
$(call add_soong_config_var_value,ANDROID,SYSTEM_OPTIMIZE_JAVA,true)

As these optimizations can change the resulting stack traces, a parallel
effort is working to simplify retracing of stack traces for more
accurate debugging and diagnostics. Additional stabilization and testing
will occur before any effort to enable these optimizations by default
for specific targets. Also note that there are no plans to enable
obfuscation.

Preliminary results (w/ `SYSTEM_OPTIMIZE_JAVA=true`):
  * SystemUI.apk (31MB -> 26MB)

Bug: 203472868
Test: SYSTEM_OPTIMIZE_JAVA=true m (validate SystemUI.apk)
Change-Id: Idd8d5ef32c06e992ad35846eb5fab67ecb58830a
2021-12-14 10:39:39 -08:00

82 lines
3.9 KiB
Plaintext

-keep class com.android.systemui.recents.OverviewProxyRecentsImpl
-keep class com.android.systemui.statusbar.car.CarStatusBar
-keep class com.android.systemui.statusbar.phone.StatusBar
-keep class com.android.systemui.statusbar.tv.TvStatusBar
-keep class com.android.systemui.car.CarSystemUIFactory
-keep class com.android.systemui.SystemUIFactory
-keep class com.android.systemui.tv.TvSystemUIFactory
-keep class * extends com.android.systemui.CoreStartable
-keep class * implements com.android.systemui.CoreStartable$Injector
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keep class ** extends androidx.preference.PreferenceFragment
-keep class com.android.systemui.tuner.*
-keep class com.android.systemui.plugins.** {
*;
}
-keep class com.android.systemui.fragments.FragmentService$FragmentCreator {
*;
}
-keep class androidx.core.app.CoreComponentFactory
-keep public class * extends com.android.systemui.CoreStartable {
public <init>(android.content.Context);
}
# Keep the wm shell lib
-keep class com.android.wm.shell.*
# Keep the protolog group methods that are called by the generated code
-keepclassmembers class com.android.wm.shell.protolog.ShellProtoLogGroup {
*;
}
-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.GlobalRootComponent { !synthetic *; }
-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.GlobalRootComponent$SysUIComponentImpl { !synthetic *; }
-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.Dagger** { !synthetic *; }
-keep,allowoptimization,allowaccessmodification class com.android.systemui.tv.Dagger** { !synthetic *; }
# Allows proguard to make private and protected methods and fields public as
# part of optimization. This lets proguard inline trivial getter/setter methods.
-allowaccessmodification
# Removes runtime checks added through Kotlin to JVM code genereration to
# avoid linear growth as more Kotlin code is converted / added to the codebase.
# These checks are generally applied to Java platform types (values returned
# from Java code that don't have nullness annotations), but we remove them to
# avoid code size increases.
#
# See also https://kotlinlang.org/docs/reference/java-interop.html
#
# TODO(b/199941987): Consider standardizing these rules in a central place as
# Kotlin gains adoption with other platform targets.
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
# Remove check for method parameters being null
static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
# When a Java platform type is returned and passed to Kotlin NonNull method,
# remove the null check
static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
static void checkNotNullExpressionValue(java.lang.Object, java.lang.String);
# Remove check that final value returned from method is null, if passing
# back Java platform type.
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String);
# Null check for accessing a field from a parent class written in Java.
static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
static void checkFieldIsNotNull(java.lang.Object, java.lang.String);
# Removes code generated from !! operator which converts Nullable type to
# NonNull type. These would throw an NPE immediate after on access.
static void checkNotNull(java.lang.Object, java.lang.String);
static void checkNotNullParameter(java.lang.Object, java.lang.String);
# Removes lateinit var check being used before being set. Check is applied
# on every field access without this.
static void throwUninitializedPropertyAccessException(java.lang.String);
}