blob: cb29ce41a450909bb58635efa02b10f8ac2cc0a9 [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",
Stephanie Bak61bd29c2022-10-24 01:50:48 +000023 ":statslog-bluetooth-java-gen",
Roopa Sattiraju816d1422022-01-17 08:20:16 -080024 ],
25 visibility: [
26 "//frameworks/base/services",
27 "//frameworks/base/services/core",
28 ],
29}
Roopa Sattirajuc7938372022-01-20 10:00:42 -080030
Roopa Sattirajua25b2352022-01-31 22:48:42 -080031java_defaults {
32 name: "service-bluetooth-common-defaults",
33 defaults: ["bluetooth-module-sdk-version-defaults"],
34 errorprone: {
35 javacflags: ["-Xep:CheckReturnValue:ERROR"],
36 },
37 product_variables: {
38 pdk: {
39 enabled: false,
40 },
41 },
42}
43
44// pre-jarjar version of service-uwb that builds against pre-jarjar version of framework-bluetooth
45java_library {
46 name: "service-bluetooth-pre-jarjar",
47 installable: false,
48 defaults: ["service-bluetooth-common-defaults"],
49 srcs: [
50 ":services.bluetooth-sources",
51 ":bluetooth-proto-enums-java-gen",
52 ":bluetooth-manager-service-proto-java-gen",
53 ],
54 // java_api_finder must accompany `srcs`
55 plugins: ["java_api_finder"],
56
57 sdk_version: "system_server_current",
58
59 lint: {
60 strict_updatability_linting: true,
61 },
62 libs: [
63 "framework-annotations-lib",
64 "framework-bluetooth-pre-jarjar",
Etienne Ruffieux3f46b3b2022-02-07 23:14:46 +000065 "app-compat-annotations",
Stephanie Bak61bd29c2022-10-24 01:50:48 +000066 "framework-statsd.stubs.module_lib",
Roopa Sattirajua25b2352022-01-31 22:48:42 -080067 ],
68
69 static_libs: [
70 "androidx.annotation_annotation",
Etienne Ruffieux3f46b3b2022-02-07 23:14:46 +000071 "androidx.appcompat_appcompat",
William Escande10a3e0a2022-02-23 15:35:33 +010072 "modules-utils-shell-command-handler",
Stephanie Bakffc0b152022-08-10 04:42:45 +000073 "bluetooth-nano-protos",
Roopa Sattirajua25b2352022-01-31 22:48:42 -080074 ],
75
76 apex_available: [
77 "com.android.bluetooth",
78 ],
ahujapalash5add3d52022-03-10 18:38:02 +000079 min_sdk_version: "Tiramisu"
Roopa Sattirajua25b2352022-01-31 22:48:42 -080080}
81
82// service-bluetooth static library
83// ==============================================================
84java_library {
85 name: "service-bluetooth",
86 defaults: ["service-bluetooth-common-defaults"],
87 installable: true,
Etienne Ruffieux3f46b3b2022-02-07 23:14:46 +000088 static_libs: [
89 "service-bluetooth-pre-jarjar",
90 "androidx.appcompat_appcompat",
91 ],
Roopa Sattirajua25b2352022-01-31 22:48:42 -080092
93 libs: [
94 "framework-bluetooth.impl",
Etienne Ruffieux3f46b3b2022-02-07 23:14:46 +000095 "app-compat-annotations",
Roopa Sattirajua25b2352022-01-31 22:48:42 -080096 ],
97 sdk_version: "system_server_current",
98
Roopa Sattiraju2806fbd2022-02-14 14:01:40 -080099 jarjar_rules: ":bluetooth-jarjar-rules",
100
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800101 optimize: {
102 enabled: true,
103 shrink: true,
104 proguard_flags_files: ["proguard.flags"],
105 },
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800106 visibility: [
107 "//packages/modules/Bluetooth/apex",
108 ],
109 apex_available: [
110 "com.android.bluetooth",
111 ],
ahujapalash5add3d52022-03-10 18:38:02 +0000112 min_sdk_version: "Tiramisu"
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800113}
114
115gensrcs {
116 name: "bluetooth-manager-service-proto-java-gen",
117 depfile: true,
118
119 tools: [
120 "aprotoc",
121 "protoc-gen-javastream",
122 "soong_zip",
123 ],
124
125 cmd: "mkdir -p $(genDir)/$(in) " +
126 "&& $(location aprotoc) " +
127 " --plugin=$(location protoc-gen-javastream) " +
128 " --dependency_out=$(depfile) " +
129 " --javastream_out=$(genDir)/$(in) " +
130 " -Iexternal/protobuf/src " +
131 " -I . " +
132 " $(in) " +
133 "&& $(location soong_zip) -jar -o $(out) -C $(genDir)/$(in) -D $(genDir)/$(in)",
134
135 srcs: [
136 ":srcs_bluetooth_manager_service_proto",
137 ],
138 output_extension: "srcjar",
139}
Etienne Ruffieuxa82b0872022-07-06 23:07:34 -0700140
Stephanie Bakffc0b152022-08-10 04:42:45 +0000141java_library {
142 name: "bluetooth-nano-protos",
143 sdk_version: "system_current",
144 min_sdk_version: "Tiramisu",
145 proto: {
146 type: "nano",
147 },
148 srcs: [
149 ":system-messages-proto-src",
150 ],
151 libs: ["libprotobuf-java-nano"],
152 apex_available: [
153 "com.android.bluetooth",
154 ],
155 lint: { strict_updatability_linting: true },
156}
157
Etienne Ruffieuxa82b0872022-07-06 23:07:34 -0700158platform_compat_config
159{
160 name: "bluetooth-compat-config",
161 src: ":service-bluetooth-pre-jarjar",
162}