diff options
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | api/system-current.txt | 2 | ||||
| -rw-r--r-- | api/test-current.txt | 2 | ||||
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 41 | ||||
| -rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 23 |
5 files changed, 69 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt index 90c023d3938e..aa45cf16f001 100644 --- a/api/current.txt +++ b/api/current.txt @@ -36036,6 +36036,7 @@ package android.telephony { method public java.lang.String getSubscriberId(); method public java.lang.String getVoiceMailAlphaTag(); method public java.lang.String getVoiceMailNumber(); + method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle); method public boolean hasCarrierPrivileges(); method public boolean hasIccCard(); method public boolean iccCloseLogicalChannel(int); @@ -36048,6 +36049,7 @@ package android.telephony { method public boolean isSmsCapable(); method public boolean isTtyModeSupported(); method public boolean isVoiceCapable(); + method public boolean isVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle); method public boolean isWorldPhone(); method public void listen(android.telephony.PhoneStateListener, int); method public java.lang.String sendEnvelopeWithStatus(java.lang.String); diff --git a/api/system-current.txt b/api/system-current.txt index 780f85344827..c1d99a9aaaa9 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -38343,6 +38343,7 @@ package android.telephony { method public java.lang.String getSubscriberId(); method public java.lang.String getVoiceMailAlphaTag(); method public java.lang.String getVoiceMailNumber(); + method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle); method public boolean handlePinMmi(java.lang.String); method public boolean handlePinMmiForSubscriber(int, java.lang.String); method public boolean hasCarrierPrivileges(); @@ -38364,6 +38365,7 @@ package android.telephony { method public boolean isTtyModeSupported(); method public boolean isVideoCallingEnabled(); method public boolean isVoiceCapable(); + method public boolean isVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle); method public boolean isWorldPhone(); method public void listen(android.telephony.PhoneStateListener, int); method public boolean needsOtaServiceProvisioning(); diff --git a/api/test-current.txt b/api/test-current.txt index c0de124bd8ae..8c4d17a539b5 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -36039,6 +36039,7 @@ package android.telephony { method public java.lang.String getSubscriberId(); method public java.lang.String getVoiceMailAlphaTag(); method public java.lang.String getVoiceMailNumber(); + method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle); method public boolean hasCarrierPrivileges(); method public boolean hasIccCard(); method public boolean iccCloseLogicalChannel(int); @@ -36051,6 +36052,7 @@ package android.telephony { method public boolean isSmsCapable(); method public boolean isTtyModeSupported(); method public boolean isVoiceCapable(); + method public boolean isVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle); method public boolean isWorldPhone(); method public void listen(android.telephony.PhoneStateListener, int); method public java.lang.String sendEnvelopeWithStatus(java.lang.String); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 0b5aaa3b273b..913cb18c6ab7 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -24,6 +24,7 @@ import android.app.ActivityThread; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; +import android.net.Uri; import android.provider.Settings; import android.provider.Settings.SettingNotFoundException; import android.os.Bundle; @@ -31,6 +32,7 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemProperties; import android.telecom.PhoneAccount; +import android.telecom.PhoneAccountHandle; import android.util.Log; import com.android.internal.telecom.ITelecomService; @@ -4865,4 +4867,43 @@ public class TelephonyManager { } return null; } + + /** + * Returns the URI for the per-account voicemail ringtone set in Phone settings. + * + * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the + * voicemail ringtone. + * @return The URI for the ringtone to play when receiving a voicemail from a specific + * PhoneAccount. + */ + public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) { + try { + ITelephony service = getITelephony(); + if (service != null) { + return service.getVoicemailRingtoneUri(accountHandle); + } + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#getVoicemailRingtoneUri", e); + } + return null; + } + + /** + * Returns whether vibration is set for voicemail notification in Phone settings. + * + * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the + * voicemail vibration setting. + * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise. + */ + public boolean isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle) { + try { + ITelephony service = getITelephony(); + if (service != null) { + return service.isVoicemailVibrationEnabled(accountHandle); + } + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#isVoicemailVibrationEnabled", e); + } + return false; + } } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 8172e94c9c90..d1badc9e7f33 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -18,7 +18,9 @@ package com.android.internal.telephony; import android.content.Intent; import android.os.Bundle; +import android.net.Uri; import android.telecom.PhoneAccount; +import android.telecom.PhoneAccountHandle; import android.telephony.CellInfo; import android.telephony.IccOpenLogicalChannelResponse; import android.telephony.ModemActivityInfo; @@ -966,7 +968,7 @@ interface ITelephony { * Returns the Status of Wi-Fi Calling */ boolean isWifiCallingAvailable(); - + /** * Returns the Status of Volte */ @@ -1014,4 +1016,23 @@ interface ITelephony { * @return Service state on specified subscription. */ ServiceState getServiceStateForSubscriber(int subId, String callingPackage); + + /** + * Returns the URI for the per-account voicemail ringtone set in Phone settings. + * + * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the + * voicemail ringtone. + * @return The URI for the ringtone to play when receiving a voicemail from a specific + * PhoneAccount. + */ + Uri getVoicemailRingtoneUri(in PhoneAccountHandle accountHandle); + + /** + * Returns whether vibration is set for voicemail notification in Phone settings. + * + * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the + * voicemail vibration setting. + * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise. + */ + boolean isVoicemailVibrationEnabled(in PhoneAccountHandle accountHandle); } |