diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-05 15:29:54 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-05 15:29:54 +0000 |
commit | 43b3152d075138b11e1fe297682b3bbc775e5641 (patch) | |
tree | 3a325b0effac02fbd228b8ddf2f96589e5df72cd /java/com/android/incallui/videotech/ims/ImsVideoTech.java | |
parent | 2034759538273aed8a0b412d8fb90994eba1f7ea (diff) | |
parent | 300a8683b9c28424fb0f0c571a0abe128c461f69 (diff) |
Update Dialer to V10 RC16 am: 10b34a5ebf
am: 300a8683b9
Change-Id: If5695bad59f8a4dab6e6c90b54943b900bd2652a
Diffstat (limited to 'java/com/android/incallui/videotech/ims/ImsVideoTech.java')
-rw-r--r-- | java/com/android/incallui/videotech/ims/ImsVideoTech.java | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/java/com/android/incallui/videotech/ims/ImsVideoTech.java b/java/com/android/incallui/videotech/ims/ImsVideoTech.java index 40fdc6fde..363a19397 100644 --- a/java/com/android/incallui/videotech/ims/ImsVideoTech.java +++ b/java/com/android/incallui/videotech/ims/ImsVideoTech.java @@ -39,6 +39,7 @@ public class ImsVideoTech implements VideoTech { private @SessionModificationState int sessionModificationState = SessionModificationState.NO_REQUEST; private int previousVideoState = VideoProfile.STATE_AUDIO_ONLY; + private boolean paused = false; public ImsVideoTech(LoggingBindings logger, VideoTechListener listener, Call call) { this.logger = logger; @@ -182,40 +183,52 @@ public class ImsVideoTech implements VideoTech { public void stopTransmission() { LogUtil.enterBlock("ImsVideoTech.stopTransmission"); + int unpausedVideoState = getUnpausedVideoState(call.getDetails().getVideoState()); call.getVideoCall() .sendSessionModifyRequest( - new VideoProfile(call.getDetails().getVideoState() & ~VideoProfile.STATE_TX_ENABLED)); + new VideoProfile(unpausedVideoState & ~VideoProfile.STATE_TX_ENABLED)); } @Override public void resumeTransmission() { LogUtil.enterBlock("ImsVideoTech.resumeTransmission"); + int unpausedVideoState = getUnpausedVideoState(call.getDetails().getVideoState()); call.getVideoCall() .sendSessionModifyRequest( - new VideoProfile(call.getDetails().getVideoState() | VideoProfile.STATE_TX_ENABLED)); + new VideoProfile(unpausedVideoState | VideoProfile.STATE_TX_ENABLED)); setSessionModificationState(SessionModificationState.WAITING_FOR_RESPONSE); } @Override public void pause() { - if (canPause()) { + if (canPause() && !paused) { LogUtil.i("ImsVideoTech.pause", "sending pause request"); + paused = true; int pausedVideoState = call.getDetails().getVideoState() | VideoProfile.STATE_PAUSED; call.getVideoCall().sendSessionModifyRequest(new VideoProfile(pausedVideoState)); } else { - LogUtil.i("ImsVideoTech.pause", "not sending request: canPause: %b", canPause()); + LogUtil.i( + "ImsVideoTech.pause", + "not sending request: canPause: %b, paused: %b", + canPause(), + paused); } } @Override public void unpause() { - if (canPause()) { + if (canPause() && paused) { LogUtil.i("ImsVideoTech.unpause", "sending unpause request"); + paused = false; int unpausedVideoState = getUnpausedVideoState(call.getDetails().getVideoState()); call.getVideoCall().sendSessionModifyRequest(new VideoProfile(unpausedVideoState)); } else { - LogUtil.i("ImsVideoTech.unpause", "not sending request: canPause: %b", canPause()); + LogUtil.i( + "ImsVideoTech.unpause", + "not sending request: canPause: %b, paused: %b", + canPause(), + paused); } } @@ -232,7 +245,8 @@ public class ImsVideoTech implements VideoTech { private boolean canPause() { return call.getDetails().can(Details.CAPABILITY_CAN_PAUSE_VIDEO) - && call.getState() == Call.STATE_ACTIVE; + && call.getState() == Call.STATE_ACTIVE + && isTransmitting(); } static int getUnpausedVideoState(int videoState) { |