Loading src/java/com/android/internal/telephony/uicc/IccCardProxy.java +5 −2 Original line number Diff line number Diff line Loading @@ -225,6 +225,9 @@ public class IccCardProxy extends Handler implements IccCard { switch (msg.what) { case EVENT_RADIO_OFF_OR_UNAVAILABLE: mRadioOn = false; if (CommandsInterface.RadioState.RADIO_UNAVAILABLE == mCi.getRadioState()) { setExternalState(State.NOT_READY); } break; case EVENT_RADIO_ON: mRadioOn = true; Loading Loading @@ -272,15 +275,15 @@ public class IccCardProxy extends Handler implements IccCard { protected void updateIccAvailability() { synchronized (mLock) { UiccCard newCard = mUiccController.getUiccCard(); CardState state = CardState.CARDSTATE_ABSENT; UiccCardApplication newApp = null; IccRecords newRecords = null; if (newCard != null) { state = newCard.getCardState(); newApp = newCard.getApplication(mCurrentAppType); if (newApp != null) { newRecords = newApp.getIccRecords(); } } else { log("No card available"); } if (mIccRecords != newRecords || mUiccApplication != newApp || mUiccCard != newCard) { Loading src/java/com/android/internal/telephony/uicc/UiccController.java +18 −2 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ public class UiccController extends Handler { protected static final int EVENT_ICC_STATUS_CHANGED = 1; protected static final int EVENT_GET_ICC_STATUS_DONE = 2; protected static final int EVENT_RADIO_UNAVAILABLE = 3; private static final int EVENT_REFRESH = 4; protected static final Object mLock = new Object(); Loading Loading @@ -198,6 +199,12 @@ public class UiccController extends Handler { AsyncResult ar = (AsyncResult)msg.obj; onGetIccCardStatusDone(ar); break; case EVENT_RADIO_UNAVAILABLE: if (DBG) log("EVENT_RADIO_UNAVAILABLE "); disposeCard(mUiccCard); mUiccCard = null; mIccChangedRegistrants.notifyRegistrants(); break; case EVENT_REFRESH: ar = (AsyncResult)msg.obj; if (DBG) log("Sim REFRESH received"); Loading @@ -213,6 +220,14 @@ public class UiccController extends Handler { } } // Destroys the card object protected synchronized void disposeCard(UiccCard uiccCard) { if (DBG) log("Disposing card"); if (uiccCard != null) { uiccCard.dispose(); } } private void handleRefresh(IccRefreshResponse refreshResponse){ if (refreshResponse == null) { log("handleRefresh received without input"); Loading @@ -233,6 +248,7 @@ public class UiccController extends Handler { mCi = ci; mCi.registerForIccStatusChanged(this, EVENT_ICC_STATUS_CHANGED, null); mCi.registerForAvailable(this, EVENT_ICC_STATUS_CHANGED, null); mCi.registerForNotAvailable(this, EVENT_RADIO_UNAVAILABLE, null); mCi.registerForIccRefresh(this, EVENT_REFRESH, null); } Loading @@ -247,10 +263,10 @@ public class UiccController extends Handler { IccCardStatus status = (IccCardStatus)ar.result; if (mUiccCard == null) { //Create new card if (DBG) log("Creating a new card"); mUiccCard = new UiccCard(mContext, mCi, status); } else { //Update already existing card if (DBG) log("Update already existing card"); mUiccCard.update(mContext, mCi , status); } Loading Loading
src/java/com/android/internal/telephony/uicc/IccCardProxy.java +5 −2 Original line number Diff line number Diff line Loading @@ -225,6 +225,9 @@ public class IccCardProxy extends Handler implements IccCard { switch (msg.what) { case EVENT_RADIO_OFF_OR_UNAVAILABLE: mRadioOn = false; if (CommandsInterface.RadioState.RADIO_UNAVAILABLE == mCi.getRadioState()) { setExternalState(State.NOT_READY); } break; case EVENT_RADIO_ON: mRadioOn = true; Loading Loading @@ -272,15 +275,15 @@ public class IccCardProxy extends Handler implements IccCard { protected void updateIccAvailability() { synchronized (mLock) { UiccCard newCard = mUiccController.getUiccCard(); CardState state = CardState.CARDSTATE_ABSENT; UiccCardApplication newApp = null; IccRecords newRecords = null; if (newCard != null) { state = newCard.getCardState(); newApp = newCard.getApplication(mCurrentAppType); if (newApp != null) { newRecords = newApp.getIccRecords(); } } else { log("No card available"); } if (mIccRecords != newRecords || mUiccApplication != newApp || mUiccCard != newCard) { Loading
src/java/com/android/internal/telephony/uicc/UiccController.java +18 −2 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ public class UiccController extends Handler { protected static final int EVENT_ICC_STATUS_CHANGED = 1; protected static final int EVENT_GET_ICC_STATUS_DONE = 2; protected static final int EVENT_RADIO_UNAVAILABLE = 3; private static final int EVENT_REFRESH = 4; protected static final Object mLock = new Object(); Loading Loading @@ -198,6 +199,12 @@ public class UiccController extends Handler { AsyncResult ar = (AsyncResult)msg.obj; onGetIccCardStatusDone(ar); break; case EVENT_RADIO_UNAVAILABLE: if (DBG) log("EVENT_RADIO_UNAVAILABLE "); disposeCard(mUiccCard); mUiccCard = null; mIccChangedRegistrants.notifyRegistrants(); break; case EVENT_REFRESH: ar = (AsyncResult)msg.obj; if (DBG) log("Sim REFRESH received"); Loading @@ -213,6 +220,14 @@ public class UiccController extends Handler { } } // Destroys the card object protected synchronized void disposeCard(UiccCard uiccCard) { if (DBG) log("Disposing card"); if (uiccCard != null) { uiccCard.dispose(); } } private void handleRefresh(IccRefreshResponse refreshResponse){ if (refreshResponse == null) { log("handleRefresh received without input"); Loading @@ -233,6 +248,7 @@ public class UiccController extends Handler { mCi = ci; mCi.registerForIccStatusChanged(this, EVENT_ICC_STATUS_CHANGED, null); mCi.registerForAvailable(this, EVENT_ICC_STATUS_CHANGED, null); mCi.registerForNotAvailable(this, EVENT_RADIO_UNAVAILABLE, null); mCi.registerForIccRefresh(this, EVENT_REFRESH, null); } Loading @@ -247,10 +263,10 @@ public class UiccController extends Handler { IccCardStatus status = (IccCardStatus)ar.result; if (mUiccCard == null) { //Create new card if (DBG) log("Creating a new card"); mUiccCard = new UiccCard(mContext, mCi, status); } else { //Update already existing card if (DBG) log("Update already existing card"); mUiccCard.update(mContext, mCi , status); } Loading