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