summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-09-03 14:34:35 -0700
committerYorke Lee <yorkelee@google.com>2013-09-03 15:18:50 -0700
commit37fa54617a6eb207284ea619133ed50a1156ff1d (patch)
tree6d681a7ef0d064bec0483621dba78da06d2484f2
parent94ad175d3839d00f72305a2a0390b1a1adc1b2a2 (diff)
Automatically unmute call if user decides not to add call
Bug: 10446594 Change-Id: If48fbbebc89b5b48641af3093a0f6547bddcaeea
-rw-r--r--InCallUI/src/com/android/incallui/AudioModeProvider.java4
-rw-r--r--InCallUI/src/com/android/incallui/CallButtonPresenter.java13
2 files changed, 17 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/AudioModeProvider.java b/InCallUI/src/com/android/incallui/AudioModeProvider.java
index 36ec20ffa..8224d3e20 100644
--- a/InCallUI/src/com/android/incallui/AudioModeProvider.java
+++ b/InCallUI/src/com/android/incallui/AudioModeProvider.java
@@ -84,6 +84,10 @@ import java.util.List;
return mAudioMode;
}
+ public boolean getMute() {
+ return mMuted;
+ }
+
/* package */ interface AudioModeListener {
void onAudioMode(int newMode);
void onMute(boolean muted);
diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
index 6e64e65c4..bc9efe507 100644
--- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
@@ -32,6 +32,8 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
private Call mCall;
private AudioModeProvider mAudioModeProvider;
private ProximitySensor mProximitySensor;
+ private boolean mAutomaticallyMuted = false;
+ private boolean mPreviousMuteState = false;
public CallButtonPresenter() {
}
@@ -166,6 +168,11 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
}
public void addCallClicked() {
+ // Automatically mute the current call
+ mAutomaticallyMuted = true;
+ mPreviousMuteState = mAudioModeProvider.getMute();
+ getUi().setMute(true);
+
CallCommandClient.getInstance().addCall();
}
@@ -204,6 +211,12 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
ui.showMerge(call.can(Capabilities.MERGE_CALLS));
ui.showSwap(call.can(Capabilities.SWAP_CALLS));
ui.showAddCall(call.can(Capabilities.ADD_CALL));
+
+ // Restore the previous mute state
+ if (mAutomaticallyMuted && mAudioModeProvider.getMute() != mPreviousMuteState) {
+ ui.setMute(mPreviousMuteState);
+ mAutomaticallyMuted = false;
+ }
}
}