Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f9d8dbe authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change I749d6801 into eclair-mr2

* changes:
  Telephony: Fix exception if PROPERTY_OPERATOR_NUMERIC is not set and minor fixes.
parents fbc18f9b 144fdfec
Loading
Loading
Loading
Loading
+26 −23
Original line number Diff line number Diff line
@@ -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,6 +574,7 @@ 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) {
        if (!TextUtils.isEmpty(mccmnc)) {
            int mcc, mnc;

            try {
@@ -603,6 +605,7 @@ public final class MccTable
                Log.e(LOG_TAG, "Can't update configuration", e);
            }
        }
    }

    /**
     * If the timezone is not already set, set it based on the MCC of the SIM.
+1 −0
Original line number Diff line number Diff line
@@ -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;
+7 −9
Original line number Diff line number Diff line
@@ -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);