SIMFileHandler.java revision 2f837b8058eba0bc59e983c67efbc00cd9a80eee
1/*
2 * Copyright (C) 2006 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.os.Message;
20import android.telephony.Rlog;
21
22import com.android.internal.telephony.CommandsInterface;
23
24/**
25 * {@hide}
26 */
27public final class SIMFileHandler extends IccFileHandler implements IccConstants {
28    static final String LOG_TAG = "GSM";
29
30    //***** Instance Variables
31
32    //***** Constructor
33
34    public SIMFileHandler(UiccCardApplication app, String aid, CommandsInterface ci) {
35        super(app, aid, ci);
36    }
37
38    //***** Overridden from IccFileHandler
39
40    @Override
41    protected String getEFPath(int efid) {
42        // TODO(): DF_GSM can be 7F20 or 7F21 to handle backward compatibility.
43        // Implement this after discussion with OEMs.
44        switch(efid) {
45        case EF_SMS:
46            return MF_SIM + DF_TELECOM;
47
48        case EF_EXT6:
49        case EF_MWIS:
50        case EF_MBI:
51        case EF_SPN:
52        case EF_AD:
53        case EF_MBDN:
54        case EF_PNN:
55        case EF_SPDI:
56        case EF_SST:
57        case EF_CFIS:
58        case EF_GID1:
59            return MF_SIM + DF_GSM;
60
61        case EF_MAILBOX_CPHS:
62        case EF_VOICE_MAIL_INDICATOR_CPHS:
63        case EF_CFF_CPHS:
64        case EF_SPN_CPHS:
65        case EF_SPN_SHORT_CPHS:
66        case EF_INFO_CPHS:
67        case EF_CSP_CPHS:
68            return MF_SIM + DF_GSM;
69        }
70        String path = getCommonIccEFPath(efid);
71        if (path == null) {
72            Rlog.e(LOG_TAG, "Error: EF Path being returned in null");
73        }
74        return path;
75    }
76
77    @Override
78    protected void logd(String msg) {
79        Rlog.d(LOG_TAG, "[SIMFileHandler] " + msg);
80    }
81
82    @Override
83    protected void loge(String msg) {
84        Rlog.e(LOG_TAG, "[SIMFileHandler] " + msg);
85    }
86}
87