diff options
author | Christine Chen <christinech@google.com> | 2013-09-13 16:29:28 -0700 |
---|---|---|
committer | Christine Chen <christinech@google.com> | 2013-09-14 14:03:53 -0700 |
commit | e91cacacb3dd7ddab7ee31f83d357a6cf14d3e1f (patch) | |
tree | b5d287f936f5364daebf09a0edd12f515dd90c8c /InCallUI/src/com/android/incallui/CallButtonPresenter.java | |
parent | 9378ba4a2efd891f1862f363aebdef66e14900be (diff) |
Takes new Call states to enable/disable buttons.
Bug: 10733320
Change-Id: Ic8e58cad46610a1fcaef2b55af458ca7661c4f8b
Diffstat (limited to 'InCallUI/src/com/android/incallui/CallButtonPresenter.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonPresenter.java | 25 |
1 files changed, 21 insertions, 4 deletions
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); |