diff options
author | Christine Chen <christinech@google.com> | 2013-09-19 17:21:14 -0700 |
---|---|---|
committer | Christine Chen <christinech@google.com> | 2013-09-19 17:49:34 -0700 |
commit | 85c3c7b52465d8725e149816591c0b62b58c585d (patch) | |
tree | db20b57cd786ffa0c47f3c40c02ece9fd4c4ff2c | |
parent | 91b4a5803e9e86195b1dc1c0408ef13799bc8d04 (diff) |
Updates extra button row with dialpad visibility
Bug: 10843473
Change-Id: Ie8bccd53daaf6d59a5db6f3c6a43f76a218ec3a8
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonPresenter.java | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index 74aff5388..6840a156d 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -37,6 +37,9 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto private boolean mAutomaticallyMuted = false; private boolean mPreviousMuteState = false; + private boolean mShowGenericMerge = false; + private boolean mShowManageConference = false; + private InCallState mPreviousState = null; public CallButtonPresenter() { @@ -208,6 +211,8 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto Log.v(this, "Show dialpad " + String.valueOf(checked)); getUi().displayDialpad(checked); mProximitySensor.onDialpadVisible(checked); + + updateExtraButtonRow(); } private void updateUi(InCallState state, Call call) { @@ -235,7 +240,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto final boolean canAdd = call.can(Capabilities.ADD_CALL); final boolean isGenericConference = call.can(Capabilities.GENERIC_CONFERENCE); - final boolean showGenericMerge = isGenericConference && canMerge; + final boolean showMerge = !isGenericConference && canMerge; if (showMerge) { @@ -292,22 +297,28 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto // - "Manage conference" (used only on GSM devices) // - "Merge" button (used only on CDMA devices) - final boolean showManageConference = (call.isConferenceCall() && !isGenericConference); - final boolean showExtraButtonRow = (showGenericMerge || showManageConference) && - !getUi().isDialpadVisible(); - - Log.i(this, "isGeneric: " + isGenericConference); - Log.i(this, "showManageConference : " + showManageConference); - Log.i(this, "showGenericMerge: " + showGenericMerge); - if (showExtraButtonRow) { - if (showGenericMerge) { - getUi().showGenericMergeButton(); - } else if (showManageConference) { - getUi().showManageConferenceCallButton(); - } - } else { - getUi().hideExtraRow(); + mShowGenericMerge = isGenericConference && canMerge; + mShowManageConference = (call.isConferenceCall() && !isGenericConference); + + updateExtraButtonRow(); + } + } + + private void updateExtraButtonRow() { + final boolean showExtraButtonRow = (mShowGenericMerge || mShowManageConference) && + !getUi().isDialpadVisible(); + + Log.d(this, "isGeneric: " + mShowGenericMerge); + Log.d(this, "mShowManageConference : " + mShowManageConference); + Log.d(this, "mShowGenericMerge: " + mShowGenericMerge); + if (showExtraButtonRow) { + if (mShowGenericMerge) { + getUi().showGenericMergeButton(); + } else if (mShowManageConference) { + getUi().showManageConferenceCallButton(); } + } else { + getUi().hideExtraRow(); } } |