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// ========================================================================= 22cc_defaults { 23 name: "libstatspush_compat_defaults", 24 srcs: [ 25 "statsd_writer.c", 26 "stats_event_list.c", 27 "StatsEventCompat.cpp" 28 ], 29 cflags: [ 30 "-Wall", 31 "-Werror", 32 "-DWRITE_TO_STATSD=1", 33 "-DWRITE_TO_LOGD=0", 34 ], 35 header_libs: ["libstatssocket_headers"], 36 static_libs: [ 37 "libbase", 38 ], 39 shared_libs: [ 40 "liblog", 41 ], 42} 43 44cc_library { 45 name: "libstatspush_compat", 46 defaults: ["libstatspush_compat_defaults"], 47 export_include_dirs: ["include"], 48 export_header_lib_headers: [ 49 "libstatssocket_headers", 50 ], 51 static_libs: ["libgtest_prod"], 52 apex_available: ["com.android.resolv"], 53 min_sdk_version: "29", 54} 55 56cc_test { 57 name: "libstatspush_compat_test", 58 defaults: ["libstatspush_compat_defaults"], 59 test_suites: ["device_tests"], 60 srcs: [ 61 "tests/StatsEventCompat_test.cpp", 62 ], 63 static_libs: ["libgmock"], 64} 65 66