am 2d0ab42b: Merge "Apply API Council comments to ConnectivityManager" into lmp-preview-dev
* commit '2d0ab42b1420db884d26fd2ef22710b5a887e9a6':
Apply API Council comments to ConnectivityManager
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index 7faf8ef..ba31243 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -898,6 +898,7 @@
case NetworkCapabilities.NET_CAPABILITY_IMS:
case NetworkCapabilities.NET_CAPABILITY_RCS:
case NetworkCapabilities.NET_CAPABILITY_XCAP:
+ case NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED: //there by default
continue;
default:
// At least one capability usually provided by unrestricted
diff --git a/core/java/android/net/LinkProperties.java b/core/java/android/net/LinkProperties.java
index 8eefa0f..bb05936 100644
--- a/core/java/android/net/LinkProperties.java
+++ b/core/java/android/net/LinkProperties.java
@@ -44,7 +44,7 @@
* does not affect live networks.
*
*/
-public final class LinkProperties implements Parcelable {
+public class LinkProperties implements Parcelable {
// The interface described by the network link.
private String mIfaceName;
private ArrayList<LinkAddress> mLinkAddresses = new ArrayList<LinkAddress>();
@@ -463,6 +463,7 @@
/**
* Implement the Parcelable interface
+ * @hide
*/
public int describeContents() {
return 0;
diff --git a/core/java/android/net/NetworkAgent.java b/core/java/android/net/NetworkAgent.java
index 7e8b1f1..3d0874b 100644
--- a/core/java/android/net/NetworkAgent.java
+++ b/core/java/android/net/NetworkAgent.java
@@ -80,6 +80,11 @@
*/
public static final int EVENT_NETWORK_PROPERTIES_CHANGED = BASE + 3;
+ /* centralize place where base network score, and network score scaling, will be
+ * stored, so as we can consistently compare apple and oranges, or wifi, ethernet and LTE
+ */
+ public static final int WIFI_BASE_SCORE = 60;
+
/**
* Sent by the NetworkAgent to ConnectivityService to pass the current
* network score.
diff --git a/core/java/android/net/RouteInfo.java b/core/java/android/net/RouteInfo.java
index c2b888c..8b42bcd 100644
--- a/core/java/android/net/RouteInfo.java
+++ b/core/java/android/net/RouteInfo.java
@@ -46,7 +46,7 @@
* destination and gateway are both specified, they must be of the same address family
* (IPv4 or IPv6).
*/
-public final class RouteInfo implements Parcelable {
+public class RouteInfo implements Parcelable {
/**
* The IP destination address for this route.
* TODO: Make this an IpPrefix.
@@ -378,6 +378,7 @@
/**
* Implement the Parcelable interface
+ * @hide
*/
public int describeContents() {
return 0;
@@ -385,6 +386,7 @@
/**
* Implement the Parcelable interface
+ * @hide
*/
public void writeToParcel(Parcel dest, int flags) {
if (mDestination == null) {
@@ -407,6 +409,7 @@
/**
* Implement the Parcelable interface.
+ * @hide
*/
public static final Creator<RouteInfo> CREATOR =
new Creator<RouteInfo>() {
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index e39e077..00bda06 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -4437,7 +4437,9 @@
mIsProvisioningNetwork.set(true);
MobileDataStateTracker mdst = (MobileDataStateTracker)
mNetTrackers[ConnectivityManager.TYPE_MOBILE];
- mdst.setInternalDataEnable(false);
+
+ // Disable radio until user starts provisioning
+ mdst.setRadio(false);
} else {
if (DBG) log("CheckMp.onComplete: warm (no dns/tcp), no url");
}
@@ -4949,17 +4951,24 @@
// Mark notification as not visible
setProvNotificationVisible(false, ConnectivityManager.TYPE_MOBILE_HIPRI, null, null);
- // If provisioning network handle as a special case,
+ // Check airplane mode
+ boolean isAirplaneModeOn = Settings.System.getInt(mContext.getContentResolver(),
+ Settings.Global.AIRPLANE_MODE_ON, 0) == 1;
+ // If provisioning network and not in airplane mode handle as a special case,
// otherwise launch browser with the intent directly.
- if (mIsProvisioningNetwork.get()) {
+ if (mIsProvisioningNetwork.get() && !isAirplaneModeOn) {
if (DBG) log("handleMobileProvisioningAction: on prov network enable then launch");
+ mIsProvisioningNetwork.set(false);
// mIsStartingProvisioning.set(true);
// MobileDataStateTracker mdst = (MobileDataStateTracker)
// mNetTrackers[ConnectivityManager.TYPE_MOBILE];
+ // Radio was disabled on CMP_RESULT_CODE_PROVISIONING_NETWORK, enable it here
+// mdst.setRadio(true);
// mdst.setEnableFailFastMobileData(DctConstants.ENABLED);
// mdst.enableMobileProvisioning(url);
} else {
if (DBG) log("handleMobileProvisioningAction: not prov network");
+ mIsProvisioningNetwork.set(false);
// Check for apps that can handle provisioning first
Intent provisioningIntent = new Intent(TelephonyIntents.ACTION_CARRIER_SETUP);
provisioningIntent.addCategory(TelephonyIntents.CATEGORY_MCCMNC_PREFIX