diff options
author | yueg <yueg@google.com> | 2017-08-03 15:27:10 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-03 15:57:57 -0700 |
commit | 848f1c463a162e4423433f988859336ae61de6d7 (patch) | |
tree | 0e65b27456d96cef469c1f070951b8c15f43f275 /java/com | |
parent | 06d387950fffadc798f222d2a5d4f8fd62b4f595 (diff) |
A possible fix for wrong duration.
We have much longer duration than expected especially on NE1 devices. Although we can't reproduce it, we should not reset duration if a call is already disconnected.
Bug: 63930386
Test: none
PiperOrigin-RevId: 164191850
Change-Id: I851d9cc9ce64a7df32bd388e45f6613372670d81
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/android/incallui/call/DialerCall.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 20dab9692..6ba0c8121 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -682,13 +682,23 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } public void setState(int state) { - mState = state; - if (mState == State.INCOMING) { + if (state == State.INCOMING) { mLogState.isIncoming = true; - } else if (mState == State.DISCONNECTED) { - mLogState.duration = + } else if (state == State.DISCONNECTED) { + long newDuration = getConnectTimeMillis() == 0 ? 0 : System.currentTimeMillis() - getConnectTimeMillis(); + if (mState != state) { + mLogState.duration = newDuration; + } else { + LogUtil.i( + "DialerCall.setState", + "ignoring state transition from DISCONNECTED to DISCONNECTED." + + " Duration would have changed from %s to %s", + mLogState.duration, + newDuration); + } } + mState = state; } public int getNumberPresentation() { |