1 /* 2 * Copyright (C) 2006, 2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.internal.telephony.uicc; 18 19 import android.telephony.Rlog; 20 21 import com.android.internal.telephony.CommandsInterface; 22 import com.android.internal.telephony.uicc.UiccCardApplication; 23 24 /** 25 * {@hide} 26 * This class should be used to access files in USIM ADF 27 */ 28 public final class UsimFileHandler extends IccFileHandler implements IccConstants { 29 static final String LOG_TAG = "UsimFH"; 30 31 public UsimFileHandler(UiccCardApplication app, String aid, CommandsInterface ci) { 32 super(app, aid, ci); 33 } 34 35 @Override 36 protected String getEFPath(int efid) { 37 switch(efid) { 38 case EF_SMS: 39 case EF_EXT5: 40 case EF_EXT6: 41 case EF_MWIS: 42 case EF_MBI: 43 case EF_SPN: 44 case EF_AD: 45 case EF_MBDN: 46 case EF_PNN: 47 case EF_OPL: 48 case EF_SPDI: 49 case EF_SST: 50 case EF_CFIS: 51 case EF_MAILBOX_CPHS: 52 case EF_VOICE_MAIL_INDICATOR_CPHS: 53 case EF_CFF_CPHS: 54 case EF_SPN_CPHS: 55 case EF_SPN_SHORT_CPHS: 56 case EF_FDN: 57 case EF_SDN: 58 case EF_EXT3: 59 case EF_MSISDN: 60 case EF_EXT2: 61 case EF_INFO_CPHS: 62 case EF_CSP_CPHS: 63 case EF_GID1: 64 case EF_GID2: 65 case EF_LI: 66 case EF_PLMN_W_ACT: 67 case EF_OPLMN_W_ACT: 68 case EF_HPLMN_W_ACT: 69 case EF_EHPLMN: 70 case EF_FPLMN: 71 case EF_LRPLMNSI: 72 case EF_HPPLMN: 73 return MF_SIM + DF_ADF; 74 75 case EF_PBR: 76 // we only support global phonebook. 77 return MF_SIM + DF_TELECOM + DF_PHONEBOOK; 78 } 79 String path = getCommonIccEFPath(efid); 80 if (path == null) { 81 // The EFids in USIM phone book entries are decided by the card manufacturer. 82 // So if we don't match any of the cases above and if its a USIM return 83 // the phone book path. 84 return MF_SIM + DF_TELECOM + DF_PHONEBOOK; 85 } 86 return path; 87 } 88 89 @Override 90 protected void logd(String msg) { 91 Rlog.d(LOG_TAG, msg); 92 } 93 94 @Override 95 protected void loge(String msg) { 96 Rlog.e(LOG_TAG, msg); 97 } 98 } 99