diff options
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonFragment.java | 15 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonPresenter.java | 25 |
2 files changed, 36 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index f6640aac0..e53a34726 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -186,6 +186,11 @@ public class CallButtonFragment } @Override + public void enableMute(boolean enabled) { + mMuteButton.setEnabled(enabled); + } + + @Override public void setHold(boolean value) { mHoldButton.setChecked(value); } @@ -196,6 +201,11 @@ public class CallButtonFragment } @Override + public void enableHold(boolean enabled) { + mHoldButton.setEnabled(enabled); + } + + @Override public void showMerge(boolean show) { mMergeButton.setVisibility(show ? View.VISIBLE : View.GONE); } @@ -211,6 +221,11 @@ public class CallButtonFragment } @Override + public void enableAddCall(boolean enabled) { + mAddCallButton.setEnabled(enabled); + } + + @Override public void setAudio(int mode) { updateAudioButtons(getPresenter().getSupportedAudio()); refreshAudioModePopup(); diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index 7dae73a7a..3171816ff 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -202,17 +202,30 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto Log.d(this, "Updating call UI for call: ", call); if (isVisible) { - Log.v(this, "Show hold ", call.can(Capabilities.HOLD)); + Log.v(this, "Show hold ", call.can(Capabilities.SUPPORT_HOLD)); + Log.v(this, "Enable hold", call.can(Capabilities.HOLD)); Log.v(this, "Show merge ", call.can(Capabilities.MERGE_CALLS)); Log.v(this, "Show swap ", call.can(Capabilities.SWAP_CALLS)); Log.v(this, "Show add call ", call.can(Capabilities.ADD_CALL)); + Log.v(this, "Show mute ", call.can(Capabilities.MUTE)); + final boolean canMerge = call.can(Capabilities.MERGE_CALLS); + final boolean canAdd = call.can(Capabilities.ADD_CALL); + + if (canMerge) { + ui.showMerge(true); + ui.showAddCall(false); + } else { + ui.showMerge(false); + ui.showAddCall(true); + ui.enableAddCall(canAdd); + } + + ui.showHold(call.can(Capabilities.SUPPORT_HOLD)); ui.setHold(call.getState() == Call.State.ONHOLD); + ui.enableHold(call.can(Capabilities.HOLD)); - ui.showHold(call.can(Capabilities.HOLD)); - ui.showMerge(call.can(Capabilities.MERGE_CALLS)); ui.showSwap(call.can(Capabilities.SWAP_CALLS)); - ui.showAddCall(call.can(Capabilities.ADD_CALL)); // Restore the previous mute state if (mAutomaticallyMuted && @@ -220,6 +233,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto ui.setMute(mPreviousMuteState); mAutomaticallyMuted = false; } + ui.enableMute(call.can(Capabilities.MUTE)); // Finally, update the "extra button row": It's displayed above the // "End" button, but only if necessary. Also, it's never displayed @@ -254,11 +268,14 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto public interface CallButtonUi extends Ui { void setVisible(boolean on); void setMute(boolean on); + void enableMute(boolean enabled); void setHold(boolean on); void showHold(boolean show); + void enableHold(boolean enabled); void showMerge(boolean show); void showSwap(boolean show); void showAddCall(boolean show); + void enableAddCall(boolean enabled); void displayDialpad(boolean on); boolean isDialpadVisible(); void setAudio(int mode); |