1ab57aa5d465ef3a6dc0895b2408276617a2f6fa0Tom Taylor/*
2ace9a749c5a2a5e07527f728b7331423d16c36cdSukanya Rajkhowa * Copyright (C) 2011 The Android Open Source Project
3c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville *
4c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville * Licensed under the Apache License, Version 2.0 (the "License");
5c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville * you may not use this file except in compliance with the License.
6c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville * You may obtain a copy of the License at
7c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville *
8c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville *      http://www.apache.org/licenses/LICENSE-2.0
9c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville *
10c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville * Unless required by applicable law or agreed to in writing, software
11c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville * distributed under the License is distributed on an "AS IS" BASIS,
12c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville * See the License for the specific language governing permissions and
14c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville * limitations under the License.
15c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville */
16c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
17c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savillepackage com.android.internal.telephony.cdma;
18c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
19a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport android.app.ActivityManagerNative;
20c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport android.content.ContentValues;
21c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport android.content.Context;
22a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport android.content.Intent;
23c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport android.content.SharedPreferences;
24c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport android.database.SQLException;
25c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport android.net.Uri;
26c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport android.os.AsyncResult;
27a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport android.os.Handler;
28c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport android.os.Message;
29a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport android.os.UserHandle;
30c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport android.preference.PreferenceManager;
31a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport android.os.PowerManager;
32a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport android.os.SystemProperties;
33c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport android.provider.Telephony;
34a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport android.text.TextUtils;
35a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport android.telephony.SubscriptionManager;
36ded9c0af7fa49504c047275ed34c2d3b22bf0c3aWink Savilleimport android.telephony.Rlog;
37c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
38c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport com.android.internal.telephony.CommandsInterface;
39ab57aa5d465ef3a6dc0895b2408276617a2f6fa0Tom Taylor
40a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport android.telephony.TelephonyManager;
411260f1c6c909f2940989b72afe1b91fd83845eaaSukanya Rajkhowa
42a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport com.android.internal.telephony.dataconnection.DcTracker;
43a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport com.android.internal.telephony.MccTable;
44c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport com.android.internal.telephony.OperatorInfo;
45c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport com.android.internal.telephony.PhoneConstants;
46c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport com.android.internal.telephony.PhoneNotifier;
47c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport com.android.internal.telephony.PhoneProxy;
48a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport com.android.internal.telephony.PhoneFactory;
49a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport com.android.internal.telephony.PhoneSubInfo;
50c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport com.android.internal.telephony.SMSDispatcher;
510d4bcdf379842af4b6304809156971e926f374f0Jake Hambyimport com.android.internal.telephony.SmsBroadcastUndelivered;
52ab57aa5d465ef3a6dc0895b2408276617a2f6fa0Tom Taylorimport com.android.internal.telephony.SubscriptionController;
53c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport com.android.internal.telephony.gsm.GsmSMSDispatcher;
54c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport com.android.internal.telephony.gsm.SmsMessage;
5580bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhaoimport com.android.internal.telephony.uicc.IccRecords;
56d720945f2be5ea5fe0faf67e67d9ea0e184eba67Alex Yakavenkaimport com.android.internal.telephony.uicc.IsimRecords;
57d720945f2be5ea5fe0faf67e67d9ea0e184eba67Alex Yakavenkaimport com.android.internal.telephony.uicc.IsimUiccRecords;
5880bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhaoimport com.android.internal.telephony.uicc.RuimRecords;
59d720945f2be5ea5fe0faf67e67d9ea0e184eba67Alex Yakavenkaimport com.android.internal.telephony.uicc.SIMRecords;
60d720945f2be5ea5fe0faf67e67d9ea0e184eba67Alex Yakavenkaimport com.android.internal.telephony.uicc.UiccCardApplication;
61c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport com.android.internal.telephony.uicc.UiccController;
62a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport com.android.internal.telephony.ServiceStateTracker;
63a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport com.android.internal.telephony.TelephonyIntents;
64a8467dd0c524787104b1ccdddc5e8af10ba729edWink Savilleimport com.android.internal.telephony.TelephonyProperties;
65c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
66c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport java.io.FileDescriptor;
67c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savilleimport java.io.PrintWriter;
68c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
69a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
70c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Savillepublic class CDMALTEPhone extends CDMAPhone {
71cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville    static final String LOG_LTE_TAG = "CDMALTEPhone";
72c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    private static final boolean DBG = true;
73c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
74e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka    /** CdmaLtePhone in addition to RuimRecords available from
75e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka     * PhoneBase needs access to SIMRecords and IsimUiccRecords
76e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka     */
77e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka    private SIMRecords mSimRecords;
78e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka    private IsimUiccRecords mIsimUiccRecords;
79e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka
80c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    // Constructors
81a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public CDMALTEPhone(Context context, CommandsInterface ci, PhoneNotifier notifier,
82a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            int phoneId) {
83a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        this(context, ci, notifier, false, phoneId);
84a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
85a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
86a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public CDMALTEPhone(Context context, CommandsInterface ci, PhoneNotifier notifier,
87a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            boolean unitTestMode, int phoneId) {
88a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        super(context, ci, notifier, phoneId);
89a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
90a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        Rlog.d(LOG_TAG, "CDMALTEPhone: constructor: sub = " + mPhoneId);
91a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
92a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mDcTracker = new DcTracker(this);
93a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
94a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
95a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
96c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
97c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    protected void initSstIcc() {
98c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        mSST = new CdmaLteServiceStateTracker(this);
99c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
100c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
101c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
102c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public void dispose() {
103c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        synchronized(PhoneProxy.lockForRadioTechnologyChange) {
10480915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal            if (mSimRecords != null) {
10580915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal                mSimRecords.unregisterForRecordsLoaded(this);
10680915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal            }
107c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville            super.dispose();
108c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        }
109c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
110c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
111c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
112c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public void removeReferences() {
113c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        super.removeReferences();
114c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
115c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
116c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
11780915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    public void handleMessage(Message msg) {
11880915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        AsyncResult ar;
11980915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        Message onComplete;
12080915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal
121197f509eb95e275863e3ca36ef1fb53df63345f5Sanket Padawe        // messages to be handled whether or not the phone is being destroyed
122197f509eb95e275863e3ca36ef1fb53df63345f5Sanket Padawe        // should only include messages which are being re-directed and do not use
123197f509eb95e275863e3ca36ef1fb53df63345f5Sanket Padawe        // resources of the phone being destroyed
124197f509eb95e275863e3ca36ef1fb53df63345f5Sanket Padawe        switch (msg.what) {
125197f509eb95e275863e3ca36ef1fb53df63345f5Sanket Padawe            // handle the select network completion callbacks.
126197f509eb95e275863e3ca36ef1fb53df63345f5Sanket Padawe            case EVENT_SET_NETWORK_MANUAL_COMPLETE:
127197f509eb95e275863e3ca36ef1fb53df63345f5Sanket Padawe            case EVENT_SET_NETWORK_AUTOMATIC_COMPLETE:
128197f509eb95e275863e3ca36ef1fb53df63345f5Sanket Padawe                super.handleMessage(msg);
129197f509eb95e275863e3ca36ef1fb53df63345f5Sanket Padawe                return;
130197f509eb95e275863e3ca36ef1fb53df63345f5Sanket Padawe        }
131197f509eb95e275863e3ca36ef1fb53df63345f5Sanket Padawe
13280915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        if (!mIsTheCurrentActivePhone) {
13380915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal            Rlog.e(LOG_TAG, "Received message " + msg +
13480915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal                    "[" + msg.what + "] while being destroyed. Ignoring.");
13580915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal            return;
13680915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        }
13780915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        switch(msg.what) {
13880915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal            case EVENT_SIM_RECORDS_LOADED:
13980915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal                mSimRecordsLoadedRegistrants.notifyRegistrants();
14080915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal                break;
14180915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal
14280915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal            default:
14380915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal                super.handleMessage(msg);
14480915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        }
14580915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    }
14680915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    @Override
147c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public PhoneConstants.DataState getDataConnectionState(String apnType) {
148c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        PhoneConstants.DataState ret = PhoneConstants.DataState.DISCONNECTED;
149c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
150c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        if (mSST == null) {
151c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville            // Radio Technology Change is ongoing, dispose() and
152c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville            // removeReferences() have already been called
153c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
154c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville            ret = PhoneConstants.DataState.DISCONNECTED;
155454b1dfd508844b42eb775e4ab2359be74d3672bWink Saville        } else if (mDcTracker.isApnTypeEnabled(apnType) == false) {
156c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville            ret = PhoneConstants.DataState.DISCONNECTED;
157c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        } else {
158454b1dfd508844b42eb775e4ab2359be74d3672bWink Saville            switch (mDcTracker.getState(apnType)) {
159c6bbea82bf74ebb492508199b6f3e172b7ce860aWink Saville                case RETRYING:
160c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                case FAILED:
161c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                case IDLE:
162c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                    ret = PhoneConstants.DataState.DISCONNECTED;
163c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                    break;
164c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
165c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                case CONNECTED:
166c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                case DISCONNECTING:
16722d85a8e3a575a6d01d2c788587971657dfe20c6Wink Saville                    if (mCT.mState != PhoneConstants.State.IDLE &&
168c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                            !mSST.isConcurrentVoiceAndDataAllowed()) {
169c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                        ret = PhoneConstants.DataState.SUSPENDED;
170c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                    } else {
171c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                        ret = PhoneConstants.DataState.CONNECTED;
172c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                    }
173c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                    break;
174c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
175c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                case CONNECTING:
176c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                case SCANNING:
177c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                    ret = PhoneConstants.DataState.CONNECTING;
178c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                    break;
179c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville            }
180c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        }
181c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
182c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        log("getDataConnectionState apnType=" + apnType + " ret=" + ret);
183c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        return ret;
184c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
185c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
186ce06370fc58f59abda3cb072326e9425da3d755dWink Saville    /**
187ce06370fc58f59abda3cb072326e9425da3d755dWink Saville     * Sets the "current" field in the telephony provider according to the
188ce06370fc58f59abda3cb072326e9425da3d755dWink Saville     * build-time operator numeric property
189ce06370fc58f59abda3cb072326e9425da3d755dWink Saville     *
190ce06370fc58f59abda3cb072326e9425da3d755dWink Saville     * @return true for success; false otherwise.
191ce06370fc58f59abda3cb072326e9425da3d755dWink Saville     */
192ce06370fc58f59abda3cb072326e9425da3d755dWink Saville    @Override
193ce06370fc58f59abda3cb072326e9425da3d755dWink Saville    boolean updateCurrentCarrierInProvider(String operatorNumeric) {
194ce06370fc58f59abda3cb072326e9425da3d755dWink Saville        boolean retVal;
195a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        if (mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_3GPP) == null) {
196ce06370fc58f59abda3cb072326e9425da3d755dWink Saville            if (DBG) log("updateCurrentCarrierInProvider APP_FAM_3GPP == null");
197ce06370fc58f59abda3cb072326e9425da3d755dWink Saville            retVal = super.updateCurrentCarrierInProvider(operatorNumeric);
198ce06370fc58f59abda3cb072326e9425da3d755dWink Saville        } else {
199ce06370fc58f59abda3cb072326e9425da3d755dWink Saville            if (DBG) log("updateCurrentCarrierInProvider not updated");
200ce06370fc58f59abda3cb072326e9425da3d755dWink Saville            retVal = true;
201ce06370fc58f59abda3cb072326e9425da3d755dWink Saville        }
202ce06370fc58f59abda3cb072326e9425da3d755dWink Saville        if (DBG) log("updateCurrentCarrierInProvider X retVal=" + retVal);
203ce06370fc58f59abda3cb072326e9425da3d755dWink Saville        return retVal;
204ce06370fc58f59abda3cb072326e9425da3d755dWink Saville    }
205ce06370fc58f59abda3cb072326e9425da3d755dWink Saville
206c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
207c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public boolean updateCurrentCarrierInProvider() {
208a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        long currentDds = SubscriptionManager.getDefaultDataSubId();
209a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        String operatorNumeric = getOperatorNumeric();
210a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
211a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        Rlog.d(LOG_TAG, "updateCurrentCarrierInProvider: mSubscription = " + getSubId()
212a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                + " currentDds = " + currentDds + " operatorNumeric = " + operatorNumeric);
213a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
214a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        if (!TextUtils.isEmpty(operatorNumeric) && (getSubId() == currentDds)) {
215c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville            try {
216c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                Uri uri = Uri.withAppendedPath(Telephony.Carriers.CONTENT_URI, "current");
217c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                ContentValues map = new ContentValues();
218c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                map.put(Telephony.Carriers.NUMERIC, operatorNumeric);
219c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                mContext.getContentResolver().insert(uri, map);
220c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville                return true;
221c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville            } catch (SQLException e) {
222a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                Rlog.e(LOG_TAG, "Can't store current operator", e);
223c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville            }
224c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        }
225c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        return false;
226c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
227c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
228c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    // return IMSI from USIM as subscriber ID.
229c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
230c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public String getSubscriberId() {
231e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka        return (mSimRecords != null) ? mSimRecords.getIMSI() : "";
232c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
233c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
2340e4abef0d7e978d4c3dea5199f451a1c69158d03Sungmin Choi    // return GID1 from USIM
2350e4abef0d7e978d4c3dea5199f451a1c69158d03Sungmin Choi    @Override
2360e4abef0d7e978d4c3dea5199f451a1c69158d03Sungmin Choi    public String getGroupIdLevel1() {
2370e4abef0d7e978d4c3dea5199f451a1c69158d03Sungmin Choi        return (mSimRecords != null) ? mSimRecords.getGid1() : "";
2380e4abef0d7e978d4c3dea5199f451a1c69158d03Sungmin Choi    }
2390e4abef0d7e978d4c3dea5199f451a1c69158d03Sungmin Choi
2407234bd8664dbec97858f3f635eaa01c77d2f2881Junda Liu    // return GID2 from USIM
2417234bd8664dbec97858f3f635eaa01c77d2f2881Junda Liu    @Override
2427234bd8664dbec97858f3f635eaa01c77d2f2881Junda Liu    public String getGroupIdLevel2() {
2437234bd8664dbec97858f3f635eaa01c77d2f2881Junda Liu        return (mSimRecords != null) ? mSimRecords.getGid2() : "";
2447234bd8664dbec97858f3f635eaa01c77d2f2881Junda Liu    }
2457234bd8664dbec97858f3f635eaa01c77d2f2881Junda Liu
246c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
247c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public String getImei() {
248c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        return mImei;
249c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
250c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
251c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
252c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public String getDeviceSvn() {
253c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        return mImeiSv;
254c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
255c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
256c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
257c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public IsimRecords getIsimRecords() {
258e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka        return mIsimUiccRecords;
259c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
260c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
261c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
262c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public String getMsisdn() {
263e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka        return (mSimRecords != null) ? mSimRecords.getMsisdnNumber() : null;
264c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
265c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
266c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
267c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public void getAvailableNetworks(Message response) {
26822d85a8e3a575a6d01d2c788587971657dfe20c6Wink Saville        mCi.getAvailableNetworks(response);
269c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
270c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
271c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
272e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka    protected void onUpdateIccAvailability() {
27380915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        if (mSimRecords != null) {
27480915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal            mSimRecords.unregisterForRecordsLoaded(this);
27580915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        }
27680915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal
277e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka        if (mUiccController == null ) {
278bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka            return;
279bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka        }
280bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka
28180bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        // Update IsimRecords
28280bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        UiccCardApplication newUiccApplication =
2832e41209f95670cb26aba5897b9bc0dcd9679e908Shishir Agrawal                mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_IMS);
28480bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        IsimUiccRecords newIsimUiccRecords = null;
285a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
28680bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        if (newUiccApplication != null) {
28780bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao            newIsimUiccRecords = (IsimUiccRecords) newUiccApplication.getIccRecords();
288a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        }
28980bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        mIsimUiccRecords = newIsimUiccRecords;
29080bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao
29180bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        // Update UsimRecords
2922e41209f95670cb26aba5897b9bc0dcd9679e908Shishir Agrawal        newUiccApplication = mUiccController.getUiccCardApplication(mPhoneId,
2932e41209f95670cb26aba5897b9bc0dcd9679e908Shishir Agrawal                UiccController.APP_FAM_3GPP);
29480bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        SIMRecords newSimRecords = null;
29580bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        if (newUiccApplication != null) {
29680bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao            newSimRecords = (SIMRecords) newUiccApplication.getIccRecords();
29780bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        }
29880bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        mSimRecords = newSimRecords;
29980915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        if (mSimRecords != null) {
30080915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal            mSimRecords.registerForRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null);
30180915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        }
302a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
303a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        super.onUpdateIccAvailability();
304a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
305e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka
306a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    @Override
307a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    protected void init(Context context, PhoneNotifier notifier) {
308a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.setPhoneType(PhoneConstants.PHONE_TYPE_CDMA);
309a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCT = new CdmaCallTracker(this);
310a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCdmaSSM = CdmaSubscriptionSourceManager.getInstance(context, mCi, this,
311a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED, null);
312a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mRuimPhoneBookInterfaceManager = new RuimPhoneBookInterfaceManager(this);
313a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mSubInfo = new PhoneSubInfo(this);
314a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mEriManager = new EriManager(this, context, EriManager.ERI_FROM_XML);
315a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
316a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.registerForAvailable(this, EVENT_RADIO_AVAILABLE, null);
317a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null);
318a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.registerForOn(this, EVENT_RADIO_ON, null);
319a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.setOnSuppServiceNotification(this, EVENT_SSN, null);
320a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mSST.registerForNetworkAttached(this, EVENT_REGISTERED_TO_NETWORK, null);
321a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.setEmergencyCallbackMode(this, EVENT_EMERGENCY_CALLBACK_MODE_ENTER, null);
322a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.registerForExitEmergencyCallbackMode(this, EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE,
323a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                null);
324a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
325a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        PowerManager pm
326a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
327a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,LOG_TAG);
328a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
329a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        // This is needed to handle phone process crashes
330a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        String inEcm = SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
331a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mIsPhoneInEcmState = inEcm.equals("true");
332a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        if (mIsPhoneInEcmState) {
333a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            // Send a message which will invoke handleExitEmergencyCallbackMode
334a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            mCi.exitEmergencyCallbackMode(obtainMessage(EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE));
335bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka        }
336e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka
337a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        // get the string that specifies the carrier OTA Sp number
338e70617d81dcd42350a737b11c25532e1d43df4ffLegler Wu        mCarrierOtaSpNumSchema = TelephonyManager.from(mContext).getOtaSpNumberSchemaForPhone(
339e70617d81dcd42350a737b11c25532e1d43df4ffLegler Wu                getPhoneId(), "");
340a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
341a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        setProperties();
342a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
343a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
344a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    // Set the properties per subscription
345a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    private void setProperties() {
346e70617d81dcd42350a737b11c25532e1d43df4ffLegler Wu        TelephonyManager tm = TelephonyManager.from(mContext);
347a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        //Change the system property
348e70617d81dcd42350a737b11c25532e1d43df4ffLegler Wu        tm.setPhoneType(getPhoneId(), PhoneConstants.PHONE_TYPE_CDMA);
349a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        // Sets operator alpha property by retrieving from build-time system property
350a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        String operatorAlpha = SystemProperties.get("ro.cdma.home.operator.alpha");
351b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal        if (!TextUtils.isEmpty(operatorAlpha)) {
352e70617d81dcd42350a737b11c25532e1d43df4ffLegler Wu            tm.setSimOperatorNameForPhone(getPhoneId(), operatorAlpha);
353b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal        }
354a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
355a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        // Sets operator numeric property by retrieving from build-time system property
356a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        String operatorNumeric = SystemProperties.get(PROPERTY_CDMA_HOME_OPERATOR_NUMERIC);
357a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        log("update icc_operator_numeric=" + operatorNumeric);
358b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal        if (!TextUtils.isEmpty(operatorNumeric)) {
359e70617d81dcd42350a737b11c25532e1d43df4ffLegler Wu            tm.setSimOperatorNumericForPhone(getPhoneId(), operatorNumeric);
360ab57aa5d465ef3a6dc0895b2408276617a2f6fa0Tom Taylor
361ab57aa5d465ef3a6dc0895b2408276617a2f6fa0Tom Taylor            SubscriptionController.getInstance().setMccMnc(operatorNumeric, getSubId());
362b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal            // Sets iso country property by retrieving from build-time system property
363b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal            setIsoCountryProperty(operatorNumeric);
364b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal            // Updates MCC MNC device configuration information
365b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal            log("update mccmnc=" + operatorNumeric);
366b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal            MccTable.updateMccMncConfiguration(mContext, operatorNumeric, false);
367b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal        }
368a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        // Sets current entry in the telephony carrier table
369a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        updateCurrentCarrierInProvider();
370a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
371a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
372a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    @Override
373a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public void setSystemProperty(String property, String value) {
374a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        if(getUnitTestMode()) {
375a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            return;
376e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka        }
3776bc4098827f3070a44b5e51508b455d7c7be9c07Wink Saville        TelephonyManager.setTelephonyProperty(mPhoneId, property, value);
378a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
379a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
380a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public String getSystemProperty(String property, String defValue) {
381a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        if(getUnitTestMode()) {
382a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            return null;
383a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        }
3846bc4098827f3070a44b5e51508b455d7c7be9c07Wink Saville        return TelephonyManager.getTelephonyProperty(mPhoneId, property, defValue);
385a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
386a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
387a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public void updateDataConnectionTracker() {
388a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        ((DcTracker)mDcTracker).update();
389a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
390a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
391a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public void setInternalDataEnabled(boolean enable, Message onCompleteMsg) {
392a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        ((DcTracker)mDcTracker)
393a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                .setInternalDataEnabled(enable, onCompleteMsg);
394a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
395a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
396a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public boolean setInternalDataEnabledFlag(boolean enable) {
397a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville       return ((DcTracker)mDcTracker)
398a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                .setInternalDataEnabledFlag(enable);
399a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
400a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
401a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    /**
402a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville     * @return operator numeric.
403a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville     */
404a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public String getOperatorNumeric() {
405a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        String operatorNumeric = null;
40680bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        IccRecords curIccRecords = null;
407a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        if (mCdmaSubscriptionSource == CDMA_SUBSCRIPTION_NV) {
408a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            operatorNumeric = SystemProperties.get("ro.cdma.home.operator.numeric");
40980bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        } else if (mCdmaSubscriptionSource == CDMA_SUBSCRIPTION_RUIM_SIM) {
41080bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao            curIccRecords = mSimRecords;
41180bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao            if (curIccRecords != null) {
41280bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                operatorNumeric = curIccRecords.getOperatorNumeric();
41380bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao            } else {
41480bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                curIccRecords = mIccRecords.get();
41580bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                if (curIccRecords != null && (curIccRecords instanceof RuimRecords)) {
41680bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                    RuimRecords csim = (RuimRecords) curIccRecords;
41780bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                    operatorNumeric = csim.getRUIMOperatorNumeric();
41880bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                }
41980bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao            }
42080bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        }
42180bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        if (operatorNumeric == null) {
422a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            Rlog.e(LOG_TAG, "getOperatorNumeric: Cannot retrieve operatorNumeric:"
423a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                    + " mCdmaSubscriptionSource = " + mCdmaSubscriptionSource + " mIccRecords = "
42480bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                    + ((curIccRecords != null) ? curIccRecords.getRecordsLoaded() : null));
425e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka        }
426e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka
427a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        Rlog.d(LOG_TAG, "getOperatorNumeric: mCdmaSubscriptionSource = " + mCdmaSubscriptionSource
428a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                + " operatorNumeric = " + operatorNumeric);
429a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
430a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        return operatorNumeric;
431a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
432a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public void registerForAllDataDisconnected(Handler h, int what, Object obj) {
433a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        ((DcTracker)mDcTracker)
434a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville               .registerForAllDataDisconnected(h, what, obj);
435a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
436a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
437a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public void unregisterForAllDataDisconnected(Handler h) {
438a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        ((DcTracker)mDcTracker)
439a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                .unregisterForAllDataDisconnected(h);
440bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka    }
441bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka
442bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka    @Override
44380915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    public void registerForSimRecordsLoaded(Handler h, int what, Object obj) {
44480915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        mSimRecordsLoadedRegistrants.addUnique(h, what, obj);
44580915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    }
44680915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal
44780915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    @Override
44880915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    public void unregisterForSimRecordsLoaded(Handler h) {
44980915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        mSimRecordsLoadedRegistrants.remove(h);
45080915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    }
45180915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal
45280915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal
45380915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    @Override
454c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    protected void log(String s) {
455cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville            Rlog.d(LOG_LTE_TAG, s);
456cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville    }
457cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville
458cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville    protected void loge(String s) {
459cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville            Rlog.e(LOG_LTE_TAG, s);
460c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
461c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
462cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville    protected void loge(String s, Throwable e) {
463cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville        Rlog.e(LOG_LTE_TAG, s, e);
464f61aaae6608243be4e0da97a56ff9fed488cb173Shishir Agrawal    }
465cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville
466c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
467c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
468c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        pw.println("CDMALTEPhone extends:");
469c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        super.dump(fd, pw, args);
470c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
471c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville}
472