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