summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--InCallUI/src/com/android/incallui/Call.java12
-rw-r--r--InCallUI/src/com/android/incallui/CallCardFragment.java10
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java38
-rw-r--r--InCallUI/src/com/android/incallui/InCallServiceImpl.java2
4 files changed, 27 insertions, 35 deletions
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java
index d87c49384..22cc18234 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -21,9 +21,9 @@ import android.os.RemoteException;
import android.telecomm.CallCapabilities;
import android.telecomm.CallNumberPresentation;
import android.telecomm.CallServiceDescriptor;
+import android.telecomm.PhoneAccount;
import android.telecomm.RemoteCallVideoProvider;
import android.telecomm.GatewayInfo;
-import android.telecomm.Subscription;
import android.telephony.DisconnectCause;
import com.google.common.collect.ImmutableSortedSet;
@@ -109,7 +109,7 @@ public final class Call {
private long mConnectTimeMillis = 0;
private Uri mHandle;
private GatewayInfo mGatewayInfo;
- private Subscription mSubscription;
+ private PhoneAccount mAccount;
private CallServiceDescriptor mCurrentCallServiceDescriptor;
private CallServiceDescriptor mHandoffCallServiceDescriptor;
private RemoteCallVideoProvider mCallVideoProvider;
@@ -222,12 +222,12 @@ public final class Call {
mGatewayInfo = gatewayInfo;
}
- public Subscription getSubscription() {
- return mSubscription;
+ public PhoneAccount getAccount() {
+ return mAccount;
}
- public void setSubscription(Subscription subscription) {
- mSubscription = subscription;
+ public void setAccount(PhoneAccount account) {
+ mAccount = account;
}
/** The descriptor for the call service currently routing this call. */
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java
index 933fbca30..701622044 100644
--- a/InCallUI/src/com/android/incallui/CallCardFragment.java
+++ b/InCallUI/src/com/android/incallui/CallCardFragment.java
@@ -455,7 +455,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
* Additional labels are applied as follows:
* 1. All outgoing calls with display "Calling via [Provider]"
* 2. Ongoing calls will display the name of the provider or wifi connection
- * 2. Incoming calls will only display "Incoming via..." for subscriptions
+ * 2. Incoming calls will only display "Incoming via..." for accounts
*/
private String getCallStateLabelFromState(int state, int cause, String label, boolean isWiFi,
boolean isGatewayCall) {
@@ -463,8 +463,8 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
String callStateLabel = null; // Label to display as part of the call banner
boolean isSpecialCall = label != null;
- boolean isSubscriptionOrWifi = isSpecialCall && !isGatewayCall;
- boolean isSubscriptionOnly = isSubscriptionOrWifi && !isWiFi;
+ boolean isAccountOrWifi = isSpecialCall && !isGatewayCall;
+ boolean isAccountOnly = isAccountOrWifi && !isWiFi;
switch (state) {
case Call.State.IDLE:
@@ -473,7 +473,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
case Call.State.ACTIVE:
// We normally don't show a "call state label" at all in this state
// (but we can use the call state label to display the provider name).
- if (isSubscriptionOrWifi) {
+ if (isAccountOrWifi) {
callStateLabel = label;
}
break;
@@ -492,7 +492,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
break;
case Call.State.INCOMING:
case Call.State.CALL_WAITING:
- if (isSubscriptionOnly) {
+ if (isAccountOnly) {
callStateLabel = context.getString(R.string.incoming_via_template, label);
} else {
callStateLabel = context.getString(R.string.card_title_incoming_call);
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index e2dd14b3d..272e99f6f 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -16,20 +16,14 @@
package com.android.incallui;
-import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
-import android.graphics.Bitmap;
-import android.net.Uri;
-import android.net.wifi.WifiInfo;
-import android.net.wifi.WifiManager;
import android.telecomm.CallCapabilities;
import android.telecomm.CallServiceDescriptor;
-import android.telecomm.Subscription;
+import android.telecomm.PhoneAccount;
import android.telephony.DisconnectCause;
-import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.text.format.DateUtils;
@@ -41,8 +35,6 @@ import com.android.incallui.InCallPresenter.InCallStateListener;
import com.android.incallui.InCallPresenter.IncomingCallListener;
import com.android.services.telephony.common.AudioMode;
-import java.util.List;
-
import com.google.common.base.Preconditions;
/**
@@ -448,16 +440,16 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
if (mIsWiFiCachedValue == true) {
return mContext.getResources().getDrawable(R.drawable.ic_in_call_wifi);
}
- Subscription subscription = mPrimary.getSubscription();
- if (subscription != null) {
- return subscription.getIcon(mContext);
+ PhoneAccount account = mPrimary.getAccount();
+ if (account != null) {
+ return account.getIcon(mContext);
}
return null;
}
/**
* Returns the label (line of text above the number/name) for any given call.
- * For example, "calling via [Subscription/Google Voice/Wifi]" for outgoing calls.
+ * For example, "calling via [Account/Google Voice/Wifi]" for outgoing calls.
*/
private String getConnectionLabel() {
if (hasOutgoingGatewayCall() && getUi() != null) {
@@ -472,28 +464,28 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
return null;
}
}
- Subscription subscription = mPrimary.getSubscription();
- if (mIsWiFiCachedValue == true || subscription != null) {
- // Label will be either subscription name or WiFi connection
+ PhoneAccount account = mPrimary.getAccount();
+ if (mIsWiFiCachedValue == true || account != null) {
+ // Label will be either account name or WiFi connection
// TODO: get the name of the wifi connection
String wifiString = mContext.getString(R.string.wifi_constant);
- return subscription == null? wifiString : subscription.getLabel(mContext);
+ return account == null? wifiString : account.getLabel(mContext);
}
return null;
}
private String getSecondaryCallProviderLabel() {
- Subscription subscription = mSecondary.getSubscription();
- if (subscription != null) {
- return subscription.getLabel(mContext);
+ PhoneAccount account = mSecondary.getAccount();
+ if (account != null) {
+ return account.getLabel(mContext);
}
return null;
}
private Drawable getSecondaryCallProviderIcon() {
- Subscription subscription = mSecondary.getSubscription();
- if (subscription != null) {
- return subscription.getIcon(mContext);
+ PhoneAccount account = mSecondary.getAccount();
+ if (account != null) {
+ return account.getIcon(mContext);
}
return null;
}
diff --git a/InCallUI/src/com/android/incallui/InCallServiceImpl.java b/InCallUI/src/com/android/incallui/InCallServiceImpl.java
index 121321a13..c12920886 100644
--- a/InCallUI/src/com/android/incallui/InCallServiceImpl.java
+++ b/InCallUI/src/com/android/incallui/InCallServiceImpl.java
@@ -124,7 +124,7 @@ public class InCallServiceImpl extends InCallService {
call.setCapabilities(telecommCall.getCapabilities());
call.setConnectTimeMillis(telecommCall.getConnectTimeMillis());
call.setGatewayInfo(telecommCall.getGatewayInfo());
- call.setSubscription(telecommCall.getSubscription());
+ call.setAccount(telecommCall.getAccount());
call.setCurrentCallServiceDescriptor(telecommCall.getCurrentCallServiceDescriptor());
call.setHandoffCallServiceDescriptor(telecommCall.getHandoffCallServiceDescriptor());
call.setState(translateState(telecommCall.getState()));