summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorduckyoung.chai <duckyoung.chai@samsung.com>2011-09-15 16:12:51 +0900
committerWink Saville <wink@google.com>2011-09-15 11:10:12 -0700
commit80c32a37b63ceff885199e22a8505ac557c86d35 (patch)
tree2368f84ae17e5dcaa5c77371fff6d5a743d2e204 /telephony
parentcb995121ee4bb4da236e8181fbfbd33bc2f9173a (diff)
downloadframeworks_base-80c32a37b63ceff885199e22a8505ac557c86d35.zip
frameworks_base-80c32a37b63ceff885199e22a8505ac557c86d35.tar.gz
frameworks_base-80c32a37b63ceff885199e22a8505ac557c86d35.tar.bz2
[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>
Diffstat (limited to 'telephony')
-rwxr-xr-x[-rw-r--r--]telephony/java/android/telephony/TelephonyManager.java20
-rwxr-xr-x[-rw-r--r--]telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl5
-rwxr-xr-x[-rw-r--r--]telephony/java/com/android/internal/telephony/PhoneSubInfo.java8
-rwxr-xr-x[-rw-r--r--]telephony/java/com/android/internal/telephony/PhoneSubInfoProxy.java7
4 files changed, 40 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index c59dd3c..8ead45e 100644..100755
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -762,6 +762,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>
* Requires Permission:
diff --git a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
index def770f..da0326c 100644..100755
--- a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
+++ b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
@@ -54,6 +54,11 @@ interface IPhoneSubInfo {
String getLine1AlphaTag();
/**
+ * Retrieves MSISDN Number.
+ */
+ String getMsisdn();
+
+ /**
* Retrieves the voice mail number.
*/
String getVoiceMailNumber();
diff --git a/telephony/java/com/android/internal/telephony/PhoneSubInfo.java b/telephony/java/com/android/internal/telephony/PhoneSubInfo.java
index de18d0a..e8449ce 100644..100755
--- a/telephony/java/com/android/internal/telephony/PhoneSubInfo.java
+++ b/telephony/java/com/android/internal/telephony/PhoneSubInfo.java
@@ -105,6 +105,14 @@ public class PhoneSubInfo extends IPhoneSubInfo.Stub {
}
/**
+ * Retrieves the MSISDN string.
+ */
+ public String getMsisdn() {
+ mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
+ return mPhone.getMsisdn();
+ }
+
+ /**
* Retrieves the voice mail number.
*/
public String getVoiceMailNumber() {
diff --git a/telephony/java/com/android/internal/telephony/PhoneSubInfoProxy.java b/telephony/java/com/android/internal/telephony/PhoneSubInfoProxy.java
index a287b2e..bd130de 100644..100755
--- a/telephony/java/com/android/internal/telephony/PhoneSubInfoProxy.java
+++ b/telephony/java/com/android/internal/telephony/PhoneSubInfoProxy.java
@@ -75,6 +75,13 @@ public class PhoneSubInfoProxy extends IPhoneSubInfo.Stub {
}
/**
+ * Retrieves the MSISDN Number.
+ */
+ public String getMsisdn() {
+ return mPhoneSubInfo.getMsisdn();
+ }
+
+ /**
* Retrieves the voice mail number.
*/
public String getVoiceMailNumber() {