diff options
author | Brad Ebinger <breadley@google.com> | 2017-07-07 15:59:13 -0700 |
---|---|---|
committer | Brad Ebinger <breadley@google.com> | 2017-07-10 22:10:19 +0000 |
commit | b079fc5ba77b79175837c1132211b9d81cb9ad78 (patch) | |
tree | ce4b6f9115ffd29891e1297a45abac62fe56ee16 /src | |
parent | 38141eefcd12f5ff9127612da374d03a4803de54 (diff) | |
download | android_packages_services_Telecomm-b079fc5ba77b79175837c1132211b9d81cb9ad78.tar.gz android_packages_services_Telecomm-b079fc5ba77b79175837c1132211b9d81cb9ad78.tar.bz2 android_packages_services_Telecomm-b079fc5ba77b79175837c1132211b9d81cb9ad78.zip |
Log Outgoing rejected/canceled VT calls as video
When placing a call that is rejected or canceled before
it went to active, we used to log those calls as audio calls.
This change fixes that bug and correctly logs these
canceled/rejected calls as video calls.
Test: Manual, telecom unit tests
Bug: 63099560
Change-Id: I8eff4c99d06a50c7d19ec3cfa08524cf1ad79ac2
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/server/telecom/Call.java | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java index ad9ac355..9ab52900 100644 --- a/src/com/android/server/telecom/Call.java +++ b/src/com/android/server/telecom/Call.java @@ -780,6 +780,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable { return; } + updateVideoHistoryViaState(mState, newState); + mState = newState; maybeLoadCannedSmsResponses(); @@ -792,12 +794,6 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable { mAnalytics.setCallStartTime(mConnectTimeMillis); } - // Video state changes are normally tracked against history when a call is active. - // When the call goes active we need to be sure we track the history in case the - // state never changes during the duration of the call -- we want to ensure we - // always know the state at the start of the call. - mVideoStateHistory = mVideoStateHistory | mVideoState; - // We're clearly not disconnected, so reset the disconnected time. mDisconnectTimeMillis = 0; } else if (mState == CallState.DISCONNECTED) { @@ -806,12 +802,6 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable { setLocallyDisconnecting(false); fixParentAfterDisconnect(); } - if (mState == CallState.DISCONNECTED && - (mDisconnectCause.getCode() == DisconnectCause.MISSED || - mDisconnectCause.getCode() == DisconnectCause.REJECTED)) { - // Ensure when an incoming call is missed that the video state history is updated. - mVideoStateHistory |= mVideoState; - } // Log the state transition event String event = null; @@ -2487,13 +2477,14 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable { videoState = VideoProfile.STATE_AUDIO_ONLY; } - // Track which video states were applicable over the duration of the call. - // Only track the call state when the call is active or disconnected. This ensures we do - // not include the video state when: + // Track Video State history during the duration of the call. + // Only update the history when the call is active or disconnected. This ensures we do + // not include the video state history when: // - Call is incoming (but not answered). // - Call it outgoing (but not answered). // We include the video state when disconnected to ensure that rejected calls reflect the // appropriate video state. + // For all other times we add to the video state history, see #setState. if (isActive() || getState() == CallState.DISCONNECTED) { mVideoStateHistory = mVideoStateHistory | videoState; } @@ -2740,4 +2731,21 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable { l.onHandoverRequested(this, handoverToHandle, videoState, extras); } } + + /** + * Sets the video history based on the state and state transitions of the call. Always add the + * current video state to the video state history during a call transition except for the + * transitions DIALING->ACTIVE and RINGING->ACTIVE. In these cases, clear the history. If a + * call starts dialing/ringing as a VT call and gets downgraded to audio, we need to record + * the history as an audio call. + */ + private void updateVideoHistoryViaState(int oldState, int newState) { + if ((oldState == CallState.DIALING || oldState == CallState.RINGING) + && newState == CallState.ACTIVE) { + mVideoStateHistory = mVideoState; + } + + mVideoStateHistory |= mVideoState; + } + } |