summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPaul Jensen <pauljensen@google.com>2015-04-14 11:56:59 +0000
committerAndroid Partner Code Review <android-gerrit-partner@google.com>2015-04-14 11:56:59 +0000
commit557d2f54893b8da5a7e282fca6267a46d03738bf (patch)
tree4b0ad6c580cd6337399284e25f60d83525fec656 /core
parentab5267a4033c47761aeabad34d4228e59e6a0b07 (diff)
parentbfd17b75a67e3a3c9a99a87db35be4d753e6bd08 (diff)
downloadframeworks_base-557d2f54893b8da5a7e282fca6267a46d03738bf.zip
frameworks_base-557d2f54893b8da5a7e282fca6267a46d03738bf.tar.gz
frameworks_base-557d2f54893b8da5a7e282fca6267a46d03738bf.tar.bz2
Merge "Add ConnectivityManager.reportNetworkConnectivity() API" into m-wireless-dev
Diffstat (limited to 'core')
-rw-r--r--core/java/android/net/ConnectivityManager.java25
-rw-r--r--core/java/android/net/IConnectivityManager.aidl2
2 files changed, 25 insertions, 2 deletions
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index 99e368d..050cafc 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -1708,10 +1708,33 @@ public class ConnectivityManager {
*
* @param network The {@link Network} the application was attempting to use
* or {@code null} to indicate the current default network.
+ * @deprecated Use {@link #reportNetworkConnectivity} which allows reporting both
+ * working and non-working connectivity.
*/
public void reportBadNetwork(Network network) {
try {
- mService.reportBadNetwork(network);
+ // One of these will be ignored because it matches system's current state.
+ // The other will trigger the necessary reevaluation.
+ mService.reportNetworkConnectivity(network, true);
+ mService.reportNetworkConnectivity(network, false);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Report to the framework whether a network has working connectivity.
+ * This provides a hint to the system that a particular network is providing
+ * working connectivity or not. In response the framework may re-evaluate
+ * the network's connectivity and might take further action thereafter.
+ *
+ * @param network The {@link Network} the application was attempting to use
+ * or {@code null} to indicate the current default network.
+ * @param hasConnectivity {@code true} if the application was able to successfully access the
+ * Internet using {@code network} or {@code false} if not.
+ */
+ public void reportNetworkConnectivity(Network network, boolean hasConnectivity) {
+ try {
+ mService.reportNetworkConnectivity(network, hasConnectivity);
} catch (RemoteException e) {
}
}
diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl
index 171c7d4..05ef2e6 100644
--- a/core/java/android/net/IConnectivityManager.aidl
+++ b/core/java/android/net/IConnectivityManager.aidl
@@ -95,7 +95,7 @@ interface IConnectivityManager
void reportInetCondition(int networkType, int percentage);
- void reportBadNetwork(in Network network);
+ void reportNetworkConnectivity(in Network network, boolean hasConnectivity);
ProxyInfo getGlobalProxy();