1//
2// Copyright (C) 2019 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//
16
17// =========================================================================
18// Native library that toggles between the old and new statsd socket
19// protocols. This library should only be used by DNS resolver or other
20// native modules on Q that log pushed atoms to statsd.
21// =========================================================================
22package {
23    default_applicable_licenses: ["Android-Apache-2.0"],
24}
25
26cc_defaults {
27    name: "libstatspush_compat_defaults",
28    srcs: [
29        "statsd_writer.c",
30        "stats_event_list.c",
31        "StatsEventCompat.cpp"
32    ],
33    cflags: [
34        "-Wall",
35        "-Werror",
36        "-DWRITE_TO_STATSD=1",
37        "-DWRITE_TO_LOGD=0",
38    ],
39    header_libs: [
40        "libcutils_headers",
41        "libstatssocket_headers",
42    ],
43    static_libs: [
44        "libbase",
45    ],
46    shared_libs: [
47        "liblog",
48    ],
49}
50
51cc_library {
52    name: "libstatspush_compat",
53    defaults: ["libstatspush_compat_defaults"],
54    export_include_dirs: ["include"],
55    export_header_lib_headers: [
56        "libstatssocket_headers",
57    ],
58    header_libs: ["libgtest_prod_headers"],
59    apex_available: ["com.android.resolv"],
60    min_sdk_version: "29",
61}
62
63cc_test {
64    name: "libstatspush_compat_test",
65    defaults: ["libstatspush_compat_defaults"],
66    test_suites: ["device_tests"],
67    srcs: [
68        "tests/StatsEventCompat_test.cpp",
69    ],
70    static_libs: ["libgmock"],
71}
72