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;
18
19import java.io.FileDescriptor;
20import java.io.PrintWriter;
21
22import android.os.RemoteException;
23import android.os.ServiceManager;
24
25
26public class PhoneSubInfoProxy extends IPhoneSubInfo.Stub {
27    private PhoneSubInfo mPhoneSubInfo;
28
29    public PhoneSubInfoProxy(PhoneSubInfo phoneSubInfo) {
30        mPhoneSubInfo = phoneSubInfo;
31    }
32
33    public void setmPhoneSubInfo(PhoneSubInfo phoneSubInfo) {
34        mPhoneSubInfo = phoneSubInfo;
35    }
36
37    @Override
38    public String getDeviceId() {
39        return mPhoneSubInfo.getDeviceId();
40    }
41
42    public String getImei() {
43        return mPhoneSubInfo.getImei();
44    }
45
46    public String getNai() {
47        return mPhoneSubInfo.getNai();
48    }
49
50    @Override
51    public String getDeviceSvn() {
52        return mPhoneSubInfo.getDeviceSvn();
53    }
54
55    /**
56     * Retrieves the unique subscriber ID, e.g., IMSI for GSM phones.
57     */
58    @Override
59    public String getSubscriberId() {
60        return mPhoneSubInfo.getSubscriberId();
61    }
62
63    /**
64     * Retrieves the Group Identifier Level1 for GSM phones.
65     */
66    public String getGroupIdLevel1() {
67        return mPhoneSubInfo.getGroupIdLevel1();
68    }
69
70    /**
71     * Retrieves the serial number of the ICC, if applicable.
72     */
73    @Override
74    public String getIccSerialNumber() {
75        return mPhoneSubInfo.getIccSerialNumber();
76    }
77
78    /**
79     * Retrieves the phone number string for line 1.
80     */
81    @Override
82    public String getLine1Number() {
83        return mPhoneSubInfo.getLine1Number();
84    }
85
86    /**
87     * Retrieves the alpha identifier for line 1.
88     */
89    @Override
90    public String getLine1AlphaTag() {
91        return mPhoneSubInfo.getLine1AlphaTag();
92    }
93
94    /**
95     * Retrieves the MSISDN Number.
96     */
97    @Override
98    public String getMsisdn() {
99        return mPhoneSubInfo.getMsisdn();
100    }
101
102    /**
103     * Retrieves the voice mail number.
104     */
105    @Override
106    public String getVoiceMailNumber() {
107        return mPhoneSubInfo.getVoiceMailNumber();
108    }
109
110    /**
111     * Retrieves the complete voice mail number.
112     */
113    @Override
114    public String getCompleteVoiceMailNumber() {
115        return mPhoneSubInfo.getCompleteVoiceMailNumber();
116    }
117
118    /**
119     * Retrieves the alpha identifier associated with the voice mail number.
120     */
121    @Override
122    public String getVoiceMailAlphaTag() {
123        return mPhoneSubInfo.getVoiceMailAlphaTag();
124    }
125
126    /**
127     * Returns the IMS private user identity (IMPI) that was loaded from the ISIM.
128     * @return the IMPI, or null if not present or not loaded
129     */
130    @Override
131    public String getIsimImpi() {
132        return mPhoneSubInfo.getIsimImpi();
133    }
134
135    /**
136     * Returns the IMS home network domain name that was loaded from the ISIM.
137     * @return the IMS domain name, or null if not present or not loaded
138     */
139    @Override
140    public String getIsimDomain() {
141        return mPhoneSubInfo.getIsimDomain();
142    }
143
144    /**
145     * Returns the IMS public user identities (IMPU) that were loaded from the ISIM.
146     * @return an array of IMPU strings, with one IMPU per string, or null if
147     *      not present or not loaded
148     */
149    @Override
150    public String[] getIsimImpu() {
151        return mPhoneSubInfo.getIsimImpu();
152    }
153
154    @Override
155    public String getDeviceIdForPhone(int phoneId) throws RemoteException {
156        // FIXME: getDeviceIdForPhone
157        return null;
158    }
159
160    @Override
161    public String getImeiForSubscriber(int subId) throws RemoteException {
162        // FIXME: getImeiForSubscriber
163        return null;
164    }
165
166    @Override
167    public String getDeviceSvnUsingSubId(int subId) throws RemoteException {
168        // FIXME: getDeviceSvnUsingSubId
169        return null;
170    }
171
172    @Override
173    public String getNaiForSubscriber(int subId) throws RemoteException {
174        // FIXME: NaiForSubscriber
175        return null;
176    }
177
178    @Override
179    public String getSubscriberIdForSubscriber(int subId) throws RemoteException {
180        // FIXME: getSubscriberIdForSubscriber
181        return null;
182    }
183
184    @Override
185    public String getGroupIdLevel1ForSubscriber(int subId) throws RemoteException {
186        // FIXME: getGroupIdLevel1ForSubscriber
187        return null;
188    }
189
190    @Override
191    public String getIccSerialNumberForSubscriber(int subId) throws RemoteException {
192        // FIXME: getIccSerialNumberForSubscriber
193        return null;
194    }
195
196    @Override
197    public String getLine1NumberForSubscriber(int subId) throws RemoteException {
198        // FIXME: getLine1NumberForSubscriber
199        return null;
200    }
201
202    @Override
203    public String getLine1AlphaTagForSubscriber(int subId) throws RemoteException {
204        // FIXME: getLine1AlphaTagForSubscriber
205        return null;
206    }
207
208    @Override
209    public String getMsisdnForSubscriber(int subId) throws RemoteException {
210        // FIXME: getMsisdnForSubscriber
211        return null;
212    }
213
214    @Override
215    public String getVoiceMailNumberForSubscriber(int subId) throws RemoteException {
216        // FIXME: getVoiceMailNumberForSubscriber
217        return null;
218    }
219
220    @Override
221    public String getCompleteVoiceMailNumberForSubscriber(int subId) throws RemoteException {
222        // FIXME: getCompleteVoiceMailNumberForSubscriber
223        return null;
224    }
225
226    @Override
227    public String getVoiceMailAlphaTagForSubscriber(int subId) throws RemoteException {
228        // FIXME: getVoiceMailAlphaTagForSubscriber
229        return null;
230    }
231
232    /**
233     * Returns the IMS Service Table (IST) that was loaded from the ISIM.
234     * @return IMS Service Table or null if not present or not loaded
235     */
236    @Override
237    public String getIsimIst() {
238        return mPhoneSubInfo.getIsimIst();
239    }
240
241    /**
242     * Returns the IMS Proxy Call Session Control Function(PCSCF) that were loaded from the ISIM.
243     * @return an array of  PCSCF strings with one PCSCF per string, or null if
244     *      not present or not loaded
245     */
246    @Override
247    public String[] getIsimPcscf() {
248        return mPhoneSubInfo.getIsimPcscf();
249    }
250
251    /**
252     * Returns the response of ISIM Authetification through RIL.
253     * Returns null if the Authentification hasn't been successed or isn't present iphonesubinfo.
254     * @return the response of ISIM Authetification, or null if not available
255     * @deprecated
256     * @see getIccSimChallengeResponse
257     */
258    public String getIsimChallengeResponse(String nonce) {
259        return mPhoneSubInfo.getIsimChallengeResponse(nonce);
260    }
261
262    /**
263     * Returns the response of the SIM application on the UICC to authentication
264     * challenge/response algorithm. The data string and challenge response are
265     * Base64 encoded Strings.
266     * Can support EAP-SIM, EAP-AKA with results encoded per 3GPP TS 31.102.
267     *
268     * @param appType ICC application type (@see com.android.internal.telephony.PhoneConstants#APPTYPE_xxx)
269     * @param data authentication challenge data
270     * @return challenge response
271     */
272    public String getIccSimChallengeResponse(int subId, int appType, String data) {
273        return mPhoneSubInfo.getIccSimChallengeResponse(subId, appType, data);
274    }
275
276    @Override
277    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
278        mPhoneSubInfo.dump(fd, pw, args);
279    }
280}
281