mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-04 09:17:29 +01:00
Fixed an UI error when Bluetooth discovery starting fails
This commit is contained in:
parent
61c74e9b15
commit
9627360fac
@ -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.error("Discovery starting failed");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
private void stopBTDiscovery() {
|
||||
|
Loading…
Reference in New Issue
Block a user