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 com.android.internal.telephony.CommandsInterface;
20 import com.android.telephony.Rlog;
21 
22 /**
23  * {@hide}
24  * This class should be used to access files in CSIM ADF
25  */
26 public final class CsimFileHandler extends IccFileHandler implements IccConstants {
27     static final String LOG_TAG = "CsimFH";
28 
CsimFileHandler(UiccCardApplication app, String aid, CommandsInterface ci)29     public CsimFileHandler(UiccCardApplication app, String aid, CommandsInterface ci) {
30         super(app, aid, ci);
31     }
32 
33     @Override
getEFPath(int efid)34     protected String getEFPath(int efid) {
35         switch(efid) {
36         case EF_SMS:
37         case EF_CST:
38         case EF_FDN:
39         case EF_MSISDN:
40         case EF_RUIM_SPN:
41         case EF_CSIM_LI:
42         case EF_CSIM_MDN:
43         case EF_CSIM_IMSIM:
44         case EF_CSIM_CDMAHOME:
45         case EF_CSIM_EPRL:
46         case EF_CSIM_PRL:
47         case EF_CSIM_MIPUPP:
48             return MF_SIM + DF_ADF;
49         case EF_CSIM_MSPL:
50         case EF_CSIM_MLPL:
51             return MF_SIM + DF_TELECOM + DF_MMSS;
52         }
53         String path = getCommonIccEFPath(efid);
54         if (path == null) {
55             // The EFids in UICC phone book entries are decided by the card manufacturer.
56             // So if we don't match any of the cases above and if its a UICC return
57             // the global 3g phone book path.
58             return MF_SIM + DF_TELECOM + DF_PHONEBOOK;
59         }
60         return path;
61     }
62 
63     @Override
logd(String msg)64     protected void logd(String msg) {
65         Rlog.d(LOG_TAG, msg);
66     }
67 
68     @Override
loge(String msg)69     protected void loge(String msg) {
70         Rlog.e(LOG_TAG, msg);
71     }
72 }
73