From c2ea695927a5866cea732ea784a8ee4473b8ba19 Mon Sep 17 00:00:00 2001 From: twyen Date: Mon, 6 Nov 2017 16:56:11 -0800 Subject: Unify voicemail call placing All voicemails are called by using CallIntentBuilder.forVoicemail() so the PhoneAccountHandle can be designated. A future CL will use dialogs to customize the call (multi SIM selection, RTT, etc.) As a result voicemail error messages and legacy voicemail notifications will call the account it is received from directly. Bug: 64216442 Test: Unit tests PiperOrigin-RevId: 174784322 Change-Id: Ibe1c57bc7852e3d55a39a0cc2da19b6a79954c0f --- java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'java/com/android/voicemail/impl') diff --git a/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java b/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java index d55e3b5ae..2f8dc7ad8 100644 --- a/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java +++ b/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java @@ -20,14 +20,14 @@ import android.annotation.TargetApi; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; -import android.net.Uri; import android.os.Build.VERSION_CODES; import android.os.Bundle; import android.support.annotation.Nullable; -import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telephony.TelephonyManager; import android.telephony.VisualVoicemailSms; +import com.android.dialer.callintent.CallInitiationType; +import com.android.dialer.callintent.CallIntentBuilder; import com.android.voicemail.VoicemailClient; import com.android.voicemail.impl.OmtpConstants; import com.android.voicemail.impl.OmtpVvmCarrierConfigHelper; @@ -94,8 +94,9 @@ public class LegacyModeSmsHandler { PendingIntent.getActivity( context, CALL_VOICEMAIL_REQUEST_CODE, - new Intent( - Intent.ACTION_CALL, Uri.fromParts(PhoneAccount.SCHEME_VOICEMAIL, "", null)), + CallIntentBuilder.forVoicemail( + phoneAccountHandle, CallInitiationType.Type.LEGACY_VOICEMAIL_NOTIFICATION) + .build(), PendingIntent.FLAG_UPDATE_CURRENT); } else { Intent launchVoicemailSettingsIntent = -- cgit v1.2.3