2019-12-03 04:27:46 +00:00
|
|
|
//
|
|
|
|
// Copyright (C) 2018 The Android Open Source Project
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
|
|
|
|
// =========================================================================
|
|
|
|
// Native library to write stats log to statsd socket on Android R and later
|
|
|
|
// =========================================================================
|
2020-05-08 23:23:54 +00:00
|
|
|
cc_library {
|
|
|
|
name: "libstatssocket",
|
2019-12-03 04:27:46 +00:00
|
|
|
srcs: [
|
2019-11-06 23:15:23 +00:00
|
|
|
"stats_buffer_writer.c",
|
2019-12-03 04:27:46 +00:00
|
|
|
"stats_event.c",
|
2019-11-06 23:15:23 +00:00
|
|
|
// TODO(b/145573568): Remove stats_event_list once stats_event
|
|
|
|
// migration is complete.
|
2019-12-03 04:27:46 +00:00
|
|
|
"stats_event_list.c",
|
|
|
|
"statsd_writer.c",
|
|
|
|
],
|
2020-05-08 23:23:54 +00:00
|
|
|
host_supported: true,
|
2019-12-03 04:27:46 +00:00
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
"-DLIBLOG_LOG_TAG=1006",
|
|
|
|
"-DWRITE_TO_STATSD=1",
|
|
|
|
"-DWRITE_TO_LOGD=0",
|
|
|
|
],
|
2020-05-08 23:23:54 +00:00
|
|
|
export_include_dirs: ["include"],
|
|
|
|
shared_libs: [
|
|
|
|
"libcutils",
|
|
|
|
"liblog",
|
2019-12-03 04:27:46 +00:00
|
|
|
],
|
2019-12-19 23:44:58 +00:00
|
|
|
|
|
|
|
// enumerate stable entry points for APEX use
|
|
|
|
stubs: {
|
|
|
|
symbol_file: "libstatssocket.map.txt",
|
|
|
|
versions: [
|
|
|
|
"1",
|
|
|
|
],
|
2020-05-08 23:23:54 +00:00
|
|
|
}
|
2019-12-03 04:27:46 +00:00
|
|
|
}
|
2019-12-11 02:46:23 +00:00
|
|
|
|
|
|
|
cc_library_headers {
|
|
|
|
name: "libstatssocket_headers",
|
|
|
|
export_include_dirs: ["include"],
|
|
|
|
host_supported: true,
|
2020-04-08 14:40:03 +00:00
|
|
|
apex_available: ["com.android.resolv"],
|
2020-04-16 09:48:33 +00:00
|
|
|
min_sdk_version: "29",
|
2019-12-11 02:46:23 +00:00
|
|
|
}
|
2019-12-13 01:16:59 +00:00
|
|
|
|
|
|
|
cc_benchmark {
|
|
|
|
name: "libstatssocket_benchmark",
|
|
|
|
srcs: [
|
|
|
|
"benchmark/main.cpp",
|
|
|
|
"benchmark/stats_event_benchmark.cpp",
|
|
|
|
],
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
static_libs: [
|
2020-05-08 23:23:54 +00:00
|
|
|
"libstatssocket",
|
2019-12-13 01:16:59 +00:00
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libcutils",
|
|
|
|
"liblog",
|
|
|
|
"libgtest_prod",
|
|
|
|
],
|
|
|
|
}
|
2020-01-07 17:36:04 +00:00
|
|
|
|
|
|
|
cc_test {
|
|
|
|
name: "libstatssocket_test",
|
|
|
|
srcs: ["tests/stats_event_test.cpp"],
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
static_libs: [
|
|
|
|
"libgmock",
|
2020-05-08 23:23:54 +00:00
|
|
|
"libstatssocket",
|
2020-01-07 17:36:04 +00:00
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libcutils",
|
|
|
|
"liblog",
|
|
|
|
"libutils",
|
|
|
|
],
|
|
|
|
test_suites: ["device_tests"],
|
|
|
|
}
|