blob: 0aa9dba16c907dc89b53b3e0cf8096735c352fc3 [file] [log] [blame]
Roopa Sattiraju816d1422022-01-17 08:20:16 -08001// 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: "services.bluetooth-sources",
21 srcs: [
22 "java/**/*.java",
23 ],
24 visibility: [
25 "//frameworks/base/services",
26 "//frameworks/base/services/core",
27 ],
28}
Roopa Sattirajuc7938372022-01-20 10:00:42 -080029
Roopa Sattirajua25b2352022-01-31 22:48:42 -080030java_defaults {
31 name: "service-bluetooth-common-defaults",
32 defaults: ["bluetooth-module-sdk-version-defaults"],
33 errorprone: {
34 javacflags: ["-Xep:CheckReturnValue:ERROR"],
35 },
36 product_variables: {
37 pdk: {
38 enabled: false,
39 },
40 },
41}
42
43// pre-jarjar version of service-uwb that builds against pre-jarjar version of framework-bluetooth
44java_library {
45 name: "service-bluetooth-pre-jarjar",
46 installable: false,
47 defaults: ["service-bluetooth-common-defaults"],
48 srcs: [
49 ":services.bluetooth-sources",
50 ":bluetooth-proto-enums-java-gen",
51 ":bluetooth-manager-service-proto-java-gen",
52 ],
53 // java_api_finder must accompany `srcs`
54 plugins: ["java_api_finder"],
55
56 sdk_version: "system_server_current",
57
58 lint: {
59 strict_updatability_linting: true,
60 },
61 libs: [
62 "framework-annotations-lib",
63 "framework-bluetooth-pre-jarjar",
Etienne Ruffieux3f46b3b2022-02-07 23:14:46 +000064 "app-compat-annotations",
Roopa Sattirajua25b2352022-01-31 22:48:42 -080065 ],
66
67 static_libs: [
68 "androidx.annotation_annotation",
Etienne Ruffieux3f46b3b2022-02-07 23:14:46 +000069 "androidx.appcompat_appcompat",
William Escande10a3e0a2022-02-23 15:35:33 +010070 "modules-utils-shell-command-handler",
Stephanie Bakffc0b152022-08-10 04:42:45 +000071 "bluetooth-nano-protos",
Roopa Sattirajua25b2352022-01-31 22:48:42 -080072 ],
73
74 apex_available: [
75 "com.android.bluetooth",
76 ],
ahujapalash5add3d52022-03-10 18:38:02 +000077 min_sdk_version: "Tiramisu"
Roopa Sattirajua25b2352022-01-31 22:48:42 -080078}
79
80// service-bluetooth static library
81// ==============================================================
82java_library {
83 name: "service-bluetooth",
84 defaults: ["service-bluetooth-common-defaults"],
85 installable: true,
Etienne Ruffieux3f46b3b2022-02-07 23:14:46 +000086 static_libs: [
87 "service-bluetooth-pre-jarjar",
88 "androidx.appcompat_appcompat",
89 ],
Roopa Sattirajua25b2352022-01-31 22:48:42 -080090
91 libs: [
92 "framework-bluetooth.impl",
Etienne Ruffieux3f46b3b2022-02-07 23:14:46 +000093 "app-compat-annotations",
Roopa Sattirajua25b2352022-01-31 22:48:42 -080094 ],
95 sdk_version: "system_server_current",
96
Roopa Sattiraju2806fbd2022-02-14 14:01:40 -080097 jarjar_rules: ":bluetooth-jarjar-rules",
98
Roopa Sattirajua25b2352022-01-31 22:48:42 -080099 optimize: {
100 enabled: true,
101 shrink: true,
102 proguard_flags_files: ["proguard.flags"],
103 },
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800104 visibility: [
105 "//packages/modules/Bluetooth/apex",
106 ],
107 apex_available: [
108 "com.android.bluetooth",
109 ],
ahujapalash5add3d52022-03-10 18:38:02 +0000110 min_sdk_version: "Tiramisu"
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800111}
112
113gensrcs {
114 name: "bluetooth-manager-service-proto-java-gen",
115 depfile: true,
116
117 tools: [
118 "aprotoc",
119 "protoc-gen-javastream",
120 "soong_zip",
121 ],
122
123 cmd: "mkdir -p $(genDir)/$(in) " +
124 "&& $(location aprotoc) " +
125 " --plugin=$(location protoc-gen-javastream) " +
126 " --dependency_out=$(depfile) " +
127 " --javastream_out=$(genDir)/$(in) " +
128 " -Iexternal/protobuf/src " +
129 " -I . " +
130 " $(in) " +
131 "&& $(location soong_zip) -jar -o $(out) -C $(genDir)/$(in) -D $(genDir)/$(in)",
132
133 srcs: [
134 ":srcs_bluetooth_manager_service_proto",
135 ],
136 output_extension: "srcjar",
137}
Etienne Ruffieuxa82b0872022-07-06 23:07:34 -0700138
Stephanie Bakffc0b152022-08-10 04:42:45 +0000139java_library {
140 name: "bluetooth-nano-protos",
141 sdk_version: "system_current",
142 min_sdk_version: "Tiramisu",
143 proto: {
144 type: "nano",
145 },
146 srcs: [
147 ":system-messages-proto-src",
148 ],
149 libs: ["libprotobuf-java-nano"],
150 apex_available: [
151 "com.android.bluetooth",
152 ],
153 lint: { strict_updatability_linting: true },
154}
155
Etienne Ruffieuxa82b0872022-07-06 23:07:34 -0700156platform_compat_config
157{
158 name: "bluetooth-compat-config",
159 src: ":service-bluetooth-pre-jarjar",
160}