diff options
author | Shishir Agrawal <shishir@google.com> | 2014-11-18 02:07:57 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-18 02:07:57 +0000 |
commit | b9b2aa2f19de547ad0804389e8e18dd20828ec86 (patch) | |
tree | a3a1c466355f96c87a9b7e69116ccc63a89182fe /telephony | |
parent | 98cfc9e36cf614abf2648188a123b7c481aa85c3 (diff) | |
parent | 2f74e913c85ccb405e4fe18a8f3c4c90153663a8 (diff) | |
download | frameworks_base-b9b2aa2f19de547ad0804389e8e18dd20828ec86.zip frameworks_base-b9b2aa2f19de547ad0804389e8e18dd20828ec86.tar.gz frameworks_base-b9b2aa2f19de547ad0804389e8e18dd20828ec86.tar.bz2 |
am 2f74e913: am c9f1b3a0: Merge "Add new API to set voicemail number." into lmp-mr1-dev
* commit '2f74e913c85ccb405e4fe18a8f3c4c90153663a8':
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 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(); |