Skip to content

Commit 7eed139

Browse files
Wink SavilleAndroid (Google) Code Review
authored andcommitted
Merge "Telephony: Remove SimCard and RuimCard"
2 parents f64a6d5 + e7af59b commit 7eed139

File tree

12 files changed

+36
-123
lines changed

12 files changed

+36
-123
lines changed

telephony/java/com/android/internal/telephony/IccCard.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
/**
4545
* {@hide}
4646
*/
47-
public abstract class IccCard {
47+
public class IccCard {
4848
protected String mLogTag;
4949
protected boolean mDbg;
5050

@@ -68,6 +68,10 @@ public abstract class IccCard {
6868
private boolean mIccFdnEnabled = false; // Default to disabled.
6969
// Will be updated when SIM_READY.
7070

71+
/* Parameter is3gpp's values to be passed to constructor */
72+
public final static boolean CARD_IS_3GPP = true;
73+
public final static boolean CARD_IS_NOT_3GPP = false;
74+
7175

7276
/* The extra data for broacasting intent INTENT_ICC_STATE_CHANGE */
7377
static public final String INTENT_KEY_ICC_STATE = "ss";
@@ -162,8 +166,11 @@ public State getState() {
162166
return State.UNKNOWN;
163167
}
164168

165-
public IccCard(PhoneBase phone, String logTag, Boolean dbg) {
169+
public IccCard(PhoneBase phone, String logTag, Boolean is3gpp, Boolean dbg) {
166170
mPhone = phone;
171+
this.is3gpp = is3gpp;
172+
mCdmaSSM = CdmaSubscriptionSourceManager.getInstance(mPhone.getContext(),
173+
mPhone.mCM, mHandler, EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED, null);
167174
mPhone.mCM.registerForOffOrNotAvailable(mHandler, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null);
168175
mPhone.mCM.registerForOn(mHandler, EVENT_RADIO_ON, null);
169176
mPhone.mCM.registerForIccStatusChanged(mHandler, EVENT_ICC_STATUS_CHANGED, null);
@@ -175,6 +182,7 @@ public void dispose() {
175182
mPhone.mCM.unregisterForIccStatusChanged(mHandler);
176183
mPhone.mCM.unregisterForOffOrNotAvailable(mHandler);
177184
mPhone.mCM.unregisterForOn(mHandler);
185+
mCdmaSSM.dispose(mHandler);
178186
}
179187

180188
protected void finalize() {
@@ -447,7 +455,9 @@ public void changeIccFdnPassword(String oldPassword, String newPassword,
447455
* yet available
448456
*
449457
*/
450-
public abstract String getServiceProviderName();
458+
public String getServiceProviderName () {
459+
return mPhone.mIccRecords.getServiceProviderName();
460+
}
451461

452462
protected void updateStateProperty() {
453463
mPhone.setSystemProperty(TelephonyProperties.PROPERTY_SIM_STATE, getState().toString());
@@ -912,7 +922,13 @@ private void log(String msg) {
912922
Log.d(mLogTag, "[IccCard] " + msg);
913923
}
914924

915-
protected abstract int getCurrentApplicationIndex();
925+
protected int getCurrentApplicationIndex() {
926+
if (is3gpp) {
927+
return mIccCardStatus.getGsmUmtsSubscriptionAppIndex();
928+
} else {
929+
return mIccCardStatus.getCdmaSubscriptionAppIndex();
930+
}
931+
}
916932

917933
public String getAid() {
918934
String aid = "";

telephony/java/com/android/internal/telephony/PhoneBase.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import com.android.internal.telephony.ims.IsimRecords;
4242
import com.android.internal.telephony.test.SimulatedRadioControl;
4343
import com.android.internal.telephony.gsm.SIMRecords;
44-
import com.android.internal.telephony.gsm.SimCard;
4544

4645
import java.util.Locale;
4746

telephony/java/com/android/internal/telephony/cdma/CDMALTEPhone.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
import android.util.Log;
2929

3030
import com.android.internal.telephony.CommandsInterface;
31+
import com.android.internal.telephony.IccCard;
3132
import com.android.internal.telephony.OperatorInfo;
3233
import com.android.internal.telephony.Phone;
3334
import com.android.internal.telephony.PhoneNotifier;
3435
import com.android.internal.telephony.PhoneProxy;
3536
import com.android.internal.telephony.SMSDispatcher;
3637
import com.android.internal.telephony.gsm.GsmSMSDispatcher;
37-
import com.android.internal.telephony.gsm.SimCard;
3838
import com.android.internal.telephony.ims.IsimRecords;
3939

4040
public class CDMALTEPhone extends CDMAPhone {
@@ -79,7 +79,7 @@ public void handleMessage (Message msg) {
7979

8080
@Override
8181
protected void initSstIcc() {
82-
mIccCard = new SimCard(this, LOG_TAG, DBG);
82+
mIccCard = new IccCard(this, LOG_TAG, IccCard.CARD_IS_3GPP, DBG);
8383
mIccRecords = new CdmaLteUiccRecords(this);
8484
mIccFileHandler = new CdmaLteUiccFileHandler(this);
8585
// CdmaLteServiceStateTracker registers with IccCard to know

telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import com.android.internal.telephony.CommandException;
4747
import com.android.internal.telephony.CommandsInterface;
4848
import com.android.internal.telephony.Connection;
49+
import com.android.internal.telephony.IccCard;
4950
import com.android.internal.telephony.IccException;
5051
import com.android.internal.telephony.IccFileHandler;
5152
import com.android.internal.telephony.IccPhoneBookInterfaceManager;
@@ -148,7 +149,7 @@ public CDMAPhone(Context context, CommandsInterface ci, PhoneNotifier notifier,
148149
}
149150

150151
protected void initSstIcc() {
151-
mIccCard = new RuimCard(this, LOG_TAG, DBG);
152+
mIccCard = new IccCard(this, LOG_TAG, IccCard.CARD_IS_NOT_3GPP, DBG);
152153
mIccRecords = new RuimRecords(this);
153154
mIccFileHandler = new RuimFileHandler(this);
154155
// CdmaServiceStateTracker registers with IccCard to know

telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ public void cancelPostDial() {
432432
return DisconnectCause.OUT_OF_SERVICE;
433433
} else if (phone.mCdmaSubscriptionSource ==
434434
CdmaSubscriptionSourceManager.SUBSCRIPTION_FROM_RUIM
435-
&& phone.getIccCard().getState() != RuimCard.State.READY) {
435+
&& phone.getIccCard().getState() != IccCard.State.READY) {
436436
return DisconnectCause.ICC_ERROR;
437437
} else if (causeCode==CallFailCause.NORMAL_CLEARING) {
438438
return DisconnectCause.NORMAL;

telephony/java/com/android/internal/telephony/cdma/RuimCard.java

Lines changed: 0 additions & 56 deletions
This file was deleted.

telephony/java/com/android/internal/telephony/cdma/RuimRecords.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
import com.android.internal.telephony.AdnRecordLoader;
3131
import com.android.internal.telephony.CommandsInterface;
3232
import com.android.internal.telephony.IccRefreshResponse;
33+
import com.android.internal.telephony.IccCard;
3334
import com.android.internal.telephony.TelephonyProperties;
34-
import com.android.internal.telephony.cdma.RuimCard;
3535
import com.android.internal.telephony.MccTable;
3636

3737
// can't be used since VoiceMailConstants is not public
@@ -346,7 +346,7 @@ protected void onAllRecordsLoaded() {
346346
recordsLoadedRegistrants.notifyRegistrants(
347347
new AsyncResult(null, null, null));
348348
phone.mIccCard.broadcastIccStateChangedIntent(
349-
RuimCard.INTENT_VALUE_ICC_LOADED, null);
349+
IccCard.INTENT_VALUE_ICC_LOADED, null);
350350
}
351351

352352
private void onRuimReady() {
@@ -355,7 +355,7 @@ private void onRuimReady() {
355355
*/
356356

357357
phone.mIccCard.broadcastIccStateChangedIntent(
358-
RuimCard.INTENT_VALUE_ICC_READY, null);
358+
IccCard.INTENT_VALUE_ICC_READY, null);
359359

360360
fetchRuimRecords();
361361

telephony/java/com/android/internal/telephony/gsm/GSMPhone.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import com.android.internal.telephony.CallStateException;
5757
import com.android.internal.telephony.CommandsInterface;
5858
import com.android.internal.telephony.Connection;
59+
import com.android.internal.telephony.IccCard;
5960
import com.android.internal.telephony.IccFileHandler;
6061
import com.android.internal.telephony.IccPhoneBookInterfaceManager;
6162
import com.android.internal.telephony.IccSmsInterfaceManager;
@@ -135,7 +136,7 @@ public class GSMPhone extends PhoneBase {
135136
}
136137

137138
mCM.setPhoneType(Phone.PHONE_TYPE_GSM);
138-
mIccCard = new SimCard(this, LOG_TAG, true);
139+
mIccCard = new IccCard(this, LOG_TAG, IccCard.CARD_IS_3GPP, true);
139140
mCT = new GsmCallTracker(this);
140141
mSST = new GsmServiceStateTracker (this);
141142
mSMS = new GsmSMSDispatcher(this, mSmsStorageMonitor, mSmsUsageMonitor);

telephony/java/com/android/internal/telephony/gsm/GsmConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public void cancelPostDial() {
370370
} else if (serviceState == ServiceState.STATE_OUT_OF_SERVICE
371371
|| serviceState == ServiceState.STATE_EMERGENCY_ONLY ) {
372372
return DisconnectCause.OUT_OF_SERVICE;
373-
} else if (phone.getIccCard().getState() != SimCard.State.READY) {
373+
} else if (phone.getIccCard().getState() != IccCard.State.READY) {
374374
return DisconnectCause.ICC_ERROR;
375375
} else if (causeCode == CallFailCause.ERROR_UNSPECIFIED) {
376376
if (phone.mSST.mRestrictedState.isCsRestricted()) {

telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ dialingNumber, time, obtainMessage(
765765
// invalid length
766766
handlePasswordError(com.android.internal.R.string.invalidPin);
767767
} else if (sc.equals(SC_PIN) &&
768-
phone.mIccCard.getState() == SimCard.State.PUK_REQUIRED ) {
768+
phone.mIccCard.getState() == IccCard.State.PUK_REQUIRED ) {
769769
// Sim is puk-locked
770770
handlePasswordError(com.android.internal.R.string.needPuk);
771771
} else {

0 commit comments

Comments
 (0)