summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui/CallCardFragment.java
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2015-03-26 10:50:42 -0700
committerYorke Lee <yorkelee@google.com>2015-03-26 10:50:42 -0700
commit300b3d0b7e3c335483febbf8fc5ee0ee4f059c39 (patch)
tree486b069d531d607cc431e16b874f1a24025dc60e /InCallUI/src/com/android/incallui/CallCardFragment.java
parent753fae1bfe34ac79b96648b17dcd8498b1a6a974 (diff)
parent22875bb1d3fa4f023e6ca127a77159ab42bbbabc (diff)
merge changes from m-wireless
Change-Id: Id93b2d6e840baaa0b9b42b4595bca0dc41972994
Diffstat (limited to 'InCallUI/src/com/android/incallui/CallCardFragment.java')
-rw-r--r--InCallUI/src/com/android/incallui/CallCardFragment.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java
index 5f5146e19..94e4ef161 100644
--- a/InCallUI/src/com/android/incallui/CallCardFragment.java
+++ b/InCallUI/src/com/android/incallui/CallCardFragment.java
@@ -491,10 +491,11 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
DisconnectCause disconnectCause,
String connectionLabel,
Drawable callStateIcon,
- String gatewayNumber) {
+ String gatewayNumber,
+ boolean isWifi) {
boolean isGatewayCall = !TextUtils.isEmpty(gatewayNumber);
CharSequence callStateLabel = getCallStateLabelFromState(state, videoState,
- sessionModificationState, disconnectCause, connectionLabel, isGatewayCall);
+ sessionModificationState, disconnectCause, connectionLabel, isGatewayCall, isWifi);
Log.v(this, "setCallState " + callStateLabel);
Log.v(this, "DisconnectCause " + disconnectCause.toString());
@@ -502,6 +503,10 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
if (TextUtils.equals(callStateLabel, mCallStateLabel.getText())) {
// Nothing to do if the labels are the same
+ if (state == Call.State.ACTIVE || state == Call.State.CONFERENCED) {
+ mCallStateLabel.clearAnimation();
+ mCallStateIcon.clearAnimation();
+ }
return;
}
@@ -655,10 +660,11 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
* 2. Ongoing calls will display the name of the provider.
* 3. Incoming calls will only display "Incoming via..." for accounts.
* 4. Video calls, and session modification states (eg. requesting video).
+ * 5. Incoming and active Wi-Fi calls will show label provided by hint.
*/
private CharSequence getCallStateLabelFromState(int state, int videoState,
int sessionModificationState, DisconnectCause disconnectCause, String label,
- boolean isGatewayCall) {
+ boolean isGatewayCall, boolean isWifi) {
final Context context = getView().getContext();
CharSequence callStateLabel = null; // Label to display as part of the call banner
@@ -672,7 +678,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 (isAccount) {
+ if (isAccount || isWifi) {
callStateLabel = label;
} else if (sessionModificationState
== Call.SessionModificationState.REQUEST_FAILED) {
@@ -689,7 +695,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
break;
case Call.State.CONNECTING:
case Call.State.DIALING:
- if (isSpecialCall) {
+ if (isSpecialCall && !isWifi) {
callStateLabel = context.getString(R.string.calling_via_template, label);
} else {
callStateLabel = context.getString(R.string.card_title_dialing);
@@ -700,7 +706,9 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
break;
case Call.State.INCOMING:
case Call.State.CALL_WAITING:
- if (isAccount) {
+ if (isWifi) {
+ callStateLabel = label;
+ } else if (isAccount) {
callStateLabel = context.getString(R.string.incoming_via_template, label);
} else if (VideoProfile.VideoState.isBidirectional(videoState)) {
callStateLabel = context.getString(R.string.notification_incoming_video_call);