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

Commit f6bf9e4c authored by Brandon Maxwell's avatar Brandon Maxwell
Browse files

Fixing crash related to typing ADN numbers in Dialpad

Bug: 25813349
Change-Id: I3e26ec2edd917df4892d401867acbeb5f97edf64
parent da8da31e
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -192,7 +192,6 @@ public class SpecialCharSequenceMgr {
     * and query cancel handler implemented in {@link SimContactQueryCookie}.
     */
    static boolean handleAdnEntry(Context context, String input, EditText textField) {
        context = context.getApplicationContext();
        /* ADN entries are of the form "N(N)(N)#" */
        TelephonyManager telephonyManager =
                (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
@@ -248,16 +247,17 @@ public class SpecialCharSequenceMgr {
                List<PhoneAccountHandle> subscriptionAccountHandles =
                        PhoneAccountUtils.getSubscriptionPhoneAccounts(context);

                Context applicationContext = context.getApplicationContext();
                boolean hasUserSelectedDefault = subscriptionAccountHandles.contains(
                        TelecomUtil.getDefaultOutgoingPhoneAccount(context,
                        TelecomUtil.getDefaultOutgoingPhoneAccount(applicationContext,
                                PhoneAccount.SCHEME_TEL));

                if (subscriptionAccountHandles.size() == 1 || hasUserSelectedDefault) {
                    Uri uri = TelecomUtil.getAdnUriForPhoneAccount(context, null);
                    Uri uri = TelecomUtil.getAdnUriForPhoneAccount(applicationContext, null);
                    handleAdnQuery(handler, sc, uri);
                } else if (subscriptionAccountHandles.size() > 1){
                    SelectPhoneAccountListener callback =
                            new HandleAdnEntryAccountSelectedCallback(context, handler, sc);
                    SelectPhoneAccountListener callback = new HandleAdnEntryAccountSelectedCallback(
                            applicationContext, handler, sc);

                    DialogFragment dialogFragment = SelectPhoneAccountDialogFragment.newInstance(
                            subscriptionAccountHandles, callback);