From 70dce4edfc06166c9672fc490053ad1c2e88e889 Mon Sep 17 00:00:00 2001 From: maxwelb Date: Mon, 31 Jul 2017 13:03:06 -0700 Subject: Fix bug where CDMA generic conference showed wrong duration There was an issue with the duration shown in the InCallUI when a CMDA generic conference was ended early. This resulted in the duration showing as a huge number, rather than the proper value. This issue is a regression caused by cl/157138159, which attempts to only start the timer once. This CL fixes the issue by ensuring that the Chronometer's base is reset every time the timer row updates, instead of just once when start is called. This matches the logic from prior to cl/157138159. Repro steps: 1) Disable advanced calling on device with Verizon SIM 2) Place call from DUT to device A 3) Accept call on device A 4) Place call from DUT to device B 5) Before answering the call on device B, hang up the added call on DUT. Results (without fix): InCallUI switches to generic conference view (Phone number/name changes to "Incall"). Duration becomes a huge number. See https://drive.google.com/open?id=0B5N2YRME1XrUeDJWYnRBWGRQM00 Results (with fix): InCallUI switches to generic conference with proper duration. See https://drive.google.com/open?id=0B5N2YRME1XrUaDRtcjRWX3BxMTA Bug: 64099380 Test: Manual, see steps PiperOrigin-RevId: 163735661 Change-Id: I98bcd6517b55a21b58e4b32b00d66fdba4c45143 --- .../android/incallui/contactgrid/ContactGridManager.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'java/com/android') diff --git a/java/com/android/incallui/contactgrid/ContactGridManager.java b/java/com/android/incallui/contactgrid/ContactGridManager.java index a6d7d95f0..e4a8a1cc4 100644 --- a/java/com/android/incallui/contactgrid/ContactGridManager.java +++ b/java/com/android/incallui/contactgrid/ContactGridManager.java @@ -31,6 +31,7 @@ import android.widget.TextView; import android.widget.ViewAnimator; import com.android.contacts.common.compat.PhoneNumberUtilsCompat; import com.android.dialer.common.Assert; +import com.android.dialer.common.LogUtil; import com.android.dialer.lettertile.LetterTileDrawable; import com.android.dialer.util.DrawableConverter; import com.android.incallui.incall.protocol.ContactPhotoType; @@ -347,12 +348,16 @@ public class ContactGridManager { } if (info.isTimerVisible) { + bottomTextSwitcher.setDisplayedChild(1); + bottomTimerView.setBase( + primaryCallState.connectTimeMillis + - System.currentTimeMillis() + + SystemClock.elapsedRealtime()); if (!isTimerStarted) { - bottomTextSwitcher.setDisplayedChild(1); - bottomTimerView.setBase( - primaryCallState.connectTimeMillis - - System.currentTimeMillis() - + SystemClock.elapsedRealtime()); + LogUtil.i( + "ContactGridManager.updateBottomRow", + "starting timer with base: %d", + bottomTimerView.getBase()); bottomTimerView.start(); isTimerStarted = true; } -- cgit v1.2.3