blob: 779f354fd1f81d53a10bcc17f22b03a8fa9b4fbf [file] [log] [blame]
paulhu802ab972021-12-14 01:30:22 +00001//
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 {
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000018 default_team: "trendy_team_fwk_core_networking",
paulhu802ab972021-12-14 01:30:22 +000019 // See: http://go/android-license-faq
20 default_applicable_licenses: ["Android-Apache-2.0"],
21}
22
Remi NGUYEN VANc41daa42023-08-14 15:34:20 +090023service_remoteauth_pre_jarjar_lib = "service-remoteauth-pre-jarjar"
24
Remi NGUYEN VAN0395b702022-03-08 19:49:49 +090025// Include build rules from Sources.bp
26build = ["Sources.bp"]
27
Remi NGUYEN VAN86bbfe92022-03-30 18:51:41 +090028filegroup {
29 name: "service-connectivity-tiramisu-sources",
30 srcs: [
31 "src/**/*.java",
32 ],
33 visibility: ["//visibility:private"],
34}
Cole Fausta52ecf02023-12-20 11:57:07 -080035
Remi NGUYEN VAN86bbfe92022-03-30 18:51:41 +090036// The above filegroup can be used to specify different sources depending
37// on the branch, while minimizing merge conflicts in the rest of the
38// build rules.
39
paulhu537f7202022-02-08 21:25:28 +080040// This builds T+ services depending on framework-connectivity-t
paulhu802ab972021-12-14 01:30:22 +000041// hidden symbols separately from the S+ services, to ensure that S+
42// services cannot accidentally depend on T+ hidden symbols from
paulhu537f7202022-02-08 21:25:28 +080043// framework-connectivity-t.
paulhu802ab972021-12-14 01:30:22 +000044java_library {
45 name: "service-connectivity-tiramisu-pre-jarjar",
46 sdk_version: "system_server_current",
47 // TODO(b/210962470): Bump this to at least S, and then T.
48 min_sdk_version: "30",
49 srcs: [
Remi NGUYEN VAN86bbfe92022-03-30 18:51:41 +090050 ":service-connectivity-tiramisu-sources",
paulhu802ab972021-12-14 01:30:22 +000051 ],
52 libs: [
53 "framework-annotations-lib",
Hassan Alic4f63fa2022-11-17 16:13:48 +000054 "framework-configinfrastructure",
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +090055 "framework-connectivity-pre-jarjar",
paulhu537f7202022-02-08 21:25:28 +080056 "framework-connectivity-t-pre-jarjar",
Igor Chernyshev9dac6602022-12-13 19:28:32 -080057 // TODO: use framework-tethering-pre-jarjar when it is separated from framework-tethering
58 "framework-tethering.impl",
Paul Hu03a51d52023-01-13 14:17:04 +080059 "framework-wifi",
paulhu802ab972021-12-14 01:30:22 +000060 "service-connectivity-pre-jarjar",
Remi NGUYEN VANb6cde3d2022-03-10 04:32:15 +000061 "service-nearby-pre-jarjar",
Kangping Donge7fef892023-08-11 15:30:09 +080062 "service-thread-pre-jarjar",
Remi NGUYEN VANc41daa42023-08-14 15:34:20 +090063 service_remoteauth_pre_jarjar_lib,
Xiao Ma0a171c02022-01-23 16:14:51 +000064 "ServiceConnectivityResources",
paulhu802ab972021-12-14 01:30:22 +000065 "unsupportedappusage",
66 ],
67 static_libs: [
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +090068 // Do not add static_libs here if they are already included in framework-connectivity
69 // or in service-connectivity. They are not necessary (included via
70 // service-connectivity-pre-jarjar), and in the case of code that is already in
71 // framework-connectivity, the classes would be included in the apex twice.
paulhu802ab972021-12-14 01:30:22 +000072 "modules-utils-statemachine",
paulhu802ab972021-12-14 01:30:22 +000073 ],
74 apex_available: [
75 "com.android.tethering",
76 ],
77 visibility: [
Chiachang Wanga5d98752024-02-28 07:50:15 +000078 "//frameworks/base/services/tests/VpnTests",
Aaron Huang720ad7c2022-01-26 00:43:10 +080079 "//frameworks/base/tests/vcn",
paulhu802ab972021-12-14 01:30:22 +000080 "//packages/modules/Connectivity/service",
81 "//packages/modules/Connectivity/tests:__subpackages__",
Aaron Huang720ad7c2022-01-26 00:43:10 +080082 "//packages/modules/IPsec/tests/iketests",
paulhu802ab972021-12-14 01:30:22 +000083 ],
Cole Fausta52ecf02023-12-20 11:57:07 -080084 lint: {
85 baseline_filename: "lint-baseline.xml",
86 },
paulhu802ab972021-12-14 01:30:22 +000087}
Yuyang Huang6e12ac62023-04-04 13:00:54 +090088
89// Test building mDNS as a standalone, so that it can be imported into other repositories as-is.
90// The mDNS code is platform code so it should use framework-annotations-lib, contrary to apps that
91// should use sdk_version: "system_current" and only androidx.annotation_annotation. But this build
92// rule verifies that the mDNS code can be built into apps, if code transformations are applied to
93// the annotations.
94// When using "system_current", framework annotations are not available; they would appear as
95// package-private as they are marked as such in the system_current stubs. So build against
96// core_platform and add the stubs manually in "libs". See http://b/147773144#comment7.
97java_library {
98 name: "service-connectivity-mdns-standalone-build-test",
99 sdk_version: "core_platform",
Yuyang Huangfc831702023-08-21 17:48:48 +0900100 min_sdk_version: "21",
101 lint: {
102 error_checks: ["NewApi"],
Cole Faustbe30b3e2024-01-25 02:41:58 +0000103
Yuyang Huangfc831702023-08-21 17:48:48 +0900104 },
Yuyang Huang6e12ac62023-04-04 13:00:54 +0900105 srcs: [
Yuyang Huang6e12ac62023-04-04 13:00:54 +0900106 "src/com/android/server/connectivity/mdns/**/*.java",
Yuyang Huang33fa4d22023-02-14 22:59:37 +0900107 ":framework-connectivity-t-mdns-standalone-build-sources",
Cole Fausta52ecf02023-12-20 11:57:07 -0800108 ":service-mdns-droidstubs",
Yuyang Huang6e12ac62023-04-04 13:00:54 +0900109 ],
110 exclude_srcs: [
111 "src/com/android/server/connectivity/mdns/internal/SocketNetlinkMonitor.java",
Kangping Dong1a1beee2023-09-22 18:32:02 +0800112 "src/com/android/server/connectivity/mdns/SocketNetLinkMonitorFactory.java",
113 "src/com/android/server/connectivity/mdns/MdnsAdvertiser.java",
114 "src/com/android/server/connectivity/mdns/MdnsAnnouncer.java",
115 "src/com/android/server/connectivity/mdns/MdnsInterfaceAdvertiser.java",
116 "src/com/android/server/connectivity/mdns/MdnsProber.java",
117 "src/com/android/server/connectivity/mdns/MdnsRecordRepository.java",
Yuyang Huang6e12ac62023-04-04 13:00:54 +0900118 ],
119 static_libs: [
120 "net-utils-device-common-mdns-standalone-build-test",
121 ],
122 libs: [
123 "framework-annotations-lib",
124 "android_system_stubs_current",
125 "androidx.annotation_annotation",
126 ],
127 visibility: [
128 "//visibility:private",
129 ],
130}
131
132droidstubs {
133 name: "service-mdns-droidstubs",
134 srcs: ["src/com/android/server/connectivity/mdns/SocketNetLinkMonitorFactory.java"],
135 libs: [
136 "net-utils-device-common-mdns-standalone-build-test",
Cole Fausta52ecf02023-12-20 11:57:07 -0800137 "service-connectivity-tiramisu-pre-jarjar",
Yuyang Huang6e12ac62023-04-04 13:00:54 +0900138 ],
139 visibility: [
140 "//visibility:private",
141 ],
Kangping Donge7fef892023-08-11 15:30:09 +0800142}