diff options
| author | Robert Greenwalt <rgreenwalt@google.com> | 2011-08-31 11:46:42 -0700 |
|---|---|---|
| committer | Robert Greenwalt <rgreenwalt@google.com> | 2011-08-31 16:53:12 -0700 |
| commit | 9b2886e24301e5d4e7052ec4a6eaff273d3f516c (patch) | |
| tree | 27925e197c2c104a8ca70be59404c3c444c90c8c /services/java/com/android/server/ConnectivityService.java | |
| parent | ac73e4bb420dbda31a866f3b86b207c71ecfa2f6 (diff) | |
| download | frameworks_base-9b2886e24301e5d4e7052ec4a6eaff273d3f516c.zip frameworks_base-9b2886e24301e5d4e7052ec4a6eaff273d3f516c.tar.gz frameworks_base-9b2886e24301e5d4e7052ec4a6eaff273d3f516c.tar.bz2 | |
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
Diffstat (limited to 'services/java/com/android/server/ConnectivityService.java')
| -rw-r--r-- | services/java/com/android/server/ConnectivityService.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 3815c3b..2348d76 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -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 |
