From bf900241b71a4a594ce989bf0d18ada1d5fadb56 Mon Sep 17 00:00:00 2001 From: twyen Date: Fri, 8 Sep 2017 11:10:16 -0700 Subject: Send PhoneAccountHandle with ACTION_CONFIGURE_VOICEMAIL When opening a voicemail setting from Dialer with ACTION_CONFIGURE_VOICEMAIL, no subId is passed. So on a multi-SIM device, it is always configuration on the default phone regardless of SIM. To solve this, set the PhoneAccountHandle to intent extra for ACTION_CONFIGURE_VOICEMAIL. In the advanced settings, obtains subId from the PhoneAccountHandle. Test: manual - Checked that correct PhoneAccountHandle will be passed with ACTION_CONFIGURE_VOICEMAIL intent Bug: 65001008 Author: xuegang.x.liu Bug: 65001008 Test: manual - Checked that correct PhoneAccountHandle will be passed PiperOrigin-RevId: 168019873 Change-Id: I8578dd2c4ac24e4af121a90b2b175baae2832461 --- .../dialer/app/voicemail/error/VoicemailTosMessageCreator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'java/com/android/dialer/app') diff --git a/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java b/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java index baf7b9989..53f4680d2 100644 --- a/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java +++ b/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java @@ -143,7 +143,7 @@ public class VoicemailTosMessageCreator { if (isVvm3() && Vvm3VoicemailMessageCreator.PIN_NOT_SET == status.configurationState) { LogUtil.i( "VoicemailTosMessageCreator.showDeclineTosDialog", "PIN_NOT_SET, showing set PIN dialog"); - showSetPinBeforeDeclineDialog(); + showSetPinBeforeDeclineDialog(handle); return; } LogUtil.i( @@ -180,7 +180,7 @@ public class VoicemailTosMessageCreator { builder.show(); } - private void showSetPinBeforeDeclineDialog() { + private void showSetPinBeforeDeclineDialog(PhoneAccountHandle phoneAccountHandle) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage(R.string.verizon_terms_and_conditions_decline_set_pin_dialog_message); builder.setPositiveButton( @@ -191,6 +191,7 @@ public class VoicemailTosMessageCreator { Logger.get(context) .logImpression(DialerImpression.Type.VOICEMAIL_VVM3_TOS_DECLINE_CHANGE_PIN_SHOWN); Intent intent = new Intent(TelephonyManager.ACTION_CONFIGURE_VOICEMAIL); + intent.putExtra(TelephonyManager.EXTRA_PHONE_ACCOUNT_HANDLE, phoneAccountHandle); context.startActivity(intent); } }); -- cgit v1.2.3