From 8cc908aef3668de57a3991438e03c3863a4160d8 Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Wed, 24 Feb 2016 16:20:22 -0800 Subject: Fix bug of secondary call info disappear after switching calls. Bug: 27323979 Change-Id: I6f66052dee5ef3be32df4008835d0918bba54e50 --- InCallUI/src/com/android/incallui/CallCardPresenter.java | 7 +++++++ InCallUI/src/com/android/incallui/CallList.java | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'InCallUI') diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index dd255e09e..e7ddd5a81 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -697,6 +697,13 @@ public class CallCardPresenter extends Presenter return retval; } + // Sometimes there is intemediate state that two calls are in active even one is about + // to be on hold. + retval = callList.getSecondActiveCall(); + if (retval != null && retval != ignore) { + return retval; + } + // Disconnected calls get primary position if there are no active calls // to let user know quickly what call has disconnected. Disconnected // calls are very short lived. diff --git a/InCallUI/src/com/android/incallui/CallList.java b/InCallUI/src/com/android/incallui/CallList.java index 99def3669..d0f3c1000 100644 --- a/InCallUI/src/com/android/incallui/CallList.java +++ b/InCallUI/src/com/android/incallui/CallList.java @@ -298,6 +298,10 @@ public class CallList { return getFirstCallWithState(Call.State.ACTIVE); } + public Call getSecondActiveCall() { + return getCallWithState(Call.State.ACTIVE, 1); + } + public Call getBackgroundCall() { return getFirstCallWithState(Call.State.ONHOLD); } -- cgit v1.2.3