summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2014-09-18 20:56:18 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-18 20:56:18 +0000
commitbad77ad9e74a62968a22d5e86f4d6c0cf07c26c9 (patch)
tree6ef9288529172208fe7d9319607b7808347f89be /InCallUI
parent6a7d935c961a6ee2335de90f9c798141985f4349 (diff)
parent339251429da49da51411c0614a0861c3d8228a94 (diff)
am 6d54101f: am 06fda829: Merge "Replace get*PhoneAccounts* public API methods with new method (3/3)" into lmp-dev
* commit '6d54101f03c6703d31a81e71035201e74aa1fd45': Replace get*PhoneAccounts* public API methods with new method (3/3)
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/InCallActivity.java17
-rw-r--r--InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java14
2 files changed, 22 insertions, 9 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java
index b511df467..2941e1e8d 100644
--- a/InCallUI/src/com/android/incallui/InCallActivity.java
+++ b/InCallUI/src/com/android/incallui/InCallActivity.java
@@ -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;
@@ -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;
/**
@@ -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);
}
diff --git a/InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java b/InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java
index aeb14dfbf..49f23b72b 100644
--- a/InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java
+++ b/InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java
@@ -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
@@ -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() {