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