blob: 8f6a227120621b554a0aec8558bcf098343d72cb [file] [log] [blame]
Wei Wang6b7561d2021-06-03 17:33:14 -07001// Copyright (C) 2021 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19filegroup {
20 name: "nearby-service-srcs",
21 srcs: [
22 "java/**/*.java",
Daniel (Ying Wai) Fan79d7ddc2022-01-07 16:51:18 -080023 ":statslog-nearby-java-gen",
Wei Wang6b7561d2021-06-03 17:33:14 -070024 ],
25}
26
Weice57d88f62021-12-06 06:24:56 +000027filegroup {
28 name: "nearby-service-string-res",
29 srcs: [
30 "java/**/Constant.java",
Weicefcd891b2021-12-28 23:31:08 +000031 "java/**/UserActionHandlerBase.java",
32 "java/**/UserActionHandler.java",
33 "java/**/FastPairConstants.java",
Weice57d88f62021-12-06 06:24:56 +000034 ],
35}
36
37java_library {
38 name: "nearby-service-string",
39 srcs: [":nearby-service-string-res"],
Roopa Sattirajue8fabcc2022-01-11 20:40:07 -080040 libs: ["framework-bluetooth"],
Weice57d88f62021-12-06 06:24:56 +000041 sdk_version: "module_current",
42}
43
44
Wei Wang6b7561d2021-06-03 17:33:14 -070045// Main lib for nearby services.
46java_library {
47 name: "service-nearby",
48 srcs: [":nearby-service-srcs"],
49
50 defaults: [
Wei Wang6b7561d2021-06-03 17:33:14 -070051 "framework-system-server-module-defaults"
52 ],
53 libs: [
Roopa Sattirajue8fabcc2022-01-11 20:40:07 -080054 "framework-bluetooth.stubs.module_lib", // TODO(b/215722418): Change to framework-bluetooth once fixed
Chun Zhangbc34fdb2021-09-20 11:19:04 -070055 "error_prone_annotations",
Remi NGUYEN VAN15ed7d22022-01-07 13:20:08 +090056 "framework-connectivity-tiramisu.impl",
Daniel (Ying Wai) Fan79d7ddc2022-01-07 16:51:18 -080057 "framework-statsd.stubs.module_lib",
Chun Zhangbc34fdb2021-09-20 11:19:04 -070058 ],
59 static_libs: [
Chun Zhangbc34fdb2021-09-20 11:19:04 -070060 "androidx.annotation_annotation",
Chun Zhang28660812021-09-22 20:48:39 -070061 "androidx.core_core",
Weicefcd891b2021-12-28 23:31:08 +000062 "androidx.localbroadcastmanager_localbroadcastmanager",
Chun Zhangbbe60252021-09-21 22:05:03 -070063 "guava",
Chun Zhangfe6d0c12021-09-22 15:19:43 -070064 "libprotobuf-java-lite",
weicesunb989a182021-11-04 14:14:54 -070065 "fast-pair-lite-protos",
Chun Zhang00240662021-12-06 09:17:50 -080066 "modules-utils-build",
67 "modules-utils-handlerexecutor",
68 "modules-utils-preconditions",
69 "modules-utils-backgroundthread",
Wei Wang6b7561d2021-06-03 17:33:14 -070070 ],
71 sdk_version: "system_server_current",
Remi NGUYEN VAN15ed7d22022-01-07 13:20:08 +090072 // This is included in service-connectivity which is 30+
73 // TODO: allow APEXes to have service jars with higher min_sdk than the APEX
74 // (service-connectivity is only used on 31+) and use 31 here
75 min_sdk_version: "30",
Wei Wang6b7561d2021-06-03 17:33:14 -070076
77 installable: true,
Wei Wang6b7561d2021-06-03 17:33:14 -070078 dex_preopt: {
79 enabled: false,
80 app_image: false,
81 },
82 visibility: [
83 "//packages/modules/Nearby/apex",
84 ],
85 apex_available: [
Remi NGUYEN VAN15ed7d22022-01-07 13:20:08 +090086 "com.android.tethering",
Wei Wang6b7561d2021-06-03 17:33:14 -070087 ],
Chun Zhang28417032021-09-20 14:10:38 -070088}
Daniel (Ying Wai) Fan79d7ddc2022-01-07 16:51:18 -080089
90genrule {
91 name: "statslog-nearby-java-gen",
92 tools: ["stats-log-api-gen"],
93 cmd: "$(location stats-log-api-gen) --java $(out) --module nearby " +
94 " --javaPackage com.android.server.nearby.proto --javaClass NearbyStatsLog" +
95 " --minApiLevel 33",
96 out: ["com/android/server/nearby/proto/NearbyStatsLog.java"],
97}