diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2010-09-09 09:49:15 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-09-09 09:49:15 -0700 |
commit | ec52c98d441aa592a203f547c0edec79c25bf28e (patch) | |
tree | 7b63570297eed4590bbacf27342f7efd1afb9fa1 /core/java/android | |
parent | c2eff4a71bd3ab75983ffd029123f10bc177d32a (diff) | |
parent | 0727a865d83b944c2fecc0bf1228a36976fe5300 (diff) | |
download | frameworks_base-ec52c98d441aa592a203f547c0edec79c25bf28e.zip frameworks_base-ec52c98d441aa592a203f547c0edec79c25bf28e.tar.gz frameworks_base-ec52c98d441aa592a203f547c0edec79c25bf28e.tar.bz2 |
am 0727a865: Merge "Add network condition reporting." into gingerbread
Merge commit '0727a865d83b944c2fecc0bf1228a36976fe5300' into gingerbread-plus-aosp
* commit '0727a865d83b944c2fecc0bf1228a36976fe5300':
Add network condition reporting.
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/net/ConnectivityManager.java | 22 | ||||
-rw-r--r-- | core/java/android/net/IConnectivityManager.aidl | 2 | ||||
-rw-r--r-- | core/java/android/net/NetworkStateTracker.java | 9 | ||||
-rw-r--r-- | core/java/android/provider/Settings.java | 15 |
4 files changed, 47 insertions, 1 deletions
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 5b0f60f..d127ca8 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -105,6 +105,14 @@ public class ConnectivityManager * it with {@link android.content.Intent#getStringExtra(String)}. */ public static final String EXTRA_EXTRA_INFO = "extraInfo"; + /** + * The lookup key for an int that provides information about + * our connection to the internet at large. 0 indicates no connection, + * 100 indicates a great connection. Retrieve it with + * {@link android.content.Intent@getIntExtra(String)}. + * {@hide} + */ + public static final String EXTRA_INET_CONDITION = "inetCondition"; /** * Broadcast Action: The setting for background data usage has changed @@ -548,5 +556,17 @@ public class ConnectivityManager } catch (RemoteException e) { return TETHER_ERROR_SERVICE_UNAVAIL; } - } + } + + /** + * @param networkType The type of network you want to report on + * @param percentage The quality of the connection 0 is bad, 100 is good + * {@hide} + */ + public void reportInetCondition(int networkType, int percentage) { + try { + mService.reportInetCondition(networkType, percentage); + } catch (RemoteException e) { + } + } } diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl index 0eb3afd..afccdd9 100644 --- a/core/java/android/net/IConnectivityManager.aidl +++ b/core/java/android/net/IConnectivityManager.aidl @@ -74,4 +74,6 @@ interface IConnectivityManager String[] getTetherableUsbRegexs(); String[] getTetherableWifiRegexs(); + + void reportInetCondition(int networkType, int percentage); } diff --git a/core/java/android/net/NetworkStateTracker.java b/core/java/android/net/NetworkStateTracker.java index 838696d..0707df3 100644 --- a/core/java/android/net/NetworkStateTracker.java +++ b/core/java/android/net/NetworkStateTracker.java @@ -63,6 +63,15 @@ public abstract class NetworkStateTracker extends Handler { public static final int EVENT_ROAMING_CHANGED = 5; public static final int EVENT_NETWORK_SUBTYPE_CHANGED = 6; public static final int EVENT_RESTORE_DEFAULT_NETWORK = 7; + /** + * arg1: network type + * arg2: condition (0 bad, 100 good) + */ + public static final int EVENT_INET_CONDITION_CHANGE = 8; + /** + * arg1: network type + */ + public static final int EVENT_INET_CONDITION_HOLD_END = 9; public NetworkStateTracker(Context context, Handler target, diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 7fbae6d..dd83006 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -3427,6 +3427,21 @@ public final class Settings { public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE = "download_manager_max_bytes_over_mobile"; + /** + * ms during which to consume extra events related to Inet connection condition + * after a transtion to fully-connected + * @hide + */ + public static final String INET_CONDITION_DEBOUNCE_UP_DELAY = + "inet_condition_debounce_up_delay"; + + /** + * ms during which to consume extra events related to Inet connection condtion + * after a transtion to partly-connected + * @hide + */ + public static final String INET_CONDITION_DEBOUNCE_DOWN_DELAY = + "inet_condition_debounce_down_delay"; /** * @hide |