// // Copyright (C) 2024 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_team: "trendy_team_fwk_uwb", default_applicable_licenses: ["Android-Apache-2.0"], } java_defaults { name: "service-ranging-common-defaults", defaults: ["ranging-module-sdk-version-defaults"], errorprone: { javacflags: ["-Xep:CheckReturnValue:ERROR"], }, } filegroup { name: "service-ranging-srcs", srcs: [ "java/**/*.java", ], } // pre-jarjar version of service-ranging that builds against pre-jarjar version of framework-uwb java_library { name: "service-ranging-pre-jarjar", min_sdk_version: "33", installable: false, defaults: ["service-ranging-common-defaults"], srcs: [":service-ranging-srcs"], sdk_version: "system_server_current", plugins: [ "auto_value_plugin", ], libs: [ "androidx.annotation_annotation", "error_prone_annotations", "framework-annotations-lib", "framework-configinfrastructure.stubs.module_lib", "framework-statsd.stubs.module_lib", "framework-wifi.stubs.module_lib", "framework-bluetooth.stubs.module_lib", "framework-location.stubs.module_lib", ], static_libs: [ "guava", "modules-utils-shell-command-handler", "modules-utils-handlerexecutor", // TODO: migrate away from auto value if possible. "auto_value_annotations", //"modules-utils-preconditions", //"modules-utils-build", "framework-ranging-pre-jarjar", "androidx.annotation_annotation", "androidx.concurrent_concurrent-futures", "androidx.concurrent_concurrent-futures", "com.uwb.fusion", "ranging_rtt_backend", "ranging_uwb_backend", "ranging_flags_lib", ], apex_available: [ "com.android.uwb", ], } // service-ranging static library // ============================================================ java_library { name: "service-ranging", min_sdk_version: "33", defaults: [ "service-ranging-common-defaults", "standalone-system-server-module-optimize-defaults", ], installable: true, static_libs: [ "service-ranging-pre-jarjar", "ranging_uwb_backend", ], // Need to include `libs` so that Soong doesn't complain about missing classes after jarjaring // The below libraries are not actually needed to build since no source is compiled // but they are necessary so that R8 has the right references to optimize the code. // Without these, there will be missing class warnings and code may be wrongly optimized. // TODO(b/242088131): remove libraries that aren't used directly libs: [ "framework-ranging.impl", "framework-statsd.stubs.module_lib", "framework-wifi.stubs.module_lib", "framework-bluetooth.stubs.module_lib", "framework-connectivity.stubs.module_lib", ], sdk_version: "system_server_current", jarjar_rules: ":ranging-jarjar-rules", //optimize: { //proguard_flags_files: ["proguard.flags"], //}, visibility: [ "//packages/modules/Uwb/apex", ], apex_available: [ "com.android.uwb", ], }