• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2015 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 #ifndef METRICSD_METRICS_COLLECTOR_SERVICE_IMPL_H_
18 #define METRICSD_METRICS_COLLECTOR_SERVICE_IMPL_H_
19 
20 // metrics_collector binder service implementation.  Constructed by
21 // MetricsCollector.
22 
23 #include "android/brillo/metrics/BnMetricsCollectorService.h"
24 
25 #include <binder/Status.h>
26 
27 class MetricsCollector;
28 
29 class BnMetricsCollectorServiceImpl
30     : public android::brillo::metrics::BnMetricsCollectorService {
31  public:
32   // Passed a this pointer from the MetricsCollector object that constructs us.
33   explicit BnMetricsCollectorServiceImpl(
34       MetricsCollector* metrics_collector_service);
35 
36   virtual ~BnMetricsCollectorServiceImpl() = default;
37 
38   // Called by crash_reporter to report a userspace crash event.  We relay
39   // this to MetricsCollector.
40   android::binder::Status notifyUserCrash();
41 
42  private:
43   // MetricsCollector object that constructs us, we use this to call back
44   // to it.
45   MetricsCollector* metrics_collector_;
46 };
47 
48 #endif  // METRICSD_METRICS_COLLECTOR_SERVICE_IMPL_H_
49