Loading src/java/com/android/internal/telephony/cdma/CdmaLteUiccFileHandler.java→src/java/com/android/internal/telephony/CsimFileHandler.java +71 −0 Original line number Diff line number Diff line /* * Copyright (C) 2011 The Android Open Source Project * Copyright (C) 2006, 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading @@ -14,66 +14,58 @@ * limitations under the License. */ package com.android.internal.telephony.cdma; package com.android.internal.telephony; import android.util.Log; import com.android.internal.telephony.CommandsInterface; import com.android.internal.telephony.IccCard; import com.android.internal.telephony.IccConstants; import com.android.internal.telephony.IccFileHandler; import android.os.Message; import com.android.internal.telephony.UiccCardApplication; /** * {@hide} * This class should be used to access files in CSIM ADF */ public final class CdmaLteUiccFileHandler extends IccFileHandler { static final String LOG_TAG = "CDMA"; public final class CsimFileHandler extends IccFileHandler implements IccConstants { static final String LOG_TAG = "RIL_CsimFH"; public CdmaLteUiccFileHandler(IccCard card, String aid, CommandsInterface ci) { super(card, aid, ci); public CsimFileHandler(UiccCardApplication app, String aid, CommandsInterface ci) { super(app, aid, ci); } @Override protected String getEFPath(int efid) { switch(efid) { case EF_CSIM_SPN: case EF_SMS: case EF_CST: case EF_FDN: case EF_MSISDN: case EF_RUIM_SPN: case EF_CSIM_LI: case EF_CSIM_MDN: case EF_CSIM_IMSIM: case EF_CSIM_CDMAHOME: case EF_CSIM_EPRL: return MF_SIM + DF_CDMA; case EF_AD: return MF_SIM + DF_GSM; case EF_IMPI: case EF_DOMAIN: case EF_IMPU: return MF_SIM + DF_ADFISIM; } return getCommonIccEFPath(efid); return MF_SIM + DF_ADF; } @Override public void loadEFTransparent(int fileid, Message onLoaded) { if (fileid == EF_CSIM_EPRL) { // Entire PRL could be huge. We are only interested in // the first 4 bytes of the record. mCi.iccIOForApp(COMMAND_READ_BINARY, fileid, getEFPath(fileid), 0, 0, 4, null, null, mAid, obtainMessage(EVENT_READ_BINARY_DONE, fileid, 0, onLoaded)); } else { super.loadEFTransparent(fileid, onLoaded); String path = getCommonIccEFPath(efid); if (path == null) { // The EFids in UICC phone book entries are decided by the card manufacturer. // So if we don't match any of the cases above and if its a UICC return // the global 3g phone book path. return MF_SIM + DF_TELECOM + DF_PHONEBOOK; } return path; } @Override protected void logd(String msg) { Log.d(LOG_TAG, "[CdmaLteUiccFileHandler] " + msg); Log.d(LOG_TAG, msg); } @Override protected void loge(String msg) { Log.e(LOG_TAG, "[CdmaLteUiccFileHandler] " + msg); Log.e(LOG_TAG, msg); } } Loading
src/java/com/android/internal/telephony/cdma/CdmaLteUiccFileHandler.java→src/java/com/android/internal/telephony/CsimFileHandler.java +71 −0 Original line number Diff line number Diff line /* * Copyright (C) 2011 The Android Open Source Project * Copyright (C) 2006, 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading @@ -14,66 +14,58 @@ * limitations under the License. */ package com.android.internal.telephony.cdma; package com.android.internal.telephony; import android.util.Log; import com.android.internal.telephony.CommandsInterface; import com.android.internal.telephony.IccCard; import com.android.internal.telephony.IccConstants; import com.android.internal.telephony.IccFileHandler; import android.os.Message; import com.android.internal.telephony.UiccCardApplication; /** * {@hide} * This class should be used to access files in CSIM ADF */ public final class CdmaLteUiccFileHandler extends IccFileHandler { static final String LOG_TAG = "CDMA"; public final class CsimFileHandler extends IccFileHandler implements IccConstants { static final String LOG_TAG = "RIL_CsimFH"; public CdmaLteUiccFileHandler(IccCard card, String aid, CommandsInterface ci) { super(card, aid, ci); public CsimFileHandler(UiccCardApplication app, String aid, CommandsInterface ci) { super(app, aid, ci); } @Override protected String getEFPath(int efid) { switch(efid) { case EF_CSIM_SPN: case EF_SMS: case EF_CST: case EF_FDN: case EF_MSISDN: case EF_RUIM_SPN: case EF_CSIM_LI: case EF_CSIM_MDN: case EF_CSIM_IMSIM: case EF_CSIM_CDMAHOME: case EF_CSIM_EPRL: return MF_SIM + DF_CDMA; case EF_AD: return MF_SIM + DF_GSM; case EF_IMPI: case EF_DOMAIN: case EF_IMPU: return MF_SIM + DF_ADFISIM; } return getCommonIccEFPath(efid); return MF_SIM + DF_ADF; } @Override public void loadEFTransparent(int fileid, Message onLoaded) { if (fileid == EF_CSIM_EPRL) { // Entire PRL could be huge. We are only interested in // the first 4 bytes of the record. mCi.iccIOForApp(COMMAND_READ_BINARY, fileid, getEFPath(fileid), 0, 0, 4, null, null, mAid, obtainMessage(EVENT_READ_BINARY_DONE, fileid, 0, onLoaded)); } else { super.loadEFTransparent(fileid, onLoaded); String path = getCommonIccEFPath(efid); if (path == null) { // The EFids in UICC phone book entries are decided by the card manufacturer. // So if we don't match any of the cases above and if its a UICC return // the global 3g phone book path. return MF_SIM + DF_TELECOM + DF_PHONEBOOK; } return path; } @Override protected void logd(String msg) { Log.d(LOG_TAG, "[CdmaLteUiccFileHandler] " + msg); Log.d(LOG_TAG, msg); } @Override protected void loge(String msg) { Log.e(LOG_TAG, "[CdmaLteUiccFileHandler] " + msg); Log.e(LOG_TAG, msg); } }