diff options
author | Christine Chen <christinech@google.com> | 2013-09-17 14:40:43 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-17 14:40:43 -0700 |
commit | 4460ddb68e69910bae96adf7ff9e69c0d7502d3a (patch) | |
tree | dfad6271f145a6b034a5bb5d857d3c52af694996 /InCallUI | |
parent | 74fb9eb640f77b80fd8b0f9bf0b25d5fa07e9c4d (diff) | |
parent | c45651f66d67ad0ff33c302ae2c350bfdd4fe7d1 (diff) |
am eb7244f3: Un-mute phone when add-call does not go through
* commit 'eb7244f3001ca3b001b17bda99ab5c790eb1b2d3':
Un-mute phone when add-call does not go through
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonFragment.java | 9 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonPresenter.java | 19 |
2 files changed, 20 insertions, 8 deletions
diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index f79ed40f6..a508312e0 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -24,7 +24,6 @@ import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; -import android.view.ViewStub; import android.widget.CompoundButton; import android.widget.ImageButton; import android.widget.PopupMenu; @@ -150,6 +149,14 @@ public class CallButtonFragment } @Override + public void onResume() { + if (getPresenter() != null) { + getPresenter().refreshMuteState(); + } + super.onResume(); + } + + @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { } diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index db9876897..7e473e8d0 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -187,7 +187,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto mAutomaticallyMuted = true; mPreviousMuteState = AudioModeProvider.getInstance().getMute(); // Simulate a click on the mute button - getUi().setMute(true); muteClicked(true); CallCommandClient.getInstance().addCall(); @@ -246,12 +245,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto ui.showSwap(call.can(Capabilities.SWAP_CALLS)); - // Restore the previous mute state - if (mAutomaticallyMuted && - AudioModeProvider.getInstance().getMute() != mPreviousMuteState) { - ui.setMute(mPreviousMuteState); - mAutomaticallyMuted = false; - } ui.enableMute(call.can(Capabilities.MUTE)); // Finally, update the "extra button row": It's displayed above the @@ -282,6 +275,18 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto } } + public void refreshMuteState() { + // Restore the previous mute state + if (mAutomaticallyMuted && + AudioModeProvider.getInstance().getMute() != mPreviousMuteState) { + if (getUi() == null) { + return; + } + muteClicked(mPreviousMuteState); + } + mAutomaticallyMuted = false; + } + public interface CallButtonUi extends Ui { void setVisible(boolean on); void setMute(boolean on); |