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", |
| 23 | ], |
| 24 | visibility: [ |
| 25 | "//frameworks/base/services", |
| 26 | "//frameworks/base/services/core", |
| 27 | ], |
| 28 | } |
Roopa Sattiraju | c793837 | 2022-01-20 10:00:42 -0800 | [diff] [blame] | 29 | |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 30 | java_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 |
| 44 | java_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 Ruffieux | 3f46b3b | 2022-02-07 23:14:46 +0000 | [diff] [blame] | 64 | "app-compat-annotations", |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 65 | ], |
| 66 | |
| 67 | static_libs: [ |
| 68 | "androidx.annotation_annotation", |
Etienne Ruffieux | 3f46b3b | 2022-02-07 23:14:46 +0000 | [diff] [blame] | 69 | "androidx.appcompat_appcompat", |
William Escande | 10a3e0a | 2022-02-23 15:35:33 +0100 | [diff] [blame] | 70 | "modules-utils-shell-command-handler", |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 71 | ], |
| 72 | |
| 73 | apex_available: [ |
| 74 | "com.android.bluetooth", |
| 75 | ], |
ahujapalash | 5add3d5 | 2022-03-10 18:38:02 +0000 | [diff] [blame] | 76 | min_sdk_version: "Tiramisu" |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 77 | } |
| 78 | |
| 79 | // service-bluetooth static library |
| 80 | // ============================================================== |
| 81 | java_library { |
| 82 | name: "service-bluetooth", |
| 83 | defaults: ["service-bluetooth-common-defaults"], |
| 84 | installable: true, |
Etienne Ruffieux | 3f46b3b | 2022-02-07 23:14:46 +0000 | [diff] [blame] | 85 | static_libs: [ |
| 86 | "service-bluetooth-pre-jarjar", |
| 87 | "androidx.appcompat_appcompat", |
| 88 | ], |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 89 | |
| 90 | libs: [ |
| 91 | "framework-bluetooth.impl", |
Etienne Ruffieux | 3f46b3b | 2022-02-07 23:14:46 +0000 | [diff] [blame] | 92 | "app-compat-annotations", |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 93 | ], |
| 94 | sdk_version: "system_server_current", |
| 95 | |
Roopa Sattiraju | 2806fbd | 2022-02-14 14:01:40 -0800 | [diff] [blame] | 96 | jarjar_rules: ":bluetooth-jarjar-rules", |
| 97 | |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 98 | optimize: { |
| 99 | enabled: true, |
| 100 | shrink: true, |
| 101 | proguard_flags_files: ["proguard.flags"], |
| 102 | }, |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 103 | visibility: [ |
| 104 | "//packages/modules/Bluetooth/apex", |
| 105 | ], |
| 106 | apex_available: [ |
| 107 | "com.android.bluetooth", |
| 108 | ], |
ahujapalash | 5add3d5 | 2022-03-10 18:38:02 +0000 | [diff] [blame] | 109 | min_sdk_version: "Tiramisu" |
Roopa Sattiraju | a25b235 | 2022-01-31 22:48:42 -0800 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | gensrcs { |
| 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 Ruffieux | cea8f23 | 2022-07-06 23:07:34 -0700 | [diff] [blame] | 137 | |
| 138 | platform_compat_config |
| 139 | { |
| 140 | name: "bluetooth-compat-config", |
| 141 | src: ":service-bluetooth-pre-jarjar", |
| 142 | } |