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);
}
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);
}
}
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()]);
}
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;
}
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);
}
Aggregations