Loading src/java/com/android/internal/telephony/GsmCdmaPhone.java +23 −17 Original line number Diff line number Diff line Loading @@ -77,7 +77,6 @@ import com.android.internal.telephony.gsm.GsmMmiCode; import com.android.internal.telephony.gsm.SuppServiceNotification; import com.android.internal.telephony.test.SimulatedRadioControl; import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType; import com.android.internal.telephony.uicc.IccCardProxy; import com.android.internal.telephony.uicc.IccException; import com.android.internal.telephony.uicc.IccRecords; import com.android.internal.telephony.uicc.IccVmNotSupportedException; Loading @@ -88,6 +87,7 @@ import com.android.internal.telephony.uicc.SIMRecords; import com.android.internal.telephony.uicc.UiccCard; import com.android.internal.telephony.uicc.UiccCardApplication; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.telephony.uicc.UiccProfile; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -184,7 +184,6 @@ public class GsmCdmaPhone extends Phone { } private IccSmsInterfaceManager mIccSmsInterfaceManager; private IccCardProxy mIccCardProxy; private boolean mResetModemOnRadioTechnologyChange = false; Loading Loading @@ -243,7 +242,6 @@ public class GsmCdmaPhone extends Phone { = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, LOG_TAG); mIccSmsInterfaceManager = mTelephonyComponentFactory.makeIccSmsInterfaceManager(this); mIccCardProxy = mTelephonyComponentFactory.makeIccCardProxy(mContext, mCi, mPhoneId); mCi.registerForAvailable(this, EVENT_RADIO_AVAILABLE, null); mCi.registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null); Loading Loading @@ -287,10 +285,13 @@ public class GsmCdmaPhone extends Phone { logd("Precise phone type " + mPrecisePhoneType); TelephonyManager tm = TelephonyManager.from(mContext); UiccProfile uiccProfile = getUiccProfile(); if (isPhoneTypeGsm()) { mCi.setPhoneType(PhoneConstants.PHONE_TYPE_GSM); tm.setPhoneType(getPhoneId(), PhoneConstants.PHONE_TYPE_GSM); mIccCardProxy.setVoiceRadioTech(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS); if (uiccProfile != null) { uiccProfile.setVoiceRadioTech(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS); } } else { mCdmaSubscriptionSource = mCdmaSSM.getCdmaSubscriptionSource(); // This is needed to handle phone process crashes Loading @@ -303,7 +304,9 @@ public class GsmCdmaPhone extends Phone { mCi.setPhoneType(PhoneConstants.PHONE_TYPE_CDMA); tm.setPhoneType(getPhoneId(), PhoneConstants.PHONE_TYPE_CDMA); mIccCardProxy.setVoiceRadioTech(ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT); if (uiccProfile != null) { uiccProfile.setVoiceRadioTech(ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT); } // Sets operator properties by retrieving from build-time system property String operatorAlpha = SystemProperties.get("ro.cdma.home.operator.alpha"); String operatorNumeric = SystemProperties.get(PROPERTY_CDMA_HOME_OPERATOR_NUMERIC); Loading Loading @@ -2503,6 +2506,9 @@ public class GsmCdmaPhone extends Phone { } } // todo: check if ICC availability needs to be handled here. mSimRecords should not be needed // now because APIs can be called directly on UiccProfile, and that should handle the requests // correctly based on supported apps, voice RAT, etc. @Override protected void onUpdateIccAvailability() { if (mUiccController == null ) { Loading Loading @@ -3269,8 +3275,11 @@ public class GsmCdmaPhone extends Phone { mCi.setRadioPower(oldPowerState, null); } // update voice radio tech in icc card proxy mIccCardProxy.setVoiceRadioTech(newVoiceRadioTech); // update voice radio tech in UiccProfile UiccProfile uiccProfile = getUiccProfile(); if (uiccProfile != null) { uiccProfile.setVoiceRadioTech(newVoiceRadioTech); } // Send an Intent to the PhoneApp that we had a radio technology change Intent intent = new Intent(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED); Loading Loading @@ -3321,12 +3330,17 @@ public class GsmCdmaPhone extends Phone { @Override public boolean getIccRecordsLoaded() { return mIccCardProxy.getIccRecordsLoaded(); UiccProfile uiccProfile = getUiccProfile(); return uiccProfile != null && uiccProfile.getIccRecordsLoaded(); } @Override public IccCard getIccCard() { return mIccCardProxy; return UiccController.getInstance().getUiccProfileForPhone(mPhoneId); } private UiccProfile getUiccProfile() { return UiccController.getInstance().getUiccProfileForPhone(mPhoneId); } @Override Loading Loading @@ -3358,14 +3372,6 @@ public class GsmCdmaPhone extends Phone { pw.println(" isCspPlmnEnabled()=" + isCspPlmnEnabled()); pw.flush(); pw.println("++++++++++++++++++++++++++++++++"); try { mIccCardProxy.dump(fd, pw, args); } catch (Exception e) { e.printStackTrace(); } pw.flush(); pw.println("++++++++++++++++++++++++++++++++"); pw.println("DeviceStateMonitor:"); mDeviceStateMonitor.dump(fd, pw, args); pw.println("++++++++++++++++++++++++++++++++"); Loading src/java/com/android/internal/telephony/IccCard.java +1 −13 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.os.Message; import com.android.internal.telephony.IccCardConstants.State; import com.android.internal.telephony.uicc.IccCardApplicationStatus; import com.android.internal.telephony.uicc.IccFileHandler; import com.android.internal.telephony.uicc.IccRecords; /** Loading @@ -44,16 +43,12 @@ public interface IccCard { */ public State getState(); // todo: delete /** * @return IccRecords object belonging to current UiccCardApplication */ public IccRecords getIccRecords(); /** * @return IccFileHandler object belonging to current UiccCardApplication */ public IccFileHandler getIccFileHandler(); /** * Notifies handler of any transition into IccCardConstants.State.NETWORK_LOCKED */ Loading Loading @@ -95,13 +90,6 @@ public interface IccCard { */ public void supplyPuk2 (String puk2, String newPin2, Message onComplete); /** * Check whether fdn (fixed dialing number) service is available. * @return true if ICC fdn service available * false if ICC fdn service not available */ public boolean getIccFdnAvailable(); /** * Supply Network depersonalization code to the RIL */ Loading src/java/com/android/internal/telephony/PhoneFactory.java +2 −2 Original line number Diff line number Diff line Loading @@ -42,8 +42,8 @@ import com.android.internal.telephony.imsphone.ImsPhone; import com.android.internal.telephony.imsphone.ImsPhoneFactory; import com.android.internal.telephony.sip.SipPhone; import com.android.internal.telephony.sip.SipPhoneFactory; import com.android.internal.telephony.uicc.IccCardProxy; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.telephony.uicc.UiccProfile; import com.android.internal.telephony.util.NotificationChannelController; import com.android.internal.util.IndentingPrintWriter; Loading Loading @@ -435,7 +435,7 @@ public class PhoneFactory { pw.println("++++++++++++++++++++++++++++++++"); try { ((IccCardProxy)phone.getIccCard()).dump(fd, pw, args); ((UiccProfile) phone.getIccCard()).dump(fd, pw, args); } catch (Exception e) { e.printStackTrace(); } Loading src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +4 −5 Original line number Diff line number Diff line Loading @@ -51,9 +51,9 @@ import android.text.TextUtils; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.telephony.euicc.EuiccController; import com.android.internal.telephony.uicc.IccCardProxy; import com.android.internal.telephony.uicc.IccRecords; import com.android.internal.telephony.uicc.IccUtils; import com.android.internal.telephony.uicc.UiccProfile; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -131,8 +131,7 @@ public class SubscriptionInfoUpdater extends Handler { mEuiccManager = (EuiccManager) mContext.getSystemService(Context.EUICC_SERVICE); mPackageManager = IPackageManager.Stub.asInterface(ServiceManager.getService("package")); IntentFilter intentFilter = new IntentFilter( IccCardProxy.ACTION_INTERNAL_SIM_STATE_CHANGED); IntentFilter intentFilter = new IntentFilter(UiccProfile.ACTION_INTERNAL_SIM_STATE_CHANGED); mContext.registerReceiver(sReceiver, intentFilter); mCarrierServiceBindHelper = new CarrierServiceBindHelper(mContext); Loading Loading @@ -179,7 +178,7 @@ public class SubscriptionInfoUpdater extends Handler { String action = intent.getAction(); logd("Action: " + action); if (!action.equals(IccCardProxy.ACTION_INTERNAL_SIM_STATE_CHANGED)) { if (!action.equals(UiccProfile.ACTION_INTERNAL_SIM_STATE_CHANGED)) { return; } Loading @@ -194,7 +193,7 @@ public class SubscriptionInfoUpdater extends Handler { String simStatus = intent.getStringExtra(IccCardConstants.INTENT_KEY_ICC_STATE); logd("simStatus: " + simStatus); if (action.equals(IccCardProxy.ACTION_INTERNAL_SIM_STATE_CHANGED)) { if (action.equals(UiccProfile.ACTION_INTERNAL_SIM_STATE_CHANGED)) { if (IccCardConstants.INTENT_VALUE_ICC_ABSENT.equals(simStatus)) { sendMessage(obtainMessage(EVENT_SIM_ABSENT, slotIndex, -1)); } else if (IccCardConstants.INTENT_VALUE_ICC_UNKNOWN.equals(simStatus)) { Loading src/java/com/android/internal/telephony/TelephonyComponentFactory.java +11 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,9 @@ import com.android.internal.telephony.imsphone.ImsExternalCallTracker; import com.android.internal.telephony.imsphone.ImsPhone; import com.android.internal.telephony.imsphone.ImsPhoneCallTracker; import com.android.internal.telephony.uicc.IccCardProxy; import com.android.internal.telephony.uicc.IccCardStatus; import com.android.internal.telephony.uicc.UiccCard; import com.android.internal.telephony.uicc.UiccProfile; /** * This class has one-line methods to instantiate objects only. The purpose is to make code Loading Loading @@ -107,6 +110,14 @@ public class TelephonyComponentFactory { return new IccCardProxy(context, ci, phoneId); } /** * Create a new UiccProfile object. */ public UiccProfile makeUiccProfile(Context context, CommandsInterface ci, IccCardStatus ics, int phoneId, UiccCard uiccCard) { return new UiccProfile(context, ci, ics, phoneId, uiccCard); } public EriManager makeEriManager(Phone phone, Context context, int eriFileSource) { return new EriManager(phone, context, eriFileSource); } Loading Loading
src/java/com/android/internal/telephony/GsmCdmaPhone.java +23 −17 Original line number Diff line number Diff line Loading @@ -77,7 +77,6 @@ import com.android.internal.telephony.gsm.GsmMmiCode; import com.android.internal.telephony.gsm.SuppServiceNotification; import com.android.internal.telephony.test.SimulatedRadioControl; import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType; import com.android.internal.telephony.uicc.IccCardProxy; import com.android.internal.telephony.uicc.IccException; import com.android.internal.telephony.uicc.IccRecords; import com.android.internal.telephony.uicc.IccVmNotSupportedException; Loading @@ -88,6 +87,7 @@ import com.android.internal.telephony.uicc.SIMRecords; import com.android.internal.telephony.uicc.UiccCard; import com.android.internal.telephony.uicc.UiccCardApplication; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.telephony.uicc.UiccProfile; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -184,7 +184,6 @@ public class GsmCdmaPhone extends Phone { } private IccSmsInterfaceManager mIccSmsInterfaceManager; private IccCardProxy mIccCardProxy; private boolean mResetModemOnRadioTechnologyChange = false; Loading Loading @@ -243,7 +242,6 @@ public class GsmCdmaPhone extends Phone { = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, LOG_TAG); mIccSmsInterfaceManager = mTelephonyComponentFactory.makeIccSmsInterfaceManager(this); mIccCardProxy = mTelephonyComponentFactory.makeIccCardProxy(mContext, mCi, mPhoneId); mCi.registerForAvailable(this, EVENT_RADIO_AVAILABLE, null); mCi.registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null); Loading Loading @@ -287,10 +285,13 @@ public class GsmCdmaPhone extends Phone { logd("Precise phone type " + mPrecisePhoneType); TelephonyManager tm = TelephonyManager.from(mContext); UiccProfile uiccProfile = getUiccProfile(); if (isPhoneTypeGsm()) { mCi.setPhoneType(PhoneConstants.PHONE_TYPE_GSM); tm.setPhoneType(getPhoneId(), PhoneConstants.PHONE_TYPE_GSM); mIccCardProxy.setVoiceRadioTech(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS); if (uiccProfile != null) { uiccProfile.setVoiceRadioTech(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS); } } else { mCdmaSubscriptionSource = mCdmaSSM.getCdmaSubscriptionSource(); // This is needed to handle phone process crashes Loading @@ -303,7 +304,9 @@ public class GsmCdmaPhone extends Phone { mCi.setPhoneType(PhoneConstants.PHONE_TYPE_CDMA); tm.setPhoneType(getPhoneId(), PhoneConstants.PHONE_TYPE_CDMA); mIccCardProxy.setVoiceRadioTech(ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT); if (uiccProfile != null) { uiccProfile.setVoiceRadioTech(ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT); } // Sets operator properties by retrieving from build-time system property String operatorAlpha = SystemProperties.get("ro.cdma.home.operator.alpha"); String operatorNumeric = SystemProperties.get(PROPERTY_CDMA_HOME_OPERATOR_NUMERIC); Loading Loading @@ -2503,6 +2506,9 @@ public class GsmCdmaPhone extends Phone { } } // todo: check if ICC availability needs to be handled here. mSimRecords should not be needed // now because APIs can be called directly on UiccProfile, and that should handle the requests // correctly based on supported apps, voice RAT, etc. @Override protected void onUpdateIccAvailability() { if (mUiccController == null ) { Loading Loading @@ -3269,8 +3275,11 @@ public class GsmCdmaPhone extends Phone { mCi.setRadioPower(oldPowerState, null); } // update voice radio tech in icc card proxy mIccCardProxy.setVoiceRadioTech(newVoiceRadioTech); // update voice radio tech in UiccProfile UiccProfile uiccProfile = getUiccProfile(); if (uiccProfile != null) { uiccProfile.setVoiceRadioTech(newVoiceRadioTech); } // Send an Intent to the PhoneApp that we had a radio technology change Intent intent = new Intent(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED); Loading Loading @@ -3321,12 +3330,17 @@ public class GsmCdmaPhone extends Phone { @Override public boolean getIccRecordsLoaded() { return mIccCardProxy.getIccRecordsLoaded(); UiccProfile uiccProfile = getUiccProfile(); return uiccProfile != null && uiccProfile.getIccRecordsLoaded(); } @Override public IccCard getIccCard() { return mIccCardProxy; return UiccController.getInstance().getUiccProfileForPhone(mPhoneId); } private UiccProfile getUiccProfile() { return UiccController.getInstance().getUiccProfileForPhone(mPhoneId); } @Override Loading Loading @@ -3358,14 +3372,6 @@ public class GsmCdmaPhone extends Phone { pw.println(" isCspPlmnEnabled()=" + isCspPlmnEnabled()); pw.flush(); pw.println("++++++++++++++++++++++++++++++++"); try { mIccCardProxy.dump(fd, pw, args); } catch (Exception e) { e.printStackTrace(); } pw.flush(); pw.println("++++++++++++++++++++++++++++++++"); pw.println("DeviceStateMonitor:"); mDeviceStateMonitor.dump(fd, pw, args); pw.println("++++++++++++++++++++++++++++++++"); Loading
src/java/com/android/internal/telephony/IccCard.java +1 −13 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.os.Message; import com.android.internal.telephony.IccCardConstants.State; import com.android.internal.telephony.uicc.IccCardApplicationStatus; import com.android.internal.telephony.uicc.IccFileHandler; import com.android.internal.telephony.uicc.IccRecords; /** Loading @@ -44,16 +43,12 @@ public interface IccCard { */ public State getState(); // todo: delete /** * @return IccRecords object belonging to current UiccCardApplication */ public IccRecords getIccRecords(); /** * @return IccFileHandler object belonging to current UiccCardApplication */ public IccFileHandler getIccFileHandler(); /** * Notifies handler of any transition into IccCardConstants.State.NETWORK_LOCKED */ Loading Loading @@ -95,13 +90,6 @@ public interface IccCard { */ public void supplyPuk2 (String puk2, String newPin2, Message onComplete); /** * Check whether fdn (fixed dialing number) service is available. * @return true if ICC fdn service available * false if ICC fdn service not available */ public boolean getIccFdnAvailable(); /** * Supply Network depersonalization code to the RIL */ Loading
src/java/com/android/internal/telephony/PhoneFactory.java +2 −2 Original line number Diff line number Diff line Loading @@ -42,8 +42,8 @@ import com.android.internal.telephony.imsphone.ImsPhone; import com.android.internal.telephony.imsphone.ImsPhoneFactory; import com.android.internal.telephony.sip.SipPhone; import com.android.internal.telephony.sip.SipPhoneFactory; import com.android.internal.telephony.uicc.IccCardProxy; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.telephony.uicc.UiccProfile; import com.android.internal.telephony.util.NotificationChannelController; import com.android.internal.util.IndentingPrintWriter; Loading Loading @@ -435,7 +435,7 @@ public class PhoneFactory { pw.println("++++++++++++++++++++++++++++++++"); try { ((IccCardProxy)phone.getIccCard()).dump(fd, pw, args); ((UiccProfile) phone.getIccCard()).dump(fd, pw, args); } catch (Exception e) { e.printStackTrace(); } Loading
src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +4 −5 Original line number Diff line number Diff line Loading @@ -51,9 +51,9 @@ import android.text.TextUtils; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.telephony.euicc.EuiccController; import com.android.internal.telephony.uicc.IccCardProxy; import com.android.internal.telephony.uicc.IccRecords; import com.android.internal.telephony.uicc.IccUtils; import com.android.internal.telephony.uicc.UiccProfile; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -131,8 +131,7 @@ public class SubscriptionInfoUpdater extends Handler { mEuiccManager = (EuiccManager) mContext.getSystemService(Context.EUICC_SERVICE); mPackageManager = IPackageManager.Stub.asInterface(ServiceManager.getService("package")); IntentFilter intentFilter = new IntentFilter( IccCardProxy.ACTION_INTERNAL_SIM_STATE_CHANGED); IntentFilter intentFilter = new IntentFilter(UiccProfile.ACTION_INTERNAL_SIM_STATE_CHANGED); mContext.registerReceiver(sReceiver, intentFilter); mCarrierServiceBindHelper = new CarrierServiceBindHelper(mContext); Loading Loading @@ -179,7 +178,7 @@ public class SubscriptionInfoUpdater extends Handler { String action = intent.getAction(); logd("Action: " + action); if (!action.equals(IccCardProxy.ACTION_INTERNAL_SIM_STATE_CHANGED)) { if (!action.equals(UiccProfile.ACTION_INTERNAL_SIM_STATE_CHANGED)) { return; } Loading @@ -194,7 +193,7 @@ public class SubscriptionInfoUpdater extends Handler { String simStatus = intent.getStringExtra(IccCardConstants.INTENT_KEY_ICC_STATE); logd("simStatus: " + simStatus); if (action.equals(IccCardProxy.ACTION_INTERNAL_SIM_STATE_CHANGED)) { if (action.equals(UiccProfile.ACTION_INTERNAL_SIM_STATE_CHANGED)) { if (IccCardConstants.INTENT_VALUE_ICC_ABSENT.equals(simStatus)) { sendMessage(obtainMessage(EVENT_SIM_ABSENT, slotIndex, -1)); } else if (IccCardConstants.INTENT_VALUE_ICC_UNKNOWN.equals(simStatus)) { Loading
src/java/com/android/internal/telephony/TelephonyComponentFactory.java +11 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,9 @@ import com.android.internal.telephony.imsphone.ImsExternalCallTracker; import com.android.internal.telephony.imsphone.ImsPhone; import com.android.internal.telephony.imsphone.ImsPhoneCallTracker; import com.android.internal.telephony.uicc.IccCardProxy; import com.android.internal.telephony.uicc.IccCardStatus; import com.android.internal.telephony.uicc.UiccCard; import com.android.internal.telephony.uicc.UiccProfile; /** * This class has one-line methods to instantiate objects only. The purpose is to make code Loading Loading @@ -107,6 +110,14 @@ public class TelephonyComponentFactory { return new IccCardProxy(context, ci, phoneId); } /** * Create a new UiccProfile object. */ public UiccProfile makeUiccProfile(Context context, CommandsInterface ci, IccCardStatus ics, int phoneId, UiccCard uiccCard) { return new UiccProfile(context, ci, ics, phoneId, uiccCard); } public EriManager makeEriManager(Phone phone, Context context, int eriFileSource) { return new EriManager(phone, context, eriFileSource); } Loading