Ensure BT ICS unbind after completing BT future
This CL ensures that once the BT disconnected tone future is completed that we unbind from the BT ICS immediately after. There were cases where the disconnect tone doesn't play and the only place we perform the unbinding is when the disconnect tone finishes in InCallController#onDisconnectedTonePlaying. We should ensure that we always unbind the BT ICS for all cases. Once we complete the future, we for sure know that the call state is disconnected so we can safely unbind at that point. This CL also makes changes to the mPendingEndCallTone set being used. I had added logic to skip the unbinding if the set is not empty but in cases where we don't play the disconnect tone, the associated call is never cleaned up from the set. Looking at this closer, I also realized that in cases where the associated user of the calls are different, the references to the ICS connections/info would never be cleaned up properly. We should clean up the references if there are no more calls of the same associated user. We should also skip the unbinding in the case that the user used to bind to the BT ICS is the same even when the associated users of any two calls are differnet. From my understanding, we always bind to BT ICS as User 0 but it's better not to hardcode that assumption into the implementation details. Bug: 374933312 Test: Manual to verify that unbinding takes place in cases where we don't play the disconnect tone. Flag: EXEMPT bugfix Change-Id: I49481a3dcd3bc0aa92f1d86ffc1de7a80a9e89c4
Loading
Please register or sign in to comment