Remi NGUYEN VAN | 66ea68e | 2021-01-15 16:22:36 +0900 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2020 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 | |
Bob Badour | 6c7ed9d | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 17 | package { |
| 18 | // See: http://go/android-license-faq |
Baligh Uddin | 3684713 | 2021-05-23 16:38:40 +0000 | [diff] [blame] | 19 | default_applicable_licenses: ["Android-Apache-2.0"], |
Bob Badour | 6c7ed9d | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 20 | } |
| 21 | |
Remi NGUYEN VAN | f96b266 | 2021-03-14 15:28:10 +0900 | [diff] [blame] | 22 | java_library { |
| 23 | name: "framework-connectivity-protos", |
Remi NGUYEN VAN | e4d51c9 | 2021-03-19 00:24:45 +0000 | [diff] [blame] | 24 | sdk_version: "module_current", |
Remi NGUYEN VAN | da43ef0 | 2021-03-23 14:45:58 +0000 | [diff] [blame] | 25 | min_sdk_version: "30", |
Remi NGUYEN VAN | f96b266 | 2021-03-14 15:28:10 +0900 | [diff] [blame] | 26 | proto: { |
| 27 | type: "nano", |
| 28 | }, |
| 29 | srcs: [ |
| 30 | // TODO: consider moving relevant .proto files directly to the module directory |
| 31 | ":framework-javastream-protos", |
| 32 | ], |
| 33 | apex_available: [ |
| 34 | "//apex_available:platform", |
| 35 | "com.android.tethering", |
| 36 | ], |
| 37 | jarjar_rules: "jarjar-rules-proto.txt", |
| 38 | visibility: [ |
| 39 | "//visibility:private", |
| 40 | ], |
| 41 | } |
| 42 | |
Remi NGUYEN VAN | 66ea68e | 2021-01-15 16:22:36 +0900 | [diff] [blame] | 43 | filegroup { |
Remi NGUYEN VAN | 6916d51 | 2021-02-15 20:16:28 +0900 | [diff] [blame] | 44 | name: "framework-connectivity-internal-sources", |
Remi NGUYEN VAN | 66ea68e | 2021-01-15 16:22:36 +0900 | [diff] [blame] | 45 | srcs: [ |
| 46 | "src/**/*.java", |
| 47 | "src/**/*.aidl", |
| 48 | ], |
| 49 | path: "src", |
| 50 | visibility: [ |
Remi NGUYEN VAN | 6916d51 | 2021-02-15 20:16:28 +0900 | [diff] [blame] | 51 | "//visibility:private", |
| 52 | ], |
| 53 | } |
| 54 | |
| 55 | filegroup { |
| 56 | name: "framework-connectivity-aidl-export-sources", |
| 57 | srcs: [ |
| 58 | "aidl-export/**/*.aidl", |
| 59 | ], |
| 60 | path: "aidl-export", |
| 61 | visibility: [ |
| 62 | "//visibility:private", |
| 63 | ], |
| 64 | } |
| 65 | |
| 66 | // TODO: use a java_library in the bootclasspath instead |
| 67 | filegroup { |
| 68 | name: "framework-connectivity-sources", |
| 69 | srcs: [ |
| 70 | ":framework-connectivity-internal-sources", |
| 71 | ":framework-connectivity-aidl-export-sources", |
| 72 | ], |
| 73 | visibility: [ |
Remi NGUYEN VAN | 66ea68e | 2021-01-15 16:22:36 +0900 | [diff] [blame] | 74 | "//frameworks/base", |
| 75 | "//packages/modules/Connectivity:__subpackages__", |
| 76 | ], |
Bob Badour | 6c7ed9d | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 77 | } |
Remi NGUYEN VAN | f15fc7f | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 78 | |
| 79 | java_sdk_library { |
| 80 | name: "framework-connectivity", |
Remi NGUYEN VAN | e70cd84 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 81 | sdk_version: "module_current", |
| 82 | min_sdk_version: "30", |
Remi NGUYEN VAN | f15fc7f | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 83 | defaults: ["framework-module-defaults"], |
Remi NGUYEN VAN | e4d51c9 | 2021-03-19 00:24:45 +0000 | [diff] [blame] | 84 | installable: true, |
Remi NGUYEN VAN | f15fc7f | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 85 | srcs: [ |
| 86 | ":framework-connectivity-sources", |
Remi NGUYEN VAN | e70cd84 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 87 | ":net-utils-framework-common-srcs", |
Remi NGUYEN VAN | f15fc7f | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 88 | ], |
| 89 | aidl: { |
| 90 | include_dirs: [ |
| 91 | // Include directories for parcelables that are part of the stable API, and need a |
| 92 | // one-line "parcelable X" .aidl declaration to be used in AIDL interfaces. |
| 93 | // TODO(b/180293679): remove these dependencies as they should not be necessary once |
| 94 | // the module builds against API (the parcelable declarations exist in framework.aidl) |
| 95 | "frameworks/base/core/java", // For framework parcelables |
| 96 | "frameworks/native/aidl/binder", // For PersistableBundle.aidl |
| 97 | ], |
| 98 | }, |
Remi NGUYEN VAN | e70cd84 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 99 | impl_only_libs: [ |
Remi NGUYEN VAN | e70cd84 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 100 | "framework-tethering.stubs.module_lib", |
| 101 | "framework-wifi.stubs.module_lib", |
| 102 | "net-utils-device-common", |
| 103 | ], |
Remi NGUYEN VAN | f15fc7f | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 104 | libs: [ |
| 105 | "unsupportedappusage", |
| 106 | ], |
Remi NGUYEN VAN | e70cd84 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 107 | static_libs: [ |
| 108 | "framework-connectivity-protos", |
| 109 | ], |
| 110 | jarjar_rules: "jarjar-rules.txt", |
Remi NGUYEN VAN | 1fd558e | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 111 | permitted_packages: ["android.net"], |
Remi NGUYEN VAN | e70cd84 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 112 | impl_library_visibility: [ |
| 113 | "//packages/modules/Connectivity/Tethering/apex", |
| 114 | // In preparation for future move |
| 115 | "//packages/modules/Connectivity/apex", |
| 116 | "//packages/modules/Connectivity/service", |
| 117 | "//frameworks/base/packages/Connectivity/service", |
| 118 | "//frameworks/base", |
Remi NGUYEN VAN | 3912c80 | 2021-03-16 01:31:07 +0000 | [diff] [blame] | 119 | |
| 120 | // Tests using hidden APIs |
| 121 | "//external/sl4a:__subpackages__", |
| 122 | "//frameworks/base/tests/net:__subpackages__", |
| 123 | "//frameworks/libs/net/common/testutils", |
| 124 | "//frameworks/libs/net/common/tests:__subpackages__", |
| 125 | "//frameworks/opt/telephony/tests/telephonytests", |
| 126 | "//packages/modules/Connectivity/Tethering/tests:__subpackages__", |
| 127 | "//packages/modules/Connectivity/tests:__subpackages__", |
| 128 | "//packages/modules/NetworkStack/tests:__subpackages__", |
Remi NGUYEN VAN | e70cd84 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 129 | ], |
| 130 | apex_available: [ |
| 131 | "//apex_available:platform", |
| 132 | "com.android.tethering", |
| 133 | ], |
Remi NGUYEN VAN | 1fd558e | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | cc_defaults { |
| 137 | name: "libframework-connectivity-defaults", |
| 138 | cflags: [ |
| 139 | "-Wall", |
| 140 | "-Werror", |
| 141 | "-Wno-unused-parameter", |
Remi NGUYEN VAN | da43ef0 | 2021-03-23 14:45:58 +0000 | [diff] [blame] | 142 | // Don't warn about S API usage even with |
| 143 | // min_sdk 30: the library is only loaded |
| 144 | // on S+ devices |
| 145 | "-Wno-unguarded-availability", |
Remi NGUYEN VAN | 1fd558e | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 146 | "-Wthread-safety", |
| 147 | ], |
| 148 | shared_libs: [ |
Remi NGUYEN VAN | 1fd558e | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 149 | "liblog", |
| 150 | "libnativehelper", |
Remi NGUYEN VAN | 1fd558e | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 151 | ], |
| 152 | header_libs: [ |
| 153 | "dnsproxyd_protocol_headers", |
| 154 | ], |
| 155 | } |
| 156 | |
| 157 | cc_library_static { |
| 158 | name: "libconnectivityframeworkutils", |
| 159 | defaults: ["libframework-connectivity-defaults"], |
| 160 | srcs: [ |
| 161 | "jni/android_net_NetworkUtils.cpp", |
| 162 | ], |
Remi NGUYEN VAN | a5e1148 | 2021-03-21 14:30:38 +0000 | [diff] [blame] | 163 | shared_libs: ["libandroid_net"], |
Remi NGUYEN VAN | 1fd558e | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 164 | apex_available: [ |
| 165 | "//apex_available:platform", |
| 166 | "com.android.tethering", |
| 167 | ], |
| 168 | } |
| 169 | |
| 170 | cc_library_shared { |
| 171 | name: "libframework-connectivity-jni", |
Remi NGUYEN VAN | da43ef0 | 2021-03-23 14:45:58 +0000 | [diff] [blame] | 172 | min_sdk_version: "30", |
Remi NGUYEN VAN | 1fd558e | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 173 | defaults: ["libframework-connectivity-defaults"], |
| 174 | srcs: [ |
Remi NGUYEN VAN | 8d1a96d | 2021-03-23 10:50:45 +0000 | [diff] [blame] | 175 | "jni/android_net_NetworkUtils.cpp", |
Remi NGUYEN VAN | 1fd558e | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 176 | "jni/onload.cpp", |
| 177 | ], |
Remi NGUYEN VAN | a5e1148 | 2021-03-21 14:30:38 +0000 | [diff] [blame] | 178 | shared_libs: ["libandroid"], |
Remi NGUYEN VAN | 4be92df | 2021-03-24 01:49:39 +0000 | [diff] [blame] | 179 | stl: "libc++_static", |
Remi NGUYEN VAN | 1fd558e | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 180 | apex_available: [ |
Remi NGUYEN VAN | 1fd558e | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 181 | "com.android.tethering", |
Remi NGUYEN VAN | e4d51c9 | 2021-03-19 00:24:45 +0000 | [diff] [blame] | 182 | ], |
Remi NGUYEN VAN | f15fc7f | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 183 | } |