Remi NGUYEN VAN | ded2315 | 2018-12-07 16:52:24 +0900 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2018 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
paulhu | 5982eff | 2019-03-29 19:21:30 +0800 | [diff] [blame] | 17 | java_library { |
| 18 | name: "captiveportal-lib", |
| 19 | srcs: ["common/**/*.java"], |
| 20 | libs: [ |
| 21 | "androidx.annotation_annotation", |
| 22 | ], |
| 23 | sdk_version: "system_current", |
| 24 | } |
| 25 | |
Remi NGUYEN VAN | 4036956 | 2019-03-20 16:40:54 +0900 | [diff] [blame] | 26 | java_defaults { |
| 27 | name: "NetworkStackCommon", |
| 28 | sdk_version: "system_current", |
| 29 | min_sdk_version: "28", |
| 30 | } |
| 31 | |
Remi NGUYEN VAN | 0a4df5a | 2019-03-08 17:20:49 +0900 | [diff] [blame] | 32 | // Library including the network stack, used to compile both variants of the network stack |
| 33 | android_library { |
| 34 | name: "NetworkStackBase", |
Remi NGUYEN VAN | 4036956 | 2019-03-20 16:40:54 +0900 | [diff] [blame] | 35 | defaults: ["NetworkStackCommon"], |
Remi NGUYEN VAN | ded2315 | 2018-12-07 16:52:24 +0900 | [diff] [blame] | 36 | srcs: [ |
| 37 | "src/**/*.java", |
Remi NGUYEN VAN | 82b4b42 | 2019-01-20 09:35:10 +0900 | [diff] [blame] | 38 | ":framework-networkstack-shared-srcs", |
Remi NGUYEN VAN | 5daa370 | 2018-12-27 16:43:56 +0900 | [diff] [blame] | 39 | ":services-networkstack-shared-srcs", |
Chiachang Wang | 53817ca | 2019-04-11 21:24:28 +0800 | [diff] [blame^] | 40 | ":statslog-networkstack-java-gen", |
Remi NGUYEN VAN | ded2315 | 2018-12-07 16:52:24 +0900 | [diff] [blame] | 41 | ], |
Remi NGUYEN VAN | 057bf20 | 2018-12-04 12:13:09 +0900 | [diff] [blame] | 42 | static_libs: [ |
Remi NGUYEN VAN | 9babdec | 2019-04-09 02:04:54 -0700 | [diff] [blame] | 43 | "androidx.annotation_annotation", |
Chalard Jean | 5b67876 | 2019-01-30 21:04:58 +0900 | [diff] [blame] | 44 | "ipmemorystore-client", |
Remi NGUYEN VAN | 6e9fdbd | 2019-01-29 15:38:52 +0900 | [diff] [blame] | 45 | "netd_aidl_interface-java", |
| 46 | "networkstack-aidl-interfaces-java", |
Chiachang Wang | 8b5f84a | 2019-02-22 11:13:07 +0800 | [diff] [blame] | 47 | "datastallprotosnano", |
Chiachang Wang | 54663a8 | 2019-03-21 20:40:01 +0800 | [diff] [blame] | 48 | "networkstackprotosnano", |
paulhu | 5982eff | 2019-03-29 19:21:30 +0800 | [diff] [blame] | 49 | "captiveportal-lib", |
Remi NGUYEN VAN | 0a4df5a | 2019-03-08 17:20:49 +0900 | [diff] [blame] | 50 | ], |
| 51 | manifest: "AndroidManifestBase.xml", |
| 52 | } |
| 53 | |
Remi NGUYEN VAN | f38a564 | 2019-04-05 04:44:45 -0700 | [diff] [blame] | 54 | cc_library_shared { |
| 55 | name: "libnetworkstackutilsjni", |
| 56 | srcs: [ |
| 57 | "jni/network_stack_utils_jni.cpp" |
| 58 | ], |
| 59 | |
| 60 | shared_libs: [ |
| 61 | "liblog", |
| 62 | "libcutils", |
| 63 | "libnativehelper", |
| 64 | ], |
| 65 | static_libs: [ |
| 66 | "libpcap", |
| 67 | ], |
| 68 | cflags: [ |
| 69 | "-Wall", |
| 70 | "-Werror", |
| 71 | "-Wno-unused-parameter", |
| 72 | ], |
| 73 | } |
| 74 | |
Remi NGUYEN VAN | 4036956 | 2019-03-20 16:40:54 +0900 | [diff] [blame] | 75 | java_defaults { |
| 76 | name: "NetworkStackAppCommon", |
| 77 | defaults: ["NetworkStackCommon"], |
Remi NGUYEN VAN | 0a4df5a | 2019-03-08 17:20:49 +0900 | [diff] [blame] | 78 | privileged: true, |
| 79 | static_libs: [ |
| 80 | "NetworkStackBase", |
| 81 | ], |
Remi NGUYEN VAN | f38a564 | 2019-04-05 04:44:45 -0700 | [diff] [blame] | 82 | jni_libs: ["libnetworkstackutilsjni"], |
Remi NGUYEN VAN | 4036956 | 2019-03-20 16:40:54 +0900 | [diff] [blame] | 83 | // Resources already included in NetworkStackBase |
| 84 | resource_dirs: [], |
Remi NGUYEN VAN | 0a4df5a | 2019-03-08 17:20:49 +0900 | [diff] [blame] | 85 | jarjar_rules: "jarjar-rules-shared.txt", |
Remi NGUYEN VAN | 776d7f7 | 2019-03-26 14:58:08 +0900 | [diff] [blame] | 86 | optimize: { |
| 87 | proguard_flags_files: ["proguard.flags"], |
| 88 | }, |
Remi NGUYEN VAN | 0a4df5a | 2019-03-08 17:20:49 +0900 | [diff] [blame] | 89 | // The permission configuration *must* be included to ensure security of the device |
Remi NGUYEN VAN | 288fb70 | 2019-03-26 17:24:48 +0900 | [diff] [blame] | 90 | required: ["NetworkPermissionConfig"], |
Remi NGUYEN VAN | 4036956 | 2019-03-20 16:40:54 +0900 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | // Non-updatable network stack running in the system server process for devices not using the module |
| 94 | android_app { |
| 95 | name: "InProcessNetworkStack", |
| 96 | defaults: ["NetworkStackAppCommon"], |
| 97 | certificate: "platform", |
Remi NGUYEN VAN | 0a4df5a | 2019-03-08 17:20:49 +0900 | [diff] [blame] | 98 | manifest: "AndroidManifest_InProcess.xml", |
Remi NGUYEN VAN | ded2315 | 2018-12-07 16:52:24 +0900 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | // Updatable network stack packaged as an application |
| 102 | android_app { |
| 103 | name: "NetworkStack", |
Remi NGUYEN VAN | 4036956 | 2019-03-20 16:40:54 +0900 | [diff] [blame] | 104 | defaults: ["NetworkStackAppCommon"], |
Remi NGUYEN VAN | d8327a2 | 2019-02-15 17:45:03 +0900 | [diff] [blame] | 105 | certificate: "networkstack", |
Remi NGUYEN VAN | 0a4df5a | 2019-03-08 17:20:49 +0900 | [diff] [blame] | 106 | manifest: "AndroidManifest.xml", |
Chiachang Wang | 8b5f84a | 2019-02-22 11:13:07 +0800 | [diff] [blame] | 107 | } |
Chiachang Wang | 53817ca | 2019-04-11 21:24:28 +0800 | [diff] [blame^] | 108 | |
| 109 | genrule { |
| 110 | name: "statslog-networkstack-java-gen", |
| 111 | tools: ["stats-log-api-gen"], |
| 112 | cmd: "$(location stats-log-api-gen) --java $(out) --module network_stack" + |
| 113 | " --javaPackage com.android.networkstack.metrics --javaClass NetworkStackStatsLog", |
| 114 | out: ["com/android/networkstack/metrics/NetworkStackStatsLog.java"], |
| 115 | } |