summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/Call.java2
-rw-r--r--InCallUI/src/com/android/incallui/CallCardFragment.java4
-rw-r--r--InCallUI/src/com/android/incallui/CallUtils.java8
-rw-r--r--InCallUI/src/com/android/incallui/InCallVideoCallCallback.java6
-rw-r--r--InCallUI/src/com/android/incallui/VideoPauseController.java2
5 files changed, 14 insertions, 8 deletions
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java
index e26c04794..a12b985ee 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -468,7 +468,7 @@ public class Call {
public boolean isVideoCall(Context context) {
return CallUtil.isVideoEnabled(context) &&
- VideoProfile.VideoState.isVideo(getVideoState());
+ CallUtils.isVideoCall(getVideoState());
}
/**
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java
index 5e1c26a30..57fc4b713 100644
--- a/InCallUI/src/com/android/incallui/CallCardFragment.java
+++ b/InCallUI/src/com/android/incallui/CallCardFragment.java
@@ -557,7 +557,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
mCallStateIcon.setVisibility(View.GONE);
}
- if (VideoProfile.VideoState.isVideo(videoState)
+ if (CallUtils.isVideoCall(videoState)
|| (state == Call.State.ACTIVE && sessionModificationState
== Call.SessionModificationState.WAITING_FOR_RESPONSE)) {
mCallStateVideoCallIcon.setVisibility(View.VISIBLE);
@@ -687,7 +687,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
} else if (sessionModificationState
== Call.SessionModificationState.WAITING_FOR_RESPONSE) {
callStateLabel = context.getString(R.string.card_title_video_call_requesting);
- } else if (VideoProfile.VideoState.isVideo(videoState) &&
+ } else if (CallUtils.isVideoCall(videoState) &&
VideoProfile.VideoState.isPaused(videoState)) {
callStateLabel = context.getString(R.string.card_title_video_call_paused);
} else if (VideoProfile.VideoState.isBidirectional(videoState)) {
diff --git a/InCallUI/src/com/android/incallui/CallUtils.java b/InCallUI/src/com/android/incallui/CallUtils.java
index 80b553aa7..51913d4d2 100644
--- a/InCallUI/src/com/android/incallui/CallUtils.java
+++ b/InCallUI/src/com/android/incallui/CallUtils.java
@@ -35,7 +35,13 @@ import com.google.common.base.Preconditions;
public class CallUtils {
public static boolean isVideoCall(Call call) {
- return call != null && VideoProfile.VideoState.isVideo(call.getVideoState());
+ return call != null && isVideoCall(call.getVideoState());
+ }
+
+ public static boolean isVideoCall(int videoState) {
+ return VideoProfile.VideoState.isBidirectional(videoState)
+ && VideoProfile.VideoState.isTransmissionEnabled(videoState)
+ && VideoProfile.VideoState.isReceptionEnabled(videoState);
}
public static boolean isIncomingVideoCall(Call call) {
diff --git a/InCallUI/src/com/android/incallui/InCallVideoCallCallback.java b/InCallUI/src/com/android/incallui/InCallVideoCallCallback.java
index f868b3baf..ba4ab660d 100644
--- a/InCallUI/src/com/android/incallui/InCallVideoCallCallback.java
+++ b/InCallUI/src/com/android/incallui/InCallVideoCallCallback.java
@@ -52,8 +52,8 @@ public class InCallVideoCallCallback extends VideoCall.Callback {
int previousVideoState = CallUtils.getUnPausedVideoState(mCall.getVideoState());
int newVideoState = CallUtils.getUnPausedVideoState(videoProfile.getVideoState());
- boolean wasVideoCall = VideoProfile.VideoState.isVideo(previousVideoState);
- boolean isVideoCall = VideoProfile.VideoState.isVideo(newVideoState);
+ boolean wasVideoCall = CallUtils.isVideoCall(previousVideoState);
+ boolean isVideoCall = CallUtils.isVideoCall(newVideoState);
// Check for upgrades to video and downgrades to audio.
if (wasVideoCall && !isVideoCall) {
@@ -84,7 +84,7 @@ public class InCallVideoCallCallback extends VideoCall.Callback {
} else if (requestedProfile != null && responseProfile != null) {
boolean modifySucceeded = requestedProfile.getVideoState() ==
responseProfile.getVideoState();
- boolean isVideoCall = VideoProfile.VideoState.isVideo(responseProfile.getVideoState());
+ boolean isVideoCall = CallUtils.isVideoCall(responseProfile.getVideoState());
if (modifySucceeded && isVideoCall) {
InCallVideoCallCallbackNotifier.getInstance().upgradeToVideoSuccess(mCall);
} else if (!modifySucceeded && isVideoCall) {
diff --git a/InCallUI/src/com/android/incallui/VideoPauseController.java b/InCallUI/src/com/android/incallui/VideoPauseController.java
index 14e43b175..54e31f8d9 100644
--- a/InCallUI/src/com/android/incallui/VideoPauseController.java
+++ b/InCallUI/src/com/android/incallui/VideoPauseController.java
@@ -407,7 +407,7 @@ class VideoPauseController implements InCallStateListener, IncomingCallListener,
* @return {@code true} if the call is a video call, {@code false} otherwise.
*/
private static boolean isVideoCall(CallContext callContext) {
- return callContext != null && VideoProfile.VideoState.isVideo(callContext.getVideoState());
+ return callContext != null && CallUtils.isVideoCall(callContext.getVideoState());
}
/**