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