1 // Copyright (C) 2021 The Android Open Source Project 2 // Copyright (C) 2021 Google Inc. 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 #include "base/Metrics.h" 17 18 namespace android { 19 namespace base { 20 21 void (*MetricsLogger::add_instant_event_callback)(int64_t event_code) = nullptr; 22 void (*MetricsLogger::add_instant_event_with_descriptor_callback)( 23 int64_t event_code, int64_t descriptor) = nullptr; 24 void (*MetricsLogger::add_instant_event_with_metric_callback)( 25 int64_t event_code, int64_t metric_value) = nullptr; 26 void (*MetricsLogger::set_crash_annotation_callback)(const char* key, const char* value) = nullptr; 27 28 class MetricsLogLibNoOp : public MetricsLogger { logMetricEvent(MetricEventType eventType)29 void logMetricEvent(MetricEventType eventType) override {} 30 }; 31 CreateMetricsLogger()32std::unique_ptr<MetricsLogger> CreateMetricsLogger() { 33 return std::make_unique<MetricsLogLibNoOp>(); 34 } 35 36 } // namespace base 37 } // namespace android