blob: ca76812d25097ebb39d2b0b2cfdf560bbfc35ccb [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",
Roopa Sattirajua25b2352022-01-31 22:48:42 -080071 ],
72
73 apex_available: [
74 "com.android.bluetooth",
75 ],
ahujapalash5add3d52022-03-10 18:38:02 +000076 min_sdk_version: "Tiramisu"
Roopa Sattirajua25b2352022-01-31 22:48:42 -080077}
78
79// service-bluetooth static library
80// ==============================================================
81java_library {
82 name: "service-bluetooth",
83 defaults: ["service-bluetooth-common-defaults"],
84 installable: true,
Etienne Ruffieux3f46b3b2022-02-07 23:14:46 +000085 static_libs: [
86 "service-bluetooth-pre-jarjar",
87 "androidx.appcompat_appcompat",
88 ],
Roopa Sattirajua25b2352022-01-31 22:48:42 -080089
90 libs: [
91 "framework-bluetooth.impl",
Etienne Ruffieux3f46b3b2022-02-07 23:14:46 +000092 "app-compat-annotations",
Roopa Sattirajua25b2352022-01-31 22:48:42 -080093 ],
94 sdk_version: "system_server_current",
95
Roopa Sattiraju2806fbd2022-02-14 14:01:40 -080096 jarjar_rules: ":bluetooth-jarjar-rules",
97
Roopa Sattirajua25b2352022-01-31 22:48:42 -080098 optimize: {
99 enabled: true,
100 shrink: true,
101 proguard_flags_files: ["proguard.flags"],
102 },
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800103 visibility: [
104 "//packages/modules/Bluetooth/apex",
105 ],
106 apex_available: [
107 "com.android.bluetooth",
108 ],
ahujapalash5add3d52022-03-10 18:38:02 +0000109 min_sdk_version: "Tiramisu"
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800110}
111
112gensrcs {
113 name: "bluetooth-manager-service-proto-java-gen",
114 depfile: true,
115
116 tools: [
117 "aprotoc",
118 "protoc-gen-javastream",
119 "soong_zip",
120 ],
121
122 cmd: "mkdir -p $(genDir)/$(in) " +
123 "&& $(location aprotoc) " +
124 " --plugin=$(location protoc-gen-javastream) " +
125 " --dependency_out=$(depfile) " +
126 " --javastream_out=$(genDir)/$(in) " +
127 " -Iexternal/protobuf/src " +
128 " -I . " +
129 " $(in) " +
130 "&& $(location soong_zip) -jar -o $(out) -C $(genDir)/$(in) -D $(genDir)/$(in)",
131
132 srcs: [
133 ":srcs_bluetooth_manager_service_proto",
134 ],
135 output_extension: "srcjar",
136}
Etienne Ruffieuxcea8f232022-07-06 23:07:34 -0700137
138platform_compat_config
139{
140 name: "bluetooth-compat-config",
141 src: ":service-bluetooth-pre-jarjar",
142}