Loading InCallUI/src/com/android/incallui/InCallActivity.java +15 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.graphics.Point; import android.net.Uri; import android.os.Bundle; import android.telecom.DisconnectCause; import android.telecom.PhoneAccountHandle; import android.text.TextUtils; import android.view.MenuItem; import android.view.animation.Animation; Loading @@ -45,6 +46,8 @@ import com.android.phone.common.animation.AnimationListenerAdapter; import com.android.contacts.common.interactions.TouchPointManager; import com.android.incallui.Call.State; import java.util.ArrayList; import java.util.List; import java.util.Locale; /** Loading Loading @@ -492,9 +495,19 @@ public class InCallActivity extends Activity { Call pendingAccountSelectionCall = CallList.getInstance().getWaitingForAccountCall(); if (pendingAccountSelectionCall != null) { mCallCardFragment.setVisible(false); Uri handle = pendingAccountSelectionCall.getHandle(); Bundle extras = pendingAccountSelectionCall .getTelecommCall().getDetails().getExtras(); final List<PhoneAccountHandle> phoneAccountHandles; if (extras != null) { phoneAccountHandles = extras.getParcelableArrayList( android.telecom.Call.AVAILABLE_PHONE_ACCOUNTS); } else { phoneAccountHandles = new ArrayList<>(); } SelectPhoneAccountDialogFragment.showAccountDialog(getFragmentManager(), handle.getScheme()); phoneAccountHandles); } else { mCallCardFragment.setVisible(true); } Loading InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java +7 −7 Original line number Diff line number Diff line Loading @@ -46,23 +46,24 @@ public class SelectPhoneAccountDialogFragment extends DialogFragment { private List<PhoneAccountHandle> mAccountHandles; private boolean mIsSelected; private TelecomManager mTelecomManager; private final String mUriScheme; /** * Shows the account selection dialog. * This is the preferred way to show this dialog. * * @param fragmentManager The fragment manager. * @param uriScheme The URI scheme of the call we need to choose an account for. * @param accountHandles The {@code PhoneAccountHandle}s available to select from. */ public static void showAccountDialog(FragmentManager fragmentManager, String uriScheme) { SelectPhoneAccountDialogFragment fragment = new SelectPhoneAccountDialogFragment(uriScheme); public static void showAccountDialog(FragmentManager fragmentManager, List<PhoneAccountHandle> accountHandles) { SelectPhoneAccountDialogFragment fragment = new SelectPhoneAccountDialogFragment(accountHandles); fragment.show(fragmentManager, "selectAccount"); } public SelectPhoneAccountDialogFragment(String uriScheme) { public SelectPhoneAccountDialogFragment(List<PhoneAccountHandle> accountHandles) { super(); mUriScheme = uriScheme; mAccountHandles = accountHandles; } @Override Loading @@ -70,7 +71,6 @@ public class SelectPhoneAccountDialogFragment extends DialogFragment { mIsSelected = false; mTelecomManager = (TelecomManager) getActivity().getSystemService(Context.TELECOM_SERVICE); mAccountHandles = mTelecomManager.getPhoneAccountsSupportingScheme(mUriScheme); final DialogInterface.OnClickListener selectionListener = new DialogInterface.OnClickListener() { Loading Loading
InCallUI/src/com/android/incallui/InCallActivity.java +15 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.graphics.Point; import android.net.Uri; import android.os.Bundle; import android.telecom.DisconnectCause; import android.telecom.PhoneAccountHandle; import android.text.TextUtils; import android.view.MenuItem; import android.view.animation.Animation; Loading @@ -45,6 +46,8 @@ import com.android.phone.common.animation.AnimationListenerAdapter; import com.android.contacts.common.interactions.TouchPointManager; import com.android.incallui.Call.State; import java.util.ArrayList; import java.util.List; import java.util.Locale; /** Loading Loading @@ -492,9 +495,19 @@ public class InCallActivity extends Activity { Call pendingAccountSelectionCall = CallList.getInstance().getWaitingForAccountCall(); if (pendingAccountSelectionCall != null) { mCallCardFragment.setVisible(false); Uri handle = pendingAccountSelectionCall.getHandle(); Bundle extras = pendingAccountSelectionCall .getTelecommCall().getDetails().getExtras(); final List<PhoneAccountHandle> phoneAccountHandles; if (extras != null) { phoneAccountHandles = extras.getParcelableArrayList( android.telecom.Call.AVAILABLE_PHONE_ACCOUNTS); } else { phoneAccountHandles = new ArrayList<>(); } SelectPhoneAccountDialogFragment.showAccountDialog(getFragmentManager(), handle.getScheme()); phoneAccountHandles); } else { mCallCardFragment.setVisible(true); } Loading
InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java +7 −7 Original line number Diff line number Diff line Loading @@ -46,23 +46,24 @@ public class SelectPhoneAccountDialogFragment extends DialogFragment { private List<PhoneAccountHandle> mAccountHandles; private boolean mIsSelected; private TelecomManager mTelecomManager; private final String mUriScheme; /** * Shows the account selection dialog. * This is the preferred way to show this dialog. * * @param fragmentManager The fragment manager. * @param uriScheme The URI scheme of the call we need to choose an account for. * @param accountHandles The {@code PhoneAccountHandle}s available to select from. */ public static void showAccountDialog(FragmentManager fragmentManager, String uriScheme) { SelectPhoneAccountDialogFragment fragment = new SelectPhoneAccountDialogFragment(uriScheme); public static void showAccountDialog(FragmentManager fragmentManager, List<PhoneAccountHandle> accountHandles) { SelectPhoneAccountDialogFragment fragment = new SelectPhoneAccountDialogFragment(accountHandles); fragment.show(fragmentManager, "selectAccount"); } public SelectPhoneAccountDialogFragment(String uriScheme) { public SelectPhoneAccountDialogFragment(List<PhoneAccountHandle> accountHandles) { super(); mUriScheme = uriScheme; mAccountHandles = accountHandles; } @Override Loading @@ -70,7 +71,6 @@ public class SelectPhoneAccountDialogFragment extends DialogFragment { mIsSelected = false; mTelecomManager = (TelecomManager) getActivity().getSystemService(Context.TELECOM_SERVICE); mAccountHandles = mTelecomManager.getPhoneAccountsSupportingScheme(mUriScheme); final DialogInterface.OnClickListener selectionListener = new DialogInterface.OnClickListener() { Loading