diff options
author | wangqi <wangqi@google.com> | 2017-07-11 15:48:57 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-07-12 09:43:41 -0700 |
commit | 26c4fbb22fd91bd7ff8aa129e92e665415cc5922 (patch) | |
tree | 4ecf4483fa8da31a263268945e153cf8c1040af2 /java/com/android | |
parent | 4e707bb5d1a9ab1c668e834b2c56e6b75d1f82d7 (diff) |
Fix bug that proximity sensor is turned on too early.
This is caused by setting call state to OUTGOING after it's created but before
it's connecting, which incorrectly switches state as NO_CALL -> OUTGOING ->
PENDING_OUTGOING -> OUTGOING.
The fix is giving it PENDING_OUTGOING state if an outgoing call is initialized
but still not yet getting update from telecom to CONNECTING (in which case the
call will be IDLE state).
Bug: 62965119
Test: manual
PiperOrigin-RevId: 161594187
Change-Id: I02c8b4dcb0bfd5101bc69f48bb99c66d4831b72e
Diffstat (limited to 'java/com/android')
-rw-r--r-- | java/com/android/incallui/InCallPresenter.java | 4 | ||||
-rw-r--r-- | java/com/android/incallui/ProximitySensor.java | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java index 64bc4048c..0dd654903 100644 --- a/java/com/android/incallui/InCallPresenter.java +++ b/java/com/android/incallui/InCallPresenter.java @@ -852,7 +852,7 @@ public class InCallPresenter implements CallList.Listener { if (newState == InCallState.NO_CALLS) { if (mBoundAndWaitingForOutgoingCall) { - return InCallState.OUTGOING; + return InCallState.PENDING_OUTGOING; } } @@ -870,7 +870,7 @@ public class InCallPresenter implements CallList.Listener { mBoundAndWaitingForOutgoingCall = isBound; mThemeColorManager.setPendingPhoneAccountHandle(handle); if (isBound && mInCallState == InCallState.NO_CALLS) { - mInCallState = InCallState.OUTGOING; + mInCallState = InCallState.PENDING_OUTGOING; } } diff --git a/java/com/android/incallui/ProximitySensor.java b/java/com/android/incallui/ProximitySensor.java index 653d85be9..db538abdc 100644 --- a/java/com/android/incallui/ProximitySensor.java +++ b/java/com/android/incallui/ProximitySensor.java @@ -102,7 +102,10 @@ public class ProximitySensor // sensor during incoming call screen. We check hasLiveCall() because a disconnected call // can also put the in-call screen in the INCALL state. boolean hasOngoingCall = InCallState.INCALL == newState && callList.hasLiveCall(); - boolean isOffhook = (InCallState.OUTGOING == newState) || hasOngoingCall; + boolean isOffhook = + InCallState.PENDING_OUTGOING == newState + || InCallState.OUTGOING == newState + || hasOngoingCall; DialerCall activeCall = callList.getActiveCall(); boolean isVideoCall = activeCall != null && activeCall.isVideoCall(); |