resolved conflicts for merge of ec52c98d to master
Change-Id: I31297232c9d918a967b93c3ae977f81b6a94f2ed
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index 05ebd07..653e353 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -105,6 +105,14 @@
* 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
@@ -575,4 +583,16 @@
return false;
}
}
+
+ /*
+ * @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 f31fb75..9f2fc17 100644
--- a/core/java/android/net/IConnectivityManager.aidl
+++ b/core/java/android/net/IConnectivityManager.aidl
@@ -78,4 +78,6 @@
String[] getTetherableBluetoothRegexs();
void requestNetworkTransitionWakelock(in String forWhom);
+
+ void reportInetCondition(int networkType, int percentage);
}
diff --git a/core/java/android/net/NetworkStateTracker.java b/core/java/android/net/NetworkStateTracker.java
index 420992b..5420d8f 100644
--- a/core/java/android/net/NetworkStateTracker.java
+++ b/core/java/android/net/NetworkStateTracker.java
@@ -71,6 +71,18 @@
public static final int EVENT_CLEAR_NET_TRANSITION_WAKELOCK = 7;
/**
+ * msg.arg1 = network type
+ * msg.arg2 = condition (0 bad, 100 good)
+ */
+ public static final int EVENT_INET_CONDITION_CHANGE = 8;
+
+ /**
+ * msg.arg1 = network type
+ * msg.arg2 = default connection sequence number
+ */
+ public static final int EVENT_INET_CONDITION_HOLD_END = 9;
+
+ /**
* -------------------------------------------------------------
* Control Interface
* -------------------------------------------------------------
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 567ee93..6af6a81 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -3471,6 +3471,21 @@
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