
You must, must, must close the BT sockets else you run out of them. This code tries to handle all the places where BT sockets may not get closed. It also tries to tweak user experience/UI integration pieces in a few areas, and handle some NPEs that can occur when BT fails.