Merge "Add support for static RadioCapabilities." into mnc-dev

This commit is contained in:
Robert Greenwalt
2015-05-14 00:06:57 +00:00
committed by Android (Google) Code Review
3 changed files with 47 additions and 1 deletions

View File

@@ -2144,4 +2144,11 @@
<!-- Whether device supports double tap to wake -->
<bool name="config_supportDoubleTapWake">false</bool>
<!-- The RadioAccessFamilies supported by the device.
Empty is viewed as "all". Only used on devices which
don't support RIL_REQUEST_GET_RADIO_CAPABILITY
format is UMTS|LTE|... -->
<string translatable="false" name="config_radio_access_family"></string>
</resources>

View File

@@ -2276,4 +2276,5 @@
<java-symbol type="id" name="target_badge" />
<java-symbol type="bool" name="config_supportDoubleTapWake" />
<java-symbol type="drawable" name="ic_perm_device_info" />
<java-symbol type="string" name="config_radio_access_family" />
</resources>

View File

@@ -255,5 +255,43 @@ public class RadioAccessFamily implements Parcelable {
return type;
}
}
public static int singleRafTypeFromString(String rafString) {
switch (rafString) {
case "GPRS": return RAF_GPRS;
case "EDGE": return RAF_EDGE;
case "UMTS": return RAF_UMTS;
case "IS95A": return RAF_IS95A;
case "IS95B": return RAF_IS95B;
case "1XRTT": return RAF_1xRTT;
case "EVDO_0": return RAF_EVDO_0;
case "EVDO_A": return RAF_EVDO_A;
case "HSDPA": return RAF_HSDPA;
case "HSUPA": return RAF_HSUPA;
case "HSPA": return RAF_HSPA;
case "EVDO_B": return RAF_EVDO_B;
case "EHRPD": return RAF_EHRPD;
case "LTE": return RAF_LTE;
case "HSPAP": return RAF_HSPAP;
case "GSM": return RAF_GSM;
case "TD_SCDMA":return RAF_TD_SCDMA;
case "HS": return HS;
case "CDMA": return CDMA;
case "EVDO": return EVDO;
case "WCDMA": return WCDMA;
default: return RAF_UNKNOWN;
}
}
public static int rafTypeFromString(String rafList) {
rafList = rafList.toUpperCase();
String[] rafs = rafList.split("\\|");
int result = 0;
for(String raf : rafs) {
int rafType = singleRafTypeFromString(raf.trim());
if (rafType == RAF_UNKNOWN) return rafType;
result |= rafType;
}
return result;
}
}