diff options
author | Christine Chen <christinech@google.com> | 2013-09-17 11:06:11 -0700 |
---|---|---|
committer | Christine Chen <christinech@google.com> | 2013-09-17 13:51:25 -0700 |
commit | c45651f66d67ad0ff33c302ae2c350bfdd4fe7d1 (patch) | |
tree | d997e566fda7ef7920549a0425618585eb63a766 | |
parent | 812c0e88d5d86c29e4942f9a1010a95cce789657 (diff) |
Un-mute phone when add-call does not go through
- Keeps a special flag for auto muted state. When the InCallUi resumes,
checkes whether the auto mute is no longer needed.
- Removes all exciplit setMute unless it is triggered by the AudioMode
listener. Do not set UI mute state unless the Telephony layer sends an
update.
Bug: 10786369
Change-Id: Ifd1809f2d9df44121fcb29a87016152c706944cc
-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); |