Create new isNetworkSupported API
Useful for checking if on a wifi-only device. Similar to asking for NetworkInfo for a network type and checking for null, though here the intent is explicit. bug:5087537 Change-Id: Ia3ddd09b6b735b8b3ceb7a347891e015fd96b218
This commit is contained in:
parent
971cd16561
commit
0114f6e8e9
1 changed files with 26 additions and 0 deletions
|
|
@ -703,6 +703,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||
return result.toArray(new NetworkInfo[result.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNetworkSupported(int networkType) {
|
||||
enforceAccessPermission();
|
||||
return (isNetworkTypeValid(networkType) && (mNetTrackers[networkType] != null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return LinkProperties for the active (i.e., connected) default
|
||||
* network interface. It is assumed that at most one default network
|
||||
|
|
|
|||
Loading…
Reference in a new issue