summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantos Cordon <santoscordon@google.com>2013-08-29 15:04:23 -0700
committerSantos Cordon <santoscordon@google.com>2013-08-29 15:04:23 -0700
commitdfbecd3eb22237741e6ca175e29beee4854b1120 (patch)
treee9784a47888cc66c4e054b9537f7425e9d6771ab
parentfacff288cfbdfcfd9281a64fa05a78532acf3d90 (diff)
Show glowpad for call waiting calls
Two things were happening: 1. AnswerPresenter stopped listening to call event after the first incoming call 2. It was not checking for CALL_WAITING && INCOMING as valid incoming call states. fix both. bug: 10538445 Change-Id: I491f2381c33c431f0cbfcc0000f50efdc107cce9
-rw-r--r--InCallUI/src/com/android/incallui/AnswerPresenter.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/InCallUI/src/com/android/incallui/AnswerPresenter.java b/InCallUI/src/com/android/incallui/AnswerPresenter.java
index 1c970d7db..76a7b563e 100644
--- a/InCallUI/src/com/android/incallui/AnswerPresenter.java
+++ b/InCallUI/src/com/android/incallui/AnswerPresenter.java
@@ -39,13 +39,10 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi>
// TODO: change so that answer presenter never starts up if it's not incoming.
if (call != null) {
processIncomingCall(call);
-
- // Listen for call updates for the current call.
- calls.addCallUpdateListener(mCallId, this);
-
- // Listen for incoming calls.
- calls.addListener(this);
}
+
+ // Listen for incoming calls.
+ calls.addListener(this);
}
@Override
@@ -67,6 +64,10 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi>
private void processIncomingCall(Call call) {
mCallId = call.getCallId();
+
+ // Listen for call updates for the current call.
+ CallList.getInstance().addCallUpdateListener(mCallId, this);
+
Log.d(TAG, "Showing incoming for call id: " + mCallId);
final ArrayList<String> textMsgs = CallList.getInstance().getTextResponses(
call.getCallId());
@@ -84,10 +85,9 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi>
@Override
public void onCallStateChanged(Call call) {
Log.d(TAG, "onCallStateChange() " + call);
- if (call.getState() != Call.State.INCOMING) {
+ if (call.getState() != Call.State.INCOMING && call.getState() != Call.State.CALL_WAITING) {
// Stop listening for updates.
CallList.getInstance().removeCallUpdateListener(mCallId, this);
- CallList.getInstance().removeListener(this);
getUi().showAnswerUi(false);
mCallId = Call.INVALID_CALL_ID;