| 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 |
|
| 17 |
package android.net; |
| 18 |
|
| 19 |
import android.os.Parcelable; |
| 20 |
import android.net.ConnectivityMetricsEvent; |
| 21 |
import android.net.INetdEventCallback; |
| 22 |
import android.net.LinkProperties; |
| 23 |
import android.net.Network; |
| 24 |
import android.net.NetworkCapabilities; |
| 25 |
|
| 26 |
/** {@hide} */ |
| 27 |
interface IIpConnectivityMetrics { |
| 28 |
|
| 29 |
/** |
| 30 |
* @return the number of remaining available slots in buffer, |
| 31 |
* or -1 if the event was dropped due to rate limiting. |
| 32 |
*/ |
| 33 |
int logEvent(in ConnectivityMetricsEvent event); |
| 34 |
|
| 35 |
void logDefaultNetworkValidity(boolean valid); |
| 36 |
void logDefaultNetworkEvent(in Network defaultNetwork, int score, boolean validated, |
| 37 |
in LinkProperties lp, in NetworkCapabilities nc, in Network previousDefaultNetwork, |
| 38 |
int previousScore, in LinkProperties previousLp, in NetworkCapabilities previousNc); |
| 39 |
|
| 40 |
/** |
| 41 |
* Callback can be registered by DevicePolicyManager or NetworkWatchlistService only. |
| 42 |
* @return status {@code true} if registering/unregistering of the callback was successful, |
| 43 |
* {@code false} otherwise (might happen if IIpConnectivityMetrics is not available, |
| 44 |
* if it happens make sure you call it when the service is up in the caller) |
| 45 |
*/ |
| 46 |
boolean addNetdEventCallback(in int callerType, in INetdEventCallback callback); |
| 47 |
boolean removeNetdEventCallback(in int callerType); |
| 48 |
} |