1// Copyright (C) 2019 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_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19apex {
20    name: "com.android.os.statsd",
21    defaults: ["com.android.os.statsd-defaults"],
22    manifest: "apex_manifest.json",
23}
24
25apex_defaults {
26    bootclasspath_fragments: ["com.android.os.statsd-bootclasspath-fragment"],
27    jni_libs: [
28        "libstats_jni",
29    ],
30    native_shared_libs: [
31        "libstatspull",
32        "libstatssocket",
33    ],
34    binaries: ["statsd"],
35    java_libs: [
36        "service-statsd",
37    ],
38    compile_multilib: "both",
39    prebuilts: [
40        "com.android.os.statsd.init.rc",
41        "current_sdkinfo",
42    ],
43    name: "com.android.os.statsd-defaults",
44    updatable: true,
45    min_sdk_version: "30",
46    key: "com.android.os.statsd.key",
47    certificate: ":com.android.os.statsd.certificate",
48}
49
50apex_key {
51    name: "com.android.os.statsd.key",
52    public_key: "com.android.os.statsd.avbpubkey",
53    private_key: "com.android.os.statsd.pem",
54}
55
56android_app_certificate {
57    name: "com.android.os.statsd.certificate",
58    // This will use com.android.os.statsd.x509.pem (the cert) and
59    // com.android.os.statsd.pk8 (the private key)
60    certificate: "com.android.os.statsd",
61}
62
63prebuilt_etc {
64    name: "com.android.os.statsd.init.rc",
65    src: "statsd.rc",
66    filename: "init.rc",
67    installable: false,
68}
69
70// ==========================================================
71// Make libstatssocket available to unbundled modules
72// ==========================================================
73sdk {
74    name: "statsd-module-sdk",
75    bootclasspath_fragments: ["com.android.os.statsd-bootclasspath-fragment"],
76    native_shared_libs: [
77        "libstatssocket",
78    ],
79}
80
81// TODO(b/180769414): ART should be able to use the statsd-module-sdk entry,
82// but unfortunately that conflicts with internal builds. Make a special copy
83// for ART for the time being.
84sdk {
85    name: "statsd-module-sdk-for-art",
86    native_shared_libs: [
87        "libstatssocket",
88    ],
89}
90
91// Encapsulate the contributions made by the com.android.os.statsd to the bootclasspath.
92bootclasspath_fragment {
93    name: "com.android.os.statsd-bootclasspath-fragment",
94    contents: ["framework-statsd"],
95    apex_available: ["com.android.os.statsd"],
96
97    // The bootclasspath_fragments that provide APIs on which this depends.
98    fragments: [
99        {
100            apex: "com.android.art",
101            module: "art-bootclasspath-fragment",
102        },
103    ],
104
105    // Additional stubs libraries that this fragment's contents use which are
106    // not provided by another bootclasspath_fragment.
107    additional_stubs: [
108        "android-non-updatable",
109    ],
110
111    hidden_api: {
112        max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"],
113    },
114}
115