Fix concurrency issue related to new outgoing call broadcast.
Fixes arace condition seen with the new outgoing call broadcast. The scenario occurs when an incoming call is handled by an app which receives the NewOutgoingCallBroadcast. That app cancels the call by modifying the new outgoing callbroadcast. Meanwhile, it places that same call again, expecting that Telecom will reuse the same same. HOWEVER, if the system delays passing of the new outgoing call broadcast back to Telecom, the app will have placed a new outgoing call BEFORE telecom is aware that the call was cancelled. The consequence of this is that in CallsManager#startOutgoingCall, when we first get the call to reuse, it will come back empty. Meanwhile, by the time we get into the various completable futures, the call WILL be in the list of calls which can be reused. Since the reusable call was not found earlier on, we end up aborting the new outgoing call. Test: wrote unit test to reproduce this scenario and modified code to fix the test. Fixes: 171324351 Change-Id: Ieda35ee4f729ad7bbfa87b43b7ef5d11de9f3dab
Loading
Please register or sign in to comment