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

Commit 3af7e567 authored by Yorke Lee's avatar Yorke Lee
Browse files

Use TelecommManager.getDefaultOutgoingPhoneAccount

Bug: 20224972
Change-Id: If7f1bde0229044f60bc889b380bc3e49e043e3ff
parent 4fb0b8eb
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.database.Cursor;
import android.net.Uri;
import android.os.Looper;
import android.provider.Settings;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import android.telephony.PhoneNumberUtils;
@@ -213,7 +214,7 @@ public class SpecialCharSequenceMgr {
                        PhoneAccountUtils.getSubscriptionPhoneAccounts(context);

                boolean hasUserSelectedDefault = subscriptionAccountHandles.contains(
                        telecomManager.getUserSelectedOutgoingPhoneAccount());
                        telecomManager.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL));

                if (subscriptionAccountHandles.size() == 1 || hasUserSelectedDefault) {
                    Uri uri = telecomManager.getAdnUriForPhoneAccount(null);
@@ -278,7 +279,7 @@ public class SpecialCharSequenceMgr {
            List<PhoneAccountHandle> subscriptionAccountHandles =
                    PhoneAccountUtils.getSubscriptionPhoneAccounts(context);
            boolean hasUserSelectedDefault = subscriptionAccountHandles.contains(
                    telecomManager.getUserSelectedOutgoingPhoneAccount());
                    telecomManager.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL));

            if (subscriptionAccountHandles.size() == 1 || hasUserSelectedDefault) {
                // Don't bring up the dialog for single-SIM or if the default outgoing account is
+4 −2
Original line number Diff line number Diff line
@@ -935,7 +935,8 @@ public class DialpadFragment extends Fragment
                    List<PhoneAccountHandle> subscriptionAccountHandles =
                            PhoneAccountUtils.getSubscriptionPhoneAccounts(getActivity());
                    boolean hasUserSelectedDefault = subscriptionAccountHandles.contains(
                            getTelecomManager().getUserSelectedOutgoingPhoneAccount());
                            getTelecomManager().getDefaultOutgoingPhoneAccount(
                                    PhoneAccount.SCHEME_VOICEMAIL));
                    boolean needsAccountDisambiguation = subscriptionAccountHandles.size() > 1
                            && !hasUserSelectedDefault;

@@ -1526,7 +1527,8 @@ public class DialpadFragment extends Fragment
    private boolean isVoicemailAvailable() {
        try {
            PhoneAccountHandle defaultUserSelectedAccount =
                    getTelecomManager().getUserSelectedOutgoingPhoneAccount();
                    getTelecomManager().getDefaultOutgoingPhoneAccount(
                            PhoneAccount.SCHEME_VOICEMAIL);
            if (defaultUserSelectedAccount == null) {
                // In a single-SIM phone, there is no default outgoing phone account selected by
                // the user, so just call TelephonyManager#getVoicemailNumber directly.