summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2014-05-09 14:56:03 +0800
committeremancebo <emancebo@cyngn.com>2014-09-04 15:20:01 -0700
commit5ef891cb4a0d85755132fa8ad5fc0770be208308 (patch)
tree67849fe10ec3e70fb6790554632ee0287e4ff0da
parent298fc72f9fb1f119e0be03cc668148a2487bfff7 (diff)
downloadpackages_apps_InCallUI-5ef891cb4a0d85755132fa8ad5fc0770be208308.tar.gz
packages_apps_InCallUI-5ef891cb4a0d85755132fa8ad5fc0770be208308.tar.bz2
packages_apps_InCallUI-5ef891cb4a0d85755132fa8ad5fc0770be208308.zip
InCallUI: Update mute state accordingly after adding call
The mute state of sub1 that is stored in the mute table isn't restored to the previous state when the second call(on sub2) is connected. Restore the mute state for sub1 in CallButtonPresenter#refreshMuteState(). CRs-Fixed: 660470 Change-Id: I7e829d3eefe246801021571e0028085204f1f499
-rw-r--r--src/com/android/incallui/CallButtonPresenter.java7
-rw-r--r--src/com/android/incallui/CallCommandClient.java12
2 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/incallui/CallButtonPresenter.java b/src/com/android/incallui/CallButtonPresenter.java
index d9ff8011..d76c3e99 100644
--- a/src/com/android/incallui/CallButtonPresenter.java
+++ b/src/com/android/incallui/CallButtonPresenter.java
@@ -44,6 +44,8 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
private boolean mAutomaticallyMuted = false;
private boolean mPreviousMuteState = false;
+ private int mPreviousSub = 0;
+
private boolean mShowGenericMerge = false;
private boolean mShowManageConference = false;
private boolean mShowButtonsIfIdle = true;
@@ -213,6 +215,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
// Automatically mute the current call
mAutomaticallyMuted = true;
mPreviousMuteState = AudioModeProvider.getInstance().getMute();
+ mPreviousSub = mCall.getSubscription();
// Simulate a click on the mute button
CallCommandClient.getInstance().muteInternal(true);
CallCommandClient.getInstance().addCall();
@@ -397,6 +400,10 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
public void refreshMuteState() {
// Restore the previous mute state
+ if (mAutomaticallyMuted) {
+ CallCommandClient.getInstance().updateMuteState(
+ mPreviousSub, mPreviousMuteState);
+ }
if (mAutomaticallyMuted &&
AudioModeProvider.getInstance().getMute() != mPreviousMuteState) {
if (getUi() == null) {
diff --git a/src/com/android/incallui/CallCommandClient.java b/src/com/android/incallui/CallCommandClient.java
index 4a1570d0..6c7118a6 100644
--- a/src/com/android/incallui/CallCommandClient.java
+++ b/src/com/android/incallui/CallCommandClient.java
@@ -125,6 +125,18 @@ public class CallCommandClient {
} catch (RemoteException e) {
Log.e(this, "Error muting phone.", e);
}
+ }
+
+ public void updateMuteState(int sub, boolean muted) {
+ if (mCommandService == null) {
+ Log.e(this, "Cannot updateMuteState; CallCommandService == null");
+ return;
+ }
+ try {
+ mCommandService.updateMuteState(sub, muted);
+ } catch (RemoteException e) {
+ Log.e(this, "Error updateMuteState.", e);
+ }
}
public void hold(int callId, boolean onOff) {