summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java35
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl5
2 files changed, 40 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index c7c8b30..b0a5999 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -1973,6 +1973,41 @@ public class TelephonyManager {
}
/**
+ * Sets the voice mail number.
+ * <p>
+ * Requires Permission:
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
+ * Or the calling app has carrier privileges. @see #hasCarrierPrivileges
+ *
+ * @param alphaTag The alpha tag to display.
+ * @param number The voicemail number.
+ */
+ public boolean setVoiceMailNumber(String alphaTag, String number) {
+ return setVoiceMailNumber(getDefaultSubscription(), alphaTag, number);
+ }
+
+ /**
+ * Sets the voicemail number for the given subscriber.
+ * <p>
+ * Requires Permission:
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
+ * Or the calling app has carrier privileges. @see #hasCarrierPrivileges
+ *
+ * @param subId The subscriber id.
+ * @param alphaTag The alpha tag to display.
+ * @param number The voicemail number.
+ */
+ /** {@hide} */
+ public boolean setVoiceMailNumber(int subId, String alphaTag, String number) {
+ try {
+ return getITelephony().setVoiceMailNumber(subId, alphaTag, number);
+ } catch (RemoteException ex) {
+ } catch (NullPointerException ex) {
+ }
+ return false;
+ }
+
+ /**
* Returns the voice mail count. Return 0 if unavailable.
* <p>
* Requires Permission:
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index c50261d..cbfa9f6 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -417,6 +417,11 @@ interface ITelephony {
boolean needsOtaServiceProvisioning();
/**
+ * Sets the voicemail number for a particular subscriber.
+ */
+ boolean setVoiceMailNumber(int subId, String alphaTag, String number);
+
+ /**
* Returns the unread count of voicemails
*/
int getVoiceMessageCount();