summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2016-05-02 13:29:41 -0700
committerAdnan Begovic <adnan@cyngn.com>2016-05-02 13:38:16 -0700
commitcbf3ace21b9009301746d229669b9c2bb70af642 (patch)
treeb19424a9afd1fd9343b312d8d096368801d03bc1
parent6c7dd77337bbe7ff9becef2c153d3f527aac53ca (diff)
downloadandroid_packages_services_Telecomm-cbf3ace21b9009301746d229669b9c2bb70af642.tar.gz
android_packages_services_Telecomm-cbf3ace21b9009301746d229669b9c2bb70af642.tar.bz2
android_packages_services_Telecomm-cbf3ace21b9009301746d229669b9c2bb70af642.zip
Telecomm: Bandaid possible NPE on call waiting scenarios.
Since the CallWaitingDialog can be created numerous times within the scope of answering a call object via the callsmanager, it's possible that the active call object can be discarded from a separate thread and thus can cause an NPE when being handled. Similarly to I1b4c251a9419991fe96ee0951e4a14a6f25ccc8d, mitigate the symptom until the original implementation can be revamped. TICKET: CYNGNOS-2688 Change-Id: I7332e97f7ed03a23c8d8d33e34379154e3dce215
-rw-r--r--src/com/android/server/telecom/CallsManager.java22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index a8a18e32..402ac054 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -2505,10 +2505,13 @@ public class CallsManager extends Call.ListenerBase implements VideoProviderProx
heldCall.disconnect();
}
- Log.v(this, "Holding active/dialing call %s before answering incoming call %s.",
- mLocalCallsManager.mForegroundCall, mNewCall);
-
- mActiveCall.hold();
+ // TODO: This active call reference can be nullified and discarded from another thread,
+ // Fix this by reworking the state machine surrounding calls within telecomm.
+ if (mActiveCall != null) {
+ Log.v(this, "Holding active/dialing call %s before answering incoming call %s.",
+ mLocalCallsManager.mForegroundCall, mNewCall);
+ mActiveCall.hold();
+ }
// TODO: Wait until we get confirmation of
// the active call being
// on-hold before answering the new call.
@@ -2520,10 +2523,13 @@ public class CallsManager extends Call.ListenerBase implements VideoProviderProx
private void handleEndCallAndAnswer() {
// We don't want to hold, just disconnect
- Log.v(this, "Holding active/dialing call %s for termination before answering incoming call %s.",
- mLocalCallsManager.mForegroundCall, mNewCall);
-
- mActiveCall.hold();
+ // TODO: This active call reference can be nullified and discarded from another thread,
+ // Fix this by reworking the state machine surrounding calls within telecomm.
+ if (mActiveCall != null) {
+ Log.v(this, "Holding active/dialing call %s for termination before answering incoming call %s.",
+ mLocalCallsManager.mForegroundCall, mNewCall);
+ mActiveCall.hold();
+ }
// TODO: Wait until we get confirmation of
// the active call being
// on-hold before answering the new call.