diff options
Diffstat (limited to 'InCallUI/src/com/android/incallui')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonFragment.java | 16 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonPresenter.java | 2 |
2 files changed, 13 insertions, 5 deletions
diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index aa2dca784..f2146a60e 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -57,6 +57,10 @@ public class CallButtonFragment private View mManageConferenceButton; private View mGenericMergeButton; + // Constants for Drawable.setAlpha() + private static final int HIDDEN = 0; + private static final int VISIBLE = 255; + @Override CallButtonPresenter createPresenter() { // TODO: find a cleaner way to include audio mode provider than @@ -202,6 +206,13 @@ public class CallButtonFragment @Override public void setMute(boolean value) { + final LayerDrawable layers = (LayerDrawable) mMuteButton.getBackground(); + + layers.findDrawableByLayerId(R.id.muteOffItem) + .setAlpha(value ? HIDDEN : VISIBLE); + layers.findDrawableByLayerId(R.id.muteOnItem) + .setAlpha(value ? VISIBLE : HIDDEN); + mMuteButton.setSelected(value); } @@ -409,10 +420,6 @@ public class CallButtonFragment Log.v(this, "showSpeakerphoneOffIcon: " + showSpeakerphoneOffIcon); Log.v(this, "showHandsetIcon: " + showHandsetIcon); - // Constants for Drawable.setAlpha() - final int HIDDEN = 0; - final int VISIBLE = 255; - mAudioButton.setEnabled(audioButtonEnabled); mAudioButton.setSelected(audioButtonChecked); @@ -436,6 +443,7 @@ public class CallButtonFragment layers.findDrawableByLayerId(R.id.speakerphoneOffItem) .setAlpha(showSpeakerphoneOffIcon ? VISIBLE : HIDDEN); + } private void showAudioModePopup() { diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index 129c68cb9..dc5eda1c3 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -138,7 +138,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto @Override public void onMute(boolean muted) { - if (getUi() != null) { + if (getUi() != null && !mAutomaticallyMuted) { getUi().setMute(muted); } } |