blob: 73ae59abcadf09ab2a1e4c118f11c6b05828289d [file] [log] [blame]
Dave Mankoff99416592022-11-10 22:57:43 +00001-keep class com.android.systemui.VendorServices
2
Dave Mankoff99416592022-11-10 22:57:43 +00003# Needed to ensure callback field references are kept in their respective
4# owning classes when the downstream callback registrars only store weak refs.
Jared Duke8e741232023-09-19 22:51:05 +00005# Note that we restrict this to SysUISingleton classes, as other registering
6# classes should either *always* unregister or *never* register from their
7# constructor. We also keep callback class names for easier debugging.
8-keepnames @com.android.systemui.util.annotations.WeaklyReferencedCallback class *
9-keepnames class * extends @com.android.systemui.util.annotations.WeaklyReferencedCallback **
10-if @com.android.systemui.util.annotations.WeaklyReferencedCallback class *
11-keepclassmembers,allowaccessmodification @com.android.systemui.dagger.SysUISingleton class * {
Dave Mankoff99416592022-11-10 22:57:43 +000012 <1> *;
13}
Jared Duke8e741232023-09-19 22:51:05 +000014-if class * extends @com.android.systemui.util.annotations.WeaklyReferencedCallback **
15-keepclassmembers,allowaccessmodification @com.android.systemui.dagger.SysUISingleton class * {
Dave Mankoff99416592022-11-10 22:57:43 +000016 <1> *;
17}
18
19-keepclasseswithmembers class * {
20 public <init>(android.content.Context, android.util.AttributeSet);
21}
22
Darrell Shiae159d92023-06-07 18:41:26 +000023# The plugins and core log subpackages act as shared libraries that might be referenced in
Dave Mankoff99416592022-11-10 22:57:43 +000024# dynamically-loaded plugin APKs.
25-keep class com.android.systemui.plugins.** {
26 *;
27}
Darrell Shiae159d92023-06-07 18:41:26 +000028-keep class com.android.systemui.log.core.** {
Hawkwood Glaziera3ebc6b2023-05-03 18:49:40 +000029 *;
30}
Dave Mankoff99416592022-11-10 22:57:43 +000031-keep class androidx.core.app.CoreComponentFactory
32
33# Keep the wm shell lib
34-keep class com.android.wm.shell.*
35# Keep the protolog group methods that are called by the generated code
36-keepclassmembers class com.android.wm.shell.protolog.ShellProtoLogGroup {
37 *;
38}
39
40# Prevent optimization or access modification of any referenced code that may
41# conflict with code in the bootclasspath.
42# TODO(b/222468116): Resolve such collisions in the build system.
43-keepnames class android.**.nano.** { *; }
44-keepnames class com.android.**.nano.** { *; }
45-keepnames class com.android.internal.protolog.** { *; }
46-keepnames class android.hardware.common.** { *; }
47
48# Allows proguard to make private and protected methods and fields public as
49# part of optimization. This lets proguard inline trivial getter/setter methods.
50-allowaccessmodification
51
52# Removes runtime checks added through Kotlin to JVM code genereration to
53# avoid linear growth as more Kotlin code is converted / added to the codebase.
54# These checks are generally applied to Java platform types (values returned
55# from Java code that don't have nullness annotations), but we remove them to
56# avoid code size increases.
57#
58# See also https://kotlinlang.org/docs/reference/java-interop.html
59#
60# TODO(b/199941987): Consider standardizing these rules in a central place as
61# Kotlin gains adoption with other platform targets.
62-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
63 # Remove check for method parameters being null
64 static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
65
66 # When a Java platform type is returned and passed to Kotlin NonNull method,
67 # remove the null check
68 static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
69 static void checkNotNullExpressionValue(java.lang.Object, java.lang.String);
70
71 # Remove check that final value returned from method is null, if passing
72 # back Java platform type.
73 static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
74 static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String);
75
76 # Null check for accessing a field from a parent class written in Java.
77 static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
78 static void checkFieldIsNotNull(java.lang.Object, java.lang.String);
79
80 # Removes code generated from !! operator which converts Nullable type to
81 # NonNull type. These would throw an NPE immediate after on access.
82 static void checkNotNull(java.lang.Object, java.lang.String);
83 static void checkNotNullParameter(java.lang.Object, java.lang.String);
84
85 # Removes lateinit var check being used before being set. Check is applied
86 # on every field access without this.
87 static void throwUninitializedPropertyAccessException(java.lang.String);
88}
89
90
91# Strip verbose logs.
92-assumenosideeffects class android.util.Log {
93 static *** v(...);
94 static *** isLoggable(...);
95}
96-assumenosideeffects class android.util.Slog {
97 static *** v(...);
98}
99-maximumremovedandroidloglevel 2