summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep Gutta <sangutta@codeaurora.org>2014-04-28 11:47:14 +0530
committeremancebo <emancebo@cyngn.com>2014-09-04 15:20:00 -0700
commitf7e4b58ba1bbb810818c90e8ba9d0aba086bd42d (patch)
tree02c3967f4e8180f206a49088a2dc08a752b70933
parent98b05977f75f359792d250733e2ceab935c2377d (diff)
downloadpackages_apps_InCallUI-f7e4b58ba1bbb810818c90e8ba9d0aba086bd42d.tar.gz
packages_apps_InCallUI-f7e4b58ba1bbb810818c90e8ba9d0aba086bd42d.tar.bz2
packages_apps_InCallUI-f7e4b58ba1bbb810818c90e8ba9d0aba086bd42d.zip
MSIM(DSDA): Fix incoming call answering issue.
By the time incall answer activity starts, if device has any incoming calls present on any subscription process all of them. -Add few log messages which helps in debugging dsda issue. Change-Id: I8177ad998ecead001ae82df2956abb8a857aadbd CRs-Fixed: 652167
-rw-r--r--src/com/android/incallui/MSimAnswerPresenter.java23
-rw-r--r--src/com/android/incallui/MSimInCallActivity.java2
2 files changed, 18 insertions, 7 deletions
diff --git a/src/com/android/incallui/MSimAnswerPresenter.java b/src/com/android/incallui/MSimAnswerPresenter.java
index f813e65a..424d71b5 100644
--- a/src/com/android/incallui/MSimAnswerPresenter.java
+++ b/src/com/android/incallui/MSimAnswerPresenter.java
@@ -41,10 +41,15 @@ public class MSimAnswerPresenter extends Presenter<MSimAnswerPresenter.AnswerUi>
super.onUiReady(ui);
final CallList calls = CallList.getInstance();
- final Call call = calls.getIncomingCall();
- // TODO: change so that answer presenter never starts up if it's not incoming.
- if (call != null) {
- processIncomingCall(call);
+ for (int i = 0; i < MSimTelephonyManager.getDefault().getPhoneCount(); i++) {
+ Call call = calls.getCallWithState(Call.State.INCOMING, 0, i);
+ if (call == null) {
+ call = calls.getCallWithState(Call.State.CALL_WAITING, 0, i);
+ }
+ // TODO: change so that answer presenter never starts up if it's not incoming.
+ if (call != null) {
+ processIncomingCall(call);
+ }
}
// Listen for incoming calls.
@@ -56,13 +61,14 @@ public class MSimAnswerPresenter extends Presenter<MSimAnswerPresenter.AnswerUi>
public void onUiUnready(AnswerUi ui) {
super.onUiUnready(ui);
- int subscription = CallList.getInstance().getActiveSubscription();
CallList.getInstance().removeListener(this);
// This is necessary because the activity can be destroyed while an incoming call exists.
// This happens when back button is pressed while incoming call is still being shown.
- if (mCallId[subscription] != Call.INVALID_CALL_ID) {
- CallList.getInstance().removeCallUpdateListener(mCallId[subscription], this);
+ for (int i = 0; i < MSimTelephonyManager.getDefault().getPhoneCount(); i++) {
+ if (mCallId[i] != Call.INVALID_CALL_ID) {
+ CallList.getInstance().removeCallUpdateListener(mCallId[i], this);
+ }
}
CallList.getInstance().removeActiveSubChangeListener(this);
}
@@ -137,6 +143,7 @@ public class MSimAnswerPresenter extends Presenter<MSimAnswerPresenter.AnswerUi>
public void onAnswer(int callType) {
int subscription = CallList.getInstance().getActiveSubscription();
if (mCallId[subscription] == Call.INVALID_CALL_ID) {
+ Log.d(this, "onAnswer sub = " + subscription);
return;
}
@@ -198,6 +205,8 @@ public class MSimAnswerPresenter extends Presenter<MSimAnswerPresenter.AnswerUi>
} else if ((call == null) && (calls.existsLiveCall(subscription))) {
Log.i(TAG, "Hide incoming for call id: " + mCallId[subscription] + " " + this);
getUi().showAnswerUi(false);
+ } else {
+ Log.i(TAG, "No incoming call present for sub = " + subscription + " " + this);
}
}
}
diff --git a/src/com/android/incallui/MSimInCallActivity.java b/src/com/android/incallui/MSimInCallActivity.java
index 4550059e..df7c1dae 100644
--- a/src/com/android/incallui/MSimInCallActivity.java
+++ b/src/com/android/incallui/MSimInCallActivity.java
@@ -189,6 +189,7 @@ public class MSimInCallActivity extends InCallActivity {
bar.addTab(mDsdaTab[subscription], subscription, false);
}
mDsdaTabAdd[subscription] = true;
+ Log.d(this, "addDsdaTab, subscription = " + subscription + " tab count = " + tabCount);
}
private void removeDsdaTab(int subscription) {
@@ -202,6 +203,7 @@ public class MSimInCallActivity extends InCallActivity {
return;
}
}
+ Log.d(this, "removeDsdaTab, subscription = " + subscription + " tab count = " + tabCount);
}
private void updateDsdaTabSelection() {