From 45d129394a71a112e28567f47faf89d365bca0a0 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Tue, 23 Feb 2016 15:28:35 -0800 Subject: [PATCH] Add Linux-specific version of metrics. This patch adds empty metrics implementation for Linux in order to fix build errors. Bug: 27324453 Change-Id: I2f45db6147689bf295176b7ad30a613a7f5a8d9f --- osi/BUILD.gn | 1 + osi/src/metrics_linux.cpp | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 osi/src/metrics_linux.cpp diff --git a/osi/BUILD.gn b/osi/BUILD.gn index 28307f38c..b0a8f9193 100644 --- a/osi/BUILD.gn +++ b/osi/BUILD.gn @@ -31,6 +31,7 @@ static_library("osi") { "src/hash_map.c", "src/hash_map_utils.c", "src/list.c", + "src/metrics_linux.cpp", "src/mutex.c", "src/reactor.c", "src/ringbuffer.c", diff --git a/osi/src/metrics_linux.cpp b/osi/src/metrics_linux.cpp new file mode 100644 index 000000000..f01323617 --- /dev/null +++ b/osi/src/metrics_linux.cpp @@ -0,0 +1,60 @@ +/****************************************************************************** + * + * Copyright (C) 2016 Google, Inc. + * + * 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. + * + ******************************************************************************/ + + +#define LOG_TAG "bt_osi_metrics" + +extern "C" { +#include "osi/include/metrics.h" +} + +void metrics_pair_event(uint32_t disconnect_reason, uint64_t timestamp_ms, + uint32_t device_class, device_type_t device_type) { + //TODO(jpawlowski): implement +} + +void metrics_wake_event(wake_event_type_t type, const char *requestor, + const char *name, uint64_t timestamp_ms) { + //TODO(jpawlowski): implement +} + +void metrics_scan_event(bool start, const char *initator, scan_tech_t type, + uint32_t results, uint64_t timestamp_ms) { + //TODO(jpawlowski): implement +} + +void metrics_a2dp_session(int64_t session_duration_sec, + const char *disconnect_reason, + uint32_t device_class, + int32_t media_timer_min_ms, + int32_t media_timer_max_ms, + int32_t media_timer_avg_ms, + int32_t buffer_overruns_max_count, + int32_t buffer_overruns_total, + float buffer_underruns_average, + int32_t buffer_underruns_count) { + //TODO(jpawlowski): implement +} + +void metrics_write(int fd, bool clear) { + //TODO(jpawlowski): implement +} + +void metrics_print(int fd, bool clear) { + //TODO(jpawlowski): implement +} -- 2.11.0