Merge "Add setVoicemailRingtoneUri() and setVoicemailVibrationEnabled()"
This commit is contained in:
committed by
Android (Google) Code Review
commit
cef08d66b3
@@ -39333,6 +39333,8 @@ package android.telephony {
|
||||
method public boolean setOperatorBrandOverride(java.lang.String);
|
||||
method public boolean setPreferredNetworkTypeToGlobal();
|
||||
method public boolean setVoiceMailNumber(java.lang.String, java.lang.String);
|
||||
method public void setVoicemailRingtoneUri(android.telecom.PhoneAccountHandle, android.net.Uri);
|
||||
method public void setVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle, boolean);
|
||||
field public static final java.lang.String ACTION_CONFIGURE_VOICEMAIL = "android.telephony.action.CONFIGURE_VOICEMAIL";
|
||||
field public static final java.lang.String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE";
|
||||
field public static final java.lang.String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE";
|
||||
|
||||
@@ -42734,6 +42734,8 @@ package android.telephony {
|
||||
method public boolean setRadioPower(boolean);
|
||||
method public void setVisualVoicemailEnabled(android.telecom.PhoneAccountHandle, boolean);
|
||||
method public boolean setVoiceMailNumber(java.lang.String, java.lang.String);
|
||||
method public void setVoicemailRingtoneUri(android.telecom.PhoneAccountHandle, android.net.Uri);
|
||||
method public void setVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle, boolean);
|
||||
method public void silenceRinger();
|
||||
method public boolean supplyPin(java.lang.String);
|
||||
method public int[] supplyPinReportResult(java.lang.String);
|
||||
|
||||
@@ -39471,6 +39471,8 @@ package android.telephony {
|
||||
method public boolean setOperatorBrandOverride(java.lang.String);
|
||||
method public boolean setPreferredNetworkTypeToGlobal();
|
||||
method public boolean setVoiceMailNumber(java.lang.String, java.lang.String);
|
||||
method public void setVoicemailRingtoneUri(android.telecom.PhoneAccountHandle, android.net.Uri);
|
||||
method public void setVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle, boolean);
|
||||
field public static final java.lang.String ACTION_CONFIGURE_VOICEMAIL = "android.telephony.action.CONFIGURE_VOICEMAIL";
|
||||
field public static final java.lang.String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE";
|
||||
field public static final java.lang.String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE";
|
||||
|
||||
@@ -5906,6 +5906,29 @@ public class TelephonyManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the per-account voicemail ringtone.
|
||||
*
|
||||
* <p>Requires that the calling app is the default dialer, or has carrier privileges, or has
|
||||
* permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
|
||||
*
|
||||
* @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
|
||||
* voicemail ringtone.
|
||||
* @param uri The URI for the ringtone to play when receiving a voicemail from a specific
|
||||
* PhoneAccount.
|
||||
* @see #hasCarrierPrivileges
|
||||
*/
|
||||
public void setVoicemailRingtoneUri(PhoneAccountHandle phoneAccountHandle, Uri uri) {
|
||||
try {
|
||||
ITelephony service = getITelephony();
|
||||
if (service != null) {
|
||||
service.setVoicemailRingtoneUri(getOpPackageName(), phoneAccountHandle, uri);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Error calling ITelephony#setVoicemailRingtoneUri", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether vibration is set for voicemail notification in Phone settings.
|
||||
*
|
||||
@@ -5925,6 +5948,31 @@ public class TelephonyManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the per-account preference whether vibration is enabled for voicemail notifications.
|
||||
*
|
||||
* <p>Requires that the calling app is the default dialer, or has carrier privileges, or has
|
||||
* permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
|
||||
*
|
||||
* @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
|
||||
* voicemail vibration setting.
|
||||
* @param enabled Whether to enable or disable vibration for voicemail notifications from a
|
||||
* specific PhoneAccount.
|
||||
* @see #hasCarrierPrivileges
|
||||
*/
|
||||
public void setVoicemailVibrationEnabled(PhoneAccountHandle phoneAccountHandle,
|
||||
boolean enabled) {
|
||||
try {
|
||||
ITelephony service = getITelephony();
|
||||
if (service != null) {
|
||||
service.setVoicemailVibrationEnabled(getOpPackageName(), phoneAccountHandle,
|
||||
enabled);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Error calling ITelephony#isVoicemailVibrationEnabled", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the application ID for the app type like {@link APPTYPE_CSIM}.
|
||||
*
|
||||
|
||||
@@ -1145,6 +1145,20 @@ interface ITelephony {
|
||||
*/
|
||||
Uri getVoicemailRingtoneUri(in PhoneAccountHandle accountHandle);
|
||||
|
||||
/**
|
||||
* Sets the per-account voicemail ringtone.
|
||||
*
|
||||
* <p>Requires that the calling app is the default dialer, or has carrier privileges, or
|
||||
* has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
|
||||
*
|
||||
* @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
|
||||
* voicemail ringtone.
|
||||
* @param uri The URI for the ringtone to play when receiving a voicemail from a specific
|
||||
* PhoneAccount.
|
||||
*/
|
||||
void setVoicemailRingtoneUri(String callingPackage,
|
||||
in PhoneAccountHandle phoneAccountHandle, in Uri uri);
|
||||
|
||||
/**
|
||||
* Returns whether vibration is set for voicemail notification in Phone settings.
|
||||
*
|
||||
@@ -1154,6 +1168,20 @@ interface ITelephony {
|
||||
*/
|
||||
boolean isVoicemailVibrationEnabled(in PhoneAccountHandle accountHandle);
|
||||
|
||||
/**
|
||||
* Sets the per-account preference whether vibration is enabled for voicemail notifications.
|
||||
*
|
||||
* <p>Requires that the calling app is the default dialer, or has carrier privileges, or
|
||||
* has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
|
||||
*
|
||||
* @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
|
||||
* voicemail vibration setting.
|
||||
* @param enabled Whether to enable or disable vibration for voicemail notifications from a
|
||||
* specific PhoneAccount.
|
||||
*/
|
||||
void setVoicemailVibrationEnabled(String callingPackage,
|
||||
in PhoneAccountHandle phoneAccountHandle, boolean enabled);
|
||||
|
||||
/**
|
||||
* Returns a list of packages that have carrier privileges.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user