CDMALTEPhone.java revision e70617d81dcd42350a737b11c25532e1d43df4ff
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
240c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
241c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public String getImei() {
242c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        return mImei;
243c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
244c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
245c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
246c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public String getDeviceSvn() {
247c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        return mImeiSv;
248c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
249c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
250c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
251c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public IsimRecords getIsimRecords() {
252e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka        return mIsimUiccRecords;
253c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
254c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
255c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
256c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public String getMsisdn() {
257e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka        return (mSimRecords != null) ? mSimRecords.getMsisdnNumber() : null;
258c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
259c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
260c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
261c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public void getAvailableNetworks(Message response) {
26222d85a8e3a575a6d01d2c788587971657dfe20c6Wink Saville        mCi.getAvailableNetworks(response);
263c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
264c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
265c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
266e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka    protected void onUpdateIccAvailability() {
26780915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        if (mSimRecords != null) {
26880915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal            mSimRecords.unregisterForRecordsLoaded(this);
26980915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        }
27080915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal
271e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka        if (mUiccController == null ) {
272bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka            return;
273bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka        }
274bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka
27580bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        // Update IsimRecords
27680bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        UiccCardApplication newUiccApplication =
2772e41209f95670cb26aba5897b9bc0dcd9679e908Shishir Agrawal                mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_IMS);
27880bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        IsimUiccRecords newIsimUiccRecords = null;
279a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
28080bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        if (newUiccApplication != null) {
28180bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao            newIsimUiccRecords = (IsimUiccRecords) newUiccApplication.getIccRecords();
282a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        }
28380bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        mIsimUiccRecords = newIsimUiccRecords;
28480bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao
28580bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        // Update UsimRecords
2862e41209f95670cb26aba5897b9bc0dcd9679e908Shishir Agrawal        newUiccApplication = mUiccController.getUiccCardApplication(mPhoneId,
2872e41209f95670cb26aba5897b9bc0dcd9679e908Shishir Agrawal                UiccController.APP_FAM_3GPP);
28880bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        SIMRecords newSimRecords = null;
28980bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        if (newUiccApplication != null) {
29080bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao            newSimRecords = (SIMRecords) newUiccApplication.getIccRecords();
29180bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        }
29280bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        mSimRecords = newSimRecords;
29380915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        if (mSimRecords != null) {
29480915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal            mSimRecords.registerForRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null);
29580915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        }
296a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
297a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        super.onUpdateIccAvailability();
298a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
299e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka
300a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    @Override
301a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    protected void init(Context context, PhoneNotifier notifier) {
302a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.setPhoneType(PhoneConstants.PHONE_TYPE_CDMA);
303a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCT = new CdmaCallTracker(this);
304a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCdmaSSM = CdmaSubscriptionSourceManager.getInstance(context, mCi, this,
305a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED, null);
306a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mRuimPhoneBookInterfaceManager = new RuimPhoneBookInterfaceManager(this);
307a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mSubInfo = new PhoneSubInfo(this);
308a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mEriManager = new EriManager(this, context, EriManager.ERI_FROM_XML);
309a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
310a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.registerForAvailable(this, EVENT_RADIO_AVAILABLE, null);
311a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null);
312a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.registerForOn(this, EVENT_RADIO_ON, null);
313a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.setOnSuppServiceNotification(this, EVENT_SSN, null);
314a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mSST.registerForNetworkAttached(this, EVENT_REGISTERED_TO_NETWORK, null);
315a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.setEmergencyCallbackMode(this, EVENT_EMERGENCY_CALLBACK_MODE_ENTER, null);
316a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mCi.registerForExitEmergencyCallbackMode(this, EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE,
317a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                null);
318a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
319a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        PowerManager pm
320a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
321a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,LOG_TAG);
322a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
323a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        // This is needed to handle phone process crashes
324a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        String inEcm = SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
325a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        mIsPhoneInEcmState = inEcm.equals("true");
326a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        if (mIsPhoneInEcmState) {
327a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            // Send a message which will invoke handleExitEmergencyCallbackMode
328a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            mCi.exitEmergencyCallbackMode(obtainMessage(EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE));
329bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka        }
330e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka
331a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        // get the string that specifies the carrier OTA Sp number
332e70617d81dcd42350a737b11c25532e1d43df4ffLegler Wu        mCarrierOtaSpNumSchema = TelephonyManager.from(mContext).getOtaSpNumberSchemaForPhone(
333e70617d81dcd42350a737b11c25532e1d43df4ffLegler Wu                getPhoneId(), "");
334a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
335a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        setProperties();
336a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
337a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
338a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    // Set the properties per subscription
339a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    private void setProperties() {
340e70617d81dcd42350a737b11c25532e1d43df4ffLegler Wu        TelephonyManager tm = TelephonyManager.from(mContext);
341a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        //Change the system property
342e70617d81dcd42350a737b11c25532e1d43df4ffLegler Wu        tm.setPhoneType(getPhoneId(), PhoneConstants.PHONE_TYPE_CDMA);
343a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        // Sets operator alpha property by retrieving from build-time system property
344a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        String operatorAlpha = SystemProperties.get("ro.cdma.home.operator.alpha");
345b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal        if (!TextUtils.isEmpty(operatorAlpha)) {
346e70617d81dcd42350a737b11c25532e1d43df4ffLegler Wu            tm.setSimOperatorNameForPhone(getPhoneId(), operatorAlpha);
347b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal        }
348a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
349a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        // Sets operator numeric property by retrieving from build-time system property
350a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        String operatorNumeric = SystemProperties.get(PROPERTY_CDMA_HOME_OPERATOR_NUMERIC);
351a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        log("update icc_operator_numeric=" + operatorNumeric);
352b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal        if (!TextUtils.isEmpty(operatorNumeric)) {
353e70617d81dcd42350a737b11c25532e1d43df4ffLegler Wu            tm.setSimOperatorNumericForPhone(getPhoneId(), operatorNumeric);
354ab57aa5d465ef3a6dc0895b2408276617a2f6fa0Tom Taylor
355ab57aa5d465ef3a6dc0895b2408276617a2f6fa0Tom Taylor            SubscriptionController.getInstance().setMccMnc(operatorNumeric, getSubId());
356b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal            // Sets iso country property by retrieving from build-time system property
357b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal            setIsoCountryProperty(operatorNumeric);
358b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal            // Updates MCC MNC device configuration information
359b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal            log("update mccmnc=" + operatorNumeric);
360b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal            MccTable.updateMccMncConfiguration(mContext, operatorNumeric, false);
361b93bb3538c55f173f94a4ee7510d9d1521d8f731Shishir Agrawal        }
362a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        // Sets current entry in the telephony carrier table
363a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        updateCurrentCarrierInProvider();
364a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
365a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
366a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    @Override
367a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public void setSystemProperty(String property, String value) {
368a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        if(getUnitTestMode()) {
369a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            return;
370e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka        }
3716bc4098827f3070a44b5e51508b455d7c7be9c07Wink Saville        TelephonyManager.setTelephonyProperty(mPhoneId, property, value);
372a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
373a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
374a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public String getSystemProperty(String property, String defValue) {
375a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        if(getUnitTestMode()) {
376a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            return null;
377a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        }
3786bc4098827f3070a44b5e51508b455d7c7be9c07Wink Saville        return TelephonyManager.getTelephonyProperty(mPhoneId, property, defValue);
379a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
380a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
381a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public void updateDataConnectionTracker() {
382a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        ((DcTracker)mDcTracker).update();
383a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
384a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
385a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public void setInternalDataEnabled(boolean enable, Message onCompleteMsg) {
386a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        ((DcTracker)mDcTracker)
387a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                .setInternalDataEnabled(enable, onCompleteMsg);
388a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
389a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
390a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public boolean setInternalDataEnabledFlag(boolean enable) {
391a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville       return ((DcTracker)mDcTracker)
392a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                .setInternalDataEnabledFlag(enable);
393a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
394a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
395a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    /**
396a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville     * @return operator numeric.
397a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville     */
398a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public String getOperatorNumeric() {
399a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        String operatorNumeric = null;
40080bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        IccRecords curIccRecords = null;
401a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        if (mCdmaSubscriptionSource == CDMA_SUBSCRIPTION_NV) {
402a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            operatorNumeric = SystemProperties.get("ro.cdma.home.operator.numeric");
40380bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        } else if (mCdmaSubscriptionSource == CDMA_SUBSCRIPTION_RUIM_SIM) {
40480bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao            curIccRecords = mSimRecords;
40580bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao            if (curIccRecords != null) {
40680bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                operatorNumeric = curIccRecords.getOperatorNumeric();
40780bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao            } else {
40880bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                curIccRecords = mIccRecords.get();
40980bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                if (curIccRecords != null && (curIccRecords instanceof RuimRecords)) {
41080bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                    RuimRecords csim = (RuimRecords) curIccRecords;
41180bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                    operatorNumeric = csim.getRUIMOperatorNumeric();
41280bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                }
41380bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao            }
41480bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        }
41580bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao        if (operatorNumeric == null) {
416a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville            Rlog.e(LOG_TAG, "getOperatorNumeric: Cannot retrieve operatorNumeric:"
417a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                    + " mCdmaSubscriptionSource = " + mCdmaSubscriptionSource + " mIccRecords = "
41880bc1e5a6f0bd91b886351997b797e01732c1c67Jing Zhao                    + ((curIccRecords != null) ? curIccRecords.getRecordsLoaded() : null));
419e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka        }
420e287feac673ff68565b766e0e463d105fa9cef9dAlex Yakavenka
421a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        Rlog.d(LOG_TAG, "getOperatorNumeric: mCdmaSubscriptionSource = " + mCdmaSubscriptionSource
422a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                + " operatorNumeric = " + operatorNumeric);
423a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
424a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        return operatorNumeric;
425a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
426a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public void registerForAllDataDisconnected(Handler h, int what, Object obj) {
427a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        ((DcTracker)mDcTracker)
428a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville               .registerForAllDataDisconnected(h, what, obj);
429a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    }
430a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville
431a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville    public void unregisterForAllDataDisconnected(Handler h) {
432a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville        ((DcTracker)mDcTracker)
433a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville                .unregisterForAllDataDisconnected(h);
434bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka    }
435bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka
436bb36adde615d3d85fa0fc23935197c6bc6a799edAlex Yakavenka    @Override
43780915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    public void registerForSimRecordsLoaded(Handler h, int what, Object obj) {
43880915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        mSimRecordsLoadedRegistrants.addUnique(h, what, obj);
43980915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    }
44080915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal
44180915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    @Override
44280915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    public void unregisterForSimRecordsLoaded(Handler h) {
44380915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal        mSimRecordsLoadedRegistrants.remove(h);
44480915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    }
44580915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal
44680915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal
44780915ad5159e7a4e72fa436787044b0c075ff6cfShishir Agrawal    @Override
448c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    protected void log(String s) {
449cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville            Rlog.d(LOG_LTE_TAG, s);
450cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville    }
451cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville
452cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville    protected void loge(String s) {
453cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville            Rlog.e(LOG_LTE_TAG, s);
454c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
455c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville
456cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville    protected void loge(String s, Throwable e) {
457cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville        Rlog.e(LOG_LTE_TAG, s, e);
458f61aaae6608243be4e0da97a56ff9fed488cb173Shishir Agrawal    }
459cbaa45bbf2cab852b6c9c3a887e9f803d4e857eaWink Saville
460c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    @Override
461c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
462c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        pw.println("CDMALTEPhone extends:");
463c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville        super.dump(fd, pw, args);
464c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville    }
465c38bb60d867c5d61d90b7179a9ed2b2d1848124fWink Saville}
466