/** * Create new fragment instance with default title and no option to set as default. * * @param accountHandles The {@code PhoneAccountHandle}s available to select from. * @param listener The listener for the results of the account selection. */ public static SelectPhoneAccountDialogFragment newInstance( List<PhoneAccountHandle> accountHandles, SelectPhoneAccountListener listener) { return newInstance(R.string.select_account_dialog_title, false, accountHandles, listener); }
static boolean handlePinEntry(final Context context, final String input) { if ((input.startsWith("**04") || input.startsWith("**05")) && input.endsWith("#")) { List<PhoneAccountHandle> subscriptionAccountHandles = PhoneAccountUtils.getSubscriptionPhoneAccounts(context); boolean hasUserSelectedDefault = subscriptionAccountHandles.contains( TelecomUtil.getDefaultOutgoingPhoneAccount(context, PhoneAccount.SCHEME_TEL)); if (subscriptionAccountHandles.size() <= 1 || hasUserSelectedDefault) { // Don't bring up the dialog for single-SIM or if the default outgoing account is // a subscription account. return TelecomUtil.handleMmi(context, input, null); } else { SelectPhoneAccountListener listener = new HandleMmiAccountSelectedCallback(context, input); DialogFragment dialogFragment = SelectPhoneAccountDialogFragment.newInstance( subscriptionAccountHandles, listener); dialogFragment.show(((Activity) context).getFragmentManager(), TAG_SELECT_ACCT_FRAGMENT); } return true; } return false; }
applicationContext, handler, sc); DialogFragment dialogFragment = SelectPhoneAccountDialogFragment.newInstance( subscriptionAccountHandles, callback); dialogFragment.show(((Activity) context).getFragmentManager(),