Skip to content

Commit

Permalink
Merge "frameworks/base: forward port DC-HSPAP support from cm-10" int…
Browse files Browse the repository at this point in the history
…o cm-11.0
  • Loading branch information
ciwrl authored and Gerrit Code Review committed Mar 27, 2014
2 parents 4251a52 + eed8a49 commit 086d341
Show file tree
Hide file tree
Showing 22 changed files with 60 additions and 9 deletions.
5 changes: 5 additions & 0 deletions core/java/android/net/MobileDataStateTracker.java
Expand Up @@ -457,6 +457,9 @@ public String getTcpBufferSizesPropName() {
case TelephonyManager.NETWORK_TYPE_HSPAP:
networkTypeStr = "hspap";
break;
case TelephonyManager.NETWORK_TYPE_DCHSPAP:
networkTypeStr = "dchspap";
break;
case TelephonyManager.NETWORK_TYPE_CDMA:
networkTypeStr = "cdma";
break;
Expand Down Expand Up @@ -932,6 +935,7 @@ static class NetworkDataEntry {
new NetworkDataEntry(TelephonyManager.NETWORK_TYPE_HSUPA, 14400, 5760, UNKNOWN),
new NetworkDataEntry(TelephonyManager.NETWORK_TYPE_HSPA, 14400, 5760, UNKNOWN),
new NetworkDataEntry(TelephonyManager.NETWORK_TYPE_HSPAP, 21000, 5760, UNKNOWN),
new NetworkDataEntry(TelephonyManager.NETWORK_TYPE_DCHSPAP, 42000, 5760, UNKNOWN),
new NetworkDataEntry(TelephonyManager.NETWORK_TYPE_CDMA, UNKNOWN, UNKNOWN, UNKNOWN),
new NetworkDataEntry(TelephonyManager.NETWORK_TYPE_1xRTT, UNKNOWN, UNKNOWN, UNKNOWN),
new NetworkDataEntry(TelephonyManager.NETWORK_TYPE_EVDO_0, 2468, 153, UNKNOWN),
Expand Down Expand Up @@ -965,6 +969,7 @@ private static int getNormalizedSignalStrength(int networkType, SignalStrength s
case TelephonyManager.NETWORK_TYPE_HSUPA:
case TelephonyManager.NETWORK_TYPE_HSPA:
case TelephonyManager.NETWORK_TYPE_HSPAP:
case TelephonyManager.NETWORK_TYPE_DCHSPAP:
level = ss.getGsmLevel();
break;
case TelephonyManager.NETWORK_TYPE_CDMA:
Expand Down
5 changes: 3 additions & 2 deletions core/java/android/os/BatteryStats.java
Expand Up @@ -855,12 +855,13 @@ 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", "hspa+","dc-hspa+", "other"
};

public static final int NUM_DATA_CONNECTION_TYPES = DATA_CONNECTION_OTHER+1;
Expand Down
3 changes: 3 additions & 0 deletions core/java/com/android/internal/os/BatteryStatsImpl.java
Expand Up @@ -2177,6 +2177,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;
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/SystemUI/res/values/cm_strings.xml
Expand Up @@ -19,7 +19,7 @@
<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>
<string name="accessibility_data_connection_DC">DC-HSPA+</string>

<string name="accessibility_quick_settings_ringer">Sound <xliff:g id="state" example="Off">%s</xliff:g>.</string>
<string name="accessibility_quick_settings_vibration">Vibration <xliff:g id="state" example="Off">%s</xliff:g>.</string>
Expand Down
Expand Up @@ -746,6 +746,13 @@ private final void updateDataNetType() {
R.string.accessibility_data_connection_3g);
}
break;
case TelephonyManager.NETWORK_TYPE_DCHSPAP:
mDataIconList = TelephonyIcons.DATA_DC[mInetCondition];
mDataTypeIconId = R.drawable.stat_sys_data_fully_connected_dc;
mQSDataTypeIconId = TelephonyIcons.QS_DATA_DC[mInetCondition];
mContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_DC);
break;
case TelephonyManager.NETWORK_TYPE_CDMA:
if (!mShowAtLeastThreeGees) {
// display 1xRTT for IS95A/B
Expand Down
Expand Up @@ -154,6 +154,24 @@ class TelephonyIcons {

};

//DC-HPSPA+
static final int[][] DATA_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 },
{ 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 }
};

static final int[] QS_DATA_DC = {
R.drawable.ic_qs_signal_dc,
R.drawable.ic_qs_signal_full_dc

};

