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    systemserverclasspath_fragments: ["com.android.os.statsd-systemserverclasspath-fragment"],
28    jni_libs: [
29        "libstats_jni",
30    ],
31    native_shared_libs: [
32        "libstatspull",
33        "libstatssocket",
34    ],
35    binaries: ["statsd"],
36    compile_multilib: "both",
37    prebuilts: [
38        "com.android.os.statsd.init.rc",
39        "current_sdkinfo",
40    ],
41    name: "com.android.os.statsd-defaults",
42    defaults: ["r-launched-apex-module"],
43    key: "com.android.os.statsd.key",
44    certificate: ":com.android.os.statsd.certificate",
45}
46
47apex_key {
48    name: "com.android.os.statsd.key",
49    public_key: "com.android.os.statsd.avbpubkey",
50    private_key: "com.android.os.statsd.pem",
51}
52
53android_app_certificate {
54    name: "com.android.os.statsd.certificate",
55    // This will use com.android.os.statsd.x509.pem (the cert) and
56    // com.android.os.statsd.pk8 (the private key)
57    certificate: "com.android.os.statsd",
58}
59
60prebuilt_etc {
61    name: "com.android.os.statsd.init.rc",
62    src: "statsd.rc",
63    filename: "init.rc",
64    installable: false,
65}
66
67// ==========================================================
68// Make libstatssocket available to unbundled modules
69// ==========================================================
70sdk {
71    name: "statsd-module-sdk",
72    apexes: [
73        // Adds exportable dependencies of the APEX to the sdk,
74        // e.g. *classpath_fragments.
75        "com.android.os.statsd",
76    ],
77    native_shared_libs: [
78        "libstatspull",
79        "libstatssocket",
80    ],
81}
82
83// Encapsulate the contributions made by the com.android.os.statsd to the bootclasspath.
84bootclasspath_fragment {
85    name: "com.android.os.statsd-bootclasspath-fragment",
86    contents: ["framework-statsd"],
87    apex_available: ["com.android.os.statsd"],
88
89    // The bootclasspath_fragments that provide APIs on which this depends.
90    fragments: [
91        {
92            apex: "com.android.art",
93            module: "art-bootclasspath-fragment",
94        },
95    ],
96
97    // Additional stubs libraries that this fragment's contents use which are
98    // not provided by another bootclasspath_fragment.
99    additional_stubs: [
100        "android-non-updatable",
101    ],
102
103    hidden_api: {
104        max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"],
105
106        // The following packages contain classes from other modules on the
107        // bootclasspath. That means that the hidden API flags for this module
108        // has to explicitly list every single class this module provides in
109        // that package to differentiate them from the classes provided by other
110        // modules. That can include private classes that are not part of the
111        // API.
112        split_packages: [
113            "android.app",
114            "android.os",
115            "android.util",
116        ],
117
118        // The following packages and all their subpackages currently only
119        // contain classes from this bootclasspath_fragment. Listing a package
120        // here won't prevent other bootclasspath modules from adding classes in
121        // any of those packages but it will prevent them from adding those
122        // classes into an API surface, e.g. public, system, etc.. Doing so will
123        // result in a build failure due to inconsistent flags.
124        package_prefixes: [
125            "com.android.internal.statsd",
126        ],
127    },
128}
129
130systemserverclasspath_fragment {
131    name: "com.android.os.statsd-systemserverclasspath-fragment",
132    standalone_contents: ["service-statsd"],
133    apex_available: ["com.android.os.statsd"],
134}
135