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