From 86c45823c73e38826f8f1bf9ff01940f639dfa08 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Wed, 20 Mar 2019 16:40:54 +0900 Subject: Compile NetworkStack resources only once The current build files would compile resources both for the android_library and the android_app build rules, since the android_app build rule resource_dirs default to ["res"]. Set resource_dirs to [] for these build rules so that resources are only inherited from the android_library. Also refactor the build file using java_defaults to avoid repeating configuration. Test: flashed, boots, WiFi working Bug: 127908503 Change-Id: Ie51dd1bd1a8ee5145e3f1b95beb1de59665b4c51 --- packages/NetworkStack/Android.bp | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/packages/NetworkStack/Android.bp b/packages/NetworkStack/Android.bp index 8872147b65ed..c3031801e8d4 100644 --- a/packages/NetworkStack/Android.bp +++ b/packages/NetworkStack/Android.bp @@ -14,11 +14,16 @@ // limitations under the License. // +java_defaults { + name: "NetworkStackCommon", + sdk_version: "system_current", + min_sdk_version: "28", +} + // Library including the network stack, used to compile both variants of the network stack android_library { name: "NetworkStackBase", - sdk_version: "system_current", - min_sdk_version: "28", + defaults: ["NetworkStackCommon"], srcs: [ "src/**/*.java", ":framework-networkstack-shared-srcs", @@ -33,34 +38,32 @@ android_library { manifest: "AndroidManifestBase.xml", } -// Non-updatable in-process network stack for devices not using the module -android_app { - name: "InProcessNetworkStack", - sdk_version: "system_current", - min_sdk_version: "28", - certificate: "platform", +java_defaults { + name: "NetworkStackAppCommon", + defaults: ["NetworkStackCommon"], privileged: true, static_libs: [ "NetworkStackBase", ], + // Resources already included in NetworkStackBase + resource_dirs: [], jarjar_rules: "jarjar-rules-shared.txt", // The permission configuration *must* be included to ensure security of the device required: ["NetworkStackPermissionStub"], +} + +// Non-updatable network stack running in the system server process for devices not using the module +android_app { + name: "InProcessNetworkStack", + defaults: ["NetworkStackAppCommon"], + certificate: "platform", manifest: "AndroidManifest_InProcess.xml", } // Updatable network stack packaged as an application android_app { name: "NetworkStack", - sdk_version: "system_current", - min_sdk_version: "28", + defaults: ["NetworkStackAppCommon"], certificate: "networkstack", - privileged: true, - static_libs: [ - "NetworkStackBase" - ], - jarjar_rules: "jarjar-rules-shared.txt", - // The permission configuration *must* be included to ensure security of the device - required: ["NetworkStackPermissionStub"], manifest: "AndroidManifest.xml", } -- cgit v1.2.3-59-g8ed1b