diff options
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); |