• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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      */
logEvent(in ConnectivityMetricsEvent event)33     int logEvent(in ConnectivityMetricsEvent event);
34 
logDefaultNetworkValidity(boolean valid)35     void logDefaultNetworkValidity(boolean valid);
logDefaultNetworkEvent(in Network defaultNetwork, int score, boolean validated, in LinkProperties lp, in NetworkCapabilities nc, in Network previousDefaultNetwork, int previousScore, in LinkProperties previousLp, in NetworkCapabilities previousNc)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      */
addNetdEventCallback(in int callerType, in INetdEventCallback callback)46     boolean addNetdEventCallback(in int callerType, in INetdEventCallback callback);
removeNetdEventCallback(in int callerType)47     boolean removeNetdEventCallback(in int callerType);
48 }
49