summaryrefslogtreecommitdiff
path: root/InCallUI/src/com
diff options
context:
space:
mode:
authorEvan Charlton <evanc@google.com>2014-07-19 18:23:02 -0700
committerEvan Charlton <evanc@google.com>2014-07-20 10:35:27 -0700
commit76e1b4bfb2e21300068f10cc94922214e62c8f86 (patch)
tree20fe96127a0d19322a93a44155deeb4aab81eb42 /InCallUI/src/com
parentdc1d856995361eca7167823b229d971033283ba0 (diff)
Rename PhoneAccount to PhoneAccountHandle
Change-Id: I2e97b348e6316a8b3ccc39fd81013e7f514a2889
Diffstat (limited to 'InCallUI/src/com')
-rw-r--r--InCallUI/src/com/android/incallui/Call.java4
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java32
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java8
-rw-r--r--InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java22
-rw-r--r--InCallUI/src/com/android/incallui/TelecommAdapter.java6
5 files changed, 35 insertions, 37 deletions
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java
index f6c039138..96a0bf43e 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -18,7 +18,7 @@ package com.android.incallui;
import android.net.Uri;
import android.telecomm.CallCapabilities;
-import android.telecomm.PhoneAccount;
+import android.telecomm.PhoneAccountHandle;
import android.telecomm.RemoteCallVideoProvider;
import android.telecomm.GatewayInfo;
import android.telecomm.VideoCallProfile;
@@ -311,7 +311,7 @@ public final class Call {
return mTelecommCall.getDetails().getGatewayInfo();
}
- public PhoneAccount getAccount() {
+ public PhoneAccountHandle getAccountHandle() {
return mTelecommCall.getDetails().getAccount();
}
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index 957bf056c..db1c56b08 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -22,7 +22,7 @@ import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.telecomm.CallCapabilities;
-import android.telecomm.PhoneAccount;
+import android.telecomm.PhoneAccountHandle;
import android.telecomm.PhoneAccountMetadata;
import android.telecomm.StatusHints;
import android.telecomm.TelecommManager;
@@ -225,10 +225,10 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
// If it's an emergency call, and they're not populating the callback number,
// then try to fall back to the phone sub info (to hopefully get the SIM's
// number directly from the telephony layer).
- PhoneAccount account = mPrimary.getAccount();
- if (account != null) {
+ PhoneAccountHandle accountHandle = mPrimary.getAccountHandle();
+ if (accountHandle != null) {
TelecommManager mgr = TelecommManager.from(mContext);
- PhoneAccountMetadata metadata = mgr.getPhoneAccountMetadata(account);
+ PhoneAccountMetadata metadata = mgr.getPhoneAccountMetadata(accountHandle);
if (metadata != null) {
return metadata.getSubscriptionNumber();
}
@@ -482,9 +482,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
* Return the Drawable object of the icon to display to the left of the connection label.
*/
private Drawable getConnectionIcon() {
- PhoneAccount account = mPrimary.getAccount();
- if (account != null) {
- PhoneAccountMetadata data = getTelecommManager().getPhoneAccountMetadata(account);
+ PhoneAccountHandle accountHandle = mPrimary.getAccountHandle();
+ if (accountHandle != null) {
+ PhoneAccountMetadata data = getTelecommManager().getPhoneAccountMetadata(accountHandle);
if (data != null) {
return data.getIcon(mContext);
}
@@ -509,9 +509,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
return null;
}
}
- PhoneAccount account = mPrimary.getAccount();
- if (account != null) {
- PhoneAccountMetadata data = getTelecommManager().getPhoneAccountMetadata(account);
+ PhoneAccountHandle accountHandle = mPrimary.getAccountHandle();
+ if (accountHandle != null) {
+ PhoneAccountMetadata data = getTelecommManager().getPhoneAccountMetadata(accountHandle);
if (data != null) {
return data.getLabel();
}
@@ -520,9 +520,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
}
private String getSecondaryCallProviderLabel() {
- PhoneAccount account = mSecondary.getAccount();
- if (account != null) {
- PhoneAccountMetadata data = getTelecommManager().getPhoneAccountMetadata(account);
+ PhoneAccountHandle accountHandle = mSecondary.getAccountHandle();
+ if (accountHandle != null) {
+ PhoneAccountMetadata data = getTelecommManager().getPhoneAccountMetadata(accountHandle);
if (data != null) {
return data.getLabel();
}
@@ -531,9 +531,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
}
private Drawable getSecondaryCallProviderIcon() {
- PhoneAccount account = mSecondary.getAccount();
- if (account != null) {
- PhoneAccountMetadata data = getTelecommManager().getPhoneAccountMetadata(account);
+ PhoneAccountHandle accountHandle = mSecondary.getAccountHandle();
+ if (accountHandle != null) {
+ PhoneAccountMetadata data = getTelecommManager().getPhoneAccountMetadata(accountHandle);
if (data != null) {
return data.getIcon(mContext);
}
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index 78c800d31..ac802f0a0 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -21,7 +21,7 @@ import android.content.Context;
import android.content.Intent;
import android.telecomm.CallCapabilities;
import android.telecomm.Phone;
-import android.telecomm.PhoneAccount;
+import android.telecomm.PhoneAccountHandle;
import android.telecomm.VideoCallProfile;
import com.google.common.base.Preconditions;
@@ -404,11 +404,11 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
return mProximitySensor;
}
- public void handleAccountSelection(PhoneAccount account) {
+ public void handleAccountSelection(PhoneAccountHandle accountHandle) {
Call call = mCallList.getWaitingForAccountCall();
if (call != null) {
String callId = call.getId();
- TelecommAdapter.getInstance().phoneAccountSelected(callId, account);
+ TelecommAdapter.getInstance().phoneAccountSelected(callId, accountHandle);
}
}
@@ -695,7 +695,7 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
// we get an incoming call.
final boolean startStartupSequence = (InCallState.INCOMING == newState);
- // A dialog to show on top of the InCallUI to select a PhoneAccount
+ // A dialog to show on top of the InCallUI to select a PhoneAccountHandle
final boolean showAccountPicker = (InCallState.WAITING_FOR_ACCOUNT == newState);
// A new outgoing call indicates that the user just now dialed a number and when that
diff --git a/InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java b/InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java
index eb61bba0a..47c96e780 100644
--- a/InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java
+++ b/InCallUI/src/com/android/incallui/SelectPhoneAccountDialogFragment.java
@@ -16,7 +16,7 @@
package com.android.incallui;
-import com.google.android.collect.Lists;
+import android.telecomm.PhoneAccountHandle;
import android.app.AlertDialog;
import android.app.Dialog;
@@ -25,7 +25,6 @@ import android.app.FragmentManager;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
-import android.telecomm.PhoneAccount;
import android.telecomm.PhoneAccountMetadata;
import android.telecomm.TelecommManager;
import android.view.LayoutInflater;
@@ -38,15 +37,13 @@ import android.widget.TextView;
import com.android.contacts.common.R;
-import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
/**
* Dialog that allows the user to switch between default SIM cards
*/
public class SelectPhoneAccountDialogFragment extends DialogFragment {
- private List<PhoneAccount> mAccounts;
+ private List<PhoneAccountHandle> mAccountHandless;
private boolean mIsSelected;
private TelecommManager mTelecommManager;
@@ -60,15 +57,15 @@ public class SelectPhoneAccountDialogFragment extends DialogFragment {
public Dialog onCreateDialog(Bundle savedInstanceState) {
mIsSelected = false;
mTelecommManager = TelecommManager.from(getActivity());
- mAccounts = mTelecommManager.getEnabledPhoneAccounts();
+ mAccountHandless = mTelecommManager.getEnabledPhoneAccounts();
final DialogInterface.OnClickListener selectionListener =
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mIsSelected = true;
- PhoneAccount selectedAccount = mAccounts.get(which);
- InCallPresenter.getInstance().handleAccountSelection(selectedAccount);
+ PhoneAccountHandle selectedAccountHandle = mAccountHandless.get(which);
+ InCallPresenter.getInstance().handleAccountSelection(selectedAccountHandle);
}
};
@@ -77,18 +74,19 @@ public class SelectPhoneAccountDialogFragment extends DialogFragment {
ListAdapter selectAccountListAdapter = new SelectAccountListAdapter(
builder.getContext(),
R.layout.select_account_list_item,
- mAccounts);
+ mAccountHandless);
return builder.setTitle(R.string.select_account_dialog_title)
.setAdapter(selectAccountListAdapter, selectionListener)
.create();
}
- private class SelectAccountListAdapter extends ArrayAdapter<PhoneAccount> {
+ private class SelectAccountListAdapter extends ArrayAdapter<PhoneAccountHandle> {
private Context mContext;
private int mResId;
- public SelectAccountListAdapter(Context context, int resource, List<PhoneAccount> objects) {
+ public SelectAccountListAdapter(
+ Context context, int resource, List<PhoneAccountHandle> objects) {
super(context, resource, objects);
mContext = context;
mResId = resource;
@@ -115,7 +113,7 @@ public class SelectPhoneAccountDialogFragment extends DialogFragment {
holder = (ViewHolder) rowView.getTag();
}
- PhoneAccount item = getItem(position);
+ PhoneAccountHandle item = getItem(position);
PhoneAccountMetadata itemMetadata = mTelecommManager.getPhoneAccountMetadata(item);
holder.textView.setText(itemMetadata.getLabel());
holder.imageView.setImageDrawable(itemMetadata.getIcon(mContext));
diff --git a/InCallUI/src/com/android/incallui/TelecommAdapter.java b/InCallUI/src/com/android/incallui/TelecommAdapter.java
index 11ddc42b2..37962fd0d 100644
--- a/InCallUI/src/com/android/incallui/TelecommAdapter.java
+++ b/InCallUI/src/com/android/incallui/TelecommAdapter.java
@@ -22,7 +22,7 @@ import android.content.Intent;
import android.os.Looper;
import android.telecomm.InCallAdapter;
import android.telecomm.Phone;
-import android.telecomm.PhoneAccount;
+import android.telecomm.PhoneAccountHandle;
import com.google.common.base.Preconditions;
@@ -196,9 +196,9 @@ final class TelecommAdapter implements InCallPhoneListener {
}
}
- void phoneAccountSelected(String callId, PhoneAccount account) {
+ void phoneAccountSelected(String callId, PhoneAccountHandle accountHandle) {
if (mPhone != null) {
- getTelecommCallById(callId).phoneAccountSelected(account);
+ getTelecommCallById(callId).phoneAccountSelected(accountHandle);
} else {
Log.e(this, "error phoneAccountSelected, mAdapter is null");
}