PBAP: Clean up SDP record when closing service
* PBAP SDP record was never cleaned up when PBAP service is closed,
resulting in stacked SDP records for PBAP.
* This CL groups cleanup statements into one method and calls it during
onAcceptFailed() and closeService()
* onAcceptFailed() will clean up SDP, shutdown server sockets before
starting a new server socket again
* startSocketListeners() will fail if SDP record already exist before it
starts, caller is responsible in cleaning up the SDP record
* Also, if SDP record is valid, mAdapter should never be null and the
check is unnecessary.
Test: Pair with car kit and repeatly toggle Bluetooth ON/OFF
1 file changed