blob: 83caf35538eabe8dd938a66f7911f51d190ecac2 [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 {
18 // See: http://go/android-license-faq
19 default_applicable_licenses: ["Android-Apache-2.0"],
20}
21
Remi NGUYEN VAN0395b702022-03-08 19:49:49 +090022// Include build rules from Sources.bp
23build = ["Sources.bp"]
24
Remi NGUYEN VAN86bbfe92022-03-30 18:51:41 +090025filegroup {
26 name: "service-connectivity-tiramisu-sources",
27 srcs: [
28 "src/**/*.java",
29 ],
30 visibility: ["//visibility:private"],
31}
32// The above filegroup can be used to specify different sources depending
33// on the branch, while minimizing merge conflicts in the rest of the
34// build rules.
35
paulhu537f7202022-02-08 21:25:28 +080036// This builds T+ services depending on framework-connectivity-t
paulhu802ab972021-12-14 01:30:22 +000037// hidden symbols separately from the S+ services, to ensure that S+
38// services cannot accidentally depend on T+ hidden symbols from
paulhu537f7202022-02-08 21:25:28 +080039// framework-connectivity-t.
paulhu802ab972021-12-14 01:30:22 +000040java_library {
41 name: "service-connectivity-tiramisu-pre-jarjar",
42 sdk_version: "system_server_current",
43 // TODO(b/210962470): Bump this to at least S, and then T.
44 min_sdk_version: "30",
45 srcs: [
Remi NGUYEN VAN86bbfe92022-03-30 18:51:41 +090046 ":service-connectivity-tiramisu-sources",
paulhu802ab972021-12-14 01:30:22 +000047 ],
48 libs: [
49 "framework-annotations-lib",
Hassan Alic4f63fa2022-11-17 16:13:48 +000050 "framework-configinfrastructure",
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +090051 "framework-connectivity-pre-jarjar",
paulhu537f7202022-02-08 21:25:28 +080052 "framework-connectivity-t-pre-jarjar",
Igor Chernyshev9dac6602022-12-13 19:28:32 -080053 // TODO: use framework-tethering-pre-jarjar when it is separated from framework-tethering
54 "framework-tethering.impl",
Paul Hu03a51d52023-01-13 14:17:04 +080055 "framework-wifi",
paulhu802ab972021-12-14 01:30:22 +000056 "service-connectivity-pre-jarjar",
Remi NGUYEN VANb6cde3d2022-03-10 04:32:15 +000057 "service-nearby-pre-jarjar",
Kangping Donge7fef892023-08-11 15:30:09 +080058 "service-thread-pre-jarjar",
Igor Zaslavskyec344f42023-08-08 04:28:45 +000059 "service-remoteauth-pre-jarjar",
Xiao Ma0a171c02022-01-23 16:14:51 +000060 "ServiceConnectivityResources",
paulhu802ab972021-12-14 01:30:22 +000061 "unsupportedappusage",
62 ],
63 static_libs: [
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +090064 // Do not add static_libs here if they are already included in framework-connectivity
65 // or in service-connectivity. They are not necessary (included via
66 // service-connectivity-pre-jarjar), and in the case of code that is already in
67 // framework-connectivity, the classes would be included in the apex twice.
paulhu802ab972021-12-14 01:30:22 +000068 "modules-utils-statemachine",
paulhu802ab972021-12-14 01:30:22 +000069 ],
70 apex_available: [
71 "com.android.tethering",
72 ],
73 visibility: [
Aaron Huang720ad7c2022-01-26 00:43:10 +080074 "//frameworks/base/tests/vcn",
paulhu802ab972021-12-14 01:30:22 +000075 "//packages/modules/Connectivity/service",
76 "//packages/modules/Connectivity/tests:__subpackages__",
Aaron Huang720ad7c2022-01-26 00:43:10 +080077 "//packages/modules/IPsec/tests/iketests",
paulhu802ab972021-12-14 01:30:22 +000078 ],
79}
Yuyang Huang6e12ac62023-04-04 13:00:54 +090080
81// Test building mDNS as a standalone, so that it can be imported into other repositories as-is.
82// The mDNS code is platform code so it should use framework-annotations-lib, contrary to apps that
83// should use sdk_version: "system_current" and only androidx.annotation_annotation. But this build
84// rule verifies that the mDNS code can be built into apps, if code transformations are applied to
85// the annotations.
86// When using "system_current", framework annotations are not available; they would appear as
87// package-private as they are marked as such in the system_current stubs. So build against
88// core_platform and add the stubs manually in "libs". See http://b/147773144#comment7.
89java_library {
90 name: "service-connectivity-mdns-standalone-build-test",
91 sdk_version: "core_platform",
92 srcs: [
Yuyang Huang6e12ac62023-04-04 13:00:54 +090093 "src/com/android/server/connectivity/mdns/**/*.java",
Yuyang Huang33fa4d22023-02-14 22:59:37 +090094 ":framework-connectivity-t-mdns-standalone-build-sources",
95 ":service-mdns-droidstubs"
Yuyang Huang6e12ac62023-04-04 13:00:54 +090096 ],
97 exclude_srcs: [
98 "src/com/android/server/connectivity/mdns/internal/SocketNetlinkMonitor.java",
99 "src/com/android/server/connectivity/mdns/SocketNetLinkMonitorFactory.java"
100 ],
101 static_libs: [
102 "net-utils-device-common-mdns-standalone-build-test",
103 ],
104 libs: [
105 "framework-annotations-lib",
106 "android_system_stubs_current",
107 "androidx.annotation_annotation",
108 ],
109 visibility: [
110 "//visibility:private",
111 ],
112}
113
114droidstubs {
115 name: "service-mdns-droidstubs",
116 srcs: ["src/com/android/server/connectivity/mdns/SocketNetLinkMonitorFactory.java"],
117 libs: [
118 "net-utils-device-common-mdns-standalone-build-test",
119 "service-connectivity-tiramisu-pre-jarjar"
120 ],
121 visibility: [
122 "//visibility:private",
123 ],
Kangping Donge7fef892023-08-11 15:30:09 +0800124}