1// Copyright (C) 2020 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
15// Defaults shared between real and test versions of the APEX.
16package {
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20apex_defaults {
21    name: "com.android.geotz-defaults",
22    updatable: true,
23    min_sdk_version: "31",
24
25    // Explicit because the defaulting behavior only works for the real
26    // module.
27    file_contexts: ":com.android.geotz-file_contexts",
28
29    systemserverclasspath_fragments: ["com.android.geotz-systemserverclasspath-fragment"],
30
31    // Shared signing information.
32    key: "com.android.geotz.key",
33    certificate: ":com.android.geotz.certificate",
34}
35
36apex_key {
37    name: "com.android.geotz.key",
38    public_key: "com.android.geotz.avbpubkey",
39    private_key: "com.android.geotz.pem",
40}
41
42android_app_certificate {
43    name: "com.android.geotz.certificate",
44    certificate: "com.android.geotz",
45}
46
47// Encapsulate the contributions made by the com.android.geotz to the systemserverclasspath.
48systemserverclasspath_fragment {
49    name: "com.android.geotz-systemserverclasspath-fragment",
50    // This name is hardcoded on Android S with associated AndroidManifest.xml
51    // entries in the system server. Do not remove until all releases use an
52    // APK.
53    contents: ["geotz"],
54    apex_available: ["com.android.geotz"],
55}
56
57// The definition for the real (not test) geotz APEX.
58apex {
59    name: "com.android.geotz",
60    defaults: ["com.android.geotz-defaults"],
61    manifest: "manifest.json",
62    prebuilts: [
63        "apex_tzs2.dat",
64    ],
65}
66
67// A library intended to be added to the system server classpath.
68java_library {
69    name: "geotz",
70    java_resource_dirs: ["resources/"],
71    srcs: [
72        "src/main/java/**/*.java",
73    ],
74    libs: [
75        "androidx.annotation_annotation",
76    ],
77    static_libs: [
78        "offlinelocationtimezoneprovider",
79    ],
80    sdk_version: "system_31",
81    // TODO(b/188773212): force dex compilation for inclusion in bootclasspath_fragment.
82    compile_dex: true,
83    apex_available: [
84        "com.android.geotz",
85    ],
86}
87