blob: 0f83cd4665296b9d1cebaf1b63ea6bd2f5e107e2 [file] [log] [blame]
Mike Yuae7f9f72018-12-14 16:18:27 +08001/*
2 * Copyright (C) 2018 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 NETD_RESOLV_EVENT_REPORTER_H
18#define NETD_RESOLV_EVENT_REPORTER_H
19
20#include "aidl/android/net/metrics/INetdEventListener.h"
21
22/*
23 * This class can be used to get the binder reference to the netd events listener service
24 * via stable runtime ABI which is achieved from libbinder_ndk.
25 */
26class ResolverEventReporter {
27 public:
28 // Returns the binder from the singleton ResolverEventReporter. This method is threadsafe.
29 static std::shared_ptr<aidl::android::net::metrics::INetdEventListener> getListener();
30
31 private:
32 // Get netd events listener binder.
33 ResolverEventReporter();
34
35 std::shared_ptr<aidl::android::net::metrics::INetdEventListener> mListener;
36};
37
38#endif // NETD_RESOLV_EVENT_REPORTER_H