Skip to content

Commit 80c32a3

Browse files
duckyoung.chaiWink Saville
authored andcommitted
[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>
1 parent cb99512 commit 80c32a3

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

telephony/java/android/telephony/TelephonyManager.java

100644100755
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,26 @@ public String getLine1AlphaTag() {
761761
}
762762
}
763763

764+
/**
765+
* Returns the MSISDN string.
766+
* for a GSM phone. Return null if it is unavailable.
767+
* <p>
768+
* Requires Permission:
769+
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
770+
*
771+
* @hide
772+
*/
773+
public String getMsisdn() {
774+
try {
775+
return getSubscriberInfo().getMsisdn();
776+
} catch (RemoteException ex) {
777+
return null;
778+
} catch (NullPointerException ex) {
779+
// This could happen before phone restarts due to crashing
780+
return null;
781+
}
782+
}
783+
764784
/**
765785
* Returns the voice mail number. Return null if it is unavailable.
766786
* <p>

telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl

100644100755
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ interface IPhoneSubInfo {
5353
*/
5454
String getLine1AlphaTag();
5555

56+
/**
57+
* Retrieves MSISDN Number.
58+
*/
59+
String getMsisdn();
60+
5661
/**
5762
* Retrieves the voice mail number.
5863
*/

telephony/java/com/android/internal/telephony/PhoneSubInfo.java

100644100755
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ public String getLine1AlphaTag() {
104104
return (String) mPhone.getLine1AlphaTag();
105105
}
106106

107+
/**
108+
* Retrieves the MSISDN string.
109+
*/
110+
public String getMsisdn() {
111+
mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
112+
return mPhone.getMsisdn();
113+
}
114+
107115
/**
108116
* Retrieves the voice mail number.
109117
*/

telephony/java/com/android/internal/telephony/PhoneSubInfoProxy.java

100644100755
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ public String getLine1AlphaTag() {
7474
return mPhoneSubInfo.getLine1AlphaTag();
7575
}
7676

77+
/**
78+
* Retrieves the MSISDN Number.
79+
*/
80+
public String getMsisdn() {
81+
return mPhoneSubInfo.getMsisdn();
82+
}
83+
7784
/**
7885
* Retrieves the voice mail number.
7986
*/

0 commit comments

Comments
 (0)