diff options
author | Shishir Agrawal <shishir@google.com> | 2014-11-17 23:52:48 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-17 23:52:48 +0000 |
commit | 2f74e913c85ccb405e4fe18a8f3c4c90153663a8 (patch) | |
tree | 8f80b05e76bcab3e9056d3723a462d3a83d7379f /telephony | |
parent | fc7ebb934ea83c9124797928d0061bda5f89df4f (diff) | |
parent | c9f1b3a0e8f64ae75f71e363c612b8734031b1b2 (diff) | |
download | frameworks_base-2f74e913c85ccb405e4fe18a8f3c4c90153663a8.zip frameworks_base-2f74e913c85ccb405e4fe18a8f3c4c90153663a8.tar.gz frameworks_base-2f74e913c85ccb405e4fe18a8f3c4c90153663a8.tar.bz2 |
am c9f1b3a0: Merge "Add new API to set voicemail number." into lmp-mr1-dev
* commit 'c9f1b3a0e8f64ae75f71e363c612b8734031b1b2':
Add new API to set voicemail number.
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 35 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 5 |
2 files changed, 40 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index b06d44c..f2d859f 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(); |