diff options
author | Yorke Lee <yorkelee@google.com> | 2015-04-20 16:53:33 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-20 16:53:33 +0000 |
commit | e14ae85f2c0023c410cf5f3217125150d7b26790 (patch) | |
tree | 6113acd525dab19d8a91d54302f4a5c51b33e618 /InCallUI | |
parent | e39b860bf4c2c499ee892f07046dccebff4677d1 (diff) | |
parent | b337928d730a578a55f13a322e6f87e74c24a088 (diff) |
Merge "Remove use of VideoProfile.VideoState.isVideo"
Diffstat (limited to 'InCallUI')
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 9359fd5c0..e49ff86c5 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()); } /** |