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", |
| 85 | api_only: true, |
| 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", |
| 90 | ], |
| 91 | aidl: { |
| 92 | include_dirs: [ |
| 93 | // Include directories for parcelables that are part of the stable API, and need a |
| 94 | // one-line "parcelable X" .aidl declaration to be used in AIDL interfaces. |
| 95 | // TODO(b/180293679): remove these dependencies as they should not be necessary once |
| 96 | // the module builds against API (the parcelable declarations exist in framework.aidl) |
| 97 | "frameworks/base/core/java", // For framework parcelables |
| 98 | "frameworks/native/aidl/binder", // For PersistableBundle.aidl |
| 99 | ], |
| 100 | }, |
| 101 | libs: [ |
| 102 | "unsupportedappusage", |
| 103 | ], |
Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 104 | permitted_packages: ["android.net"], |
| 105 | } |
| 106 | |
| 107 | cc_defaults { |
| 108 | name: "libframework-connectivity-defaults", |
| 109 | cflags: [ |
| 110 | "-Wall", |
| 111 | "-Werror", |
| 112 | "-Wno-unused-parameter", |
Remi NGUYEN VAN | b36fb99 | 2021-03-23 14:45:58 +0000 | [diff] [blame^] | 113 | // Don't warn about S API usage even with |
| 114 | // min_sdk 30: the library is only loaded |
| 115 | // on S+ devices |
| 116 | "-Wno-unguarded-availability", |
Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 117 | "-Wthread-safety", |
| 118 | ], |
| 119 | shared_libs: [ |
Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 120 | "liblog", |
| 121 | "libnativehelper", |
Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 122 | ], |
| 123 | header_libs: [ |
| 124 | "dnsproxyd_protocol_headers", |
| 125 | ], |
| 126 | } |
| 127 | |
| 128 | cc_library_static { |
| 129 | name: "libconnectivityframeworkutils", |
| 130 | defaults: ["libframework-connectivity-defaults"], |
| 131 | srcs: [ |
| 132 | "jni/android_net_NetworkUtils.cpp", |
| 133 | ], |
Remi NGUYEN VAN | 31f329e | 2021-03-21 14:30:38 +0000 | [diff] [blame] | 134 | shared_libs: ["libandroid_net"], |
Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 135 | apex_available: [ |
| 136 | "//apex_available:platform", |
| 137 | "com.android.tethering", |
| 138 | ], |
| 139 | } |
| 140 | |
| 141 | cc_library_shared { |
| 142 | name: "libframework-connectivity-jni", |
Remi NGUYEN VAN | b36fb99 | 2021-03-23 14:45:58 +0000 | [diff] [blame^] | 143 | min_sdk_version: "30", |
Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 144 | defaults: ["libframework-connectivity-defaults"], |
| 145 | srcs: [ |
Remi NGUYEN VAN | 6b0c407 | 2021-03-23 10:50:45 +0000 | [diff] [blame] | 146 | "jni/android_net_NetworkUtils.cpp", |
Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 147 | "jni/onload.cpp", |
| 148 | ], |
Remi NGUYEN VAN | 31f329e | 2021-03-21 14:30:38 +0000 | [diff] [blame] | 149 | shared_libs: ["libandroid"], |
Remi NGUYEN VAN | 47cc651 | 2021-03-24 01:49:39 +0000 | [diff] [blame] | 150 | stl: "libc++_static", |
Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 151 | apex_available: [ |
| 152 | "//apex_available:platform", |
| 153 | "com.android.tethering", |
Remi NGUYEN VAN | 3b52af9 | 2021-03-19 00:24:45 +0000 | [diff] [blame] | 154 | ], |
Remi NGUYEN VAN | 11b5a5c | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 155 | } |
Remi NGUYEN VAN | eb6aa22 | 2021-03-14 12:56:26 +0900 | [diff] [blame] | 156 | |
| 157 | java_library { |
| 158 | name: "framework-connectivity.impl", |
Remi NGUYEN VAN | 3b52af9 | 2021-03-19 00:24:45 +0000 | [diff] [blame] | 159 | sdk_version: "module_current", |
Remi NGUYEN VAN | b36fb99 | 2021-03-23 14:45:58 +0000 | [diff] [blame^] | 160 | min_sdk_version: "30", |
Remi NGUYEN VAN | eb6aa22 | 2021-03-14 12:56:26 +0900 | [diff] [blame] | 161 | srcs: [ |
| 162 | ":framework-connectivity-sources", |
| 163 | ], |
| 164 | aidl: { |
| 165 | include_dirs: [ |
| 166 | "frameworks/base/core/java", // For framework parcelables |
| 167 | "frameworks/native/aidl/binder", // For PersistableBundle.aidl |
| 168 | ], |
| 169 | }, |
| 170 | libs: [ |
Remi NGUYEN VAN | 3b52af9 | 2021-03-19 00:24:45 +0000 | [diff] [blame] | 171 | // TODO (b/183097033) remove once module_current includes core_current |
| 172 | "stable.core.platform.api.stubs", |
| 173 | "framework-tethering", |
| 174 | "framework-wifi", |
Remi NGUYEN VAN | eb6aa22 | 2021-03-14 12:56:26 +0900 | [diff] [blame] | 175 | "unsupportedappusage", |
Remi NGUYEN VAN | eb6aa22 | 2021-03-14 12:56:26 +0900 | [diff] [blame] | 176 | ], |
| 177 | static_libs: [ |
Remi NGUYEN VAN | 8c2d521 | 2021-03-14 15:28:10 +0900 | [diff] [blame] | 178 | "framework-connectivity-protos", |
Remi NGUYEN VAN | eb6aa22 | 2021-03-14 12:56:26 +0900 | [diff] [blame] | 179 | "net-utils-device-common", |
| 180 | ], |
| 181 | jarjar_rules: "jarjar-rules.txt", |
| 182 | apex_available: ["com.android.tethering"], |
| 183 | installable: true, |
Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 184 | permitted_packages: ["android.net"], |
Remi NGUYEN VAN | eb6aa22 | 2021-03-14 12:56:26 +0900 | [diff] [blame] | 185 | } |