diff options
author | Muhammed Siju <msiju_qc@codeaurora.org> | 2014-01-01 10:50:45 +0530 |
---|---|---|
committer | emancebo <emancebo@cyngn.com> | 2014-09-02 15:42:29 -0700 |
commit | 7c828405be0caa2c2fa41e20805fd76fc7aa7e75 (patch) | |
tree | 6a420ef02b7c6d3328f35fbbfb3ba1bd4027947a | |
parent | 90e0e146037955ee0a47045cd8790da5f248ed77 (diff) | |
download | packages_apps_InCallUI-7c828405be0caa2c2fa41e20805fd76fc7aa7e75.tar.gz packages_apps_InCallUI-7c828405be0caa2c2fa41e20805fd76fc7aa7e75.tar.bz2 packages_apps_InCallUI-7c828405be0caa2c2fa41e20805fd76fc7aa7e75.zip |
MSIM(DSDA): Retain LCH mode of other active sub for MT far-end disconnect.
When a call is ended by remote party on one sub, if an active call is
present in other sub, set the other sub as active while retaining
it's LCH state.
If the call was disconnected locally, disable LCH for the other active
sub.
Conflicts:
src/com/android/incallui/CallCommandClient.java
CRs-Fixed: 548848
Change-Id: I31e0fd445e243fcabbca39eb8498ba99c55a96a1
-rw-r--r-- | src/com/android/incallui/CallCommandClient.java | 14 | ||||
-rw-r--r-- | src/com/android/incallui/CallList.java | 7 | ||||
-rw-r--r-- | src/com/android/incallui/InCallPresenter.java | 12 | ||||
-rw-r--r-- | src/com/android/incallui/MSimInCallActivity.java | 8 |
4 files changed, 31 insertions, 10 deletions
diff --git a/src/com/android/incallui/CallCommandClient.java b/src/com/android/incallui/CallCommandClient.java index f55c9d8d..ae5f2f93 100644 --- a/src/com/android/incallui/CallCommandClient.java +++ b/src/com/android/incallui/CallCommandClient.java @@ -345,19 +345,27 @@ public class CallCommandClient { } } - public void setActiveSubscription(int subscriptionId) { - Log.i(this, "set active sub = " + subscriptionId); + public void setActiveSubscription(int subscriptionId, boolean retainLch) { + Log.i(this, "set active sub = " + subscriptionId + " retainLch = " + retainLch); if (mCommandService == null) { Log.e(this, "Cannot set active Sub; CallCommandService == null"); return; } try { - mCommandService.setActiveSubscription(subscriptionId); + if (retainLch) { + mCommandService.setActiveSubRetainLch(subscriptionId); + } else { + mCommandService.setActiveSubscription(subscriptionId); + } } catch (RemoteException e) { Log.e(this, "Error setActiveSub.", e); } } + public void setActiveSubscription(int subscriptionId) { + setActiveSubscription(subscriptionId, false); + } + public int getActiveSubscription() { int subscriptionId = MSimConstants.INVALID_SUBSCRIPTION; diff --git a/src/com/android/incallui/CallList.java b/src/com/android/incallui/CallList.java index e9cab0da..4ddc3c78 100644 --- a/src/com/android/incallui/CallList.java +++ b/src/com/android/incallui/CallList.java @@ -564,15 +564,18 @@ public class CallList { * This method checks whether any other subscription currently has active voice * call other than current active subscription, if yes it makes that other * subscription as active subscription i.e user visible subscription. + * @param retainLch whether to retain the LCH state of the other active sub */ - public boolean switchToOtherActiveSubscription() { + public boolean switchToOtherActiveSubscription(boolean retainLch) { int activeSub = getActiveSubscription(); boolean subSwitched = false; for (int i = 0; i < MSimTelephonyManager.getDefault().getPhoneCount(); i++) { if ((i != activeSub) && existsLiveCall(i)) { - Log.i(this, "switchToOtherActiveSubscription, sub = " + i); + Log.i(this, "switchToOtherActiveSubscription, sub = " + i + + " retainLch = " + retainLch); subSwitched = true; + CallCommandClient.getInstance().setActiveSubscription(i, retainLch); setActiveSubscription(i); break; } diff --git a/src/com/android/incallui/InCallPresenter.java b/src/com/android/incallui/InCallPresenter.java index 5204d22b..8169721a 100644 --- a/src/com/android/incallui/InCallPresenter.java +++ b/src/com/android/incallui/InCallPresenter.java @@ -100,6 +100,8 @@ public class InCallPresenter implements CallList.Listener { private boolean isImsMediaInitialized = false; + private Call.DisconnectCause mLastDisconnectCause = Call.DisconnectCause.UNKNOWN; + public static synchronized InCallPresenter getInstance() { if (sInCallPresenter == null) { sInCallPresenter = new InCallPresenter(); @@ -173,9 +175,11 @@ public class InCallPresenter implements CallList.Listener { final boolean doFinish = (mInCallActivity != null && isActivityStarted()); Log.i(this, "Hide in call UI: " + doFinish); - if ((mCallList != null) && !(mCallList.existsLiveCall(mCallList.getActiveSubscription())) - && mCallList.switchToOtherActiveSubscription()) { - return; + if ((mCallList != null) && !(mCallList.existsLiveCall(mCallList.getActiveSubscription()))) { + Log.d(this, "Switch active sub. Last disc cause = " + mLastDisconnectCause); + boolean retainLch = (mLastDisconnectCause == Call.DisconnectCause.NORMAL) + ? true: false; + if (mCallList.switchToOtherActiveSubscription(retainLch)) return; } if (doFinish) { @@ -406,6 +410,8 @@ public class InCallPresenter implements CallList.Listener { */ @Override public void onDisconnect(Call call) { + mLastDisconnectCause = (call != null ) ? call.getDisconnectCause(): + Call.DisconnectCause.UNKNOWN; hideDialpadForDisconnect(); maybeShowErrorDialogOnDisconnect(call); diff --git a/src/com/android/incallui/MSimInCallActivity.java b/src/com/android/incallui/MSimInCallActivity.java index a216d8d0..2a4df735 100644 --- a/src/com/android/incallui/MSimInCallActivity.java +++ b/src/com/android/incallui/MSimInCallActivity.java @@ -217,8 +217,12 @@ public class MSimInCallActivity extends InCallActivity { public void onTabSelected(Tab tab, FragmentTransaction ft) { ActionBar bar = getActionBar(); - - if (CallList.getInstance().existsLiveCall(mSubscription)) { + int tabCount = bar.getTabCount(); + //Don't setActiveSubscription if tab count is 1.This is to avoid + //setting active subscription automatically when call on one sub + //ends and it's corresponding tab is removed.For such cases active + //subscription will be set by InCallPresenter.attemptFinishActivity. + if (tabCount != TAB_COUNT_ONE && CallList.getInstance().existsLiveCall(mSubscription)) { CallCommandClient.getInstance().setActiveSubscription(mSubscription); } } |