Add network type TYPE_MOBILE_IA.
Add a network type for establishing connections to the apn used for the initial connection. Enable some debug for now. Bug: 8733613 Change-Id: Ia627ac0cf5715660b6d02bb13a83d46ec1727b87
This commit is contained in:
@@ -355,11 +355,17 @@ public class ConnectivityManager {
|
||||
*/
|
||||
public static final int TYPE_WIFI_P2P = 13;
|
||||
|
||||
/** {@hide} */
|
||||
public static final int MAX_RADIO_TYPE = TYPE_WIFI_P2P;
|
||||
/**
|
||||
* The network to use for initially attaching to the network
|
||||
* {@hide}
|
||||
*/
|
||||
public static final int TYPE_MOBILE_IA = 14;
|
||||
|
||||
/** {@hide} */
|
||||
public static final int MAX_NETWORK_TYPE = TYPE_WIFI_P2P;
|
||||
public static final int MAX_RADIO_TYPE = TYPE_MOBILE_IA;
|
||||
|
||||
/** {@hide} */
|
||||
public static final int MAX_NETWORK_TYPE = TYPE_MOBILE_IA;
|
||||
|
||||
/**
|
||||
* If you want to set the default network preference,you can directly
|
||||
@@ -436,6 +442,8 @@ public class ConnectivityManager {
|
||||
return "MOBILE_CBS";
|
||||
case TYPE_WIFI_P2P:
|
||||
return "WIFI_P2P";
|
||||
case TYPE_MOBILE_IA:
|
||||
return "MOBILE_IA";
|
||||
default:
|
||||
return Integer.toString(type);
|
||||
}
|
||||
@@ -458,6 +466,7 @@ public class ConnectivityManager {
|
||||
case TYPE_MOBILE_FOTA:
|
||||
case TYPE_MOBILE_IMS:
|
||||
case TYPE_MOBILE_CBS:
|
||||
case TYPE_MOBILE_IA:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -489,6 +498,7 @@ public class ConnectivityManager {
|
||||
case TYPE_MOBILE_MMS:
|
||||
case TYPE_MOBILE_SUPL:
|
||||
case TYPE_MOBILE_HIPRI:
|
||||
case TYPE_MOBILE_IA:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
||||
@@ -51,8 +51,8 @@ import java.io.PrintWriter;
|
||||
public class MobileDataStateTracker implements NetworkStateTracker {
|
||||
|
||||
private static final String TAG = "MobileDataStateTracker";
|
||||
private static final boolean DBG = false;
|
||||
private static final boolean VDBG = false;
|
||||
private static final boolean DBG = true;
|
||||
private static final boolean VDBG = true;
|
||||
|
||||
private PhoneConstants.DataState mMobileDataState;
|
||||
private ITelephony mPhoneService;
|
||||
@@ -597,6 +597,8 @@ public class MobileDataStateTracker implements NetworkStateTracker {
|
||||
return PhoneConstants.APN_TYPE_IMS;
|
||||
case ConnectivityManager.TYPE_MOBILE_CBS:
|
||||
return PhoneConstants.APN_TYPE_CBS;
|
||||
case ConnectivityManager.TYPE_MOBILE_IA:
|
||||
return PhoneConstants.APN_TYPE_IA;
|
||||
default:
|
||||
sloge("Error mapping networkType " + netType + " to apnType.");
|
||||
return null;
|
||||
|
||||
@@ -196,6 +196,7 @@
|
||||
<item>"mobile_ims,11,0,2,60000,true"</item>
|
||||
<item>"mobile_cbs,12,0,2,60000,true"</item>
|
||||
<item>"wifi_p2p,13,1,0,-1,true"</item>
|
||||
<item>"mobile_ia,14,0,2,-1,true"</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Array of ConnectivityManager.TYPE_xxxx constants for networks that may only
|
||||
@@ -204,6 +205,7 @@
|
||||
<item>10</item>
|
||||
<item>11</item>
|
||||
<item>12</item>
|
||||
<item>14</item>
|
||||
</integer-array>
|
||||
|
||||
<!-- This string array should be overridden by the device to present a list of radio
|
||||
@@ -226,6 +228,7 @@
|
||||
<item>10</item> <!-- TYPE_MOBILE_FOTA -->
|
||||
<item>11</item> <!-- TYPE_MOBILE_IMS -->
|
||||
<item>12</item> <!-- TYPE_MOBILE_CBS -->
|
||||
<item>14</item> <!-- TYPE_MOBILE_IA -->
|
||||
</integer-array>
|
||||
|
||||
<!-- The maximum duration (in milliseconds) we expect a network transition to take -->
|
||||
|
||||
@@ -472,6 +472,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
com.android.internal.R.array.radioAttributes);
|
||||
for (String raString : raStrings) {
|
||||
RadioAttributes r = new RadioAttributes(raString);
|
||||
if (VDBG) log("raString=" + raString + " r=" + r);
|
||||
if (r.mType > ConnectivityManager.MAX_RADIO_TYPE) {
|
||||
loge("Error in radioAttributes - ignoring attempt to define type " + r.mType);
|
||||
continue;
|
||||
@@ -492,6 +493,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
for (String naString : naStrings) {
|
||||
try {
|
||||
NetworkConfig n = new NetworkConfig(naString);
|
||||
if (VDBG) log("naString=" + naString + " config=" + n);
|
||||
if (n.type > ConnectivityManager.MAX_NETWORK_TYPE) {
|
||||
loge("Error in networkAttributes - ignoring attempt to define type " +
|
||||
n.type);
|
||||
@@ -518,6 +520,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
// ignore it - leave the entry null
|
||||
}
|
||||
}
|
||||
if (VDBG) log("mNetworksDefined=" + mNetworksDefined);
|
||||
|
||||
mProtectedNetworks = new ArrayList<Integer>();
|
||||
int[] protectedNetworks = context.getResources().getIntArray(
|
||||
|
||||
@@ -106,7 +106,8 @@ public class DctConstants {
|
||||
public static final int APN_IMS_ID = 5;
|
||||
public static final int APN_FOTA_ID = 6;
|
||||
public static final int APN_CBS_ID = 7;
|
||||
public static final int APN_NUM_TYPES = 8;
|
||||
public static final int APN_IA_ID = 8;
|
||||
public static final int APN_NUM_TYPES = 9;
|
||||
|
||||
public static final int DISABLED = 0;
|
||||
public static final int ENABLED = 1;
|
||||
|
||||
@@ -119,5 +119,7 @@ public class PhoneConstants {
|
||||
public static final String APN_TYPE_IMS = "ims";
|
||||
/** APN type for CBS */
|
||||
public static final String APN_TYPE_CBS = "cbs";
|
||||
/** APN type for IA Initial Attach APN */
|
||||
public static final String APN_TYPE_IA = "ia";
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user