diff options
author | Tyler Gunn <tgunn@google.com> | 2014-09-03 18:13:44 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-03 18:13:45 +0000 |
commit | 2c379955868a67b19bd3bd042284b612f4495ca4 (patch) | |
tree | addd30b9fe041bf78b5be3984bd910ca408e93a5 /InCallUI | |
parent | e6c05fb93cc314cf08fce75059462cced297b61d (diff) | |
parent | 7c5cee7e818e7447a248b7ca6cd17ebec28fcf10 (diff) |
Merge "Add supported URI scheme to PhoneAccounts. (4/4)" into lmp-dev
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() { |