blob: 319481523cdfbe7fc3a03a7cefdb6dbeba7d317d [file] [log] [blame]
Dave Mankoff99416592022-11-10 22:57:43 +00001# Preserve line number information for debugging stack traces.
2-keepattributes SourceFile,LineNumberTable
3
4-keep class com.android.systemui.VendorServices
5
6# the `#inject` methods are accessed via reflection to work on ContentProviders
7-keepclassmembers class * extends com.android.systemui.dagger.SysUIComponent { void inject(***); }
8
9# Needed for builds to properly initialize KeyFrames from xml scene
10-keepclassmembers class * extends androidx.constraintlayout.motion.widget.Key {
11 public <init>();
12}
13
14# Needed to ensure callback field references are kept in their respective
15# owning classes when the downstream callback registrars only store weak refs.
16# TODO(b/264686688): Handle these cases with more targeted annotations.
17-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
18 private com.android.keyguard.KeyguardUpdateMonitorCallback *;
19 private com.android.systemui.privacy.PrivacyConfig$Callback *;
20 private com.android.systemui.privacy.PrivacyItemController$Callback *;
21 private com.android.systemui.settings.UserTracker$Callback *;
22 private com.android.systemui.statusbar.phone.StatusBarWindowCallback *;
23 private com.android.systemui.util.service.Observer$Callback *;
24 private com.android.systemui.util.service.ObservableServiceConnection$Callback *;
25}
26# Note that these rules are temporary companions to the above rules, required
27# for cases like Kotlin where fields with anonymous types use the anonymous type
28# rather than the supertype.
29-if class * extends com.android.keyguard.KeyguardUpdateMonitorCallback
30-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
31 <1> *;
32}
33-if class * extends com.android.systemui.privacy.PrivacyConfig$Callback
34-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
35 <1> *;
36}
37-if class * extends com.android.systemui.privacy.PrivacyItemController$Callback
38-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
39 <1> *;
40}
41-if class * extends com.android.systemui.settings.UserTracker$Callback
42-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
43 <1> *;
44}
45-if class * extends com.android.systemui.statusbar.phone.StatusBarWindowCallback
46-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
47 <1> *;
48}
49-if class * extends com.android.systemui.util.service.Observer$Callback
50-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
51 <1> *;
52}
53-if class * extends com.android.systemui.util.service.ObservableServiceConnection$Callback
54-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
55 <1> *;
56}
57
58-keepclasseswithmembers class * {
59 public <init>(android.content.Context, android.util.AttributeSet);
60}
61
62-keep class ** extends androidx.preference.PreferenceFragment
63-keep class com.android.systemui.tuner.*
64
Darrell Shiae159d92023-06-07 18:41:26 +000065# The plugins and core log subpackages act as shared libraries that might be referenced in
Dave Mankoff99416592022-11-10 22:57:43 +000066# dynamically-loaded plugin APKs.
67-keep class com.android.systemui.plugins.** {
68 *;
69}
Darrell Shiae159d92023-06-07 18:41:26 +000070-keep class com.android.systemui.log.core.** {
Hawkwood Glaziera3ebc6b2023-05-03 18:49:40 +000071 *;
72}
Dave Mankoff99416592022-11-10 22:57:43 +000073-keep class com.android.systemui.fragments.FragmentService$FragmentCreator {
74 *;
75}
76-keep class androidx.core.app.CoreComponentFactory
77
78# Keep the wm shell lib
79-keep class com.android.wm.shell.*
80# Keep the protolog group methods that are called by the generated code
81-keepclassmembers class com.android.wm.shell.protolog.ShellProtoLogGroup {
82 *;
83}
84
85# Prevent optimization or access modification of any referenced code that may
86# conflict with code in the bootclasspath.
87# TODO(b/222468116): Resolve such collisions in the build system.
88-keepnames class android.**.nano.** { *; }
89-keepnames class com.android.**.nano.** { *; }
90-keepnames class com.android.internal.protolog.** { *; }
91-keepnames class android.hardware.common.** { *; }
92
93# Allows proguard to make private and protected methods and fields public as
94# part of optimization. This lets proguard inline trivial getter/setter methods.
95-allowaccessmodification
96
97# Removes runtime checks added through Kotlin to JVM code genereration to
98# avoid linear growth as more Kotlin code is converted / added to the codebase.
99# These checks are generally applied to Java platform types (values returned
100# from Java code that don't have nullness annotations), but we remove them to
101# avoid code size increases.
102#
103# See also https://kotlinlang.org/docs/reference/java-interop.html
104#
105# TODO(b/199941987): Consider standardizing these rules in a central place as
106# Kotlin gains adoption with other platform targets.
107-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
108 # Remove check for method parameters being null
109 static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
110
111 # When a Java platform type is returned and passed to Kotlin NonNull method,
112 # remove the null check
113 static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
114 static void checkNotNullExpressionValue(java.lang.Object, java.lang.String);
115
116 # Remove check that final value returned from method is null, if passing
117 # back Java platform type.
118 static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
119 static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String);
120
121 # Null check for accessing a field from a parent class written in Java.
122 static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
123 static void checkFieldIsNotNull(java.lang.Object, java.lang.String);
124
125 # Removes code generated from !! operator which converts Nullable type to
126 # NonNull type. These would throw an NPE immediate after on access.
127 static void checkNotNull(java.lang.Object, java.lang.String);
128 static void checkNotNullParameter(java.lang.Object, java.lang.String);
129
130 # Removes lateinit var check being used before being set. Check is applied
131 # on every field access without this.
132 static void throwUninitializedPropertyAccessException(java.lang.String);
133}
134
135
136# Strip verbose logs.
137-assumenosideeffects class android.util.Log {
138 static *** v(...);
139 static *** isLoggable(...);
140}
141-assumenosideeffects class android.util.Slog {
142 static *** v(...);
143}
144-maximumremovedandroidloglevel 2