163 lines
		
	
	
		
			4.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			163 lines
		
	
	
		
			4.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| // Copyright (C) 2021 The Android Open Source Project
 | |
| //
 | |
| // Licensed under the Apache License, Version 2.0 (the "License");
 | |
| // you may not use this file except in compliance with the License.
 | |
| // You may obtain a copy of the License at
 | |
| //
 | |
| //      http://www.apache.org/licenses/LICENSE-2.0
 | |
| //
 | |
| // Unless required by applicable law or agreed to in writing, software
 | |
| // distributed under the License is distributed on an "AS IS" BASIS,
 | |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | |
| // See the License for the specific language governing permissions and
 | |
| // limitations under the License.
 | |
| 
 | |
| package {
 | |
|     default_applicable_licenses: ["Android-Apache-2.0"],
 | |
| }
 | |
| 
 | |
| filegroup {
 | |
|     name: "services.bluetooth-sources",
 | |
|     srcs: [
 | |
|         "java/**/*.java",
 | |
|         ":statslog-bluetooth-java-gen",
 | |
|     ],
 | |
|     visibility: [
 | |
|         "//frameworks/base/services",
 | |
|         "//frameworks/base/services/core",
 | |
|     ],
 | |
| }
 | |
| 
 | |
| java_defaults {
 | |
|     name: "service-bluetooth-common-defaults",
 | |
|     defaults: ["bluetooth-module-sdk-version-defaults"],
 | |
|     errorprone: {
 | |
|         javacflags: ["-Xep:CheckReturnValue:ERROR"],
 | |
|     },
 | |
|     product_variables: {
 | |
|         pdk: {
 | |
|             enabled: false,
 | |
|         },
 | |
|     },
 | |
| }
 | |
| 
 | |
| // pre-jarjar version of service-uwb that builds against pre-jarjar version of framework-bluetooth
 | |
| java_library {
 | |
|     name: "service-bluetooth-pre-jarjar",
 | |
|     installable: false,
 | |
|     defaults: ["service-bluetooth-common-defaults"],
 | |
|     srcs: [
 | |
|         ":services.bluetooth-sources",
 | |
|         ":bluetooth-proto-enums-java-gen",
 | |
|         ":bluetooth-manager-service-proto-java-gen",
 | |
|     ],
 | |
|     // java_api_finder must accompany `srcs`
 | |
|     plugins: ["java_api_finder"],
 | |
| 
 | |
|     sdk_version: "system_server_current",
 | |
| 
 | |
|     lint: {
 | |
|         strict_updatability_linting: true,
 | |
|     },
 | |
|     libs: [
 | |
|         "framework-annotations-lib",
 | |
|         "framework-bluetooth-pre-jarjar",
 | |
|         "app-compat-annotations",
 | |
|         "framework-statsd.stubs.module_lib",
 | |
|     ],
 | |
| 
 | |
|     static_libs: [
 | |
|         "androidx.annotation_annotation",
 | |
|         "androidx.appcompat_appcompat",
 | |
|         "modules-utils-shell-command-handler",
 | |
|         "bluetooth-nano-protos",
 | |
|     ],
 | |
| 
 | |
|     apex_available: [
 | |
|         "com.android.bluetooth",
 | |
|     ],
 | |
|     min_sdk_version: "Tiramisu"
 | |
| }
 | |
| 
 | |
| // service-bluetooth static library
 | |
| // ==============================================================
 | |
| java_library {
 | |
|     name: "service-bluetooth",
 | |
|     defaults: ["service-bluetooth-common-defaults"],
 | |
|     installable: true,
 | |
|     static_libs: [
 | |
|         "service-bluetooth-pre-jarjar",
 | |
|         "androidx.appcompat_appcompat",
 | |
|     ],
 | |
| 
 | |
|     libs: [
 | |
|         "framework-bluetooth.impl",
 | |
|         "app-compat-annotations",
 | |
|     ],
 | |
|     sdk_version: "system_server_current",
 | |
| 
 | |
|     jarjar_rules: ":bluetooth-jarjar-rules",
 | |
| 
 | |
|     optimize: {
 | |
|         enabled: true,
 | |
|         shrink: true,
 | |
|         proguard_flags_files: ["proguard.flags"],
 | |
|     },
 | |
|     visibility: [
 | |
|         "//packages/modules/Bluetooth/apex",
 | |
|     ],
 | |
|     apex_available: [
 | |
|         "com.android.bluetooth",
 | |
|     ],
 | |
|     min_sdk_version: "Tiramisu"
 | |
| }
 | |
| 
 | |
| gensrcs {
 | |
|     name: "bluetooth-manager-service-proto-java-gen",
 | |
|     depfile: true,
 | |
| 
 | |
|     tools: [
 | |
|         "aprotoc",
 | |
|         "protoc-gen-javastream",
 | |
|         "soong_zip",
 | |
|     ],
 | |
| 
 | |
|     cmd: "mkdir -p $(genDir)/$(in) " +
 | |
|         "&& $(location aprotoc) " +
 | |
|         "  --plugin=$(location protoc-gen-javastream) " +
 | |
|         "  --dependency_out=$(depfile) " +
 | |
|         "  --javastream_out=$(genDir)/$(in) " +
 | |
|         "  -Iexternal/protobuf/src " +
 | |
|         "  -I . " +
 | |
|         "  $(in) " +
 | |
|         "&& $(location soong_zip) -jar -o $(out) -C $(genDir)/$(in) -D $(genDir)/$(in)",
 | |
| 
 | |
|     srcs: [
 | |
|         ":srcs_bluetooth_manager_service_proto",
 | |
|     ],
 | |
|     output_extension: "srcjar",
 | |
| }
 | |
| 
 | |
| java_library {
 | |
|     name: "bluetooth-nano-protos",
 | |
|     sdk_version: "system_current",
 | |
|     min_sdk_version: "Tiramisu",
 | |
|     proto: {
 | |
|         type: "nano",
 | |
|     },
 | |
|     srcs: [
 | |
|         ":system-messages-proto-src",
 | |
|     ],
 | |
|     libs: ["libprotobuf-java-nano"],
 | |
|     apex_available: [
 | |
|         "com.android.bluetooth",
 | |
|     ],
 | |
|     lint: { strict_updatability_linting: true },
 | |
| }
 | |
| 
 | |
| platform_compat_config
 | |
| {
 | |
|     name: "bluetooth-compat-config",
 | |
|     src: ":service-bluetooth-pre-jarjar",
 | |
| }
 |