Merge "SIM Status now shows data connection instead of voice." into lmp-mr1-dev

This commit is contained in:
Prem Kumar
2014-12-29 13:23:49 +00:00
committed by Android (Google) Code Review

View File

@@ -236,17 +236,12 @@ public class SimStatus extends PreferenceActivity {
private void updateNetworkType() { private void updateNetworkType() {
// Whether EDGE, UMTS, etc... // Whether EDGE, UMTS, etc...
String networktype = null; String networktype = null;
final ITelephony telephony = ITelephony.Stub.asInterface( final int subId = mSir.getSubscriptionId();
ServiceManager.getService(Context.TELEPHONY_SERVICE)); final int actualNetworkType = mTelephonyManager.getDataNetworkType(
try {
final int actualNetworkType = telephony.getVoiceNetworkTypeForSubscriber(
mSir.getSubscriptionId()); mSir.getSubscriptionId());
if (TelephonyManager.NETWORK_TYPE_UNKNOWN != actualNetworkType) { if (TelephonyManager.NETWORK_TYPE_UNKNOWN != actualNetworkType) {
networktype = mTelephonyManager.getNetworkTypeName(actualNetworkType); networktype = mTelephonyManager.getNetworkTypeName(actualNetworkType);
} }
} catch (RemoteException remoteException){
// Do nothing, networkType will remain null.
}
setSummaryText(KEY_NETWORK_TYPE, networktype); setSummaryText(KEY_NETWORK_TYPE, networktype);
} }