summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-09-03 16:20:13 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-09-03 16:20:13 -0700
commitf7d4b7cb753263dd58dd8d3fb995e757d35c4782 (patch)
tree6f19ab3d97482b3bb9db8b9a5b98ba5b4f023e20
parent1a48f3cf510a1599cb568fd71891c9fb314a69b2 (diff)
parent000b7aaeae220791fe50d0a372f1cad4fb9258b1 (diff)
am ea541401: Merge "Automatically unmute call if user decides not to add call" into klp-dev
* commit 'ea541401b5c56bc393eb0b6fb934ab63d3a90441': Automatically unmute call if user decides not to add call
-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;
+ }
}
}