1/*
2 * Copyright (C) 2007 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 android.telephony.ImsiEncryptionInfo;
20
21/**
22 * Interface used to retrieve various phone-related subscriber information.
23 *
24 */
25interface IPhoneSubInfo {
26
27    /**
28     * Retrieves the unique device ID, e.g., IMEI for GSM phones.
29     */
30    String getDeviceId(String callingPackage);
31
32     /**
33     * Retrieves the unique Network Access ID
34     */
35    String getNaiForSubscriber(int subId, String callingPackage);
36
37    /**
38     * Retrieves the unique device ID of a phone for the device, e.g., IMEI
39     * for GSM phones.
40     */
41    String getDeviceIdForPhone(int phoneId, String callingPackage);
42
43    /**
44     * Retrieves the IMEI.
45     */
46    String getImeiForSubscriber(int subId, String callingPackage);
47
48    /**
49     * Retrieves the software version number for the device, e.g., IMEI/SV
50     * for GSM phones.
51     */
52    String getDeviceSvn(String callingPackage);
53
54    /**
55     * Retrieves the software version number of a subId for the device, e.g., IMEI/SV
56     * for GSM phones.
57     */
58    String getDeviceSvnUsingSubId(int subId, String callingPackage);
59
60    /**
61     * Retrieves the unique sbuscriber ID, e.g., IMSI for GSM phones.
62     */
63    String getSubscriberId(String callingPackage);
64
65    /**
66     * Retrieves the unique subscriber ID of a given subId, e.g., IMSI for GSM phones.
67     */
68    String getSubscriberIdForSubscriber(int subId, String callingPackage);
69
70    /**
71     * Retrieves the Group Identifier Level1 for GSM phones of a subId.
72     */
73    String getGroupIdLevel1ForSubscriber(int subId, String callingPackage);
74
75    /**
76     * Retrieves the serial number of the ICC, if applicable.
77     */
78    String getIccSerialNumber(String callingPackage);
79
80    /**
81     * Retrieves the serial number of a given subId.
82     */
83    String getIccSerialNumberForSubscriber(int subId, String callingPackage);
84
85    /**
86     * Retrieves the phone number string for line 1.
87     */
88    String getLine1Number(String callingPackage);
89
90    /**
91     * Retrieves the phone number string for line 1 of a subcription.
92     */
93    String getLine1NumberForSubscriber(int subId, String callingPackage);
94
95
96    /**
97     * Retrieves the alpha identifier for line 1.
98     */
99    String getLine1AlphaTag(String callingPackage);
100
101    /**
102     * Retrieves the alpha identifier for line 1 of a subId.
103     */
104    String getLine1AlphaTagForSubscriber(int subId, String callingPackage);
105
106
107    /**
108     * Retrieves MSISDN Number.
109     */
110    String getMsisdn(String callingPackage);
111
112    /**
113     * Retrieves the Msisdn of a subId.
114     */
115    String getMsisdnForSubscriber(int subId, String callingPackage);
116
117    /**
118     * Retrieves the voice mail number.
119     */
120    String getVoiceMailNumber(String callingPackage);
121
122    /**
123     * Retrieves the voice mail number of a given subId.
124     */
125    String getVoiceMailNumberForSubscriber(int subId, String callingPackage);
126
127    /**
128     * Retrieves the complete voice mail number.
129     */
130    String getCompleteVoiceMailNumber();
131
132    /**
133     * Retrieves the complete voice mail number for particular subId
134     */
135    String getCompleteVoiceMailNumberForSubscriber(int subId);
136
137    /**
138     * Retrieves the Carrier information used to encrypt IMSI and IMPI.
139     */
140    ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int subId, int keyType,
141    String callingPackage);
142
143    /**
144     * Stores the Carrier information used to encrypt IMSI and IMPI.
145     */
146    void setCarrierInfoForImsiEncryption(int subId, String callingPackage,
147    in ImsiEncryptionInfo imsiEncryptionInfo);
148
149    /**
150     * Resets the Carrier Keys in the database. This involves 2 steps:
151     *  1. Delete the keys from the database.
152     *  2. Send an intent to download new Certificates.
153     */
154    void resetCarrierKeysForImsiEncryption(int subId, String callingPackage);
155
156    /**
157     * Retrieves the alpha identifier associated with the voice mail number.
158     */
159    String getVoiceMailAlphaTag(String callingPackage);
160
161    /**
162     * Retrieves the alpha identifier associated with the voice mail number
163     * of a subId.
164     */
165    String getVoiceMailAlphaTagForSubscriber(int subId, String callingPackage);
166
167    /**
168     * Returns the IMS private user identity (IMPI) that was loaded from the ISIM.
169     * @return the IMPI, or null if not present or not loaded
170     */
171    String getIsimImpi(int subId);
172
173    /**
174     * Returns the IMS home network domain name that was loaded from the ISIM.
175     * @return the IMS domain name, or null if not present or not loaded
176     */
177    String getIsimDomain(int subId);
178
179    /**
180     * Returns the IMS public user identities (IMPU) that were loaded from the ISIM.
181     * @return an array of IMPU strings, with one IMPU per string, or null if
182     *      not present or not loaded
183     */
184    String[] getIsimImpu(int subId);
185
186    /**
187     * Returns the IMS Service Table (IST) that was loaded from the ISIM.
188     * @return IMS Service Table or null if not present or not loaded
189     */
190    String getIsimIst(int subId);
191
192    /**
193     * Returns the IMS Proxy Call Session Control Function(PCSCF) that were loaded from the ISIM.
194     * @return an array of PCSCF strings with one PCSCF per string, or null if
195     *      not present or not loaded
196     */
197    String[] getIsimPcscf(int subId);
198
199    /**
200     * Returns the response of the SIM application on the UICC to authentication
201     * challenge/response algorithm. The data string and challenge response are
202     * Base64 encoded Strings.
203     * Can support EAP-SIM, EAP-AKA with results encoded per 3GPP TS 31.102.
204     *
205     * @param subId subscription ID to be queried
206     * @param appType ICC application type (@see com.android.internal.telephony.PhoneConstants#APPTYPE_xxx)
207     * @param authType Authentication type, see PhoneConstants#AUTHTYPE_xxx
208     * @param data authentication challenge data
209     * @return challenge response
210     */
211    String getIccSimChallengeResponse(int subId, int appType, int authType, String data);
212}
213