diff options
Diffstat (limited to 'java/com/android/incallui/videotech/ims/ImsVideoTech.java')
-rw-r--r-- | java/com/android/incallui/videotech/ims/ImsVideoTech.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/java/com/android/incallui/videotech/ims/ImsVideoTech.java b/java/com/android/incallui/videotech/ims/ImsVideoTech.java index a6cef7b81..3d73e4e7d 100644 --- a/java/com/android/incallui/videotech/ims/ImsVideoTech.java +++ b/java/com/android/incallui/videotech/ims/ImsVideoTech.java @@ -19,6 +19,7 @@ package com.android.incallui.videotech.ims; import android.content.Context; import android.os.Build; import android.support.annotation.Nullable; +import android.support.annotation.VisibleForTesting; import android.telecom.Call; import android.telecom.Call.Details; import android.telecom.VideoProfile; @@ -40,7 +41,8 @@ public class ImsVideoTech implements VideoTech { private @SessionModificationState int sessionModificationState = SessionModificationState.NO_REQUEST; private int previousVideoState = VideoProfile.STATE_AUDIO_ONLY; - private boolean paused = false; + + @VisibleForTesting boolean paused = false; public ImsVideoTech(LoggingBindings logger, VideoTechListener listener, Call call) { this.logger = logger; @@ -247,6 +249,24 @@ public class ImsVideoTech implements VideoTech { call.getVideoCall().setDeviceOrientation(rotation); } + /** + * Called when we receive an rx_pause from the IMS stack. Update our state so we know we are + * currently paused. This is important in the cases where we swap calls since pause() and + * unpause() are not called. + */ + void onPausedEvent() { + paused = true; + } + + /** + * Called when we receive an rx_resume from the IMS stack. Update our state so we know we are + * currently not paused. This is important in the cases where we swap calls since pause() and + * unpause() are not called. + */ + void onResumedEvent() { + paused = false; + } + private boolean canPause() { return call.getDetails().can(Details.CAPABILITY_CAN_PAUSE_VIDEO) && call.getState() == Call.STATE_ACTIVE |