1 /*
2  * Copyright (C) 2008 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.os.*;
20 
21 import com.android.internal.telephony.CommandsInterface;
22 import com.android.telephony.Rlog;
23 
24 /**
25  * {@hide}
26  */
27 public final class RuimFileHandler extends IccFileHandler {
28     static final String LOG_TAG = "RuimFH";
29 
30     //***** Instance Variables
31 
32     //***** Constructor
RuimFileHandler(UiccCardApplication app, String aid, CommandsInterface ci)33     public RuimFileHandler(UiccCardApplication app, String aid, CommandsInterface ci) {
34         super(app, aid, ci);
35     }
36 
37     //***** Overridden from IccFileHandler
38 
39     @Override
loadEFImgTransparent(int fileid, int highOffset, int lowOffset, int length, Message onLoaded)40     public void loadEFImgTransparent(int fileid, int highOffset, int lowOffset,
41             int length, Message onLoaded) {
42         Message response = obtainMessage(EVENT_READ_ICON_DONE, fileid, 0,
43                 onLoaded);
44 
45         /* Per TS 31.102, for displaying of Icon, under
46          * DF Telecom and DF Graphics , EF instance(s) (4FXX,transparent files)
47          * are present. The possible image file identifiers (EF instance) for
48          * EF img ( 4F20, linear fixed file) are : 4F01 ... 4F05.
49          * It should be MF_SIM + DF_TELECOM + DF_GRAPHICS, same path as EF IMG
50          */
51         mCi.iccIOForApp(COMMAND_GET_RESPONSE, fileid, getEFPath(EF_IMG), 0, 0,
52                 GET_RESPONSE_EF_IMG_SIZE_BYTES, null, null,
53                 mAid, response);
54     }
55 
56     @Override
getEFPath(int efid)57     protected String getEFPath(int efid) {
58         switch(efid) {
59         case EF_SMS:
60         case EF_CST:
61         case EF_RUIM_SPN:
62         case EF_CSIM_LI:
63         case EF_CSIM_MDN:
64         case EF_CSIM_IMSIM:
65         case EF_CSIM_CDMAHOME:
66         case EF_CSIM_EPRL:
67         case EF_CSIM_PRL:
68         case EF_CSIM_MIPUPP:
69             return MF_SIM + DF_CDMA;
70         case EF_CSIM_MSPL:
71         case EF_CSIM_MLPL:
72             return MF_SIM + DF_TELECOM + DF_MMSS;
73         }
74         return getCommonIccEFPath(efid);
75     }
76 
77     @Override
logd(String msg)78     protected void logd(String msg) {
79         Rlog.d(LOG_TAG, "[RuimFileHandler] " + msg);
80     }
81 
82     @Override
loge(String msg)83     protected void loge(String msg) {
84         Rlog.e(LOG_TAG, "[RuimFileHandler] " + msg);
85     }
86 
87 }
88