Remi NGUYEN VAN | c2fb349 | 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 | 9d15624 | 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 | d2f0300 | 2021-03-14 15:28:10 +0900 | [diff] [blame] | 26 | java_library { |
| 27 | name: "framework-connectivity-protos", |
Remi NGUYEN VAN | 2a311db | 2021-03-19 00:24:45 +0000 | [diff] [blame] | 28 | sdk_version: "module_current", |
Remi NGUYEN VAN | d2f0300 | 2021-03-14 15:28:10 +0900 | [diff] [blame] | 29 | proto: { |
| 30 | type: "nano", |
| 31 | }, |
| 32 | srcs: [ |
| 33 | // TODO: consider moving relevant .proto files directly to the module directory |
| 34 | ":framework-javastream-protos", |
| 35 | ], |
| 36 | apex_available: [ |
| 37 | "//apex_available:platform", |
| 38 | "com.android.tethering", |
| 39 | ], |
| 40 | jarjar_rules: "jarjar-rules-proto.txt", |
| 41 | visibility: [ |
| 42 | "//visibility:private", |
| 43 | ], |
| 44 | } |
| 45 | |
Remi NGUYEN VAN | c2fb349 | 2021-01-15 16:22:36 +0900 | [diff] [blame] | 46 | filegroup { |
Remi NGUYEN VAN | 076dcdc | 2021-02-15 20:16:28 +0900 | [diff] [blame] | 47 | name: "framework-connectivity-internal-sources", |
Remi NGUYEN VAN | c2fb349 | 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 | 076dcdc | 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 | c2fb349 | 2021-01-15 16:22:36 +0900 | [diff] [blame] | 77 | "//frameworks/base", |
| 78 | "//packages/modules/Connectivity:__subpackages__", |
| 79 | ], |
Bob Badour | 9d15624 | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 80 | } |
Remi NGUYEN VAN | c1326df | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 81 | |
| 82 | java_sdk_library { |
| 83 | name: "framework-connectivity", |
| 84 | api_only: true, |
| 85 | defaults: ["framework-module-defaults"], |
Remi NGUYEN VAN | 2a311db | 2021-03-19 00:24:45 +0000 | [diff] [blame] | 86 | installable: true, |
Remi NGUYEN VAN | c1326df | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 87 | srcs: [ |
| 88 | ":framework-connectivity-sources", |
| 89 | ], |
| 90 | aidl: { |
| 91 | include_dirs: [ |
| 92 | // Include directories for parcelables that are part of the stable API, and need a |
| 93 | // one-line "parcelable X" .aidl declaration to be used in AIDL interfaces. |
| 94 | // TODO(b/180293679): remove these dependencies as they should not be necessary once |
| 95 | // the module builds against API (the parcelable declarations exist in framework.aidl) |
| 96 | "frameworks/base/core/java", // For framework parcelables |
| 97 | "frameworks/native/aidl/binder", // For PersistableBundle.aidl |
| 98 | ], |
| 99 | }, |
| 100 | libs: [ |
| 101 | "unsupportedappusage", |
| 102 | ], |
Remi NGUYEN VAN | 8f0031d | 2021-03-19 10:13:40 +0000 | [diff] [blame^] | 103 | permitted_packages: ["android.net"], |
| 104 | } |
| 105 | |
| 106 | cc_defaults { |
| 107 | name: "libframework-connectivity-defaults", |
| 108 | cflags: [ |
| 109 | "-Wall", |
| 110 | "-Werror", |
| 111 | "-Wno-unused-parameter", |
| 112 | "-Wthread-safety", |
| 113 | ], |
| 114 | shared_libs: [ |
| 115 | "libbase", |
| 116 | "liblog", |
| 117 | "libnativehelper", |
| 118 | "libnetd_client", |
| 119 | ], |
| 120 | header_libs: [ |
| 121 | "dnsproxyd_protocol_headers", |
| 122 | ], |
| 123 | } |
| 124 | |
| 125 | cc_library_static { |
| 126 | name: "libconnectivityframeworkutils", |
| 127 | defaults: ["libframework-connectivity-defaults"], |
| 128 | srcs: [ |
| 129 | "jni/android_net_NetworkUtils.cpp", |
| 130 | ], |
| 131 | apex_available: [ |
| 132 | "//apex_available:platform", |
| 133 | "com.android.tethering", |
| 134 | ], |
| 135 | } |
| 136 | |
| 137 | cc_library_shared { |
| 138 | name: "libframework-connectivity-jni", |
| 139 | defaults: ["libframework-connectivity-defaults"], |
| 140 | srcs: [ |
| 141 | "jni/onload.cpp", |
| 142 | ], |
| 143 | static_libs: ["libconnectivityframeworkutils"], |
| 144 | apex_available: [ |
| 145 | "//apex_available:platform", |
| 146 | "com.android.tethering", |
Remi NGUYEN VAN | 2a311db | 2021-03-19 00:24:45 +0000 | [diff] [blame] | 147 | ], |
Remi NGUYEN VAN | c1326df | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 148 | } |
Remi NGUYEN VAN | 1142754 | 2021-03-14 12:56:26 +0900 | [diff] [blame] | 149 | |
| 150 | java_library { |
| 151 | name: "framework-connectivity.impl", |
Remi NGUYEN VAN | 2a311db | 2021-03-19 00:24:45 +0000 | [diff] [blame] | 152 | sdk_version: "module_current", |
Remi NGUYEN VAN | 1142754 | 2021-03-14 12:56:26 +0900 | [diff] [blame] | 153 | srcs: [ |
| 154 | ":framework-connectivity-sources", |
| 155 | ], |
| 156 | aidl: { |
| 157 | include_dirs: [ |
| 158 | "frameworks/base/core/java", // For framework parcelables |
| 159 | "frameworks/native/aidl/binder", // For PersistableBundle.aidl |
| 160 | ], |
| 161 | }, |
| 162 | libs: [ |
Remi NGUYEN VAN | 2a311db | 2021-03-19 00:24:45 +0000 | [diff] [blame] | 163 | // TODO (b/183097033) remove once module_current includes core_current |
| 164 | "stable.core.platform.api.stubs", |
| 165 | "framework-tethering", |
| 166 | "framework-wifi", |
Remi NGUYEN VAN | 1142754 | 2021-03-14 12:56:26 +0900 | [diff] [blame] | 167 | "unsupportedappusage", |
Remi NGUYEN VAN | 1142754 | 2021-03-14 12:56:26 +0900 | [diff] [blame] | 168 | ], |
| 169 | static_libs: [ |
Remi NGUYEN VAN | d2f0300 | 2021-03-14 15:28:10 +0900 | [diff] [blame] | 170 | "framework-connectivity-protos", |
Remi NGUYEN VAN | 1142754 | 2021-03-14 12:56:26 +0900 | [diff] [blame] | 171 | "net-utils-device-common", |
| 172 | ], |
| 173 | jarjar_rules: "jarjar-rules.txt", |
| 174 | apex_available: ["com.android.tethering"], |
| 175 | installable: true, |
Remi NGUYEN VAN | 8f0031d | 2021-03-19 10:13:40 +0000 | [diff] [blame^] | 176 | permitted_packages: ["android.net"], |
Remi NGUYEN VAN | 1142754 | 2021-03-14 12:56:26 +0900 | [diff] [blame] | 177 | } |