[toro] Add telephonyManager API ( getMsisdnNumber() ) for IMS Module.
IMS Module need the MSISDN value for IMS registration.(VZW Requirement) Change-Id: I8713b6c55788276246ee1c2f91eaf2d3ab8cc813 Signed-off-by: duckyoung.chai <duckyoung.chai@samsung.com>
This commit is contained in:
committed by
Wink Saville
parent
cb995121ee
commit
80c32a37b6
20
telephony/java/android/telephony/TelephonyManager.java
Normal file → Executable file
20
telephony/java/android/telephony/TelephonyManager.java
Normal file → Executable file
@@ -761,6 +761,26 @@ public class TelephonyManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the MSISDN string.
|
||||
* for a GSM phone. Return null if it is unavailable.
|
||||
* <p>
|
||||
* Requires Permission:
|
||||
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public String getMsisdn() {
|
||||
try {
|
||||
return getSubscriberInfo().getMsisdn();
|
||||
} catch (RemoteException ex) {
|
||||
return null;
|
||||
} catch (NullPointerException ex) {
|
||||
// This could happen before phone restarts due to crashing
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the voice mail number. Return null if it is unavailable.
|
||||
* <p>
|
||||
|
||||
5
telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
Normal file → Executable file
5
telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
Normal file → Executable file
@@ -53,6 +53,11 @@ interface IPhoneSubInfo {
|
||||
*/
|
||||
String getLine1AlphaTag();
|
||||
|
||||
/**
|
||||
* Retrieves MSISDN Number.
|
||||
*/
|
||||
String getMsisdn();
|
||||
|
||||
/**
|
||||
* Retrieves the voice mail number.
|
||||
*/
|
||||
|
||||
8
telephony/java/com/android/internal/telephony/PhoneSubInfo.java
Normal file → Executable file
8
telephony/java/com/android/internal/telephony/PhoneSubInfo.java
Normal file → Executable file
@@ -104,6 +104,14 @@ public class PhoneSubInfo extends IPhoneSubInfo.Stub {
|
||||
return (String) mPhone.getLine1AlphaTag();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the MSISDN string.
|
||||
*/
|
||||
public String getMsisdn() {
|
||||
mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
|
||||
return mPhone.getMsisdn();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the voice mail number.
|
||||
*/
|
||||
|
||||
7
telephony/java/com/android/internal/telephony/PhoneSubInfoProxy.java
Normal file → Executable file
7
telephony/java/com/android/internal/telephony/PhoneSubInfoProxy.java
Normal file → Executable file
@@ -74,6 +74,13 @@ public class PhoneSubInfoProxy extends IPhoneSubInfo.Stub {
|
||||
return mPhoneSubInfo.getLine1AlphaTag();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the MSISDN Number.
|
||||
*/
|
||||
public String getMsisdn() {
|
||||
return mPhoneSubInfo.getMsisdn();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the voice mail number.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user