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