Loading src/java/com/android/internal/telephony/PhoneProxy.java +16 −1 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ public class PhoneProxy extends Handler implements Phone { private static final int EVENT_REQUEST_VOICE_RADIO_TECH_DONE = 3; private static final int EVENT_RIL_CONNECTED = 4; private static final int EVENT_UPDATE_PHONE_OBJECT = 5; private static final int EVENT_SIM_RECORDS_LOADED = 6; private int mPhoneId = 0; Loading Loading @@ -144,6 +145,16 @@ public class PhoneProxy extends Handler implements Phone { phoneObjectUpdater(msg.arg1); break; case EVENT_SIM_RECORDS_LOADED: // Only check for the voice radio tech if it not going to be updated by the voice // registration changes. if (!mActivePhone.getContext().getResources().getBoolean( com.android.internal.R.bool.config_switch_phone_on_voice_reg_state_change)) { mCommandsInterface.getVoiceRadioTechnology(obtainMessage( EVENT_REQUEST_VOICE_RADIO_TECH_DONE)); } break; default: loge("Error! This handler was not registered for this message type. Message: " + msg.what); Loading Loading @@ -264,12 +275,12 @@ public class PhoneProxy extends Handler implements Phone { if (oldPhone != null) { outgoingPhoneName = ((PhoneBase) oldPhone).getPhoneName(); oldPhone.unregisterForSimRecordsLoaded(this); } logd("Switching Voice Phone : " + outgoingPhoneName + " >>> " + (ServiceState.isGsm(newVoiceRadioTech) ? "GSM" : "CDMA")); if (ServiceState.isCdma(newVoiceRadioTech)) { mActivePhone = PhoneFactory.getCdmaPhone(mPhoneId); } else if (ServiceState.isGsm(newVoiceRadioTech)) { Loading @@ -289,6 +300,7 @@ public class PhoneProxy extends Handler implements Phone { if (imsPhone != null) { mActivePhone.acquireOwnershipOfImsPhone(imsPhone); } mActivePhone.registerForSimRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null); } if (oldPhone != null) { Loading Loading @@ -1291,6 +1303,9 @@ public class PhoneProxy extends Handler implements Phone { @Override public void dispose() { if (mActivePhone != null) { mActivePhone.unregisterForSimRecordsLoaded(this); } mCommandsInterface.unregisterForOn(this); mCommandsInterface.unregisterForVoiceRadioTechChanged(this); mCommandsInterface.unregisterForRilConnected(this); Loading src/java/com/android/internal/telephony/cdma/CDMALTEPhone.java +40 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,9 @@ public class CDMALTEPhone extends CDMAPhone { @Override public void dispose() { synchronized(PhoneProxy.lockForRadioTechnologyChange) { if (mSimRecords != null) { mSimRecords.unregisterForRecordsLoaded(this); } super.dispose(); } } Loading @@ -113,6 +116,25 @@ public class CDMALTEPhone extends CDMAPhone { super.removeReferences(); } @Override public void handleMessage(Message msg) { AsyncResult ar; Message onComplete; if (!mIsTheCurrentActivePhone) { Rlog.e(LOG_TAG, "Received message " + msg + "[" + msg.what + "] while being destroyed. Ignoring."); return; } switch(msg.what) { case EVENT_SIM_RECORDS_LOADED: mSimRecordsLoadedRegistrants.notifyRegistrants(); break; default: super.handleMessage(msg); } } @Override public PhoneConstants.DataState getDataConnectionState(String apnType) { PhoneConstants.DataState ret = PhoneConstants.DataState.DISCONNECTED; Loading Loading @@ -234,6 +256,10 @@ public class CDMALTEPhone extends CDMAPhone { @Override protected void onUpdateIccAvailability() { if (mSimRecords != null) { mSimRecords.unregisterForRecordsLoaded(this); } if (mUiccController == null ) { return; } Loading @@ -256,6 +282,9 @@ public class CDMALTEPhone extends CDMAPhone { newSimRecords = (SIMRecords) newUiccApplication.getIccRecords(); } mSimRecords = newSimRecords; if (mSimRecords != null) { mSimRecords.registerForRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null); } super.onUpdateIccAvailability(); } Loading Loading @@ -396,6 +425,17 @@ public class CDMALTEPhone extends CDMAPhone { .unregisterForAllDataDisconnected(h); } @Override public void registerForSimRecordsLoaded(Handler h, int what, Object obj) { mSimRecordsLoadedRegistrants.addUnique(h, what, obj); } @Override public void unregisterForSimRecordsLoaded(Handler h) { mSimRecordsLoadedRegistrants.remove(h); } @Override protected void log(String s) { Rlog.d(LOG_LTE_TAG, s); Loading src/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java +10 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker { public CdmaLteServiceStateTracker(CDMALTEPhone phone) { super(phone, new CellInfoLte()); mCdmaLtePhone = phone; mCdmaLtePhone.registerForSimRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null); mCellInfoLte = (CellInfoLte) mCellInfo; ((CellInfoLte)mCellInfo).setCellSignalStrength(new CellSignalStrengthLte()); Loading @@ -74,6 +75,12 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker { if (DBG) log("CdmaLteServiceStateTracker Constructors"); } @Override public void dispose() { mPhone.unregisterForSimRecordsLoaded(this); super.dispose(); } @Override public void handleMessage(Message msg) { AsyncResult ar; Loading Loading @@ -114,6 +121,9 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker { // the latest variables. pollState(); break; case EVENT_SIM_RECORDS_LOADED: updatePhoneObject(); break; case EVENT_ALL_DATA_DISCONNECTED: int dds = SubscriptionManager.getDefaultDataSubId(); ProxyController.getInstance().unregisterForAllDataDisconnected(dds, this); Loading Loading
src/java/com/android/internal/telephony/PhoneProxy.java +16 −1 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ public class PhoneProxy extends Handler implements Phone { private static final int EVENT_REQUEST_VOICE_RADIO_TECH_DONE = 3; private static final int EVENT_RIL_CONNECTED = 4; private static final int EVENT_UPDATE_PHONE_OBJECT = 5; private static final int EVENT_SIM_RECORDS_LOADED = 6; private int mPhoneId = 0; Loading Loading @@ -144,6 +145,16 @@ public class PhoneProxy extends Handler implements Phone { phoneObjectUpdater(msg.arg1); break; case EVENT_SIM_RECORDS_LOADED: // Only check for the voice radio tech if it not going to be updated by the voice // registration changes. if (!mActivePhone.getContext().getResources().getBoolean( com.android.internal.R.bool.config_switch_phone_on_voice_reg_state_change)) { mCommandsInterface.getVoiceRadioTechnology(obtainMessage( EVENT_REQUEST_VOICE_RADIO_TECH_DONE)); } break; default: loge("Error! This handler was not registered for this message type. Message: " + msg.what); Loading Loading @@ -264,12 +275,12 @@ public class PhoneProxy extends Handler implements Phone { if (oldPhone != null) { outgoingPhoneName = ((PhoneBase) oldPhone).getPhoneName(); oldPhone.unregisterForSimRecordsLoaded(this); } logd("Switching Voice Phone : " + outgoingPhoneName + " >>> " + (ServiceState.isGsm(newVoiceRadioTech) ? "GSM" : "CDMA")); if (ServiceState.isCdma(newVoiceRadioTech)) { mActivePhone = PhoneFactory.getCdmaPhone(mPhoneId); } else if (ServiceState.isGsm(newVoiceRadioTech)) { Loading @@ -289,6 +300,7 @@ public class PhoneProxy extends Handler implements Phone { if (imsPhone != null) { mActivePhone.acquireOwnershipOfImsPhone(imsPhone); } mActivePhone.registerForSimRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null); } if (oldPhone != null) { Loading Loading @@ -1291,6 +1303,9 @@ public class PhoneProxy extends Handler implements Phone { @Override public void dispose() { if (mActivePhone != null) { mActivePhone.unregisterForSimRecordsLoaded(this); } mCommandsInterface.unregisterForOn(this); mCommandsInterface.unregisterForVoiceRadioTechChanged(this); mCommandsInterface.unregisterForRilConnected(this); Loading
src/java/com/android/internal/telephony/cdma/CDMALTEPhone.java +40 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,9 @@ public class CDMALTEPhone extends CDMAPhone { @Override public void dispose() { synchronized(PhoneProxy.lockForRadioTechnologyChange) { if (mSimRecords != null) { mSimRecords.unregisterForRecordsLoaded(this); } super.dispose(); } } Loading @@ -113,6 +116,25 @@ public class CDMALTEPhone extends CDMAPhone { super.removeReferences(); } @Override public void handleMessage(Message msg) { AsyncResult ar; Message onComplete; if (!mIsTheCurrentActivePhone) { Rlog.e(LOG_TAG, "Received message " + msg + "[" + msg.what + "] while being destroyed. Ignoring."); return; } switch(msg.what) { case EVENT_SIM_RECORDS_LOADED: mSimRecordsLoadedRegistrants.notifyRegistrants(); break; default: super.handleMessage(msg); } } @Override public PhoneConstants.DataState getDataConnectionState(String apnType) { PhoneConstants.DataState ret = PhoneConstants.DataState.DISCONNECTED; Loading Loading @@ -234,6 +256,10 @@ public class CDMALTEPhone extends CDMAPhone { @Override protected void onUpdateIccAvailability() { if (mSimRecords != null) { mSimRecords.unregisterForRecordsLoaded(this); } if (mUiccController == null ) { return; } Loading @@ -256,6 +282,9 @@ public class CDMALTEPhone extends CDMAPhone { newSimRecords = (SIMRecords) newUiccApplication.getIccRecords(); } mSimRecords = newSimRecords; if (mSimRecords != null) { mSimRecords.registerForRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null); } super.onUpdateIccAvailability(); } Loading Loading @@ -396,6 +425,17 @@ public class CDMALTEPhone extends CDMAPhone { .unregisterForAllDataDisconnected(h); } @Override public void registerForSimRecordsLoaded(Handler h, int what, Object obj) { mSimRecordsLoadedRegistrants.addUnique(h, what, obj); } @Override public void unregisterForSimRecordsLoaded(Handler h) { mSimRecordsLoadedRegistrants.remove(h); } @Override protected void log(String s) { Rlog.d(LOG_LTE_TAG, s); Loading
src/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java +10 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker { public CdmaLteServiceStateTracker(CDMALTEPhone phone) { super(phone, new CellInfoLte()); mCdmaLtePhone = phone; mCdmaLtePhone.registerForSimRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null); mCellInfoLte = (CellInfoLte) mCellInfo; ((CellInfoLte)mCellInfo).setCellSignalStrength(new CellSignalStrengthLte()); Loading @@ -74,6 +75,12 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker { if (DBG) log("CdmaLteServiceStateTracker Constructors"); } @Override public void dispose() { mPhone.unregisterForSimRecordsLoaded(this); super.dispose(); } @Override public void handleMessage(Message msg) { AsyncResult ar; Loading Loading @@ -114,6 +121,9 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker { // the latest variables. pollState(); break; case EVENT_SIM_RECORDS_LOADED: updatePhoneObject(); break; case EVENT_ALL_DATA_DISCONNECTED: int dds = SubscriptionManager.getDefaultDataSubId(); ProxyController.getInstance().unregisterForAllDataDisconnected(dds, this); Loading