Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 360d2eb8 authored by Varun Berry's avatar Varun Berry
Browse files

Remove PhoneAccountHandle when building the intent to call Voicemail.

This will break functionality for calling voicemail in a multi-sim
device.

Bug: 197228468
Test: manual.
Change-Id: If4463a24af2feb23d033190236e314b535d10fd6
parent 13758314
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -560,7 +560,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
      case CallbackAction.VOICE:
        if (callLogCache.isVoicemailNumber(accountHandle, number)) {
          // Call to generic voicemail number, in case there are multiple accounts
          primaryActionButtonView.setTag(IntentProvider.getReturnVoicemailCallIntentProvider(null));
          primaryActionButtonView.setTag(IntentProvider.getReturnVoicemailCallIntentProvider());
        } else if (canSupportAssistedDialing()) {
          primaryActionButtonView.setTag(
              IntentProvider.getAssistedDialIntentProvider(
+2 −3
Original line number Diff line number Diff line
@@ -161,14 +161,13 @@ public abstract class IntentProvider {
    };
  }

  public static IntentProvider getReturnVoicemailCallIntentProvider(
      @Nullable PhoneAccountHandle phoneAccountHandle) {
  public static IntentProvider getReturnVoicemailCallIntentProvider() {
    return new IntentProvider() {
      @Override
      public Intent getIntent(Context context) {
        return PreCall.getIntent(
            context,
            CallIntentBuilder.forVoicemail(phoneAccountHandle, CallInitiationType.Type.CALL_LOG));
            CallIntentBuilder.forVoicemail(CallInitiationType.Type.CALL_LOG));
      }
    };
  }
+2 −2
Original line number Diff line number Diff line
@@ -117,10 +117,10 @@ public class CallIntentBuilder implements Parcelable {
  }

  public static CallIntentBuilder forVoicemail(
      @Nullable PhoneAccountHandle phoneAccountHandle, CallInitiationType.Type callInitiationType) {
      CallInitiationType.Type callInitiationType) {
    return new CallIntentBuilder(
            Uri.fromParts(PhoneAccount.SCHEME_VOICEMAIL, "", null), callInitiationType)
        .setPhoneAccountHandle(phoneAccountHandle);
        .setPhoneAccountHandle(null);
  }

  public void setUri(@NonNull Uri uri) {
+1 −5
Original line number Diff line number Diff line
@@ -19,8 +19,6 @@ package com.android.dialer.commandline.impl;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import com.android.dialer.buildtype.BuildType;
import com.android.dialer.buildtype.BuildType.Type;
@@ -67,12 +65,10 @@ public class CallCommand implements Command {
    }
    String number = args.expectPositional(0, "number");
    TelecomManager telecomManager = appContext.getSystemService(TelecomManager.class);
    PhoneAccountHandle phoneAccountHandle =
        telecomManager.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL);
    CallIntentBuilder callIntentBuilder;
    if ("voicemail".equals(number)) {
      callIntentBuilder =
          CallIntentBuilder.forVoicemail(phoneAccountHandle, CallInitiationType.Type.DIALPAD);
          CallIntentBuilder.forVoicemail(CallInitiationType.Type.DIALPAD);
    } else {
      callIntentBuilder = new CallIntentBuilder(number, CallInitiationType.Type.DIALPAD);
    }
+1 −1
Original line number Diff line number Diff line
@@ -1136,7 +1136,7 @@ public class DialpadFragment extends Fragment

  public void callVoicemail() {
    PreCall.start(
        getContext(), CallIntentBuilder.forVoicemail(null, CallInitiationType.Type.DIALPAD));
        getContext(), CallIntentBuilder.forVoicemail(CallInitiationType.Type.DIALPAD));
    hideAndClearDialpad();
  }

Loading