Merge "Add some network/phone type constants."

This commit is contained in:
Robert Greenwalt
2010-11-03 17:05:24 -07:00
committed by Android (Google) Code Review
6 changed files with 42 additions and 6 deletions

View File

@@ -315,6 +315,17 @@ public class MobileDataStateTracker implements NetworkStateTracker {
case TelephonyManager.NETWORK_TYPE_EVDO_B:
networkTypeStr = "evdo";
break;
case TelephonyManager.NETWORK_TYPE_IDEN:
networkTypeStr = "iden";
break;
case TelephonyManager.NETWORK_TYPE_LTE:
networkTypeStr = "lte";
break;
case TelephonyManager.NETWORK_TYPE_EHRPD:
networkTypeStr = "ehrpd";
break;
default:
Log.e(TAG, "unknown network type: " + tm.getNetworkType());
}
return "net.tcp.buffersize." + networkTypeStr;
}

View File

@@ -654,11 +654,14 @@ public abstract class BatteryStats implements Parcelable {
public static final int DATA_CONNECTION_HSPA = 10;
public static final int DATA_CONNECTION_IDEN = 11;
public static final int DATA_CONNECTION_EVDO_B = 12;
public static final int DATA_CONNECTION_OTHER = 13;
public static final int DATA_CONNECTION_LTE = 13;
public static final int DATA_CONNECTION_EHRPD = 14;
public static final int DATA_CONNECTION_OTHER = 15;
static final String[] DATA_CONNECTION_NAMES = {
"none", "gprs", "edge", "umts", "cdma", "evdo_0", "evdo_A",
"1xrtt", "hsdpa", "hsupa", "hspa", "iden", "evdo_b", "other"
"1xrtt", "hsdpa", "hsupa", "hspa", "iden", "evdo_b", "lte",
"ehrpd", "other"
};
public static final int NUM_DATA_CONNECTION_TYPES = DATA_CONNECTION_OTHER+1;

View File

@@ -1786,6 +1786,12 @@ public final class BatteryStatsImpl extends BatteryStats {
case TelephonyManager.NETWORK_TYPE_EVDO_B:
bin = DATA_CONNECTION_EVDO_B;
break;
case TelephonyManager.NETWORK_TYPE_LTE:
bin = DATA_CONNECTION_LTE;
break;
case TelephonyManager.NETWORK_TYPE_EHRPD:
bin = DATA_CONNECTION_EHRPD;
break;
default:
bin = DATA_CONNECTION_OTHER;
break;

View File

@@ -750,6 +750,7 @@ public class StatusBarPolicy {
case TelephonyManager.NETWORK_TYPE_EVDO_B:
mDataIconList = sDataNetType_3g[mInetCondition];
break;
// TODO - add support for NETWORK_TYPE_LTE and NETWORK_TYPE_EHRPD
default:
mDataIconList = sDataNetType_g[mInetCondition];
break;

View File

@@ -127,7 +127,7 @@ public class NeighboringCellInfo implements Parcelable
location = "0" + location;
}
}
// TODO - handle LTE and eHRPD (or find they can't be supported)
try {// set LAC/CID or PSC based on radioType
switch (radioType) {
case NETWORK_TYPE_GPRS:

View File

@@ -272,13 +272,17 @@ public class TelephonyManager {
public static final int PHONE_TYPE_GSM = Phone.PHONE_TYPE_GSM;
/** Phone radio is CDMA. */
public static final int PHONE_TYPE_CDMA = Phone.PHONE_TYPE_CDMA;
/** Phone is via SIP. */
public static final int PHONE_TYPE_SIP = Phone.PHONE_TYPE_SIP;
/**
* Returns a constant indicating the device phone type.
* Returns a constant indicating the device phone type. This
* indicates the type of radio used to transmit voice calls.
*
* @see #PHONE_TYPE_NONE
* @see #PHONE_TYPE_GSM
* @see #PHONE_TYPE_CDMA
* @see #PHONE_TYPE_SIP
*/
public int getPhoneType() {
try{
@@ -393,11 +397,15 @@ public class TelephonyManager {
public static final int NETWORK_TYPE_IDEN = 11;
/** Current network is EVDO revision B*/
public static final int NETWORK_TYPE_EVDO_B = 12;
/** Current network is LTE */
public static final int NETWORK_TYPE_LTE = 13;
/** Current network is eHRPD */
public static final int NETWORK_TYPE_EHRPD = 14;
/**
* Returns a constant indicating the radio technology (network type)
* currently in use on the device.
* currently in use on the device for data transmission.
* @return the network type
*
* @see #NETWORK_TYPE_UNKNOWN
@@ -412,6 +420,9 @@ public class TelephonyManager {
* @see #NETWORK_TYPE_EVDO_A
* @see #NETWORK_TYPE_EVDO_B
* @see #NETWORK_TYPE_1xRTT
* @see #NETWORK_TYPE_IDEN
* @see #NETWORK_TYPE_LTE
* @see #NETWORK_TYPE_EHRPD
*/
public int getNetworkType() {
try{
@@ -462,6 +473,10 @@ public class TelephonyManager {
return "CDMA - EvDo rev. B";
case NETWORK_TYPE_1xRTT:
return "CDMA - 1xRTT";
case NETWORK_TYPE_LTE:
return "LTE";
case NETWORK_TYPE_EHRPD:
return "CDMA - eHRPD";
default:
return "UNKNOWN";
}