Loading src/java/com/android/internal/telephony/GsmCdmaPhone.java +72 −53 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ import com.android.internal.telephony.cdma.EriManager; 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; Loading Loading @@ -283,6 +284,7 @@ public class GsmCdmaPhone extends Phone { mMeid = null; mPrecisePhoneType = precisePhoneType; logd("Precise phone type " + mPrecisePhoneType); TelephonyManager tm = TelephonyManager.from(mContext); if (isPhoneTypeGsm()) { Loading @@ -307,8 +309,6 @@ public class GsmCdmaPhone extends Phone { String operatorNumeric = SystemProperties.get(PROPERTY_CDMA_HOME_OPERATOR_NUMERIC); logd("init: operatorAlpha='" + operatorAlpha + "' operatorNumeric='" + operatorNumeric + "'"); if (mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_3GPP) == null || isPhoneTypeCdmaLte()) { if (!TextUtils.isEmpty(operatorAlpha)) { logd("init: set 'gsm.sim.operator.alpha' to operator='" + operatorAlpha + "'"); tm.setSimOperatorNameForPhone(mPhoneId, operatorAlpha); Loading @@ -326,7 +326,6 @@ public class GsmCdmaPhone extends Phone { logd("update mccmnc=" + operatorNumeric); MccTable.updateMccMncConfiguration(mContext, operatorNumeric, false); } } // Sets current entry in the telephony carrier table updateCurrentCarrierInProvider(operatorNumeric); Loading Loading @@ -678,11 +677,7 @@ public class GsmCdmaPhone extends Phone { if (getUnitTestMode()) { return; } if (isPhoneTypeGsm() || isPhoneTypeCdmaLte()) { TelephonyManager.setTelephonyProperty(mPhoneId, property, value); } else { super.setSystemProperty(property, value); } } @Override Loading Loading @@ -1681,14 +1676,10 @@ public class GsmCdmaPhone extends Phone { @Override public String getSystemProperty(String property, String defValue) { if (isPhoneTypeGsm() || isPhoneTypeCdmaLte()) { if (getUnitTestMode()) { return null; } return TelephonyManager.getTelephonyProperty(mPhoneId, property, defValue); } else { return super.getSystemProperty(property, defValue); } } private boolean isValidCommandInterfaceCFAction (int commandInterfaceCFAction) { Loading Loading @@ -2537,7 +2528,7 @@ public class GsmCdmaPhone extends Phone { if (mSimRecords != null) { mSimRecords.unregisterForRecordsLoaded(this); } if (isPhoneTypeCdmaLte()) { if (isPhoneTypeCdmaLte() || isPhoneTypeCdma()) { newUiccApplication = mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_3GPP); SIMRecords newSimRecords = null; Loading Loading @@ -2599,7 +2590,6 @@ public class GsmCdmaPhone extends Phone { */ @Override public boolean updateCurrentCarrierInProvider() { if (isPhoneTypeGsm() || isPhoneTypeCdmaLte()) { long currentDds = SubscriptionManager.getDefaultDataSubscriptionId(); String operatorNumeric = getOperatorNumeric(); Loading @@ -2618,9 +2608,6 @@ public class GsmCdmaPhone extends Phone { } } return false; } else { return true; } } //CDMA Loading Loading @@ -3300,7 +3287,13 @@ public class GsmCdmaPhone extends Phone { + (ServiceState.isGsm(newVoiceRadioTech) ? "GSM" : "CDMA")); if (ServiceState.isCdma(newVoiceRadioTech)) { UiccCardApplication cdmaApplication = mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_3GPP2); if (cdmaApplication != null && cdmaApplication.getType() == AppType.APPTYPE_RUIM) { switchPhoneType(PhoneConstants.PHONE_TYPE_CDMA); } else { switchPhoneType(PhoneConstants.PHONE_TYPE_CDMA_LTE); } } else if (ServiceState.isGsm(newVoiceRadioTech)) { switchPhoneType(PhoneConstants.PHONE_TYPE_GSM); } else { Loading Loading @@ -3420,8 +3413,16 @@ public class GsmCdmaPhone extends Phone { if (mCdmaSubscriptionSource == CDMA_SUBSCRIPTION_NV) { operatorNumeric = SystemProperties.get("ro.cdma.home.operator.numeric"); } else if (mCdmaSubscriptionSource == CDMA_SUBSCRIPTION_RUIM_SIM) { UiccCardApplication uiccCardApplication = mUiccApplication.get(); if (uiccCardApplication != null && uiccCardApplication.getType() == AppType.APPTYPE_RUIM) { logd("Legacy RUIM app present"); curIccRecords = mIccRecords.get(); } else { // Use sim-records for SimApp, USimApp, CSimApp and ISimApp. curIccRecords = mSimRecords; if (curIccRecords != null) { } if (curIccRecords != null && curIccRecords == mSimRecords) { operatorNumeric = curIccRecords.getOperatorNumeric(); } else { curIccRecords = mIccRecords.get(); Loading Loading @@ -3534,4 +3535,22 @@ public class GsmCdmaPhone extends Phone { return mWakeLock; } @Override public int getLteOnCdmaMode() { int currentConfig = super.getLteOnCdmaMode(); int lteOnCdmaModeDynamicValue = currentConfig; UiccCardApplication cdmaApplication = mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_3GPP2); if (cdmaApplication != null && cdmaApplication.getType() == AppType.APPTYPE_RUIM) { //Legacy RUIM cards don't support LTE. lteOnCdmaModeDynamicValue = RILConstants.LTE_ON_CDMA_FALSE; //Override only if static configuration is TRUE. if (currentConfig == RILConstants.LTE_ON_CDMA_TRUE) { return lteOnCdmaModeDynamicValue; } } return currentConfig; } } src/java/com/android/internal/telephony/ServiceStateTracker.java +36 −80 Original line number Diff line number Diff line Loading @@ -579,9 +579,7 @@ public class ServiceStateTracker extends Handler { mCellLoc = new GsmCellLocation(); mNewCellLoc = new GsmCellLocation(); } else { if (mPhone.isPhoneTypeCdmaLte()) { mPhone.registerForSimRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null); } mCellLoc = new CdmaCellLocation(); mNewCellLoc = new CdmaCellLocation(); mCdmaSSM = CdmaSubscriptionSourceManager.getInstance(mPhone.getContext(), mCi, this, Loading Loading @@ -3768,7 +3766,6 @@ public class ServiceStateTracker extends Handler { public void powerOffRadioSafely(DcTracker dcTracker) { synchronized (this) { if (!mPendingRadioPowerOffAfterDataOff) { if (mPhone.isPhoneTypeGsm() || mPhone.isPhoneTypeCdmaLte()) { int dds = SubscriptionManager.getDefaultDataSubscriptionId(); // To minimize race conditions we call cleanUpAllConnections on // both if else paths instead of before this isDisconnected test. Loading Loading @@ -3809,47 +3806,6 @@ public class ServiceStateTracker extends Handler { mPendingRadioPowerOffAfterDataOff = false; } } } else { // In some network, deactivate PDP connection cause releasing of RRC connection, // which MM/IMSI detaching request needs. Without this detaching, network can // not release the network resources previously attached. // So we are avoiding data detaching on these networks. String[] networkNotClearData = mPhone.getContext().getResources() .getStringArray(com.android.internal.R.array.networks_not_clear_data); String currentNetwork = mSS.getOperatorNumeric(); if ((networkNotClearData != null) && (currentNetwork != null)) { for (int i = 0; i < networkNotClearData.length; i++) { if (currentNetwork.equals(networkNotClearData[i])) { // Don't clear data connection for this carrier if (DBG) log("Not disconnecting data for " + currentNetwork); hangupAndPowerOff(); return; } } } // To minimize race conditions we call cleanUpAllConnections on // both if else paths instead of before this isDisconnected test. if (dcTracker.isDisconnected()) { // To minimize race conditions we do this after isDisconnected dcTracker.cleanUpAllConnections(Phone.REASON_RADIO_TURNED_OFF); if (DBG) log("Data disconnected, turn off radio right away."); hangupAndPowerOff(); } else { dcTracker.cleanUpAllConnections(Phone.REASON_RADIO_TURNED_OFF); Message msg = Message.obtain(this); msg.what = EVENT_SET_RADIO_POWER_OFF; msg.arg1 = ++mPendingRadioPowerOffAfterDataOffTag; if (sendMessageDelayed(msg, 30000)) { if (DBG) log("Wait upto 30s for data to disconnect, then turn off radio."); mPendingRadioPowerOffAfterDataOff = true; } else { log("Cannot send delayed Msg, turn off radio right away."); hangupAndPowerOff(); } } } } } } Loading Loading
src/java/com/android/internal/telephony/GsmCdmaPhone.java +72 −53 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ import com.android.internal.telephony.cdma.EriManager; 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; Loading Loading @@ -283,6 +284,7 @@ public class GsmCdmaPhone extends Phone { mMeid = null; mPrecisePhoneType = precisePhoneType; logd("Precise phone type " + mPrecisePhoneType); TelephonyManager tm = TelephonyManager.from(mContext); if (isPhoneTypeGsm()) { Loading @@ -307,8 +309,6 @@ public class GsmCdmaPhone extends Phone { String operatorNumeric = SystemProperties.get(PROPERTY_CDMA_HOME_OPERATOR_NUMERIC); logd("init: operatorAlpha='" + operatorAlpha + "' operatorNumeric='" + operatorNumeric + "'"); if (mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_3GPP) == null || isPhoneTypeCdmaLte()) { if (!TextUtils.isEmpty(operatorAlpha)) { logd("init: set 'gsm.sim.operator.alpha' to operator='" + operatorAlpha + "'"); tm.setSimOperatorNameForPhone(mPhoneId, operatorAlpha); Loading @@ -326,7 +326,6 @@ public class GsmCdmaPhone extends Phone { logd("update mccmnc=" + operatorNumeric); MccTable.updateMccMncConfiguration(mContext, operatorNumeric, false); } } // Sets current entry in the telephony carrier table updateCurrentCarrierInProvider(operatorNumeric); Loading Loading @@ -678,11 +677,7 @@ public class GsmCdmaPhone extends Phone { if (getUnitTestMode()) { return; } if (isPhoneTypeGsm() || isPhoneTypeCdmaLte()) { TelephonyManager.setTelephonyProperty(mPhoneId, property, value); } else { super.setSystemProperty(property, value); } } @Override Loading Loading @@ -1681,14 +1676,10 @@ public class GsmCdmaPhone extends Phone { @Override public String getSystemProperty(String property, String defValue) { if (isPhoneTypeGsm() || isPhoneTypeCdmaLte()) { if (getUnitTestMode()) { return null; } return TelephonyManager.getTelephonyProperty(mPhoneId, property, defValue); } else { return super.getSystemProperty(property, defValue); } } private boolean isValidCommandInterfaceCFAction (int commandInterfaceCFAction) { Loading Loading @@ -2537,7 +2528,7 @@ public class GsmCdmaPhone extends Phone { if (mSimRecords != null) { mSimRecords.unregisterForRecordsLoaded(this); } if (isPhoneTypeCdmaLte()) { if (isPhoneTypeCdmaLte() || isPhoneTypeCdma()) { newUiccApplication = mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_3GPP); SIMRecords newSimRecords = null; Loading Loading @@ -2599,7 +2590,6 @@ public class GsmCdmaPhone extends Phone { */ @Override public boolean updateCurrentCarrierInProvider() { if (isPhoneTypeGsm() || isPhoneTypeCdmaLte()) { long currentDds = SubscriptionManager.getDefaultDataSubscriptionId(); String operatorNumeric = getOperatorNumeric(); Loading @@ -2618,9 +2608,6 @@ public class GsmCdmaPhone extends Phone { } } return false; } else { return true; } } //CDMA Loading Loading @@ -3300,7 +3287,13 @@ public class GsmCdmaPhone extends Phone { + (ServiceState.isGsm(newVoiceRadioTech) ? "GSM" : "CDMA")); if (ServiceState.isCdma(newVoiceRadioTech)) { UiccCardApplication cdmaApplication = mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_3GPP2); if (cdmaApplication != null && cdmaApplication.getType() == AppType.APPTYPE_RUIM) { switchPhoneType(PhoneConstants.PHONE_TYPE_CDMA); } else { switchPhoneType(PhoneConstants.PHONE_TYPE_CDMA_LTE); } } else if (ServiceState.isGsm(newVoiceRadioTech)) { switchPhoneType(PhoneConstants.PHONE_TYPE_GSM); } else { Loading Loading @@ -3420,8 +3413,16 @@ public class GsmCdmaPhone extends Phone { if (mCdmaSubscriptionSource == CDMA_SUBSCRIPTION_NV) { operatorNumeric = SystemProperties.get("ro.cdma.home.operator.numeric"); } else if (mCdmaSubscriptionSource == CDMA_SUBSCRIPTION_RUIM_SIM) { UiccCardApplication uiccCardApplication = mUiccApplication.get(); if (uiccCardApplication != null && uiccCardApplication.getType() == AppType.APPTYPE_RUIM) { logd("Legacy RUIM app present"); curIccRecords = mIccRecords.get(); } else { // Use sim-records for SimApp, USimApp, CSimApp and ISimApp. curIccRecords = mSimRecords; if (curIccRecords != null) { } if (curIccRecords != null && curIccRecords == mSimRecords) { operatorNumeric = curIccRecords.getOperatorNumeric(); } else { curIccRecords = mIccRecords.get(); Loading Loading @@ -3534,4 +3535,22 @@ public class GsmCdmaPhone extends Phone { return mWakeLock; } @Override public int getLteOnCdmaMode() { int currentConfig = super.getLteOnCdmaMode(); int lteOnCdmaModeDynamicValue = currentConfig; UiccCardApplication cdmaApplication = mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_3GPP2); if (cdmaApplication != null && cdmaApplication.getType() == AppType.APPTYPE_RUIM) { //Legacy RUIM cards don't support LTE. lteOnCdmaModeDynamicValue = RILConstants.LTE_ON_CDMA_FALSE; //Override only if static configuration is TRUE. if (currentConfig == RILConstants.LTE_ON_CDMA_TRUE) { return lteOnCdmaModeDynamicValue; } } return currentConfig; } }
src/java/com/android/internal/telephony/ServiceStateTracker.java +36 −80 Original line number Diff line number Diff line Loading @@ -579,9 +579,7 @@ public class ServiceStateTracker extends Handler { mCellLoc = new GsmCellLocation(); mNewCellLoc = new GsmCellLocation(); } else { if (mPhone.isPhoneTypeCdmaLte()) { mPhone.registerForSimRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null); } mCellLoc = new CdmaCellLocation(); mNewCellLoc = new CdmaCellLocation(); mCdmaSSM = CdmaSubscriptionSourceManager.getInstance(mPhone.getContext(), mCi, this, Loading Loading @@ -3768,7 +3766,6 @@ public class ServiceStateTracker extends Handler { public void powerOffRadioSafely(DcTracker dcTracker) { synchronized (this) { if (!mPendingRadioPowerOffAfterDataOff) { if (mPhone.isPhoneTypeGsm() || mPhone.isPhoneTypeCdmaLte()) { int dds = SubscriptionManager.getDefaultDataSubscriptionId(); // To minimize race conditions we call cleanUpAllConnections on // both if else paths instead of before this isDisconnected test. Loading Loading @@ -3809,47 +3806,6 @@ public class ServiceStateTracker extends Handler { mPendingRadioPowerOffAfterDataOff = false; } } } else { // In some network, deactivate PDP connection cause releasing of RRC connection, // which MM/IMSI detaching request needs. Without this detaching, network can // not release the network resources previously attached. // So we are avoiding data detaching on these networks. String[] networkNotClearData = mPhone.getContext().getResources() .getStringArray(com.android.internal.R.array.networks_not_clear_data); String currentNetwork = mSS.getOperatorNumeric(); if ((networkNotClearData != null) && (currentNetwork != null)) { for (int i = 0; i < networkNotClearData.length; i++) { if (currentNetwork.equals(networkNotClearData[i])) { // Don't clear data connection for this carrier if (DBG) log("Not disconnecting data for " + currentNetwork); hangupAndPowerOff(); return; } } } // To minimize race conditions we call cleanUpAllConnections on // both if else paths instead of before this isDisconnected test. if (dcTracker.isDisconnected()) { // To minimize race conditions we do this after isDisconnected dcTracker.cleanUpAllConnections(Phone.REASON_RADIO_TURNED_OFF); if (DBG) log("Data disconnected, turn off radio right away."); hangupAndPowerOff(); } else { dcTracker.cleanUpAllConnections(Phone.REASON_RADIO_TURNED_OFF); Message msg = Message.obtain(this); msg.what = EVENT_SET_RADIO_POWER_OFF; msg.arg1 = ++mPendingRadioPowerOffAfterDataOffTag; if (sendMessageDelayed(msg, 30000)) { if (DBG) log("Wait upto 30s for data to disconnect, then turn off radio."); mPendingRadioPowerOffAfterDataOff = true; } else { log("Cannot send delayed Msg, turn off radio right away."); hangupAndPowerOff(); } } } } } } Loading