diff options
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 8 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java | 23 |
2 files changed, 24 insertions, 7 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 95cc0d7db..db161a563 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -27,6 +27,7 @@ import android.content.DialogInterface.OnCancelListener; import android.content.Intent; import android.content.res.Configuration; import android.graphics.Point; +import android.net.Uri; import android.os.Bundle; import android.telephony.DisconnectCause; import android.text.TextUtils; @@ -491,9 +492,12 @@ public class InCallActivity extends Activity { mCallCardFragment.animateForNewOutgoingCall(touchPoint); } - if (CallList.getInstance().getWaitingForAccountCall() != null) { + Call pendingAccountSelectionCall = CallList.getInstance().getWaitingForAccountCall(); + if (pendingAccountSelectionCall != null) { mCallCardFragment.setVisible(false); - SelectPhoneAccountDialogFragment.show(getFragmentManager()); + Uri handle = pendingAccountSelectionCall.getHandle(); + SelectPhoneAccountDialogFragment.showAccountDialog(getFragmentManager(), + handle.getScheme()); } else { mCallCardFragment.setVisible(true); } diff --git a/InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java b/InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java index 0bc97eda8..d44047d67 100644 --- a/InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java +++ b/InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java @@ -36,6 +36,7 @@ import android.widget.ListAdapter; import android.widget.TextView; import com.android.contacts.common.R; +import com.android.contacts.common.editor.SelectAccountDialogFragment; import java.util.List; @@ -46,19 +47,31 @@ public class SelectPhoneAccountDialogFragment extends DialogFragment { private List<PhoneAccountHandle> mAccountHandles; private boolean mIsSelected; private TelecommManager mTelecommManager; - - /* Preferred way to show this dialog */ - public static void show(FragmentManager fragmentManager) { - SelectPhoneAccountDialogFragment fragment = new SelectPhoneAccountDialogFragment(); + 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. + */ + public static void showAccountDialog(FragmentManager fragmentManager, String uriScheme) { + SelectPhoneAccountDialogFragment fragment = new SelectPhoneAccountDialogFragment(uriScheme); fragment.show(fragmentManager, "selectAccount"); } + public SelectPhoneAccountDialogFragment(String uriScheme) { + super(); + mUriScheme = uriScheme; + } + @Override public Dialog onCreateDialog(Bundle savedInstanceState) { mIsSelected = false; mTelecommManager = (TelecommManager) getActivity().getSystemService(Context.TELECOMM_SERVICE); - mAccountHandles = mTelecommManager.getEnabledPhoneAccounts(); + mAccountHandles = mTelecommManager.getPhoneAccountsSupportingScheme(mUriScheme); final DialogInterface.OnClickListener selectionListener = new DialogInterface.OnClickListener() { |