summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantos Cordon <santoscordon@google.com>2013-08-14 12:39:32 -0700
committerSantos Cordon <santoscordon@google.com>2013-08-14 12:45:25 -0700
commit899251968ee4ee3cb375032185653ecd888e3f8d (patch)
treea8d539eb69a637798384aad9af30455dcf03fff4
parent58c37c6f5debfd8164e1dbc31ad13acfed6a2978 (diff)
Fix NullPointerException in InCallUI with CallTimer.
bug: 10325158 Change-Id: Ie7e89c2e1e3038df89387e99de6849ed12203824
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java12
1 files changed, 7 insertions, 5 deletions
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<CallCardPresenter.CallCardUi>
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));
}