From 307c8cfa3cc3cd58c3193b72252f5dd3bd26502f Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Fri, 13 Sep 2013 14:45:58 -0700 Subject: Fix mute state infinite loop when quickly clicking speaker and mute buttons Bug: 10648433 Change-Id: Id45d374fb0741ad87c9afe609e0f9f04c7cdb02e --- InCallUI/src/com/android/incallui/CallButtonFragment.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'InCallUI/src/com/android/incallui/CallButtonFragment.java') diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index 4c42a7845..f6640aac0 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -22,6 +22,7 @@ import android.view.LayoutInflater; import android.view.Menu; 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; @@ -98,10 +99,11 @@ public class CallButtonFragment }); mMuteButton = (ToggleButton) parent.findViewById(R.id.muteButton); - mMuteButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + mMuteButton.setOnClickListener(new OnClickListener() { @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - getPresenter().muteClicked(isChecked); + public void onClick(View v) { + final CompoundButton button = (CompoundButton) v; + getPresenter().muteClicked(button.isChecked()); } }); -- cgit v1.2.3