Loading core/res/AndroidManifest.xml +6 −0 Original line number Original line Diff line number Diff line Loading @@ -582,6 +582,12 @@ android:label="@string/permlab_readPhoneState" android:label="@string/permlab_readPhoneState" android:description="@string/permdesc_readPhoneState" /> android:description="@string/permdesc_readPhoneState" /> <!-- Allows read access to privileged phone state. @hide Used internally. --> <permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" android:permissionGroup="android.permission-group.PHONE_CALLS" android:protectionLevel="signatureOrSystem" /> <!-- ================================== --> <!-- ================================== --> <!-- Permissions for sdcard interaction --> <!-- Permissions for sdcard interaction --> <!-- ================================== --> <!-- ================================== --> Loading telephony/java/android/telephony/TelephonyManager.java +49 −0 Original line number Original line Diff line number Diff line Loading @@ -832,6 +832,55 @@ public class TelephonyManager { } } } } /** * Returns the IMS private user identity (IMPI) that was loaded from the ISIM. * @return the IMPI, or null if not present or not loaded * @hide */ public String getIsimImpi() { try { return getSubscriberInfo().getIsimImpi(); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } /** * Returns the IMS home network domain name that was loaded from the ISIM. * @return the IMS domain name, or null if not present or not loaded * @hide */ public String getIsimDomain() { try { return getSubscriberInfo().getIsimDomain(); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } /** * Returns the IMS public user identities (IMPU) that were loaded from the ISIM. * @return an array of IMPU strings, with one IMPU per string, or null if * not present or not loaded * @hide */ public String[] getIsimImpu() { try { return getSubscriberInfo().getIsimImpu(); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } private IPhoneSubInfo getSubscriberInfo() { private IPhoneSubInfo getSubscriberInfo() { // get it each time because that process crashes a lot // get it each time because that process crashes a lot return IPhoneSubInfo.Stub.asInterface(ServiceManager.getService("iphonesubinfo")); return IPhoneSubInfo.Stub.asInterface(ServiceManager.getService("iphonesubinfo")); Loading telephony/java/com/android/internal/telephony/CommandsInterface.java +13 −6 Original line number Original line Diff line number Diff line Loading @@ -1489,11 +1489,8 @@ public interface CommandsInterface { /** /** * Setup a packet data connection On successful completion, the result * Setup a packet data connection On successful completion, the result * message will return the following: [0] indicating PDP CID, which is * message will return a {@link DataCallState} object containing the connection * generated by RIL. This Connection ID is used in both GSM/UMTS and CDMA * information. * modes [1] indicating the network interface name for GSM/UMTS or CDMA [2] * indicating the IP address for this interface for GSM/UMTS and NULL in the * case of CDMA * * * @param radioTechnology * @param radioTechnology * indicates whether to setup connection on radio technology CDMA * indicates whether to setup connection on radio technology CDMA Loading Loading @@ -1569,7 +1566,7 @@ public interface CommandsInterface { /** /** * Request the status of the ICC and UICC cards. * Request the status of the ICC and UICC cards. * * * @param response * @param result * Callback message containing {@link IccCardStatus} structure for the card. * Callback message containing {@link IccCardStatus} structure for the card. */ */ public void getIccCardStatus(Message result); public void getIccCardStatus(Message result); Loading @@ -1583,4 +1580,14 @@ public interface CommandsInterface { * or {@link Phone#LTE_ON_CDMA_TRUE} * or {@link Phone#LTE_ON_CDMA_TRUE} */ */ public int getLteOnCdmaMode(); public int getLteOnCdmaMode(); /** * Request the ISIM application on the UICC to perform the AKA * challenge/response algorithm for IMS authentication. The nonce string * and challenge response are Base64 encoded Strings. * * @param nonce the nonce string to pass with the ISIM authentication request * @param response a callback message with the String response in the obj field */ public void requestIsimAuthentication(String nonce, Message response); } } telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl +19 −0 Original line number Original line Diff line number Diff line Loading @@ -67,4 +67,23 @@ interface IPhoneSubInfo { * Retrieves the alpha identifier associated with the voice mail number. * Retrieves the alpha identifier associated with the voice mail number. */ */ String getVoiceMailAlphaTag(); String getVoiceMailAlphaTag(); /** * Returns the IMS private user identity (IMPI) that was loaded from the ISIM. * @return the IMPI, or null if not present or not loaded */ String getIsimImpi(); /** * Returns the IMS home network domain name that was loaded from the ISIM. * @return the IMS domain name, or null if not present or not loaded */ String getIsimDomain(); /** * Returns the IMS public user identities (IMPU) that were loaded from the ISIM. * @return an array of IMPU strings, with one IMPU per string, or null if * not present or not loaded */ String[] getIsimImpu(); } } telephony/java/com/android/internal/telephony/IccRecords.java +61 −1 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,8 @@ import android.os.Message; import android.os.Registrant; import android.os.Registrant; import android.os.RegistrantList; import android.os.RegistrantList; import com.android.internal.telephony.ims.IsimRecords; /** /** * {@hide} * {@hide} */ */ Loading Loading @@ -70,6 +72,24 @@ public abstract class IccRecords extends Handler implements IccConstants { // ***** Event Constants // ***** Event Constants protected static final int EVENT_SET_MSISDN_DONE = 30; protected static final int EVENT_SET_MSISDN_DONE = 30; public static final int EVENT_GET_ICC_RECORD_DONE = 100; /** * Generic ICC record loaded callback. Subclasses can call EF load methods on * {@link IccFileHandler} passing a Message for onLoaded with the what field set to * {@link #EVENT_GET_ICC_RECORD_DONE} and the obj field set to an instance * of this interface. The {@link #handleMessage} method in this class will print a * log message using {@link #getEfName()} and decrement {@link #recordsToLoad}. * * If the record load was successful, {@link #onRecordLoaded} will be called with the result. * Otherwise, an error log message will be output by {@link #handleMessage} and * {@link #onRecordLoaded} will not be called. */ public interface IccRecordLoaded { String getEfName(); void onRecordLoaded(AsyncResult ar); } // ***** Constructor // ***** Constructor public IccRecords(PhoneBase p) { public IccRecords(PhoneBase p) { Loading Loading @@ -234,7 +254,32 @@ public abstract class IccRecords extends Handler implements IccConstants { //***** Overridden from Handler //***** Overridden from Handler @Override @Override public abstract void handleMessage(Message msg); public void handleMessage(Message msg) { switch (msg.what) { case EVENT_GET_ICC_RECORD_DONE: try { AsyncResult ar = (AsyncResult) msg.obj; IccRecordLoaded recordLoaded = (IccRecordLoaded) ar.userObj; if (DBG) log(recordLoaded.getEfName() + " LOADED"); if (ar.exception != null) { loge("Record Load Exception: " + ar.exception); } else { recordLoaded.onRecordLoaded(ar); } }catch (RuntimeException exc) { // I don't want these exceptions to be fatal loge("Exception parsing SIM record: " + exc); } finally { // Count up record load responses even if they are fails onRecordLoaded(); } break; default: super.handleMessage(msg); } } protected abstract void onRecordLoaded(); protected abstract void onRecordLoaded(); Loading Loading @@ -303,4 +348,19 @@ public abstract class IccRecords extends Handler implements IccConstants { * @param s is the string to write * @param s is the string to write */ */ protected abstract void log(String s); protected abstract void log(String s); /** * Write error string to log file. * * @param s is the string to write */ protected abstract void loge(String s); /** * Return an interface to retrieve the ISIM records for IMS, if available. * @return the interface to retrieve the ISIM records, or null if not supported */ public IsimRecords getIsimRecords() { return null; } } } Loading
core/res/AndroidManifest.xml +6 −0 Original line number Original line Diff line number Diff line Loading @@ -582,6 +582,12 @@ android:label="@string/permlab_readPhoneState" android:label="@string/permlab_readPhoneState" android:description="@string/permdesc_readPhoneState" /> android:description="@string/permdesc_readPhoneState" /> <!-- Allows read access to privileged phone state. @hide Used internally. --> <permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" android:permissionGroup="android.permission-group.PHONE_CALLS" android:protectionLevel="signatureOrSystem" /> <!-- ================================== --> <!-- ================================== --> <!-- Permissions for sdcard interaction --> <!-- Permissions for sdcard interaction --> <!-- ================================== --> <!-- ================================== --> Loading
telephony/java/android/telephony/TelephonyManager.java +49 −0 Original line number Original line Diff line number Diff line Loading @@ -832,6 +832,55 @@ public class TelephonyManager { } } } } /** * Returns the IMS private user identity (IMPI) that was loaded from the ISIM. * @return the IMPI, or null if not present or not loaded * @hide */ public String getIsimImpi() { try { return getSubscriberInfo().getIsimImpi(); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } /** * Returns the IMS home network domain name that was loaded from the ISIM. * @return the IMS domain name, or null if not present or not loaded * @hide */ public String getIsimDomain() { try { return getSubscriberInfo().getIsimDomain(); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } /** * Returns the IMS public user identities (IMPU) that were loaded from the ISIM. * @return an array of IMPU strings, with one IMPU per string, or null if * not present or not loaded * @hide */ public String[] getIsimImpu() { try { return getSubscriberInfo().getIsimImpu(); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } private IPhoneSubInfo getSubscriberInfo() { private IPhoneSubInfo getSubscriberInfo() { // get it each time because that process crashes a lot // get it each time because that process crashes a lot return IPhoneSubInfo.Stub.asInterface(ServiceManager.getService("iphonesubinfo")); return IPhoneSubInfo.Stub.asInterface(ServiceManager.getService("iphonesubinfo")); Loading
telephony/java/com/android/internal/telephony/CommandsInterface.java +13 −6 Original line number Original line Diff line number Diff line Loading @@ -1489,11 +1489,8 @@ public interface CommandsInterface { /** /** * Setup a packet data connection On successful completion, the result * Setup a packet data connection On successful completion, the result * message will return the following: [0] indicating PDP CID, which is * message will return a {@link DataCallState} object containing the connection * generated by RIL. This Connection ID is used in both GSM/UMTS and CDMA * information. * modes [1] indicating the network interface name for GSM/UMTS or CDMA [2] * indicating the IP address for this interface for GSM/UMTS and NULL in the * case of CDMA * * * @param radioTechnology * @param radioTechnology * indicates whether to setup connection on radio technology CDMA * indicates whether to setup connection on radio technology CDMA Loading Loading @@ -1569,7 +1566,7 @@ public interface CommandsInterface { /** /** * Request the status of the ICC and UICC cards. * Request the status of the ICC and UICC cards. * * * @param response * @param result * Callback message containing {@link IccCardStatus} structure for the card. * Callback message containing {@link IccCardStatus} structure for the card. */ */ public void getIccCardStatus(Message result); public void getIccCardStatus(Message result); Loading @@ -1583,4 +1580,14 @@ public interface CommandsInterface { * or {@link Phone#LTE_ON_CDMA_TRUE} * or {@link Phone#LTE_ON_CDMA_TRUE} */ */ public int getLteOnCdmaMode(); public int getLteOnCdmaMode(); /** * Request the ISIM application on the UICC to perform the AKA * challenge/response algorithm for IMS authentication. The nonce string * and challenge response are Base64 encoded Strings. * * @param nonce the nonce string to pass with the ISIM authentication request * @param response a callback message with the String response in the obj field */ public void requestIsimAuthentication(String nonce, Message response); } }
telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl +19 −0 Original line number Original line Diff line number Diff line Loading @@ -67,4 +67,23 @@ interface IPhoneSubInfo { * Retrieves the alpha identifier associated with the voice mail number. * Retrieves the alpha identifier associated with the voice mail number. */ */ String getVoiceMailAlphaTag(); String getVoiceMailAlphaTag(); /** * Returns the IMS private user identity (IMPI) that was loaded from the ISIM. * @return the IMPI, or null if not present or not loaded */ String getIsimImpi(); /** * Returns the IMS home network domain name that was loaded from the ISIM. * @return the IMS domain name, or null if not present or not loaded */ String getIsimDomain(); /** * Returns the IMS public user identities (IMPU) that were loaded from the ISIM. * @return an array of IMPU strings, with one IMPU per string, or null if * not present or not loaded */ String[] getIsimImpu(); } }
telephony/java/com/android/internal/telephony/IccRecords.java +61 −1 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,8 @@ import android.os.Message; import android.os.Registrant; import android.os.Registrant; import android.os.RegistrantList; import android.os.RegistrantList; import com.android.internal.telephony.ims.IsimRecords; /** /** * {@hide} * {@hide} */ */ Loading Loading @@ -70,6 +72,24 @@ public abstract class IccRecords extends Handler implements IccConstants { // ***** Event Constants // ***** Event Constants protected static final int EVENT_SET_MSISDN_DONE = 30; protected static final int EVENT_SET_MSISDN_DONE = 30; public static final int EVENT_GET_ICC_RECORD_DONE = 100; /** * Generic ICC record loaded callback. Subclasses can call EF load methods on * {@link IccFileHandler} passing a Message for onLoaded with the what field set to * {@link #EVENT_GET_ICC_RECORD_DONE} and the obj field set to an instance * of this interface. The {@link #handleMessage} method in this class will print a * log message using {@link #getEfName()} and decrement {@link #recordsToLoad}. * * If the record load was successful, {@link #onRecordLoaded} will be called with the result. * Otherwise, an error log message will be output by {@link #handleMessage} and * {@link #onRecordLoaded} will not be called. */ public interface IccRecordLoaded { String getEfName(); void onRecordLoaded(AsyncResult ar); } // ***** Constructor // ***** Constructor public IccRecords(PhoneBase p) { public IccRecords(PhoneBase p) { Loading Loading @@ -234,7 +254,32 @@ public abstract class IccRecords extends Handler implements IccConstants { //***** Overridden from Handler //***** Overridden from Handler @Override @Override public abstract void handleMessage(Message msg); public void handleMessage(Message msg) { switch (msg.what) { case EVENT_GET_ICC_RECORD_DONE: try { AsyncResult ar = (AsyncResult) msg.obj; IccRecordLoaded recordLoaded = (IccRecordLoaded) ar.userObj; if (DBG) log(recordLoaded.getEfName() + " LOADED"); if (ar.exception != null) { loge("Record Load Exception: " + ar.exception); } else { recordLoaded.onRecordLoaded(ar); } }catch (RuntimeException exc) { // I don't want these exceptions to be fatal loge("Exception parsing SIM record: " + exc); } finally { // Count up record load responses even if they are fails onRecordLoaded(); } break; default: super.handleMessage(msg); } } protected abstract void onRecordLoaded(); protected abstract void onRecordLoaded(); Loading Loading @@ -303,4 +348,19 @@ public abstract class IccRecords extends Handler implements IccConstants { * @param s is the string to write * @param s is the string to write */ */ protected abstract void log(String s); protected abstract void log(String s); /** * Write error string to log file. * * @param s is the string to write */ protected abstract void loge(String s); /** * Return an interface to retrieve the ISIM records for IMS, if available. * @return the interface to retrieve the ISIM records, or null if not supported */ public IsimRecords getIsimRecords() { return null; } } }