diff options
author | yueg <yueg@google.com> | 2017-09-12 11:10:45 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-09-13 14:15:01 -0700 |
commit | 7f78e9a692d7d7ca1f1204421adce91545a880f8 (patch) | |
tree | 955bc0586790d75ec67753586e905eccf4224d98 /java/com/android/incallui/videotech/ims/ImsVideoCallCallback.java | |
parent | b21b9f9b2efbc358ee9806af87b7edc3f82af4da (diff) |
Log swiping and clicking for switching tabs.
If it's a swipe, onPageScrolled() is called several times before onPageScrollStateChanged(SCROLL_STATE_SETTLING) and onPageSelected().
If it's a click, only onPageScrollStateChanged(SCROLL_STATE_SETTLING) is called before onPageSelected().
And onPageScrollStateChanged(SCROLL_STATE_SETTLING) will not be called if user don't switch to a new tab.
We use the difference to tell if user switching tabs by swiping or clicking.
Test: DialtactsActivityTest
PiperOrigin-RevId: 168403148
Change-Id: Iaaf84ab9c4955d0bc2c1e9857ba59fd37b3984af
Diffstat (limited to 'java/com/android/incallui/videotech/ims/ImsVideoCallCallback.java')
-rw-r--r-- | java/com/android/incallui/videotech/ims/ImsVideoCallCallback.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/java/com/android/incallui/videotech/ims/ImsVideoCallCallback.java b/java/com/android/incallui/videotech/ims/ImsVideoCallCallback.java index b83929304..49170b8dc 100644 --- a/java/com/android/incallui/videotech/ims/ImsVideoCallCallback.java +++ b/java/com/android/incallui/videotech/ims/ImsVideoCallCallback.java @@ -66,10 +66,16 @@ public class ImsVideoCallCallback extends VideoCall.Callback { "ImsVideoTech.onSessionModifyRequestReceived", "call downgraded to %d", newVideoState); } else if (previousVideoState != newVideoState) { requestedVideoState = newVideoState; - videoTech.setSessionModificationState( - SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST); - listener.onVideoUpgradeRequestReceived(); - logger.logImpression(DialerImpression.Type.IMS_VIDEO_REQUEST_RECEIVED); + if (!wasVideoCall) { + videoTech.setSessionModificationState( + SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST); + listener.onVideoUpgradeRequestReceived(); + logger.logImpression(DialerImpression.Type.IMS_VIDEO_REQUEST_RECEIVED); + } else { + LogUtil.i( + "ImsVideoTech.onSessionModifyRequestReceived", "call updated to %d", newVideoState); + videoTech.acceptVideoRequest(); + } } } |