• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15package {
16    default_team: "trendy_team_fwk_uwb",
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20java_defaults {
21    name: "uwb-module-sdk-version-defaults",
22    min_sdk_version: "Tiramisu",
23}
24
25filegroup {
26    name: "framework-uwb-updatable-exported-aidl-sources",
27    srcs: ["aidl-export/**/*.aidl"],
28    path: "aidl-export",
29    visibility: ["//visibility:private"],
30}
31
32filegroup {
33    name: "framework-uwb-updatable-java-sources",
34    srcs: [
35        "java/**/*.java",
36        "java/**/*.aidl",
37    ],
38    path: "java",
39    visibility: ["//visibility:private"],
40}
41
42filegroup {
43    name: "framework-uwb-updatable-sources",
44    defaults: ["framework-sources-module-defaults"],
45    srcs: [
46        ":framework-uwb-updatable-java-sources",
47        ":framework-uwb-updatable-exported-aidl-sources",
48    ],
49}
50
51// defaults shared between `framework-uwb` & `framework-uwb-pre-jarjar`
52// java_sdk_library `framework-uwb` needs sources to generate stubs, so it cannot reuse
53// `framework-uwb-pre-jarjar`
54java_defaults {
55    name: "framework-uwb-defaults",
56    defaults: ["uwb-module-sdk-version-defaults"],
57    static_libs: [
58        "modules-utils-preconditions",
59        "modules-utils-build",
60    ],
61    libs: [
62        "androidx.annotation_annotation",
63        "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
64    ],
65    srcs: [
66        ":framework-uwb-updatable-sources",
67    ],
68}
69
70// uwb-service needs pre-jarjared version of framework-uwb so it can reference copied utility
71// classes before they are renamed.
72java_library {
73    name: "framework-uwb-pre-jarjar",
74    defaults: ["framework-uwb-defaults"],
75    sdk_version: "module_current",
76    libs: ["framework-annotations-lib"],
77    installable: false,
78}
79
80// post-jarjar version of framework-uwb
81java_sdk_library {
82    name: "framework-uwb",
83    defaults: [
84        "framework-module-defaults",
85        "framework-uwb-defaults",
86    ],
87    jarjar_rules: ":uwb-jarjar-rules",
88
89    installable: true,
90    optimize: {
91        enabled: false,
92    },
93    hostdex: true, // for hiddenapi check
94
95    impl_library_visibility: [
96        "//external/sl4a/Common:__subpackages__",
97        "//packages/modules/Uwb:__subpackages__",
98    ],
99
100    aconfig_declarations: [
101        "uwb_aconfig_flags",
102    ],
103
104    apex_available: [
105        "com.android.uwb",
106    ],
107    permitted_packages: [
108        "android.uwb",
109        "android.uwb.util",
110        // Created by jarjar rules.
111        "com.android.x.uwb",
112    ],
113    lint: {
114        strict_updatability_linting: true,
115    },
116}
117
118// defaults for tests that need to build against framework-uwb's @hide APIs
119java_defaults {
120    name: "framework-uwb-test-defaults",
121    sdk_version: "module_current",
122    libs: [
123        "framework-uwb.impl",
124    ],
125    defaults_visibility: [
126        "//packages/modules/Uwb/framework/tests:__subpackages__",
127        "//packages/modules/Uwb/service/tests:__subpackages__",
128    ],
129}
130
131filegroup {
132    name: "uwb-jarjar-rules",
133    srcs: ["jarjar-rules.txt"],
134}
135