blob: 6f07b31538336f5de6abd0494f594e6f9b6233b4 [file] [log] [blame]
Hugo Benichieab511b2016-09-09 09:23:47 +09001/*
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.os.Parcelable;
20import android.net.ConnectivityMetricsEvent;
Michal Karpinskidd9bb4f2016-10-12 14:59:26 +010021import android.net.INetdEventCallback;
Hugo Benichieab511b2016-09-09 09:23:47 +090022
23/** {@hide} */
24interface IIpConnectivityMetrics {
25
26 /**
Hugo Benichie1c173d2016-10-18 10:36:33 +090027 * @return the number of remaining available slots in buffer,
28 * or -1 if the event was dropped due to rate limiting.
Hugo Benichieab511b2016-09-09 09:23:47 +090029 */
30 int logEvent(in ConnectivityMetricsEvent event);
Michal Karpinskidd9bb4f2016-10-12 14:59:26 +010031
32 /**
33 * At most one callback can be registered (by DevicePolicyManager).
34 * @return status {@code true} if registering/unregistering of the callback was successful,
35 * {@code false} otherwise (might happen if IIpConnectivityMetrics is not available,
36 * if it happens make sure you call it when the service is up in the caller)
37 */
38 boolean registerNetdEventCallback(in INetdEventCallback callback);
39 boolean unregisterNetdEventCallback();
Hugo Benichieab511b2016-09-09 09:23:47 +090040}