systemui: separate proguard files into multiple ones
- Keep proguard_common still containing all of them.
- To allow customization per form factor with only inclusion of
proguard_common_core.flags.
- Minor bp lint fix using bpfmt for SystemUIPluginLib
Flag: NONE
Test: build
Bug: 301283783
Change-Id: Idf352e7bfe542d263ad2ef4c1cda80d818ed54e6
diff --git a/packages/SystemUI/plugin/Android.bp b/packages/SystemUI/plugin/Android.bp
index 1beb55b..0537f17 100644
--- a/packages/SystemUI/plugin/Android.bp
+++ b/packages/SystemUI/plugin/Android.bp
@@ -26,12 +26,19 @@
name: "SystemUIPluginLib",
srcs: [
- "src/**/*.java",
- "src/**/*.kt",
"bcsmartspace/src/**/*.java",
"bcsmartspace/src/**/*.kt",
+ "src/**/*.java",
+ "src/**/*.kt",
],
+ optimize: {
+ proguard_flags_files: [
+ "proguard_plugins.flags",
+ ],
+ export_proguard_flags_files: true,
+ },
+
// If you add a static lib here, you may need to also add the package to the ClassLoaderFilter
// in PluginInstance. That will ensure that loaded plugins have access to the related classes.
// You should also add it to proguard_common.flags so that proguard does not remove the portions
@@ -43,6 +50,7 @@
"SystemUIAnimationLib",
"SystemUICommon",
"SystemUILogLib",
+ "androidx.annotation_annotation",
],
}
diff --git a/packages/SystemUI/plugin/proguard_plugins.flags b/packages/SystemUI/plugin/proguard_plugins.flags
new file mode 100644
index 0000000..abac27f
--- /dev/null
+++ b/packages/SystemUI/plugin/proguard_plugins.flags
@@ -0,0 +1,9 @@
+# The plugins and core log subpackages act as shared libraries that might be referenced in
+# dynamically-loaded plugin APKs.
+-keep class com.android.systemui.plugins.** {
+ *;
+}
+
+-keep class com.android.systemui.log.core.** {
+ *;
+}