Loading src/java/com/android/internal/telephony/ModemStackController.java +28 −1 Original line number Diff line number Diff line Loading @@ -134,6 +134,7 @@ public class ModemStackController extends Handler { private static final int EVENT_SUB_DEACTIVATED = 8; private static final int EVENT_RADIO_AVAILABLE = 9; private static final int EVENT_MODEM_CAPABILITY_CHANGED = 10; private static final int EVENT_RADIO_NOT_AVAILABLE = 11; //*****States private static final int STATE_UNKNOWN = 1; Loading Loading @@ -262,6 +263,7 @@ public class ModemStackController extends Handler { for (int i = 0; i < mCi.length; i++) { mCi[i].registerForAvailable(this, EVENT_RADIO_AVAILABLE, new Integer(i)); mCi[i].registerForModemCapEvent(this, EVENT_MODEM_CAPABILITY_CHANGED, null); mCi[i].registerForNotAvailable(this, EVENT_RADIO_NOT_AVAILABLE, new Integer(i)); } for (int i = 0; i < mNumPhones; i++) { Loading Loading @@ -353,6 +355,13 @@ public class ModemStackController extends Handler { onSetPrefNwModeDone(ar, phoneId); break; case EVENT_RADIO_NOT_AVAILABLE: ar = (AsyncResult)msg.obj; phoneId = (Integer)ar.userObj; logd("EVENT_RADIO_NOT_AVAILABLE, phoneId = " + phoneId); processRadioNotAvailable(ar, phoneId); break; default: break; } Loading @@ -373,6 +382,16 @@ public class ModemStackController extends Handler { } } // RADIO state moved to UNAVAILABLE, reset cached modem cap info private void processRadioNotAvailable(AsyncResult ar, int phoneId) { logd("processRadioNotAvailable on phoneId = " + phoneId); if (phoneId >= 0 && phoneId < mNumPhones) { mModemCapInfo[mCurrentStackId[phoneId]] = null; } else { loge("Invalid Index!!!"); } } private void onGetModemCapabilityDone(AsyncResult ar, byte[] result, int phoneId) { if (result == null && ar.exception instanceof CommandException) { Loading @@ -391,7 +410,7 @@ public class ModemStackController extends Handler { parseGetModemCapabilityResponse(result, phoneId); //Wait till we get Modem Capabilities on all subs if (areAllSubsinSameState(STATE_GOT_MODEM_CAPS)) { if (areAllModemCapInfoReceived()) { notifyModemRatCapabilitiesAvailable(); } } else { Loading Loading @@ -565,6 +584,13 @@ public class ModemStackController extends Handler { return true; } private boolean areAllModemCapInfoReceived() { for (int i = 0; i < mNumPhones; i++) { if (mModemCapInfo[mCurrentStackId[i]] == null) return false; } return true; } private void resetSubStates() { for (int i = 0; i < mNumPhones; i++) { mSubState[i] = STATE_UNKNOWN; Loading Loading @@ -748,6 +774,7 @@ public class ModemStackController extends Handler { mUpdateStackMsg = null; } notifyStackReady(false); return; } for (SubscriptionInfo subInfo : subInfoList) { int subStatus = subCtrlr.getSubState(subInfo.getSubscriptionId()); Loading Loading
src/java/com/android/internal/telephony/ModemStackController.java +28 −1 Original line number Diff line number Diff line Loading @@ -134,6 +134,7 @@ public class ModemStackController extends Handler { private static final int EVENT_SUB_DEACTIVATED = 8; private static final int EVENT_RADIO_AVAILABLE = 9; private static final int EVENT_MODEM_CAPABILITY_CHANGED = 10; private static final int EVENT_RADIO_NOT_AVAILABLE = 11; //*****States private static final int STATE_UNKNOWN = 1; Loading Loading @@ -262,6 +263,7 @@ public class ModemStackController extends Handler { for (int i = 0; i < mCi.length; i++) { mCi[i].registerForAvailable(this, EVENT_RADIO_AVAILABLE, new Integer(i)); mCi[i].registerForModemCapEvent(this, EVENT_MODEM_CAPABILITY_CHANGED, null); mCi[i].registerForNotAvailable(this, EVENT_RADIO_NOT_AVAILABLE, new Integer(i)); } for (int i = 0; i < mNumPhones; i++) { Loading Loading @@ -353,6 +355,13 @@ public class ModemStackController extends Handler { onSetPrefNwModeDone(ar, phoneId); break; case EVENT_RADIO_NOT_AVAILABLE: ar = (AsyncResult)msg.obj; phoneId = (Integer)ar.userObj; logd("EVENT_RADIO_NOT_AVAILABLE, phoneId = " + phoneId); processRadioNotAvailable(ar, phoneId); break; default: break; } Loading @@ -373,6 +382,16 @@ public class ModemStackController extends Handler { } } // RADIO state moved to UNAVAILABLE, reset cached modem cap info private void processRadioNotAvailable(AsyncResult ar, int phoneId) { logd("processRadioNotAvailable on phoneId = " + phoneId); if (phoneId >= 0 && phoneId < mNumPhones) { mModemCapInfo[mCurrentStackId[phoneId]] = null; } else { loge("Invalid Index!!!"); } } private void onGetModemCapabilityDone(AsyncResult ar, byte[] result, int phoneId) { if (result == null && ar.exception instanceof CommandException) { Loading @@ -391,7 +410,7 @@ public class ModemStackController extends Handler { parseGetModemCapabilityResponse(result, phoneId); //Wait till we get Modem Capabilities on all subs if (areAllSubsinSameState(STATE_GOT_MODEM_CAPS)) { if (areAllModemCapInfoReceived()) { notifyModemRatCapabilitiesAvailable(); } } else { Loading Loading @@ -565,6 +584,13 @@ public class ModemStackController extends Handler { return true; } private boolean areAllModemCapInfoReceived() { for (int i = 0; i < mNumPhones; i++) { if (mModemCapInfo[mCurrentStackId[i]] == null) return false; } return true; } private void resetSubStates() { for (int i = 0; i < mNumPhones; i++) { mSubState[i] = STATE_UNKNOWN; Loading Loading @@ -748,6 +774,7 @@ public class ModemStackController extends Handler { mUpdateStackMsg = null; } notifyStackReady(false); return; } for (SubscriptionInfo subInfo : subInfoList) { int subStatus = subCtrlr.getSubState(subInfo.getSubscriptionId()); Loading