summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Christoffer Adamsen <christofferqa@google.com> 2025-01-06 19:05:18 +0100
committer Christoffer Adamsen <christofferqa@google.com> 2025-01-07 15:29:01 +0100
commit6dcde63a1ed81bafb04309d701501e00b31d0d4e (patch)
treefb96e1a5816a67c5b9f63522566b0c136a53242d
parent46160a9f2cd51c07450c2be4653410c6bab76e4e (diff)
Explicitly keep default constructor in rules without members
R8 implicitly keeps the default constructor when no member rules are specified. Future versions of R8 will require apps to explicitly keep the default constructors that are required for the build to work. This conservatively changes all keep rules that currently keep the default constructor to explicitly keep the default constructor. Future work will attempt to tighten up the rules that do not require the default constructor to be kept. Bug: 373579455 Flag: NONE no behavior change Test: existing Change-Id: I8e2734d8ee1b14cdf8ed6e3a1b6ebb8432500176
-rw-r--r--packages/SystemUI/plugin_core/proguard.flags5
-rw-r--r--packages/SystemUI/proguard_common.flags20
-rw-r--r--services/proguard.flags5
3 files changed, 24 insertions, 6 deletions
diff --git a/packages/SystemUI/plugin_core/proguard.flags b/packages/SystemUI/plugin_core/proguard.flags
index 6240898b3b93..8b78ba47fdfc 100644
--- a/packages/SystemUI/plugin_core/proguard.flags
+++ b/packages/SystemUI/plugin_core/proguard.flags
@@ -8,4 +8,7 @@
-keep interface com.android.systemui.plugins.annotations.** {
*;
}
--keep,allowshrinking,allowoptimization,allowobfuscation,allowaccessmodification @com.android.systemui.plugins.annotations.** class *
+# TODO(b/373579455): Evaluate if <init> needs to be kept.
+-keep,allowshrinking,allowoptimization,allowobfuscation,allowaccessmodification @com.android.systemui.plugins.annotations.** class * {
+ void <init>();
+}
diff --git a/packages/SystemUI/proguard_common.flags b/packages/SystemUI/proguard_common.flags
index 162d8aebfc62..5765136642b0 100644
--- a/packages/SystemUI/proguard_common.flags
+++ b/packages/SystemUI/proguard_common.flags
@@ -6,8 +6,14 @@
# Note that we restrict this to SysUISingleton classes, as other registering
# classes should either *always* unregister or *never* register from their
# constructor. We also keep callback class names for easier debugging.
--keepnames @com.android.systemui.util.annotations.WeaklyReferencedCallback class *
--keepnames class * extends @com.android.systemui.util.annotations.WeaklyReferencedCallback **
+# TODO(b/373579455): Evaluate if <init> needs to be kept.
+-keepnames @com.android.systemui.util.annotations.WeaklyReferencedCallback class * {
+ void <init>();
+}
+# TODO(b/373579455): Evaluate if <init> needs to be kept.
+-keepnames class * extends @com.android.systemui.util.annotations.WeaklyReferencedCallback ** {
+ void <init>();
+}
-if @com.android.systemui.util.annotations.WeaklyReferencedCallback class *
-keepclassmembers,allowaccessmodification @com.android.systemui.dagger.SysUISingleton class * {
<1> *;
@@ -17,10 +23,16 @@
<1> *;
}
--keep class androidx.core.app.CoreComponentFactory
+# TODO(b/373579455): Evaluate if <init> needs to be kept.
+-keep class androidx.core.app.CoreComponentFactory {
+ void <init>();
+}
# Keep the wm shell lib
--keep class com.android.wm.shell.*
+# TODO(b/373579455): Evaluate if <init> needs to be kept.
+-keep class com.android.wm.shell.* {
+ void <init>();
+}
# Keep the protolog group methods that are called by the generated code
-keepclassmembers class com.android.wm.shell.protolog.ShellProtoLogGroup {
*;
diff --git a/services/proguard.flags b/services/proguard.flags
index cdd41abf6c7c..1ab10dcd847b 100644
--- a/services/proguard.flags
+++ b/services/proguard.flags
@@ -15,7 +15,10 @@
# APIs referenced by dependent JAR files and modules
# TODO(b/300514883): Pull @SystemApi keep rules from system-api.pro.
--keep interface android.annotation.SystemApi
+# TODO(b/373579455): Evaluate if <init> needs to be kept.
+-keep interface android.annotation.SystemApi {
+ void <init>();
+}
-keep @android.annotation.SystemApi class * {
public protected *;
}