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

Commit 49993d0b authored by qqzhou's avatar qqzhou Committed by Steve Kondik
Browse files

Dialer: fix still popup account select when select IP call

The codes transfer slot id not sub id into phone account, this
account is invalid, so will still popup account select dialog.
We change to transfer sub id not slot id to match phone app.

CRs-Fixed: 722959

Change-Id: Ib8e69ca7635b5ff4c3716eadeac84ab80daaddfd
parent 1923a47f
Loading
Loading
Loading
Loading
+31 −16
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.provider.VoicemailContract.Voicemails;
import android.telecom.PhoneAccount;
import android.telephony.SubscriptionManager;
import android.telecom.PhoneAccountHandle;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.BidiFormatter;
import android.text.TextDirectionHeuristics;
@@ -741,14 +742,21 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe
    public void onMenuIpCallBySlot1(MenuItem menuItem) {
        String prefix = MoreContactUtils.getIPCallPrefix(this, PhoneConstants.SUB1);
        if (!TextUtils.isEmpty(prefix)) {
            long[] subId = SubscriptionManager.getSubId(PhoneConstants.SUB1);
            if (subId != null && subId.length >= 1) {
                ComponentName serviceName =
                        new ComponentName("com.android.phone",
                        "com.android.services.telephony.TelephonyConnectionService");
                PhoneAccountHandle account = new PhoneAccountHandle(serviceName,
                    String.valueOf(PhoneConstants.SUB1));
                        String.valueOf(subId[0]));
                Intent callIntent = new Intent(CallUtil.getCallIntent(
                    prefix + "" + mNumber, account));
                        prefix + mNumber, account));
                startActivity(callIntent);
            } else {
                Intent callIntent = new Intent(CallUtil.getCallIntent(
                        prefix + mNumber));
                startActivity(callIntent);
            }
        } else {
            MoreContactUtils.showNoIPNumberDialog(this, PhoneConstants.SUB1);
        }
@@ -757,14 +765,21 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe
    public void onMenuIpCallBySlot2(MenuItem menuItem) {
        String prefix = MoreContactUtils.getIPCallPrefix(this, PhoneConstants.SUB2);
        if (!TextUtils.isEmpty(prefix)) {
            long[] subId = SubscriptionManager.getSubId(PhoneConstants.SUB2);
            if (subId != null && subId.length >= 1) {
                ComponentName serviceName =
                        new ComponentName("com.android.phone",
                        "com.android.services.telephony.TelephonyConnectionService");
                PhoneAccountHandle account = new PhoneAccountHandle(serviceName,
                    String.valueOf(PhoneConstants.SUB2));
                        String.valueOf(subId[0]));
                Intent callIntent = new Intent(CallUtil.getCallIntent(
                    prefix + "" + mNumber, account));
                        prefix + mNumber, account));
                startActivity(callIntent);
            } else {
                Intent callIntent = new Intent(CallUtil.getCallIntent(
                        prefix + mNumber));
                startActivity(callIntent);
            }
        } else {
            MoreContactUtils.showNoIPNumberDialog(this, PhoneConstants.SUB2);
        }
+18 −11
Original line number Diff line number Diff line
@@ -1145,19 +1145,26 @@ public class DialpadFragment extends AnalyticsFragment
        mContext = activity;
    }

    private void ipCallBySlot(int subscription) {
        String prefix = MoreContactUtils.getIPCallPrefix(mContext, subscription);
    private void ipCallBySlot(int slotId) {
        String prefix = MoreContactUtils.getIPCallPrefix(mContext, slotId);
        if (!TextUtils.isEmpty(prefix)) {
            long[] subId = SubscriptionManager.getSubId(slotId);
            if (subId != null && subId.length >= 1) {
                ComponentName serviceName =
                        new ComponentName("com.android.phone",
                        "com.android.services.telephony.TelephonyConnectionService");
                PhoneAccountHandle account = new PhoneAccountHandle(serviceName,
                    String.valueOf(subscription));
                        String.valueOf(subId[0]));
                Intent callIntent = new Intent(CallUtil.getCallIntent(
                    prefix + "" + getValidDialNumber(), account));
                        prefix + getValidDialNumber(), account));
                startActivity(callIntent);
            } else {
            MoreContactUtils.showNoIPNumberDialog(mContext, subscription);
                Intent callIntent = new Intent(CallUtil.getCallIntent(
                        prefix + getValidDialNumber()));
                startActivity(callIntent);
            }
        } else {
            MoreContactUtils.showNoIPNumberDialog(mContext, slotId);
        }
    }