1/*
2 * Copyright (C) 2016 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
17package android.net;
18
19import android.app.PendingIntent;
20import android.net.ConnectivityMetricsEvent;
21
22/** {@hide} */
23interface IConnectivityMetricsLogger {
24
25    /**
26     * @return 0 on success
27     *        <0 if error happened
28     *        >0 timestamp after which new events will be accepted
29     */
30    long logEvent(in ConnectivityMetricsEvent event);
31    long logEvents(in ConnectivityMetricsEvent[] events);
32
33    /**
34     * @param reference of the last event previously returned. The function will return
35     *                  events following it.
36     *                  If 0 then all events will be returned.
37     *                  After the function call it will contain reference of the last event.
38     */
39    ConnectivityMetricsEvent[] getEvents(inout ConnectivityMetricsEvent.Reference reference);
40
41    boolean register(in PendingIntent newEventsIntent);
42    void unregister(in PendingIntent newEventsIntent);
43}
44