1// 2// Copyright (C) 2021 The Android Open Source Project 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16package { 17 default_team: "trendy_team_fwk_uwb", 18 default_applicable_licenses: ["Android-Apache-2.0"], 19} 20 21java_defaults { 22 name: "service-uwb-common-defaults", 23 defaults: ["uwb-module-sdk-version-defaults"], 24 errorprone: { 25 javacflags: ["-Xep:CheckReturnValue:ERROR"], 26 }, 27} 28 29filegroup { 30 name: "service-uwb-srcs", 31 srcs: [ 32 "java/**/*.java", 33 ":statslog-uwb-java-gen", 34 ":uwb_config", 35 ], 36} 37 38filegroup { 39 name: "service-uwb-shared-with-ranging-srcs", 40 srcs: [ 41 "java/com/android/server/uwb/UwbContext.java", 42 ], 43} 44 45// pre-jarjar version of service-uwb that builds against pre-jarjar version of framework-uwb 46java_library { 47 name: "service-uwb-pre-jarjar", 48 installable: false, 49 defaults: ["service-uwb-common-defaults"], 50 srcs: [":service-uwb-srcs"], 51 required: ["libuwb_uci_jni_rust"], 52 sdk_version: "system_server_current", 53 54 libs: [ 55 "androidx.annotation_annotation", 56 "framework-annotations-lib", 57 "framework-configinfrastructure.stubs.module_lib", 58 "framework-uwb-pre-jarjar", 59 "ServiceUwbResources", 60 "framework-statsd.stubs.module_lib", 61 "framework-wifi.stubs.module_lib", 62 "framework-bluetooth.stubs.module_lib", 63 "framework-location.stubs.module_lib", 64 ], 65 66 static_libs: [ 67 "android.hardware.uwb.fira_android-V3-java", 68 "com.uwb.support.aliro", 69 "com.uwb.support.ccc", 70 "com.uwb.support.fira", 71 "com.uwb.support.generic", 72 "com.uwb.support.multichip", 73 "com.uwb.support.profile", 74 "com.uwb.support.oemextension", 75 "com.uwb.support.dltdoa", 76 "com.uwb.support.radar", 77 "com.uwb.support.rftest", 78 "com.uwb.fusion", 79 "guava", 80 "modules-utils-shell-command-handler", 81 "modules-utils-handlerexecutor", 82 "modules-utils-preconditions", 83 "uwb-config-proto", 84 "modules-utils-statemachine", 85 "modules-utils-build", 86 "cbor-java", 87 "bouncycastle-uwb", 88 "uwb_flags_lib", 89 ], 90 91 apex_available: [ 92 "com.android.uwb", 93 ], 94} 95 96// service-uwb static library 97// ============================================================ 98java_library { 99 name: "service-uwb", 100 defaults: [ 101 "service-uwb-common-defaults", 102 "standalone-system-server-module-optimize-defaults", 103 ], 104 installable: true, 105 static_libs: ["service-uwb-pre-jarjar"], 106 107 // Need to include `libs` so that Soong doesn't complain about missing classes after jarjaring 108 // The below libraries are not actually needed to build since no source is compiled 109 // but they are necessary so that R8 has the right references to optimize the code. 110 // Without these, there will be missing class warnings and code may be wrongly optimized. 111 // TODO(b/242088131): remove libraries that aren't used directly 112 libs: [ 113 "framework-uwb.impl", 114 "framework-statsd.stubs.module_lib", 115 "framework-wifi.stubs.module_lib", 116 "framework-bluetooth.stubs.module_lib", 117 "framework-connectivity.stubs.module_lib", 118 ], 119 120 sdk_version: "system_server_current", 121 122 jarjar_rules: ":uwb-jarjar-rules", 123 optimize: { 124 proguard_flags_files: ["proguard.flags"], 125 }, 126 visibility: [ 127 "//packages/modules/Uwb/apex", 128 "//packages/modules/Uwb/service/tests/uwbtests/apex", 129 ], 130 apex_available: [ 131 "com.android.uwb", 132 ], 133} 134 135// Statsd auto-generated code 136// ============================================================ 137genrule { 138 name: "statslog-uwb-java-gen", 139 tools: ["stats-log-api-gen"], 140 cmd: "$(location stats-log-api-gen) --java $(out) --module uwb " + 141 " --javaPackage com.android.server.uwb.proto --javaClass UwbStatsLog" + 142 " --minApiLevel 33", 143 out: ["com/android/server/uwb/proto/UwbStatsLog.java"], 144} 145