• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20java_defaults {
21    name: "service-uwb-common-defaults",
22    defaults: ["uwb-module-sdk-version-defaults"],
23    errorprone: {
24        javacflags: ["-Xep:CheckReturnValue:ERROR"],
25    },
26    product_variables: {
27        pdk: {
28            enabled: false,
29        },
30    },
31}
32
33filegroup {
34    name: "service-uwb-srcs",
35    srcs: [
36        "java/**/*.java",
37        ":statslog-uwb-java-gen",
38        ":uwb_config"
39    ],
40}
41
42// pre-jarjar version of service-uwb that builds against pre-jarjar version of framework-uwb
43java_library {
44    name: "service-uwb-pre-jarjar",
45    installable: false,
46    defaults: ["service-uwb-common-defaults"],
47    srcs: [ ":service-uwb-srcs" ],
48    required: ["libuwb_uci_jni_rust"],
49    sdk_version: "system_server_current",
50
51    lint: {
52        strict_updatability_linting: true,
53    },
54    libs: [
55        "androidx.annotation_annotation",
56        "framework-annotations-lib",
57        "framework-configinfrastructure",
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    ],
64
65    static_libs: [
66        "android.hardware.uwb.fira_android-V3-java",
67        "com.uwb.support.ccc",
68        "com.uwb.support.fira",
69        "com.uwb.support.generic",
70        "com.uwb.support.multichip",
71        "com.uwb.support.profile",
72        "com.uwb.support.oemextension",
73        "com.uwb.support.dltdoa",
74        "guava",
75        "modules-utils-shell-command-handler",
76        "modules-utils-handlerexecutor",
77        "modules-utils-preconditions",
78        "uwb-config-proto",
79        "modules-utils-statemachine",
80        "modules-utils-build",
81        "cbor-java",
82        "bouncycastle-uwb",
83    ],
84
85    apex_available: [
86        "com.android.uwb",
87    ],
88}
89
90// service-uwb static library
91// ============================================================
92java_library {
93    name: "service-uwb",
94    defaults: [
95        "service-uwb-common-defaults",
96        "standalone-system-server-module-optimize-defaults",
97    ],
98    installable: true,
99    static_libs: ["service-uwb-pre-jarjar"],
100
101    // Need to include `libs` so that Soong doesn't complain about missing classes after jarjaring
102    // The below libraries are not actually needed to build since no source is compiled
103    // but they are necessary so that R8 has the right references to optimize the code.
104    // Without these, there will be missing class warnings and code may be wrongly optimized.
105    // TODO(b/242088131): remove libraries that aren't used directly
106    libs: [
107        "framework-uwb.impl",
108        "framework-statsd.stubs.module_lib",
109        "framework-wifi.stubs.module_lib",
110        "framework-bluetooth.stubs.module_lib",
111        "framework-connectivity.stubs.module_lib",
112    ],
113
114    sdk_version: "system_server_current",
115
116    jarjar_rules: ":uwb-jarjar-rules",
117    optimize: {
118        proguard_flags_files: ["proguard.flags"],
119    },
120    visibility: [
121        "//packages/modules/Uwb/apex",
122        "//packages/modules/Uwb/service/tests/uwbtests/apex",
123    ],
124    apex_available: [
125        "com.android.uwb",
126    ],
127}
128
129// Statsd auto-generated code
130// ============================================================
131genrule {
132    name: "statslog-uwb-java-gen",
133    tools: ["stats-log-api-gen"],
134    cmd: "$(location stats-log-api-gen) --java $(out) --module uwb " +
135         " --javaPackage com.android.server.uwb.proto --javaClass UwbStatsLog" +
136         " --minApiLevel 33",
137    out: ["com/android/server/uwb/proto/UwbStatsLog.java"],
138}
139