diff options
| author | 2014-10-15 23:41:52 +0000 | |
|---|---|---|
| committer | 2014-10-15 23:41:54 +0000 | |
| commit | 36eaa8690da761a4218a790e18858e4319ffa8d0 (patch) | |
| tree | 6816fc6a574bfdd9c3cfc82ce9e3791b1c787ca4 | |
| parent | 8bda5cedb750912afec65940a53f4ba4ed31ec17 (diff) | |
| parent | 6bb21401a4e7c8d1ed4f60a5b1572ce78b5311f6 (diff) | |
Merge "Sprint: MMS proxy authorization does not include NAI" into lmp-mr1-dev
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 26 | ||||
| -rw-r--r-- | telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl | 5 |
2 files changed, 31 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 7173637b8543..d3cef4a1c88e 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -669,6 +669,32 @@ public class TelephonyManager { } /** + * Returns the NAI. Return null if NAI is not available. + * + */ + /** {@hide}*/ + public String getNai() { + return getNai(getDefaultSim()); + } + + /** + * Returns the NAI. Return null if NAI is not available. + * + * @param slotId of which Nai is returned + */ + /** {@hide}*/ + public String getNai(int slotId) { + long[] subId = SubscriptionManager.getSubId(slotId); + try { + return getSubscriberInfo().getNaiForSubscriber(subId[0]); + } catch (RemoteException ex) { + return null; + } catch (NullPointerException ex) { + return null; + } + } + + /** * Returns the current location of the device. *<p> * If there is only one radio in the device and that radio has an LTE connection, diff --git a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl index d7062034c6c6..98fd70caf120 100644 --- a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl +++ b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl @@ -27,6 +27,11 @@ interface IPhoneSubInfo { */ String getDeviceId(); + /** + * Retrieves the unique Network Access ID + */ + String getNaiForSubscriber(long subId); + /** * Retrieves the unique device ID of a subId for the device, e.g., IMEI * for GSM phones. |