diff options
author | Muhammed Siju <msiju@codeaurora.org> | 2015-12-24 19:12:59 +0530 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-05-20 23:09:14 -0700 |
commit | aa7ceb4ad82cd7e219a7115591607eee219e43e1 (patch) | |
tree | b456d7d8dec61474dac4534feacda8e445c02874 /src/com | |
parent | 65c7670ca82dfce0bbb7ad58277f994abc5ad7dc (diff) | |
download | packages_apps_InCallUI-aa7ceb4ad82cd7e219a7115591607eee219e43e1.tar.gz packages_apps_InCallUI-aa7ceb4ad82cd7e219a7115591607eee219e43e1.tar.bz2 packages_apps_InCallUI-aa7ceb4ad82cd7e219a7115591607eee219e43e1.zip |
Fix issue of held call disappearing during swap operation.
Sometimes during call swap, both calls may appear as ACTIVE at
InCall app momentarily. Secondary call info will not be displayed
in such cases. Back to back hide/show requests for secondary call
causes held call to be hidden due to a race condition.
To avoid this, assign the second ACTIVE call as the secondary call.
Change-Id: Ibd83dfc68b323de66a116d6a8283f5d5e0364a24
CRs-Fixed: 954866
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/incallui/CallCardPresenter.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/incallui/CallCardPresenter.java b/src/com/android/incallui/CallCardPresenter.java index b0e83b7c..8513eb6b 100644 --- a/src/com/android/incallui/CallCardPresenter.java +++ b/src/com/android/incallui/CallCardPresenter.java @@ -208,6 +208,23 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } else if (newState == InCallState.INCALL) { primary = getCallToDisplay(callList, null, false); secondary = getCallToDisplay(callList, primary, true); + // During swap scenarios, two calls can be ACTIVE at the same time momentarily. + // In such cases secondary above will be null. To avoid flickering of secondary + // call view, assign the non primary call as secondary here. + if (secondary == null && primary != null) { + Call probableSecondary = null; + if (primary == mPrimary) { + probableSecondary = mSecondary; + } else if (primary == mSecondary) { + probableSecondary = mPrimary; + } + if (probableSecondary != null && + probableSecondary.getState() == Call.State.ACTIVE && + primary.getSubId() == probableSecondary.getSubId()) { + Log.v(this, "Two calls ACTIVE"); + secondary = probableSecondary; + } + } } Log.d(this, "Primary call: " + primary); |