diff options
author | Alex Yakavenka <ayakaven@quicinc.com> | 2011-12-09 11:53:36 -0800 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2012-02-29 10:18:07 -0800 |
commit | e7af59b375f08b13d964816fc52048e670764bdb (patch) | |
tree | c6cd15cc96197116bcb56527aa98563852d95f8b /telephony | |
parent | 0c9aa1b6fca0210353af8a153cbb0380dc83ed2d (diff) | |
download | frameworks_base-e7af59b375f08b13d964816fc52048e670764bdb.zip frameworks_base-e7af59b375f08b13d964816fc52048e670764bdb.tar.gz frameworks_base-e7af59b375f08b13d964816fc52048e670764bdb.tar.bz2 |
Telephony: Remove SimCard and RuimCard
Remove notions of SimCard and RuimCard since they don't make sense
in the world of Uicc cards where each card can have multiple
3gpp and 3gpp2 subscriptions.
This change prepares code for the introduction of Uicc cards.
Change-Id: Ibab13004604f829328b73c177669b89ef97d3f25
Diffstat (limited to 'telephony')
12 files changed, 36 insertions, 123 deletions
diff --git a/telephony/java/com/android/internal/telephony/IccCard.java b/telephony/java/com/android/internal/telephony/IccCard.java index a9ef762..530a8dc 100644 --- a/telephony/java/com/android/internal/telephony/IccCard.java +++ b/telephony/java/com/android/internal/telephony/IccCard.java @@ -44,7 +44,7 @@ import com.android.internal.R; /** * {@hide} */ -public abstract class IccCard { +public class IccCard { protected String mLogTag; protected boolean mDbg; @@ -68,6 +68,10 @@ public abstract class IccCard { private boolean mIccFdnEnabled = false; // Default to disabled. // Will be updated when SIM_READY. + /* Parameter is3gpp's values to be passed to constructor */ + public final static boolean CARD_IS_3GPP = true; + public final static boolean CARD_IS_NOT_3GPP = false; + /* The extra data for broacasting intent INTENT_ICC_STATE_CHANGE */ static public final String INTENT_KEY_ICC_STATE = "ss"; @@ -162,8 +166,11 @@ public abstract class IccCard { return State.UNKNOWN; } - public IccCard(PhoneBase phone, String logTag, Boolean dbg) { + public IccCard(PhoneBase phone, String logTag, Boolean is3gpp, Boolean dbg) { mPhone = phone; + this.is3gpp = is3gpp; + mCdmaSSM = CdmaSubscriptionSourceManager.getInstance(mPhone.getContext(), + mPhone.mCM, mHandler, EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED, null); mPhone.mCM.registerForOffOrNotAvailable(mHandler, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null); mPhone.mCM.registerForOn(mHandler, EVENT_RADIO_ON, null); mPhone.mCM.registerForIccStatusChanged(mHandler, EVENT_ICC_STATUS_CHANGED, null); @@ -175,6 +182,7 @@ public abstract class IccCard { mPhone.mCM.unregisterForIccStatusChanged(mHandler); mPhone.mCM.unregisterForOffOrNotAvailable(mHandler); mPhone.mCM.unregisterForOn(mHandler); + mCdmaSSM.dispose(mHandler); } protected void finalize() { @@ -447,7 +455,9 @@ public abstract class IccCard { * yet available * */ - public abstract String getServiceProviderName(); + public String getServiceProviderName () { + return mPhone.mIccRecords.getServiceProviderName(); + } protected void updateStateProperty() { mPhone.setSystemProperty(TelephonyProperties.PROPERTY_SIM_STATE, getState().toString()); @@ -912,7 +922,13 @@ public abstract class IccCard { Log.d(mLogTag, "[IccCard] " + msg); } - protected abstract int getCurrentApplicationIndex(); + protected int getCurrentApplicationIndex() { + if (is3gpp) { + return mIccCardStatus.getGsmUmtsSubscriptionAppIndex(); + } else { + return mIccCardStatus.getCdmaSubscriptionAppIndex(); + } + } public String getAid() { String aid = ""; diff --git a/telephony/java/com/android/internal/telephony/PhoneBase.java b/telephony/java/com/android/internal/telephony/PhoneBase.java index 49f64c9..0b5a82c 100644 --- a/telephony/java/com/android/internal/telephony/PhoneBase.java +++ b/telephony/java/com/android/internal/telephony/PhoneBase.java @@ -41,7 +41,6 @@ import com.android.internal.telephony.gsm.UsimServiceTable; import com.android.internal.telephony.ims.IsimRecords; import com.android.internal.telephony.test.SimulatedRadioControl; import com.android.internal.telephony.gsm.SIMRecords; -import com.android.internal.telephony.gsm.SimCard; import java.util.Locale; diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMALTEPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMALTEPhone.java index 54e651a..3084c14 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CDMALTEPhone.java +++ b/telephony/java/com/android/internal/telephony/cdma/CDMALTEPhone.java @@ -28,13 +28,13 @@ import android.provider.Telephony; import android.util.Log; import com.android.internal.telephony.CommandsInterface; +import com.android.internal.telephony.IccCard; import com.android.internal.telephony.OperatorInfo; import com.android.internal.telephony.Phone; import com.android.internal.telephony.PhoneNotifier; import com.android.internal.telephony.PhoneProxy; import com.android.internal.telephony.SMSDispatcher; import com.android.internal.telephony.gsm.GsmSMSDispatcher; -import com.android.internal.telephony.gsm.SimCard; import com.android.internal.telephony.ims.IsimRecords; public class CDMALTEPhone extends CDMAPhone { @@ -79,7 +79,7 @@ public class CDMALTEPhone extends CDMAPhone { @Override protected void initSstIcc() { - mIccCard = new SimCard(this, LOG_TAG, DBG); + mIccCard = new IccCard(this, LOG_TAG, IccCard.CARD_IS_3GPP, DBG); mIccRecords = new CdmaLteUiccRecords(this); mIccFileHandler = new CdmaLteUiccFileHandler(this); // CdmaLteServiceStateTracker registers with IccCard to know diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java index d25291d..b5dca65 100755 --- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java +++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java @@ -46,6 +46,7 @@ import com.android.internal.telephony.CallTracker; import com.android.internal.telephony.CommandException; import com.android.internal.telephony.CommandsInterface; import com.android.internal.telephony.Connection; +import com.android.internal.telephony.IccCard; import com.android.internal.telephony.IccException; import com.android.internal.telephony.IccFileHandler; import com.android.internal.telephony.IccPhoneBookInterfaceManager; @@ -148,7 +149,7 @@ public class CDMAPhone extends PhoneBase { } protected void initSstIcc() { - mIccCard = new RuimCard(this, LOG_TAG, DBG); + mIccCard = new IccCard(this, LOG_TAG, IccCard.CARD_IS_NOT_3GPP, DBG); mIccRecords = new RuimRecords(this); mIccFileHandler = new RuimFileHandler(this); // CdmaServiceStateTracker registers with IccCard to know diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java b/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java index 40825f8..98ad3b1 100755 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java @@ -432,7 +432,7 @@ public class CdmaConnection extends Connection { return DisconnectCause.OUT_OF_SERVICE; } else if (phone.mCdmaSubscriptionSource == CdmaSubscriptionSourceManager.SUBSCRIPTION_FROM_RUIM - && phone.getIccCard().getState() != RuimCard.State.READY) { + && phone.getIccCard().getState() != IccCard.State.READY) { return DisconnectCause.ICC_ERROR; } else if (causeCode==CallFailCause.NORMAL_CLEARING) { return DisconnectCause.NORMAL; diff --git a/telephony/java/com/android/internal/telephony/cdma/RuimCard.java b/telephony/java/com/android/internal/telephony/cdma/RuimCard.java deleted file mode 100644 index 674fada..0000000 --- a/telephony/java/com/android/internal/telephony/cdma/RuimCard.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.internal.telephony.cdma; - -import com.android.internal.telephony.IccCard; - -/** - * Note: this class shares common code with SimCard, consider a base class to minimize code - * duplication. - * {@hide} - */ -public final class RuimCard extends IccCard { - - RuimCard(CDMAPhone phone, String LOG_TAG, boolean dbg) { - super(phone, LOG_TAG, dbg); - is3gpp = false; - mCdmaSSM = CdmaSubscriptionSourceManager.getInstance(mPhone.getContext(), - mPhone.mCM, mHandler, EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED, null); - - updateStateProperty(); - } - - @Override - public void dispose() { - super.dispose(); - mCdmaSSM.dispose(mHandler); - } - - @Override - public String getServiceProviderName () { - return mPhone.mIccRecords.getServiceProviderName(); - } - - @Override - protected int getCurrentApplicationIndex() { - if (mIccCardStatus == null) { - return -1; - } - return mIccCardStatus.getCdmaSubscriptionAppIndex(); - } - } - diff --git a/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java b/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java index 17a200e..e518c4c 100755 --- a/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java +++ b/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java @@ -30,8 +30,8 @@ import com.android.internal.telephony.AdnRecordCache; import com.android.internal.telephony.AdnRecordLoader; import com.android.internal.telephony.CommandsInterface; import com.android.internal.telephony.IccRefreshResponse; +import com.android.internal.telephony.IccCard; import com.android.internal.telephony.TelephonyProperties; -import com.android.internal.telephony.cdma.RuimCard; import com.android.internal.telephony.MccTable; // can't be used since VoiceMailConstants is not public @@ -346,7 +346,7 @@ public final class RuimRecords extends IccRecords { recordsLoadedRegistrants.notifyRegistrants( new AsyncResult(null, null, null)); phone.mIccCard.broadcastIccStateChangedIntent( - RuimCard.INTENT_VALUE_ICC_LOADED, null); + IccCard.INTENT_VALUE_ICC_LOADED, null); } private void onRuimReady() { @@ -355,7 +355,7 @@ public final class RuimRecords extends IccRecords { */ phone.mIccCard.broadcastIccStateChangedIntent( - RuimCard.INTENT_VALUE_ICC_READY, null); + IccCard.INTENT_VALUE_ICC_READY, null); fetchRuimRecords(); diff --git a/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java b/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java index af7c78c..4c846f1 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java +++ b/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java @@ -56,6 +56,7 @@ import com.android.internal.telephony.CallForwardInfo; import com.android.internal.telephony.CallStateException; import com.android.internal.telephony.CommandsInterface; import com.android.internal.telephony.Connection; +import com.android.internal.telephony.IccCard; import com.android.internal.telephony.IccFileHandler; import com.android.internal.telephony.IccPhoneBookInterfaceManager; import com.android.internal.telephony.IccSmsInterfaceManager; @@ -135,7 +136,7 @@ public class GSMPhone extends PhoneBase { } mCM.setPhoneType(Phone.PHONE_TYPE_GSM); - mIccCard = new SimCard(this, LOG_TAG, true); + mIccCard = new IccCard(this, LOG_TAG, IccCard.CARD_IS_3GPP, true); mCT = new GsmCallTracker(this); mSST = new GsmServiceStateTracker (this); mSMS = new GsmSMSDispatcher(this, mSmsStorageMonitor, mSmsUsageMonitor); diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmConnection.java b/telephony/java/com/android/internal/telephony/gsm/GsmConnection.java index c1ad7b3..f7c6025 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmConnection.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmConnection.java @@ -370,7 +370,7 @@ public class GsmConnection extends Connection { } else if (serviceState == ServiceState.STATE_OUT_OF_SERVICE || serviceState == ServiceState.STATE_EMERGENCY_ONLY ) { return DisconnectCause.OUT_OF_SERVICE; - } else if (phone.getIccCard().getState() != SimCard.State.READY) { + } else if (phone.getIccCard().getState() != IccCard.State.READY) { return DisconnectCause.ICC_ERROR; } else if (causeCode == CallFailCause.ERROR_UNSPECIFIED) { if (phone.mSST.mRestrictedState.isCsRestricted()) { diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java b/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java index 16d3129..205c73d 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java @@ -765,7 +765,7 @@ public final class GsmMmiCode extends Handler implements MmiCode { // invalid length handlePasswordError(com.android.internal.R.string.invalidPin); } else if (sc.equals(SC_PIN) && - phone.mIccCard.getState() == SimCard.State.PUK_REQUIRED ) { + phone.mIccCard.getState() == IccCard.State.PUK_REQUIRED ) { // Sim is puk-locked handlePasswordError(com.android.internal.R.string.needPuk); } else { diff --git a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java index de8401e..5b0f251 100755 --- a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java +++ b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java @@ -30,6 +30,7 @@ import com.android.internal.telephony.AdnRecordCache; import com.android.internal.telephony.AdnRecordLoader; import com.android.internal.telephony.BaseCommands; import com.android.internal.telephony.CommandsInterface; +import com.android.internal.telephony.IccCard; import com.android.internal.telephony.IccFileHandler; import com.android.internal.telephony.IccRecords; import com.android.internal.telephony.IccUtils; @@ -581,7 +582,7 @@ public class SIMRecords extends IccRecords { MccTable.updateMccMncConfiguration(phone, imsi.substring(0, 3 + mncLength)); } phone.mIccCard.broadcastIccStateChangedIntent( - SimCard.INTENT_VALUE_ICC_IMSI, null); + IccCard.INTENT_VALUE_ICC_IMSI, null); break; case EVENT_GET_MBI_DONE: @@ -1273,7 +1274,7 @@ public class SIMRecords extends IccRecords { recordsLoadedRegistrants.notifyRegistrants( new AsyncResult(null, null, null)); phone.mIccCard.broadcastIccStateChangedIntent( - SimCard.INTENT_VALUE_ICC_LOADED, null); + IccCard.INTENT_VALUE_ICC_LOADED, null); } //***** Private methods @@ -1298,7 +1299,7 @@ public class SIMRecords extends IccRecords { READY is sent before IMSI ready */ phone.mIccCard.broadcastIccStateChangedIntent( - SimCard.INTENT_VALUE_ICC_READY, null); + IccCard.INTENT_VALUE_ICC_READY, null); fetchSimRecords(); } diff --git a/telephony/java/com/android/internal/telephony/gsm/SimCard.java b/telephony/java/com/android/internal/telephony/gsm/SimCard.java deleted file mode 100644 index 0e68e07..0000000 --- a/telephony/java/com/android/internal/telephony/gsm/SimCard.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.internal.telephony.gsm; - -import android.util.Log; - -import com.android.internal.telephony.IccCard; -import com.android.internal.telephony.Phone; -import com.android.internal.telephony.PhoneBase; -import com.android.internal.telephony.TelephonyProperties; -import android.os.SystemProperties; - -/** - * {@hide} - */ -public final class SimCard extends IccCard { - - public SimCard(PhoneBase phone, String logTag, Boolean dbg) { - super(phone, logTag, dbg); - updateStateProperty(); - } - - @Override - public String getServiceProviderName () { - return mPhone.mIccRecords.getServiceProviderName(); - } - - @Override - protected int getCurrentApplicationIndex() { - if (mIccCardStatus == null) { - return -1; - } - return mIccCardStatus.getGsmUmtsSubscriptionAppIndex(); - } -} |