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