* commit '2f74e913c85ccb405e4fe18a8f3c4c90153663a8': Add new API to set voicemail number.
This commit is contained in:
@@ -1972,6 +1972,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>
|
||||
|
||||
@@ -416,6 +416,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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user