From a1c5d9312357b48fed4526b36649084cbc9371b8 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Sat, 11 Apr 2020 00:54:45 +0900 Subject: [PATCH] Only depend on the latest stable netd AIDL. Currently, various components in the system server depend directly on numbered versions of the netd and dnsresolver AIDL interfaces. Introduce a new build target that only includes the latest stable version, and depend on that instead. This ensures that all components in the system server use the same version of the generated classes. Depending on multiple versions of the generated classes in the same (classloader) has in the past resulted in code compiled using a newer version using a generated class from an older version, and crashing with NoSuchMethodError when it calls a method that didn't exist. Also remove the dependency from wifi code to DNS resolver AIDL interfaces. Wifi does not (and should not) call the DNS resolver directly. Test: m Bug: 143732914 Bug: 153596226 Change-Id: I2c45853171df8d2c9726f4f12204a48862b30bb6 --- services/core/Android.bp | 4 ++-- services/net/Android.bp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/services/core/Android.bp b/services/core/Android.bp index 77773edc28caa..181ce8958992e 100644 --- a/services/core/Android.bp +++ b/services/core/Android.bp @@ -127,8 +127,8 @@ java_library_static { "android.hardware.soundtrigger-V2.3-java", "android.hidl.manager-V1.2-java", "capture_state_listener-aidl-java", - "dnsresolver_aidl_interface-V4-java", - "netd_event_listener_interface-java", + "dnsresolver_aidl_interface-java", + "netd_aidl_interfaces-platform-java", "overlayable_policy_aidl-java", ], } diff --git a/services/net/Android.bp b/services/net/Android.bp index bb5409b3e032f..8b444b0fed414 100644 --- a/services/net/Android.bp +++ b/services/net/Android.bp @@ -12,8 +12,7 @@ java_library_static { ":services.net-sources", ], static_libs: [ - "dnsresolver_aidl_interface-V4-java", - "netd_aidl_interface-V3-java", + "netd_aidl_interfaces-platform-java", "netlink-client", "networkstack-client", "net-utils-services-common", @@ -44,7 +43,8 @@ java_library { "framework-wifi-util-lib", ], static_libs: [ - "dnsresolver_aidl_interface-V2-java", + // All the classes in netd_aidl_interface must be jarjar so they do not conflict with the + // classes generated by netd_aidl_interfaces-platform-java above. "netd_aidl_interface-V3-java", "netlink-client", "networkstack-client",