//CDMA
// Use 3G icons for EVDO data and 1x icons for 1XRTT data
static final int[][] DATA_1X = {
Expand Down
Expand Up @@ -1747,7 +1747,8 @@ private void requestRefLocation(int flags) {
|| networkType == TelephonyManager.NETWORK_TYPE_HSDPA
|| networkType == TelephonyManager.NETWORK_TYPE_HSUPA
|| networkType == TelephonyManager.NETWORK_TYPE_HSPA
|| networkType == TelephonyManager.NETWORK_TYPE_HSPAP) {
|| networkType == TelephonyManager.NETWORK_TYPE_HSPAP
|| networkType == TelephonyManager.NETWORK_TYPE_DCHSPAP) {
type = AGPS_REF_LOCATION_TYPE_UMTS_CELLID;
} else {
type = AGPS_REF_LOCATION_TYPE_GSM_CELLID;
Expand Down
9 changes: 7 additions & 2 deletions telephony/java/android/telephony/NeighboringCellInfo.java
Expand Up @@ -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
Expand Down Expand Up @@ -108,8 +109,10 @@ 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
mRssi = rssi;
Expand Down Expand Up @@ -144,6 +147,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;
Expand Down Expand Up @@ -220,7 +224,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.
Expand Down
7 changes: 5 additions & 2 deletions telephony/java/android/telephony/ServiceState.java
Expand Up @@ -539,8 +539,10 @@ public static String rilRadioTechnologyToString(int rt) {
rtString = "LTE";
break;
case RIL_RADIO_TECHNOLOGY_HSPAP:
rtString = "HSPA+";
break;
case RIL_RADIO_TECHNOLOGY_DCHSPAP:
rtString = "HSPAP";
rtString = "DC-HSPA+";
break;
case RIL_RADIO_TECHNOLOGY_GSM:
rtString = "GSM";
Expand Down Expand Up @@ -814,12 +816,13 @@ private int rilRadioTechnologyToNetworkType(int rt) {
case ServiceState.RIL_RADIO_TECHNOLOGY_LTE:
return TelephonyManager.NETWORK_TYPE_LTE;
case ServiceState.RIL_RADIO_TECHNOLOGY_HSPAP:
case ServiceState.RIL_RADIO_TECHNOLOGY_DCHSPAP:
return TelephonyManager.NETWORK_TYPE_HSPAP;
case ServiceState.RIL_RADIO_TECHNOLOGY_GSM:
return TelephonyManager.NETWORK_TYPE_GSM;
case ServiceState.RIL_RADIO_TECHNOLOGY_TD_SCDMA:
return TelephonyManager.NETWORK_TYPE_TD_SCDMA;
case ServiceState.RIL_RADIO_TECHNOLOGY_DCHSPAP:
return TelephonyManager.NETWORK_TYPE_DCHSPAP;
default:
return TelephonyManager.NETWORK_TYPE_UNKNOWN;
}
Expand Down
10 changes: 9 additions & 1 deletion telephony/java/android/telephony/TelephonyManager.java
Expand Up @@ -672,6 +672,11 @@ public static String getTelephonyProperty(String property, int index, String def
/** Current network is IWLAN {@hide} */
public static final int NETWORK_TYPE_IWLAN = 18;

/** Current network is DC-HSPAP
* @hide
*/
public static final int NETWORK_TYPE_DCHSPAP = 30;

/**
* @return the NETWORK_TYPE_xxxx for current data connection.
*/
Expand Down Expand Up @@ -701,7 +706,7 @@ public int getNetworkType() {
* @see #NETWORK_TYPE_EHRPD
* @see #NETWORK_TYPE_HSPAP
* @see #NETWORK_TYPE_TD_SCDMA
*
* @see #NETWORK_TYPE_DCHSPAP
* @hide
*/
public int getDataNetworkType() {
Expand Down Expand Up @@ -790,6 +795,7 @@ public static int getNetworkClass(int networkType) {
case NETWORK_TYPE_EHRPD:
case NETWORK_TYPE_HSPAP:
case NETWORK_TYPE_TD_SCDMA:
case NETWORK_TYPE_DCHSPAP:
return NETWORK_CLASS_3_G;
case NETWORK_TYPE_LTE:
case NETWORK_TYPE_IWLAN:
Expand Down Expand Up @@ -849,6 +855,8 @@ public static String getNetworkTypeName(int type) {
return "TD-SCDMA";
case NETWORK_TYPE_IWLAN:
return "IWLAN";
case NETWORK_TYPE_DCHSPAP:
return "DC-HSPA+";
default:
return "UNKNOWN";
}
Expand Down

0 comments on commit 086d341

Please sign in to comment.