Roopa Sattiraju | 816d142 | 2022-01-17 08:20:16 -0800 | [diff] [blame] | 1 | // 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 | |
| 15 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
| 19 | filegroup { |
| 20 | name: "services.bluetooth-sources", |
| 21 | srcs: [ |
| 22 | "java/**/*.java", |
Stephanie Bak | 61bd29c | 2022-10-24 01:50:48 +0000 | [diff] [blame] | 23 | ":statslog-bluetooth-java-gen", |
Roopa Sattiraju | 816d142 | 2022-01-17 08:20:16 -0800 | [diff] [blame] | 24 | ], |
| 25 | visibility: [ |
| 26 | "//frameworks/base/services", |
| 27 | "//frameworks/base/services/core", |
| 28 | ], |
| 29 | } |
Roopa Sattiraju | c793837 | 2022-01-20 10:00:42 -0800 | [diff] [blame] | 30 | |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 31 | java_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 |
| 45 | java_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 Ruffieux | 3f46b3b | 2022-02-07 23:14:46 +0000 | [diff] [blame] | 65 | "app-compat-annotations", |
Stephanie Bak | 61bd29c | 2022-10-24 01:50:48 +0000 | [diff] [blame] | 66 | "framework-statsd.stubs.module_lib", |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 67 | ], |
| 68 | |
| 69 | static_libs: [ |
| 70 | "androidx.annotation_annotation", |
Etienne Ruffieux | 3f46b3b | 2022-02-07 23:14:46 +0000 | [diff] [blame] | 71 | "androidx.appcompat_appcompat", |
William Escande | 10a3e0a | 2022-02-23 15:35:33 +0100 | [diff] [blame] | 72 | "modules-utils-shell-command-handler", |
Stephanie Bak | ffc0b15 | 2022-08-10 04:42:45 +0000 | [diff] [blame] | 73 | "bluetooth-nano-protos", |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 74 | ], |
| 75 | |
| 76 | apex_available: [ |
| 77 | "com.android.bluetooth", |
| 78 | ], |
ahujapalash | 5add3d5 | 2022-03-10 18:38:02 +0000 | [diff] [blame] | 79 | min_sdk_version: "Tiramisu" |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | // service-bluetooth static library |
| 83 | // ============================================================== |
| 84 | java_library { |
| 85 | name: "service-bluetooth", |
| 86 | defaults: ["service-bluetooth-common-defaults"], |
| 87 | installable: true, |
Etienne Ruffieux | 3f46b3b | 2022-02-07 23:14:46 +0000 | [diff] [blame] | 88 | static_libs: [ |
| 89 | "service-bluetooth-pre-jarjar", |
| 90 | "androidx.appcompat_appcompat", |
| 91 | ], |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 92 | |
| 93 | libs: [ |
| 94 | "framework-bluetooth.impl", |
Etienne Ruffieux | 3f46b3b | 2022-02-07 23:14:46 +0000 | [diff] [blame] | 95 | "app-compat-annotations", |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 96 | ], |
| 97 | sdk_version: "system_server_current", |
| 98 | |
Roopa Sattiraju | 2806fbd | 2022-02-14 14:01:40 -0800 | [diff] [blame] | 99 | jarjar_rules: ":bluetooth-jarjar-rules", |
| 100 | |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 101 | optimize: { |
| 102 | enabled: true, |
| 103 | shrink: true, |
| 104 | proguard_flags_files: ["proguard.flags"], |
| 105 | }, |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 106 | visibility: [ |
| 107 | "//packages/modules/Bluetooth/apex", |
| 108 | ], |
| 109 | apex_available: [ |
| 110 | "com.android.bluetooth", |
| 111 | ], |
ahujapalash | 5add3d5 | 2022-03-10 18:38:02 +0000 | [diff] [blame] | 112 | min_sdk_version: "Tiramisu" |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | gensrcs { |
| 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 Ruffieux | a82b087 | 2022-07-06 23:07:34 -0700 | [diff] [blame] | 140 | |
Stephanie Bak | ffc0b15 | 2022-08-10 04:42:45 +0000 | [diff] [blame] | 141 | java_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 Ruffieux | a82b087 | 2022-07-06 23:07:34 -0700 | [diff] [blame] | 158 | platform_compat_config |
| 159 | { |
| 160 | name: "bluetooth-compat-config", |
| 161 | src: ":service-bluetooth-pre-jarjar", |
| 162 | } |