diff options
| author | Vinit Deshapnde <vinitd@google.com> | 2013-08-21 13:09:01 -0700 |
|---|---|---|
| committer | Vinit Deshapnde <vinitd@google.com> | 2013-08-21 13:09:01 -0700 |
| commit | 1f12cb52a494a3eaefc62d03a8d2fdf47a5535e9 (patch) | |
| tree | bcb2aaae049ed47fd49863289d582698ca87282f /core/java/android/net/ConnectivityManager.java | |
| parent | 2241d45c68739e5bdf187ba3325ee237ef143e21 (diff) | |
Introduce network link quality statistics
This change starts tracking traffic quality data for WiFi and mobile
networks. The quality is tracked based on incidental traffic, and not
on specific measurements. Theoretical bandwidths are hard-coded, as
well as sampling interval; although sampling interval can be changed
by setting a system policy.
Bugs filed to remove shortcomings of this change -
10342372 Change LinkInfo name to something better
10342318 Move hardcoded values of MobileLinkInfo to resources
so they can be updated without changing code
Bug: 10006249
Change-Id: I83d8c7594da20fe53abbd5e1f909b1f606b035bb
Diffstat (limited to 'core/java/android/net/ConnectivityManager.java')
| -rw-r--r-- | core/java/android/net/ConnectivityManager.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 1b418fa5f8a5..f6a3a4a772a8 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -1442,4 +1442,43 @@ public class ConnectivityManager { } return null; } + + /** + * get the information about a specific network link + * @hide + */ + public LinkInfo getLinkInfo(int networkType) { + try { + LinkInfo li = mService.getLinkInfo(networkType); + return li; + } catch (RemoteException e) { + return null; + } + } + + /** + * get the information of currently active network link + * @hide + */ + public LinkInfo getActiveLinkInfo() { + try { + LinkInfo li = mService.getActiveLinkInfo(); + return li; + } catch (RemoteException e) { + return null; + } + } + + /** + * get the information of all network links + * @hide + */ + public LinkInfo[] getAllLinkInfo() { + try { + LinkInfo[] li = mService.getAllLinkInfo(); + return li; + } catch (RemoteException e) { + return null; + } + } } |
