diff options
3 files changed, 34 insertions, 32 deletions
diff --git a/telephony/java/com/android/internal/telephony/MccTable.java b/telephony/java/com/android/internal/telephony/MccTable.java index c4877cb6c914..e25eb7b7e331 100644 --- a/telephony/java/com/android/internal/telephony/MccTable.java +++ b/telephony/java/com/android/internal/telephony/MccTable.java @@ -24,6 +24,7 @@ import android.net.wifi.WifiManager; import android.os.RemoteException; import android.os.SystemProperties; import android.provider.Settings; +import android.text.TextUtils; import android.util.Log; import java.util.Arrays; @@ -573,34 +574,36 @@ public final class MccTable * @param mccmnc truncated imsi with just the MCC and MNC - MNC assumed to be from 4th to end */ public static void updateMccMncConfiguration(PhoneBase phone, String mccmnc) { - int mcc, mnc; - - try { - mcc = Integer.parseInt(mccmnc.substring(0,3)); - mnc = Integer.parseInt(mccmnc.substring(3)); - } catch (NumberFormatException e) { - Log.e(LOG_TAG, "Error parsing IMSI"); - return; - } + if (!TextUtils.isEmpty(mccmnc)) { + int mcc, mnc; + + try { + mcc = Integer.parseInt(mccmnc.substring(0,3)); + mnc = Integer.parseInt(mccmnc.substring(3)); + } catch (NumberFormatException e) { + Log.e(LOG_TAG, "Error parsing IMSI"); + return; + } - Log.d(LOG_TAG, "updateMccMncConfiguration: mcc=" + mcc + ", mnc=" + mnc); + Log.d(LOG_TAG, "updateMccMncConfiguration: mcc=" + mcc + ", mnc=" + mnc); - if (mcc != 0) { - setTimezoneFromMccIfNeeded(phone, mcc); - setLocaleFromMccIfNeeded(phone, mcc); - setWifiChannelsFromMccIfNeeded(phone, mcc); - } - try { - Configuration config = ActivityManagerNative.getDefault().getConfiguration(); if (mcc != 0) { - config.mcc = mcc; + setTimezoneFromMccIfNeeded(phone, mcc); + setLocaleFromMccIfNeeded(phone, mcc); + setWifiChannelsFromMccIfNeeded(phone, mcc); } - if (mnc != 0) { - config.mnc = mnc; + try { + Configuration config = ActivityManagerNative.getDefault().getConfiguration(); + if (mcc != 0) { + config.mcc = mcc; + } + if (mnc != 0) { + config.mnc = mnc; + } + ActivityManagerNative.getDefault().updateConfiguration(config); + } catch (RemoteException e) { + Log.e(LOG_TAG, "Can't update configuration", e); } - ActivityManagerNative.getDefault().updateConfiguration(config); - } catch (RemoteException e) { - Log.e(LOG_TAG, "Can't update configuration", e); } } diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java index e47f7994837b..279f57f00fe4 100644 --- a/telephony/java/com/android/internal/telephony/RIL.java +++ b/telephony/java/com/android/internal/telephony/RIL.java @@ -2191,6 +2191,7 @@ public final class RIL extends BaseCommands implements CommandsInterface { case RIL_REQUEST_SET_SMSC_ADDRESS: ret = responseVoid(p); break; case RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE: ret = responseVoid(p); break; case RIL_REQUEST_REPORT_SMS_MEMORY_STATUS: ret = responseVoid(p); break; + case RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING: ret = responseVoid(p); break; default: throw new RuntimeException("Unrecognized solicited response: " + rr.mRequest); //break; diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java index 04a03b2510c8..422cc190b8a1 100755 --- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java +++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java @@ -202,10 +202,6 @@ public class CDMAPhone extends PhoneBase { // Sets current entry in the telephony carrier table updateCurrentCarrierInProvider(operatorNumeric); - // Updates MCC MNC device configuration information - MccTable.updateMccMncConfiguration(this, operatorNumeric); - - // Notify voicemails. notifier.notifyMessageWaitingChanged(this); } @@ -1401,20 +1397,22 @@ public class CDMAPhone extends PhoneBase { } /** - * Sets the "current" field in the telephony provider according to the build-time - * operator numeric property + * Sets the "current" field in the telephony provider according to the + * build-time operator numeric property * * @return true for success; false otherwise. */ - // TODO(Moto): move this method into PhoneBase, since it looks identical to - // the one in GsmPhone - private boolean updateCurrentCarrierInProvider(String operatorNumeric) { + boolean updateCurrentCarrierInProvider(String operatorNumeric) { if (!TextUtils.isEmpty(operatorNumeric)) { try { Uri uri = Uri.withAppendedPath(Telephony.Carriers.CONTENT_URI, "current"); ContentValues map = new ContentValues(); map.put(Telephony.Carriers.NUMERIC, operatorNumeric); getContext().getContentResolver().insert(uri, map); + + // Updates MCC MNC device configuration information + MccTable.updateMccMncConfiguration(this, operatorNumeric); + return true; } catch (SQLException e) { Log.e(LOG_TAG, "Can't store current operator", e); |