Skip to content

Commit 0593c68

Browse files
author
John Wang
committed
Prevent dial() return null in a racing condition.
The racing condition happens between dial() returns and the first GET_CURRENT_CALLS query gets handled. If GET_CURRENT_CALLS gets handled before dial() finishs, the pendingMO can be set to null in handlePollCalls() so that dial() will return null. This null connection causes error in PhoneUtils.placeCall(). The Synchronized dial() and handlePollCalls() Methods will make sure the dial() returns before the first GET_CURRENT_CALLS gets handled. bug:6028290 Change-Id: I41b024760acb7dd13b342866180dffe3fdbe1c03
1 parent 5265466 commit 0593c68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

telephony/java/com/android/internal/telephony/gsm/GsmCallTracker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public void unregisterForVoiceCallEnded(Handler h) {
167167
/**
168168
* clirMode is one of the CLIR_ constants
169169
*/
170-
Connection
170+
synchronized Connection
171171
dial (String dialString, int clirMode, UUSInfo uusInfo) throws CallStateException {
172172
// note that this triggers call state changed notif
173173
clearDisconnected();
@@ -406,7 +406,7 @@ public void unregisterForVoiceCallEnded(Handler h) {
406406
}
407407
}
408408

409-
protected void
409+
protected synchronized void
410410
handlePollCalls(AsyncResult ar) {
411411
List polledCalls;
412412

0 commit comments

Comments
 (0)