Search in sources :

Example 51 with NetworkAgentInfo

use of com.android.server.connectivity.NetworkAgentInfo in project android_frameworks_base by crdroidandroid.

the class ConnectivityService method reportInetCondition.

// 100 percent is full good, 0 is full bad.
@Override
public void reportInetCondition(int networkType, int percentage) {
    NetworkAgentInfo nai = mLegacyTypeTracker.getNetworkForType(networkType);
    if (nai == null)
        return;
    reportNetworkConnectivity(nai.network, percentage > 50);
}
Also used : NetworkAgentInfo(com.android.server.connectivity.NetworkAgentInfo)

Example 52 with NetworkAgentInfo

use of com.android.server.connectivity.NetworkAgentInfo in project android_frameworks_base by crdroidandroid.

the class ConnectivityService method handleSetAvoidUnvalidated.

private void handleSetAvoidUnvalidated(Network network) {
    NetworkAgentInfo nai = getNetworkAgentInfoForNetwork(network);
    if (nai == null || nai.lastValidated) {
        // Nothing to do. The network either disconnected or revalidated.
        return;
    }
    if (!nai.avoidUnvalidated) {
        int oldScore = nai.getCurrentScore();
        nai.avoidUnvalidated = true;
        rematchAllNetworksAndRequests(nai, oldScore);
        sendUpdatedScoreToFactories(nai);
    }
}
Also used : NetworkAgentInfo(com.android.server.connectivity.NetworkAgentInfo)

Example 53 with NetworkAgentInfo

use of com.android.server.connectivity.NetworkAgentInfo in project android_frameworks_base by crdroidandroid.

the class ConnectivityService method getAllNetworkState.

@Override
public NetworkState[] getAllNetworkState() {
    // Require internal since we're handing out IMSI details
    enforceConnectivityInternalPermission();
    final ArrayList<NetworkState> result = Lists.newArrayList();
    for (Network network : getAllNetworks()) {
        final NetworkAgentInfo nai = getNetworkAgentInfoForNetwork(network);
        if (nai != null) {
            result.add(nai.getNetworkState());
        }
    }
    return result.toArray(new NetworkState[result.size()]);
}
Also used : NetworkAgentInfo(com.android.server.connectivity.NetworkAgentInfo) Network(android.net.Network) NetworkState(android.net.NetworkState)

Example 54 with NetworkAgentInfo

use of com.android.server.connectivity.NetworkAgentInfo in project android_frameworks_base by crdroidandroid.

the class ConnectivityService method getLinkPropertiesForType.

@Override
public LinkProperties getLinkPropertiesForType(int networkType) {
    enforceAccessPermission();
    NetworkAgentInfo nai = mLegacyTypeTracker.getNetworkForType(networkType);
    if (nai != null) {
        synchronized (nai) {
            return new LinkProperties(nai.linkProperties);
        }
    }
    return null;
}
Also used : NetworkAgentInfo(com.android.server.connectivity.NetworkAgentInfo) LinkProperties(android.net.LinkProperties)

Example 55 with NetworkAgentInfo

use of com.android.server.connectivity.NetworkAgentInfo in project android_frameworks_base by crdroidandroid.

the class KeepaliveTracker method handleStartKeepalive.

public void handleStartKeepalive(Message message) {
    KeepaliveInfo ki = (KeepaliveInfo) message.obj;
    NetworkAgentInfo nai = ki.getNai();
    int slot = findFirstFreeSlot(nai);
    mKeepalives.get(nai).put(slot, ki);
    ki.start(slot);
}
Also used : NetworkAgentInfo(com.android.server.connectivity.NetworkAgentInfo)

Aggregations

NetworkAgentInfo (com.android.server.connectivity.NetworkAgentInfo)165 LinkProperties (android.net.LinkProperties)40 Network (android.net.Network)25 NetworkPolicyManager.uidRulesToString (android.net.NetworkPolicyManager.uidRulesToString)21 NetworkCapabilities (android.net.NetworkCapabilities)20 NetworkInfo (android.net.NetworkInfo)15 NetworkRequest (android.net.NetworkRequest)15 NetworkState (android.net.NetworkState)15 RemoteException (android.os.RemoteException)14 UnknownHostException (java.net.UnknownHostException)14 AsyncChannel (com.android.internal.util.AsyncChannel)11 Vpn (com.android.server.connectivity.Vpn)10 ArrayList (java.util.ArrayList)10 FileNotFoundException (java.io.FileNotFoundException)9 IOException (java.io.IOException)9 InetAddress (java.net.InetAddress)9 XmlPullParserException (org.xmlpull.v1.XmlPullParserException)9 Nullable (android.annotation.Nullable)5 PendingIntent (android.app.PendingIntent)5 Intent (android.content.Intent)5