summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2014-12-03 15:18:08 -0800
committerNancy Chen <nancychen@google.com>2014-12-04 14:28:21 -0800
commit8c066f7cc38a32ea6bd8138eb23eaeefcadd3b8a (patch)
tree65be065fe527cb1a90dea3f0bfc905c8bbd93a14 /telecomm
parent75f304f922dcb27e57dcbea17a36d426f6b223a7 (diff)
downloadframeworks_base-8c066f7cc38a32ea6bd8138eb23eaeefcadd3b8a.zip
frameworks_base-8c066f7cc38a32ea6bd8138eb23eaeefcadd3b8a.tar.gz
frameworks_base-8c066f7cc38a32ea6bd8138eb23eaeefcadd3b8a.tar.bz2
Use TelecomManager to call TelephonyManager#getVoicemailNumber (1/2)
Since we don't want the phone app to call TelephonyManager methods directly, create a method in TelecomManager to mimic the behavior. The reason we don't return the voicemail number directly is because once TelecomManager becomes public, we don't want any old app to be able to get the SIM's voicemail number. Bug: 18233678 Change-Id: I620af409788aea7b58169b72a563baeed8115080
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecom/TelecomManager.java20
-rw-r--r--telecomm/java/com/android/internal/telecom/ITelecomService.aidl5
2 files changed, 25 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java
index 2a3d7ab..6621726 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -732,6 +732,26 @@ public class TelecomManager {
}
/**
+ * Return whether a given phone account has a voicemail number configured.
+ *
+ * @param accountHandle The handle for the account to check for a voicemail number.
+ * @return {@code true} If the given phone account has a voicemail number.
+ *
+ * @hide
+ */
+ @SystemApi
+ public boolean hasVoiceMailNumber(PhoneAccountHandle accountHandle) {
+ try {
+ if (isServiceConnected()) {
+ return getTelecomService().hasVoiceMailNumber(accountHandle);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "RemoteException calling isInCall().", e);
+ }
+ return false;
+ }
+
+ /**
* Returns whether there is an ongoing phone call (can be in dialing, ringing, active or holding
* states).
* <p>
diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
index cbd9d69..f8d7539 100644
--- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
+++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
@@ -121,6 +121,11 @@ interface ITelecomService {
boolean isVoiceMailNumber(in PhoneAccountHandle accountHandle, String number);
/**
+ * @see TelecomServiceImpl#hasVoiceMailNumber
+ */
+ boolean hasVoiceMailNumber(in PhoneAccountHandle accountHandle);
+
+ /**
* @see TelecomServiceImpl#getDefaultPhoneApp
*/
ComponentName getDefaultPhoneApp();