diff options
author | Hung-ying Tyan <tyanh@google.com> | 2010-10-21 15:54:46 +0800 |
---|---|---|
committer | Hung-ying Tyan <tyanh@google.com> | 2010-10-21 15:54:46 +0800 |
commit | 5d9e3bbb9d076544b20032372a07ac26d7a86709 (patch) | |
tree | 3ba441f631e448752ec1414c0c8fa4383a786ec7 /telephony/java | |
parent | fa7a87fb4b3d25b0b6b0985d65848a144d28df26 (diff) | |
download | frameworks_base-5d9e3bbb9d076544b20032372a07ac26d7a86709.zip frameworks_base-5d9e3bbb9d076544b20032372a07ac26d7a86709.tar.gz frameworks_base-5d9e3bbb9d076544b20032372a07ac26d7a86709.tar.bz2 |
Fix connect duration for un-established SIP calls.
Bug: 3118364
Change-Id: I931b675de04a3aac70b45d6bae27ab42a84f2d1e
Diffstat (limited to 'telephony/java')
-rw-r--r-- | telephony/java/com/android/internal/telephony/sip/SipConnectionBase.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/telephony/java/com/android/internal/telephony/sip/SipConnectionBase.java b/telephony/java/com/android/internal/telephony/sip/SipConnectionBase.java index d546a08..154a334 100644 --- a/telephony/java/com/android/internal/telephony/sip/SipConnectionBase.java +++ b/telephony/java/com/android/internal/telephony/sip/SipConnectionBase.java @@ -49,7 +49,7 @@ abstract class SipConnectionBase extends Connection { * calculating deltas. */ private long connectTimeReal; - private long duration; + private long duration = -1L; private long holdingStartTime; // The time when the Connection last transitioned // into HOLDING @@ -74,7 +74,7 @@ abstract class SipConnectionBase extends Connection { } break; case DISCONNECTED: - duration = SystemClock.elapsedRealtime() - connectTimeReal; + duration = getDurationMillis(); disconnectTime = System.currentTimeMillis(); break; case HOLDING: @@ -102,7 +102,7 @@ abstract class SipConnectionBase extends Connection { public long getDurationMillis() { if (connectTimeReal == 0) { return 0; - } else if (duration == 0) { + } else if (duration < 0) { return SystemClock.elapsedRealtime() - connectTimeReal; } else { return duration; |