diff options
author | mengsun <msun@codeaurora.org> | 2014-04-21 12:19:37 +0800 |
---|---|---|
committer | emancebo <emancebo@cyngn.com> | 2014-09-04 15:20:00 -0700 |
commit | 9bc230730809ffbdf3138343200090d8eefbe565 (patch) | |
tree | cdaba3c3a021846a6ccf6a62322cf3d3bf99f7c7 /src | |
parent | 5d646ef42ff0718080038775c4ffd73921f4e55b (diff) | |
download | packages_apps_InCallUI-9bc230730809ffbdf3138343200090d8eefbe565.tar.gz packages_apps_InCallUI-9bc230730809ffbdf3138343200090d8eefbe565.tar.bz2 packages_apps_InCallUI-9bc230730809ffbdf3138343200090d8eefbe565.zip |
Fix no sound hear when one call disconnected.
Reset current activated subscription when call state changed.
CRs-Fixed: 638094
Change-Id: Ie65483a8b2880ae0529a943c6ccb16d0ed9b3b04
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/incallui/CallList.java | 10 | ||||
-rw-r--r-- | src/com/android/incallui/InCallPresenter.java | 21 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/com/android/incallui/CallList.java b/src/com/android/incallui/CallList.java index 16a15af4..c9dca280 100644 --- a/src/com/android/incallui/CallList.java +++ b/src/com/android/incallui/CallList.java @@ -550,6 +550,16 @@ public class CallList { } } + public boolean existsConnectedCall(int subscription) { + for (Call call : mCallMap.values()) { + if (!isCallDead(call) && call.getState() != Call.State.DISCONNECTED + && call.getSubscription() == subscription) { + return true; + } + } + return false; + } + /** * Returns true, if any voice call in ACTIVE on the provided subscription. */ diff --git a/src/com/android/incallui/InCallPresenter.java b/src/com/android/incallui/InCallPresenter.java index 8169721a..b697e393 100644 --- a/src/com/android/incallui/InCallPresenter.java +++ b/src/com/android/incallui/InCallPresenter.java @@ -679,6 +679,21 @@ public class InCallPresenter implements CallList.Listener { } } + private void switchActiveSubIfNeed() { + Log.d(this, "startOrFinishUi call list:" + mCallList); + if (mCallList != null) { + int activeSub = mCallList.getActiveSubscription(); + boolean hasActiveCall = mCallList.existsConnectedCall(activeSub); + Log.d(this, "startOrFinishUi active sub : " + activeSub); + Log.d(this, "has connected call in active sub:" + hasActiveCall); + if (!hasActiveCall) { + Log.d(this, "switch sub in non-dsda, cause " + mLastDisconnectCause); + boolean retainLch = mLastDisconnectCause == Call.DisconnectCause.NORMAL; + mCallList.switchToOtherActiveSubscription(retainLch); + } + } + } + /** * When the state of in-call changes, this is the first method to get called. It determines if * the UI needs to be started or finished depending on the new state and does it. @@ -686,6 +701,12 @@ public class InCallPresenter implements CallList.Listener { private InCallState startOrFinishUi(InCallState newState) { Log.d(this, "startOrFinishUi: " + mInCallState + " -> " + newState); + // If there is a CS call in sub2, and there is a SIP call in sub1 + // disconnected, INCALL state will be got in non-dsda, so need switch + // active sub + if (newState == InCallState.INCALL) { + switchActiveSubIfNeed(); + } // TODO: Consider a proper state machine implementation // If the state isn't changing, we have already done any starting/stopping of |