Permalink
Browse files

Frameworks & SystemUI - additional DC-HSPAP support

This commit adds some more informations about Dual-Carrier HSPAP
It allows displaying a "DC" icon on status bar for compatible devices
and add a "DCHSPAP" value in state phone

Change-Id: I77d05e23c8ad3efdfeb19cf06ed92e7c57105ebe

Conflicts:
	packages/SystemUI/res/values/cm_strings.xml

Author:    matt73300 <matthias.bosc@gmail.com>
  • Loading branch information...
matthiasbosc authored and gokussjx committed Apr 10, 2013
1 parent e9b5912 commit ba5d6135cfa1e5efccbb64b37eb495134af5ad7d
@@ -827,12 +827,14 @@ public abstract long getPhoneSignalScanningTime(
public static final int DATA_CONNECTION_LTE = 13;
public static final int DATA_CONNECTION_EHRPD = 14;
public static final int DATA_CONNECTION_HSPAP = 15;
- public static final int DATA_CONNECTION_OTHER = 16;
+ public static final int DATA_CONNECTION_DCHSPAP = 16;
+ public static final int DATA_CONNECTION_OTHER = 17;
+
static final String[] DATA_CONNECTION_NAMES = {
"none", "gprs", "edge", "umts", "cdma", "evdo_0", "evdo_A",
"1xrtt", "hsdpa", "hsupa", "hspa", "iden", "evdo_b", "lte",
- "ehrpd", "hspap", "other"
+ "ehrpd", "hspap", "dchspap", "other"
};
public static final int NUM_DATA_CONNECTION_TYPES = DATA_CONNECTION_OTHER+1;
@@ -2018,6 +2018,9 @@ public void notePhoneDataConnectionStateLocked(int dataType, boolean hasData) {
case TelephonyManager.NETWORK_TYPE_HSPAP:
bin = DATA_CONNECTION_HSPAP;
break;
+ case TelephonyManager.NETWORK_TYPE_DCHSPAP:
+ bin = DATA_CONNECTION_DCHSPAP;
+ break;
default:
bin = DATA_CONNECTION_OTHER;
break;
@@ -323,6 +323,9 @@
<!-- Content description of the data connection type HSPA+ for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_data_connection_HP">HSPA+</string>
+
+ <!-- Content description of the data connection type DC-HSPA+ for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
+ <string name="accessibility_data_connection_DC">DCHSPAP</string>
<!-- Content description of the data connection type 4G for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_data_connection_4g">4G</string>
@@ -635,6 +635,12 @@ private final void updateDataNetType() {
mContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_HP);
break;
+ case TelephonyManager.NETWORK_TYPE_DCHSPAP:
+ mDataIconList = TelephonyIcons.DATA_DC[mInetCondition];
+ mDataTypeIconId = R.drawable.stat_sys_data_connected_dc;
+ mContentDescriptionDataType = mContext.getString(
+ R.string.accessibility_data_connection_DC);
+ break;
case TelephonyManager.NETWORK_TYPE_CDMA:
if (!mShowAtLeastThreeGees) {
// display 1xRTT for IS95A/B
@@ -123,6 +123,19 @@
R.drawable.stat_sys_data_fully_connected_hp }
};
+ // DC-HSPAP
+ static final int[][] DATA_DC = {
+ { R.drawable.stat_sys_data_connected_dc,
+ R.drawable.stat_sys_data_connected_dc,
+ R.drawable.stat_sys_data_connected_dc,
+ R.drawable.stat_sys_data_connected_dc },
+ { R.drawable.stat_sys_data_fully_connected_dc,
+ R.drawable.stat_sys_data_fully_connected_dc,
+ R.drawable.stat_sys_data_fully_connected_dc,
+ R.drawable.stat_sys_data_fully_connected_dc }
+ };
+
+
//CDMA
// Use 3G icons for EVDO data and 1x icons for 1XRTT data
static final int[][] DATA_1X = {
@@ -26,6 +26,7 @@
import static android.telephony.TelephonyManager.NETWORK_TYPE_HSUPA;
import static android.telephony.TelephonyManager.NETWORK_TYPE_HSPA;
import static android.telephony.TelephonyManager.NETWORK_TYPE_HSPAP;
+import static android.telephony.TelephonyManager.NETWORK_TYPE_DCHSPAP;
/**
* Represents the neighboring cell information, including
@@ -108,7 +109,8 @@ public NeighboringCellInfo(int rssi, int cid) {
* {@link TelephonyManager#NETWORK_TYPE_HSDPA TelephonyManager.NETWORK_TYPE_HSDPA},
* {@link TelephonyManager#NETWORK_TYPE_HSUPA TelephonyManager.NETWORK_TYPE_HSUPA},
* {@link TelephonyManager#NETWORK_TYPE_HSPA TelephonyManager.NETWORK_TYPE_HSPA},
- * and {@link TelephonyManager#NETWORK_TYPE_HSPAP TelephonyManager.NETWORK_TYPE_HSPAP}.
+ * {@link TelephonyManager#NETWORK_TYPE_HSPAP TelephonyManager.NETWORK_TYPE_HSPAP},
+ * and {@link TelephonyManager#NETWORK_TYPE_DCHSPAP TelephonyManager.NETWORK_TYPE_DCHSPAP}.
*/
public NeighboringCellInfo(int rssi, String location, int radioType) {
// set default value
@@ -144,6 +146,7 @@ public NeighboringCellInfo(int rssi, String location, int radioType) {
case NETWORK_TYPE_HSUPA:
case NETWORK_TYPE_HSPA:
case NETWORK_TYPE_HSPAP:
+ case NETWORK_TYPE_DCHSPAP:
mNetworkType = radioType;
mPsc = Integer.valueOf(location, 16);
break;
@@ -220,7 +223,8 @@ public int getPsc() {
* {@link TelephonyManager#NETWORK_TYPE_HSDPA TelephonyManager.NETWORK_TYPE_HSDPA},
* {@link TelephonyManager#NETWORK_TYPE_HSUPA TelephonyManager.NETWORK_TYPE_HSUPA},
* {@link TelephonyManager#NETWORK_TYPE_HSPA TelephonyManager.NETWORK_TYPE_HSPA},
- * or {@link TelephonyManager#NETWORK_TYPE_HSPAP TelephonyManager.NETWORK_TYPE_HSPAP}
+ * {@link TelephonyManager#NETWORK_TYPE_HSPAP TelephonyManager.NETWORK_TYPE_HSPAP},
+ * or {@link TelephonyManager#NETWORK_TYPE_DCHSPAP TelephonyManager.NETWORK_TYPE_DCHSPAP}
* means that Neighboring Cell information is stored for UMTS network, in
* which {@link NeighboringCellInfo#getPsc NeighboringCellInfo.getPsc}
* should be called to access location.
@@ -455,6 +455,9 @@ public static String rilRadioTechnologyToString(int rt) {
case RIL_RADIO_TECHNOLOGY_HSPAP:
rtString = "HSPAP";
break;
+ case RIL_RADIO_TECHNOLOGY_DCHSPAP:
+ rtString = "DCHSPAP";
+ break;
case RIL_RADIO_TECHNOLOGY_GSM:
rtString = "GSM";
break;
@@ -687,6 +690,8 @@ public int getNetworkType() {
return TelephonyManager.NETWORK_TYPE_LTE;
case ServiceState.RIL_RADIO_TECHNOLOGY_HSPAP:
return TelephonyManager.NETWORK_TYPE_HSPAP;
+ case ServiceState.RIL_RADIO_TECHNOLOGY_DCHSPAP:
+ return TelephonyManager.NETWORK_TYPE_DCHSPAP;
default:
return TelephonyManager.NETWORK_TYPE_UNKNOWN;
}
@@ -566,6 +566,8 @@ public String getNetworkCountryIso() {
public static final int NETWORK_TYPE_EHRPD = 14;
/** Current network is HSPA+ */
public static final int NETWORK_TYPE_HSPAP = 15;
+ /** Current network is DC-HSPAP */
+ public static final int NETWORK_TYPE_DCHSPAP = 30;
/**
* Returns a constant indicating the radio technology (network type)
@@ -588,6 +590,7 @@ public String getNetworkCountryIso() {
* @see #NETWORK_TYPE_LTE
* @see #NETWORK_TYPE_EHRPD
* @see #NETWORK_TYPE_HSPAP
+ * @see #NETWORK_TYPE_DCHSPAP
*/
public int getNetworkType() {
try{
@@ -639,6 +642,7 @@ public static int getNetworkClass(int networkType) {
case NETWORK_TYPE_EVDO_B:
case NETWORK_TYPE_EHRPD:
case NETWORK_TYPE_HSPAP:
+ case NETWORK_TYPE_DCHSPAP:
return NETWORK_CLASS_3_G;
case NETWORK_TYPE_LTE:
return NETWORK_CLASS_4_G;
@@ -691,6 +695,8 @@ public static String getNetworkTypeName(int type) {
return "iDEN";
case NETWORK_TYPE_HSPAP:
return "HSPA+";
+ case NETWORK_TYPE_DCHSPAP:
+ return "DCHSPAP";
default:
return "UNKNOWN";
}

0 comments on commit ba5d613

Please sign in to comment.