From 899251968ee4ee3cb375032185653ecd888e3f8d Mon Sep 17 00:00:00 2001 From: Santos Cordon Date: Wed, 14 Aug 2013 12:39:32 -0700 Subject: Fix NullPointerException in InCallUI with CallTimer. bug: 10325158 Change-Id: Ie7e89c2e1e3038df89387e99de6849ed12203824 --- InCallUI/src/com/android/incallui/CallCardPresenter.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'InCallUI/src/com') diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 330957e80..60486f454 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -150,13 +150,15 @@ public class CallCardPresenter extends Presenter final CallCardUi ui = getUi(); if (ui == null || mPrimary == null || mPrimary.getState() != Call.State.ACTIVE) { - ui.setPrimaryCallElapsedTime(false, null); + if (ui != null) { + ui.setPrimaryCallElapsedTime(false, null); + } mCallTimer.cancel(); + } else { + final long callStart = mPrimary.getConnectTime(); + final long duration = System.currentTimeMillis() - callStart; + ui.setPrimaryCallElapsedTime(true, DateUtils.formatElapsedTime(duration / 1000)); } - - final long callStart = mPrimary.getConnectTime(); - final long duration = System.currentTimeMillis() - callStart; - ui.setPrimaryCallElapsedTime(true, DateUtils.formatElapsedTime(duration / 1000)); } -- cgit v1.2.3