blob: 030eaa660c9f1dca3703ae4cca4b966d75399974 [file] [log] [blame]
Jared Duke629526d2022-02-08 11:28:34 -08001# Preserve line number information for debugging stack traces.
2-keepattributes SourceFile,LineNumberTable
3
Yohei Yukawa25c61e42022-02-14 22:30:49 +00004-keep class com.android.systemui.recents.OverviewProxyRecentsImpl
5-keep class com.android.systemui.statusbar.car.CarStatusBar
Dave Mankoff4a38c282022-04-22 15:28:57 +00006-keep class com.android.systemui.statusbar.phone.CentralSurfaces
Yohei Yukawa25c61e42022-02-14 22:30:49 +00007-keep class com.android.systemui.statusbar.tv.TvStatusBar
Dave Mankoffa267ea02022-07-08 18:20:20 +00008-keep class ** extends com.android.systemui.SystemUIInitializer {
9 *;
10}
Yohei Yukawa25c61e42022-02-14 22:30:49 +000011-keep class * extends com.android.systemui.CoreStartable
12-keep class * implements com.android.systemui.CoreStartable$Injector
Winsone6c90732015-09-24 16:06:29 -070013
Fabian Kozynski31ea98c02022-08-01 12:35:31 -040014# Needed for builds to properly initialize KeyFrames from xml scene
15-keepclassmembers class * extends androidx.constraintlayout.motion.widget.Key {
16 public <init>();
17}
18
Jared Duke1b05e742023-01-06 21:53:58 +000019# Needed to ensure callback field references are kept in their respective
20# owning classes when the downstream callback registrars only store weak refs.
21# TODO(b/264686688): Handle these cases with more targeted annotations.
22-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
23 private com.android.keyguard.KeyguardUpdateMonitorCallback *;
24 private com.android.systemui.privacy.PrivacyItemController$Callback *;
25 private com.android.systemui.settings.UserTracker$Callback *;
26 private com.android.systemui.statusbar.phone.StatusBarWindowCallback *;
27 private com.android.systemui.util.service.Observer$Callback *;
28 private com.android.systemui.util.service.ObservableServiceConnection$Callback *;
29}
30
Jason Monk87ccd552015-12-11 21:39:54 -050031-keepclasseswithmembers class * {
32 public <init>(android.content.Context, android.util.AttributeSet);
33}
34
Aurimas Liutikasfd52c142018-04-17 09:50:46 -070035-keep class ** extends androidx.preference.PreferenceFragment
Yohei Yukawa25c61e42022-02-14 22:30:49 +000036-keep class com.android.systemui.tuner.*
Kevin Jeon4c394532022-11-15 19:00:12 +000037
Jared Duke548aa372022-11-30 13:38:17 -080038# The plugins subpackage acts as a shared library that might be referenced in
Kevin Jeon4c394532022-11-15 19:00:12 +000039# dynamically-loaded plugin APKs.
Jason Monk86bc3312016-08-16 13:17:56 -040040-keep class com.android.systemui.plugins.** {
Jason Monke6089af2018-07-31 14:38:11 -040041 *;
Jason Monk86bc3312016-08-16 13:17:56 -040042}
Jason Monk9424af72018-12-19 14:17:26 -050043-keep class com.android.systemui.fragments.FragmentService$FragmentCreator {
44 *;
45}
Aurimas Liutikasfd52c142018-04-17 09:50:46 -070046-keep class androidx.core.app.CoreComponentFactory
Dave Mankoffa5d8a392019-10-10 12:21:09 -040047
Yohei Yukawa25c61e42022-02-14 22:30:49 +000048-keep public class * extends com.android.systemui.CoreStartable {
49 public <init>(android.content.Context);
50}
51
Winson Chungb754f522020-08-03 22:17:08 -070052# Keep the wm shell lib
Dave Mankoff85528072020-08-06 10:32:25 -040053-keep class com.android.wm.shell.*
Winson Chungb754f522020-08-03 22:17:08 -070054# Keep the protolog group methods that are called by the generated code
55-keepclassmembers class com.android.wm.shell.protolog.ShellProtoLogGroup {
56 *;
57}
Dave Mankoff85528072020-08-06 10:32:25 -040058
Yohei Yukawa25c61e42022-02-14 22:30:49 +000059-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.GlobalRootComponent { !synthetic *; }
60-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.GlobalRootComponent$SysUIComponentImpl { !synthetic *; }
61-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.Dagger** { !synthetic *; }
62-keep,allowoptimization,allowaccessmodification class com.android.systemui.tv.Dagger** { !synthetic *; }
63
Jared Duke83a28e62022-03-03 13:11:46 -080064# Prevent optimization or access modification of any referenced code that may
65# conflict with code in the bootclasspath.
66# TODO(b/222468116): Resolve such collisions in the build system.
67-keepnames class android.**.nano.** { *; }
68-keepnames class com.android.**.nano.** { *; }
69-keepnames class com.android.internal.protolog.** { *; }
70-keepnames class android.hardware.common.** { *; }
71
Jared Duke2fee7402021-10-18 14:35:04 -070072# Allows proguard to make private and protected methods and fields public as
73# part of optimization. This lets proguard inline trivial getter/setter methods.
74-allowaccessmodification
Jared Dukedc1646f2021-11-30 12:35:45 -080075
76# Removes runtime checks added through Kotlin to JVM code genereration to
77# avoid linear growth as more Kotlin code is converted / added to the codebase.
78# These checks are generally applied to Java platform types (values returned
79# from Java code that don't have nullness annotations), but we remove them to
80# avoid code size increases.
81#
82# See also https://kotlinlang.org/docs/reference/java-interop.html
83#
84# TODO(b/199941987): Consider standardizing these rules in a central place as
85# Kotlin gains adoption with other platform targets.
86-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
87 # Remove check for method parameters being null
88 static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
89
90 # When a Java platform type is returned and passed to Kotlin NonNull method,
91 # remove the null check
92 static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
93 static void checkNotNullExpressionValue(java.lang.Object, java.lang.String);
94
95 # Remove check that final value returned from method is null, if passing
96 # back Java platform type.
97 static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
98 static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String);
99
100 # Null check for accessing a field from a parent class written in Java.
101 static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
102 static void checkFieldIsNotNull(java.lang.Object, java.lang.String);
103
104 # Removes code generated from !! operator which converts Nullable type to
105 # NonNull type. These would throw an NPE immediate after on access.
106 static void checkNotNull(java.lang.Object, java.lang.String);
107 static void checkNotNullParameter(java.lang.Object, java.lang.String);
108
109 # Removes lateinit var check being used before being set. Check is applied
110 # on every field access without this.
111 static void throwUninitializedPropertyAccessException(java.lang.String);
112}