Loading src/java/com/android/internal/telephony/uicc/IccCardProxy.java +29 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import com.android.internal.telephony.uicc.IccCardApplicationStatus.PersoSubStat import com.android.internal.telephony.uicc.IccCardStatus.CardState; import com.android.internal.telephony.uicc.IccCardStatus.PinState; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.telephony.uicc.RuimRecords; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -150,6 +151,32 @@ public class IccCardProxy extends Handler implements IccCard { } } updateQuietMode(); updateActiveRecord(); } } /** * This method sets the IccRecord, corresponding to the currently active * subscription, as the active record. */ private void updateActiveRecord() { log("updateActiveRecord app type = " + mCurrentAppType + "mIccRecords = " + mIccRecords); if (mIccRecords == null) { return; } if (mCurrentAppType == UiccController.APP_FAM_3GPP2) { int newSubscriptionSource = mCdmaSSM.getCdmaSubscriptionSource(); if (newSubscriptionSource == CdmaSubscriptionSourceManager.SUBSCRIPTION_FROM_RUIM) { // Set this as the Active record. log("Setting Ruim Record as active"); mIccRecords.recordsRequired(); } } else if (mCurrentAppType == UiccController.APP_FAM_3GPP) { log("Setting SIM Record as active"); mIccRecords.recordsRequired(); } } Loading Loading @@ -255,6 +282,7 @@ public class IccCardProxy extends Handler implements IccCard { break; case EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED: updateQuietMode(); updateActiveRecord(); break; default: loge("Unhandled message with number: " + msg.what); Loading Loading @@ -283,6 +311,7 @@ public class IccCardProxy extends Handler implements IccCard { mUiccApplication = newApp; mIccRecords = newRecords; registerUiccCardEvents(); updateActiveRecord(); } updateExternalState(); Loading src/java/com/android/internal/telephony/uicc/IccRecords.java +14 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,20 @@ public abstract class IccRecords extends Handler implements IccConstants { public abstract void onReady(); //***** Public Methods /* * Called to indicate that anyone could request records * in the future after this call, once records are loaded and registrants * have been notified. This indication could be used * to optimize when to actually fetch records from the card. We * don't need to fetch records from the card if it is of no use * to anyone * */ void recordsRequired() { return; } public AdnRecordCache getAdnCache() { return mAdnCache; } Loading src/java/com/android/internal/telephony/uicc/RuimRecords.java +30 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import com.android.internal.telephony.MccTable; import com.android.internal.telephony.cdma.sms.UserData; import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType; import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState; /** Loading @@ -57,6 +58,7 @@ public final class RuimRecords extends IccRecords { private String mMin2Min1; private String mPrlVersion; private boolean mRecordsRequired = false; // From CSIM application private byte[] mEFpl = null; private byte[] mEFli = null; Loading Loading @@ -659,8 +661,36 @@ public final class RuimRecords extends IccRecords { mCi.getCDMASubscription(obtainMessage(EVENT_GET_CDMA_SUBSCRIPTION_DONE)); } /** * Called by IccCardProxy before it requests records. * We use this as a trigger to read records from the card. */ void recordsRequired() { if (DBG) log("recordsRequired"); mRecordsRequired = true; // trigger to retrieve all records fetchRuimRecords(); } private void fetchRuimRecords() { /* Don't read records if we don't expect * anyone to ask for them * * If we have already requested records OR * records are not required by anyone OR * the app is not ready * then bail */ if (mRecordsRequested || !mRecordsRequired || AppState.APPSTATE_READY != mParentApp.getState()) { if (DBG) log("fetchRuimRecords: Abort fetching records rRecordsRequested = " + mRecordsRequested + " state = " + mParentApp.getState() + " required = " + mRecordsRequired); return; } mRecordsRequested = true; if (DBG) log("fetchRuimRecords " + mRecordsToLoad); Loading Loading
src/java/com/android/internal/telephony/uicc/IccCardProxy.java +29 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import com.android.internal.telephony.uicc.IccCardApplicationStatus.PersoSubStat import com.android.internal.telephony.uicc.IccCardStatus.CardState; import com.android.internal.telephony.uicc.IccCardStatus.PinState; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.telephony.uicc.RuimRecords; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -150,6 +151,32 @@ public class IccCardProxy extends Handler implements IccCard { } } updateQuietMode(); updateActiveRecord(); } } /** * This method sets the IccRecord, corresponding to the currently active * subscription, as the active record. */ private void updateActiveRecord() { log("updateActiveRecord app type = " + mCurrentAppType + "mIccRecords = " + mIccRecords); if (mIccRecords == null) { return; } if (mCurrentAppType == UiccController.APP_FAM_3GPP2) { int newSubscriptionSource = mCdmaSSM.getCdmaSubscriptionSource(); if (newSubscriptionSource == CdmaSubscriptionSourceManager.SUBSCRIPTION_FROM_RUIM) { // Set this as the Active record. log("Setting Ruim Record as active"); mIccRecords.recordsRequired(); } } else if (mCurrentAppType == UiccController.APP_FAM_3GPP) { log("Setting SIM Record as active"); mIccRecords.recordsRequired(); } } Loading Loading @@ -255,6 +282,7 @@ public class IccCardProxy extends Handler implements IccCard { break; case EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED: updateQuietMode(); updateActiveRecord(); break; default: loge("Unhandled message with number: " + msg.what); Loading Loading @@ -283,6 +311,7 @@ public class IccCardProxy extends Handler implements IccCard { mUiccApplication = newApp; mIccRecords = newRecords; registerUiccCardEvents(); updateActiveRecord(); } updateExternalState(); Loading
src/java/com/android/internal/telephony/uicc/IccRecords.java +14 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,20 @@ public abstract class IccRecords extends Handler implements IccConstants { public abstract void onReady(); //***** Public Methods /* * Called to indicate that anyone could request records * in the future after this call, once records are loaded and registrants * have been notified. This indication could be used * to optimize when to actually fetch records from the card. We * don't need to fetch records from the card if it is of no use * to anyone * */ void recordsRequired() { return; } public AdnRecordCache getAdnCache() { return mAdnCache; } Loading
src/java/com/android/internal/telephony/uicc/RuimRecords.java +30 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import com.android.internal.telephony.MccTable; import com.android.internal.telephony.cdma.sms.UserData; import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType; import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState; /** Loading @@ -57,6 +58,7 @@ public final class RuimRecords extends IccRecords { private String mMin2Min1; private String mPrlVersion; private boolean mRecordsRequired = false; // From CSIM application private byte[] mEFpl = null; private byte[] mEFli = null; Loading Loading @@ -659,8 +661,36 @@ public final class RuimRecords extends IccRecords { mCi.getCDMASubscription(obtainMessage(EVENT_GET_CDMA_SUBSCRIPTION_DONE)); } /** * Called by IccCardProxy before it requests records. * We use this as a trigger to read records from the card. */ void recordsRequired() { if (DBG) log("recordsRequired"); mRecordsRequired = true; // trigger to retrieve all records fetchRuimRecords(); } private void fetchRuimRecords() { /* Don't read records if we don't expect * anyone to ask for them * * If we have already requested records OR * records are not required by anyone OR * the app is not ready * then bail */ if (mRecordsRequested || !mRecordsRequired || AppState.APPSTATE_READY != mParentApp.getState()) { if (DBG) log("fetchRuimRecords: Abort fetching records rRecordsRequested = " + mRecordsRequested + " state = " + mParentApp.getState() + " required = " + mRecordsRequired); return; } mRecordsRequested = true; if (DBG) log("fetchRuimRecords " + mRecordsToLoad); Loading