diff options
author | Yorke Lee <yorkelee@google.com> | 2015-04-20 17:02:42 +0000 |
---|---|---|
committer | Android Partner Code Review <android-gerrit-partner@google.com> | 2015-04-20 17:02:43 +0000 |
commit | 3e76471d9cea97fd29cd2b39dde6d03d4e84786f (patch) | |
tree | ee2dabe5dd607f375e3dae35f0fc5d05429296a1 /InCallUI | |
parent | b04531805a54810a767e5b774215226d95b8f306 (diff) | |
parent | 70a57bc30af026e8e3a9c5d715acdd3897b8ed12 (diff) |
Merge "DO NOT MERGE Remove use of VideoProfile.VideoState.isVideo" into m-wireless-dev
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 254460d76..729d87c8c 100644 --- a/InCallUI/src/com/android/incallui/Call.java +++ b/InCallUI/src/com/android/incallui/Call.java @@ -443,7 +443,7 @@ public final 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 c6f61be01..ba9dac505 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -552,7 +552,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); @@ -680,7 +680,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()); } /** |