From e7face9767de504ebae1e4615e810bf0d3af1b62 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Wed, 6 May 2015 09:50:12 -0700 Subject: Fix issue where fast 180 degree landscape rotation is not detected. - Cleaned up imports in InCallActivity. - Added new OrientationEventListener to listen for orientation changes to the device. This listener returns the current device rotation in degrees. Use the windowManager to get the current display rotation (e.g. in coarse 90 degree, 180, etc). - This solves the problem - can now detect rotation from landscape to landscape. Bug: 20727115 Change-Id: Icfad2b26083bb8236e9f4fe5580e3828cdef11b8 --- src/com/android/incallui/CallList.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/com/android/incallui/CallList.java') diff --git a/src/com/android/incallui/CallList.java b/src/com/android/incallui/CallList.java index e937bb16..bec81ec5 100644 --- a/src/com/android/incallui/CallList.java +++ b/src/com/android/incallui/CallList.java @@ -516,7 +516,12 @@ public class CallList { */ public void notifyCallsOfDeviceRotation(int rotation) { for (Call call : mCallById.values()) { - if (call.getVideoCall() != null) { + // First, ensure a VideoCall is set on the call so that the change can be sent to the + // provider (a VideoCall can be present for a call that does not currently have video, + // but can be upgraded to video). + // Second, ensure that the call videoState has video enabled (there is no need to set + // device orientation on a voice call which has not yet been upgraded to video). + if (call.getVideoCall() != null && CallUtils.isVideoCall(call)) { call.getVideoCall().setDeviceOrientation(rotation); } } -- cgit v1.2.3