1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-20 20:10:15 +02:00

Fixed an UI error when Bluetooth discovery starting fails

This commit is contained in:
TaaviE 2020-08-02 21:23:14 +03:00
parent 61c74e9b15
commit 9627360fac

View File

@ -614,15 +614,18 @@ public class DiscoveryActivity extends AbstractGBActivity implements AdapterView
*/
private void startBTDiscovery(Scanning what) {
LOG.info("Starting BT discovery");
setIsScanning(what);
handler.removeMessages(0, stopRunnable);
handler.sendMessageDelayed(getPostMessage(stopRunnable), SCAN_DURATION);
if (adapter.startDiscovery()) {
LOG.debug("Discovery starting successful");
bluetoothProgress.setVisibility(View.VISIBLE);
setIsScanning(what);
} else {
LOG.error("Discovery starting failed");
bluetoothProgress.setVisibility(View.GONE);
setIsScanning(Scanning.SCANNING_OFF);
}
bluetoothProgress.setVisibility(View.VISIBLE);
}
private void stopBTDiscovery() {