Fixed a bug where the UI thread sleeps for Bluetooth discovery