blob: aeaf09d8fafe4c46d9ba61d72005b41156a59266 [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 /**
Ricky Wai1a6e6672017-10-27 14:46:01 +010033 * Callback can be registered by DevicePolicyManager or NetworkWatchlistService only.
Michal Karpinskidd9bb4f2016-10-12 14:59:26 +010034 * @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 */
Ricky Wai1a6e6672017-10-27 14:46:01 +010038 boolean addNetdEventCallback(in int callerType, in INetdEventCallback callback);
39 boolean removeNetdEventCallback(in int callerType);
Hugo Benichieab511b2016-09-09 09:23:47 +090040}