summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2015-04-16 18:31:39 -0700
committerYorke Lee <yorkelee@google.com>2015-04-18 13:18:03 -0700
commitb04531805a54810a767e5b774215226d95b8f306 (patch)
tree13600ac9edc8bc80cfcbe84fc9f918a6247467cd /InCallUI
parentb07d70491ac6fd2fa962ed42c775d8ba1cf0cd69 (diff)
DO NOT MERGE Update buttons state once UI is ready
* updateUi was not getting called for outgoing calls between DIALING -> ACTIVE * Adhere to UI directive that buttons representing disabled functionality are hidden rather than disabled. * Also fix issue where buttons are not updated for incoming call. Bug: 20295789 Change-Id: I2606aa7b27c3dfb2de441737f1ecc2cc80ffdd7e
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/CallButtonPresenter.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
index b89afbe06..650649479 100644
--- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
@@ -58,11 +58,16 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
AudioModeProvider.getInstance().addListener(this);
// register for call state changes last
- InCallPresenter.getInstance().addListener(this);
- InCallPresenter.getInstance().addIncomingCallListener(this);
- InCallPresenter.getInstance().addDetailsListener(this);
- InCallPresenter.getInstance().addCanAddCallListener(this);
- InCallPresenter.getInstance().getInCallCameraManager().addCameraSelectionListener(this);
+ final InCallPresenter inCallPresenter = InCallPresenter.getInstance();
+ inCallPresenter.addListener(this);
+ inCallPresenter.addIncomingCallListener(this);
+ inCallPresenter.addDetailsListener(this);
+ inCallPresenter.addCanAddCallListener(this);
+ inCallPresenter.getInCallCameraManager().addCameraSelectionListener(this);
+
+ // Update the buttons state immediately for the current call
+ onStateChange(InCallState.NO_CALLS, inCallPresenter.getInCallState(),
+ CallList.getInstance());
}
@Override
@@ -100,7 +105,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
if (ui != null) {
ui.displayDialpad(false /* show */, true /* animate */);
}
- mCall = null;
+ mCall = callList.getIncomingCall();
} else {
mCall = null;
}
@@ -336,17 +341,11 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
state.isConnectingOrConnected() &&!state.isIncoming() && call != null;
ui.setEnabled(isEnabled);
- if (!isEnabled) {
+ if (call == null) {
return;
}
updateButtonsState(call);
-
- ui.enableButton(BUTTON_MUTE, call.can(android.telecom.Call.Details.CAPABILITY_MUTE));
- }
-
- private static int toInteger(boolean b) {
- return b ? 1 : 0;
}
/**