1//
2// Copyright (C) 2021 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
17package {
18    default_team: "trendy_team_fwk_core_networking",
19    // See: http://go/android-license-faq
20    default_applicable_licenses: ["Android-Apache-2.0"],
21}
22
23framework_remoteauth_srcs = [":framework-remoteauth-java-sources"]
24framework_remoteauth_api_srcs = []
25
26java_defaults {
27    name: "enable-remoteauth-targets",
28    enabled: true,
29}
30
31// Include build rules from Sources.bp
32build = ["Sources.bp"]
33
34java_defaults {
35    name: "enable-framework-connectivity-t-targets",
36    enabled: true,
37}
38
39// The above defaults can be used to disable framework-connectivity t
40// targets while minimizing merge conflicts in the build rules.
41
42// SDK library for connectivity bootclasspath classes that were part of the non-updatable API before
43// T, and were moved to the module in T. Other bootclasspath classes in connectivity should go to
44// framework-connectivity.
45java_defaults {
46    name: "framework-connectivity-t-defaults",
47    sdk_version: "module_current",
48    min_sdk_version: "Tiramisu",
49    defaults: [
50        "framework-module-defaults",
51    ],
52    srcs: [
53        ":framework-connectivity-tiramisu-updatable-sources",
54        ":framework-nearby-java-sources",
55        ":framework-thread-sources",
56    ],
57    libs: [
58        "unsupportedappusage",
59        "app-compat-annotations",
60        "androidx.annotation_annotation",
61    ],
62    static_libs: [
63        // Cannot go to framework-connectivity because mid_sdk checks require 31.
64        "modules-utils-binary-xml",
65    ],
66    impl_only_libs: [
67        // The build system will use framework-bluetooth module_current stubs, because
68        // of sdk_version: "module_current" above.
69        "framework-bluetooth",
70        "framework-wifi",
71        // Compile against the entire implementation of framework-connectivity,
72        // including hidden methods. This is safe because if framework-connectivity-t is
73        // on the bootclasspath (i.e., T), then framework-connectivity is also on the
74        // bootclasspath (because it shipped in S).
75        //
76        // This compiles against the pre-jarjar target so that this code can use
77        // non-jarjard names of widely-used packages such as com.android.net.module.util.
78        "framework-connectivity-pre-jarjar",
79    ],
80    aidl: {
81        generate_get_transaction_name: true,
82        include_dirs: [
83            // For connectivity-framework classes such as Network.aidl,
84            // and connectivity-framework-t classes such as
85            // NetworkStateSnapshot.aidl
86            "packages/modules/Connectivity/framework/aidl-export",
87        ],
88    },
89    apex_available: [
90        "com.android.tethering",
91    ],
92}
93
94filegroup {
95    name: "connectivity-t-hiddenapi-files",
96    srcs: ["hiddenapi/*.txt"],
97    visibility: ["//packages/modules/Connectivity:__subpackages__"],
98}
99
100// The filegroup lists files that are necessary for verifying building mdns as a standalone,
101// for use with service-connectivity-mdns-standalone-build-test
102// This filegroup should never be included in anywhere in the module build. It is only used for
103// building service-connectivity-mdns-standalone-build-test target. The files will be renamed by
104// copybara to prevent them from being shadowed by the bootclasspath copies.
105filegroup {
106    name: "framework-connectivity-t-mdns-standalone-build-sources",
107    srcs: [
108        "src/android/net/nsd/OffloadEngine.java",
109        "src/android/net/nsd/OffloadServiceInfo.java",
110    ],
111    visibility: ["//packages/modules/Connectivity:__subpackages__"],
112}
113
114java_library {
115    name: "framework-connectivity-t-pre-jarjar",
116    defaults: ["framework-connectivity-t-defaults"],
117    libs: [
118        "framework-bluetooth",
119        "framework-wifi",
120        "framework-connectivity-pre-jarjar",
121        "framework-location.stubs.module_lib",
122    ],
123    visibility: ["//packages/modules/Connectivity:__subpackages__"],
124}
125
126// SDK library for connectivity bootclasspath classes that were part of the non-updatable API before
127// T, and were moved to the module in T. Other bootclasspath classes in connectivity should go to
128// framework-connectivity.
129java_sdk_library {
130    name: "framework-connectivity-t",
131    defaults: [
132        "framework-connectivity-t-defaults",
133        "enable-framework-connectivity-t-targets",
134    ],
135    // Do not add static_libs to this library: put them in framework-connectivity instead.
136    // The jarjar rules are only so that references to jarjared utils in
137    // framework-connectivity-pre-jarjar match at runtime.
138    jarjar_rules: ":framework-connectivity-jarjar-rules",
139    stub_only_libs: [
140        // Use prebuilt framework-connectivity stubs to avoid circular dependencies
141        "sdk_module-lib_current_framework-connectivity",
142    ],
143    libs: [
144        "framework-location.stubs.module_lib",
145        "sdk_module-lib_current_framework-connectivity",
146    ],
147    permitted_packages: [
148        "android.app.usage",
149        "android.net",
150        "android.net.nsd",
151        "android.nearby",
152        "com.android.connectivity",
153        "com.android.nearby",
154    ],
155
156    hidden_api: {
157        max_target_o_low_priority: [
158            "hiddenapi/hiddenapi-max-target-o-low-priority-tiramisu.txt",
159        ],
160        max_target_r_low_priority: [
161            "hiddenapi/hiddenapi-max-target-r-loprio.txt",
162        ],
163        unsupported: [
164            "hiddenapi/hiddenapi-unsupported-tiramisu.txt",
165        ],
166    },
167
168    impl_library_visibility: [
169        "//packages/modules/Connectivity/Tethering/apex",
170        // In preparation for future move
171        "//packages/modules/Connectivity/apex",
172        "//packages/modules/Connectivity/service", // For R8 only
173        "//packages/modules/Connectivity/service-t",
174        "//packages/modules/Connectivity/nearby:__subpackages__",
175        "//packages/modules/Connectivity/remoteauth:__subpackages__",
176        "//frameworks/base",
177
178        // Tests using hidden APIs
179        "//cts/tests/netlegacy22.api",
180        "//cts/tests/tests/app.usage", // NetworkUsageStatsTest
181        "//external/sl4a:__subpackages__",
182        "//frameworks/base/core/tests/bandwidthtests",
183        "//frameworks/base/core/tests/benchmarks",
184        "//frameworks/base/core/tests/utillib",
185        "//frameworks/base/services/tests/VpnTests",
186        "//frameworks/base/tests/vcn",
187        "//frameworks/opt/net/ethernet/tests:__subpackages__",
188        "//frameworks/opt/telephony/tests/telephonytests",
189        "//packages/modules/CaptivePortalLogin/tests",
190        "//packages/modules/Connectivity/staticlibs/testutils",
191        "//packages/modules/Connectivity/staticlibs/tests:__subpackages__",
192        "//packages/modules/Connectivity/Tethering/tests:__subpackages__",
193        "//packages/modules/Connectivity/tests:__subpackages__",
194        "//packages/modules/Connectivity/thread/tests:__subpackages__",
195        "//packages/modules/IPsec/tests/iketests",
196        "//packages/modules/NetworkStack/tests:__subpackages__",
197        "//packages/modules/Wifi/service/tests/wifitests",
198    ],
199    aconfig_declarations: [
200        "com.android.net.flags-aconfig",
201        "com.android.net.thread.flags-aconfig",
202        "nearby_flags",
203    ],
204}
205
206// This rule is not used anymore(b/268440216).
207platform_compat_config {
208    name: "connectivity-t-platform-compat-config",
209    src: ":framework-connectivity-t",
210}
211