summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi NGUYEN VAN <reminv@google.com>2020-06-22 18:50:20 +0900
committerRemi NGUYEN VAN <reminv@google.com>2020-06-24 13:42:17 +0900
commite7c00c4b76bfc02072494c440c1c26c3ae98b7da (patch)
tree01048dc6ec11f2c73edce8e453bdd59fcf1da0cb
parent0c423089f7c64ab82461be73778e067872789f8b (diff)
Jarjar com.google.protobuf
This avoids potential conflicts if the library is also added to the bootclasspath. com.google.protobuf is pulled as a dependency when adding protobuffers, like those used for data stall, IP provisioning and validation metrics. Bug: 159587267 Test: m; manual: booted, wifi working Change-Id: I3339e47c1ca1cd8b0186da0dbf880eff245b4c67
-rw-r--r--Android.bp3
-rw-r--r--jarjar-rules-shared.txt1
-rw-r--r--proguard.flags7
3 files changed, 11 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
index 6ccbd18..ae19a1c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -91,6 +91,7 @@ java_defaults {
"netlink-client",
"networkstack-client",
"net-utils-framework-common",
+ // See note on statsprotos when adding/updating proto build rules
"datastallprotosnano",
"statsprotos",
"captiveportal-lib",
@@ -293,6 +294,8 @@ android_app {
required: ["NetworkPermissionConfig"],
}
+// When adding or modifying protos, the jarjar rules and possibly proguard rules need
+// to be updated: proto libraries may pull additional static libraries.
java_library_static {
name: "statsprotos",
proto: {
diff --git a/jarjar-rules-shared.txt b/jarjar-rules-shared.txt
index c4f4602..438fc61 100644
--- a/jarjar-rules-shared.txt
+++ b/jarjar-rules-shared.txt
@@ -2,6 +2,7 @@
rule com.android.net.module.util.** com.android.networkstack.util.@1
rule com.android.internal.util.** android.net.networkstack.util.@1
+rule com.google.protobuf.** com.android.networkstack.protobuf.@1
# Classes from net-utils-framework-common
rule com.android.net.module.util.** com.android.networkstack.util.@1
diff --git a/proguard.flags b/proguard.flags
index c60f6c3..af4262a 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -7,3 +7,10 @@
static final int CMD_*;
static final int EVENT_*;
}
+
+# The lite proto runtime uses reflection to access fields based on the names in
+# the schema, keep all the fields.
+# This replicates the base proguard rule used by the build by default
+# (proguard_basic_keeps.flags), but needs to be specified here because the
+# com.google.protobuf package is jarjared to the below package.
+-keepclassmembers class * extends com.android.networkstack.protobuf.MessageLite { <fields>; }