mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-18 06:37:47 +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) {
|
private void startBTDiscovery(Scanning what) {
|
||||||
LOG.info("Starting BT discovery");
|
LOG.info("Starting BT discovery");
|
||||||
setIsScanning(what);
|
|
||||||
|
|
||||||
handler.removeMessages(0, stopRunnable);
|
handler.removeMessages(0, stopRunnable);
|
||||||
handler.sendMessageDelayed(getPostMessage(stopRunnable), SCAN_DURATION);
|
handler.sendMessageDelayed(getPostMessage(stopRunnable), SCAN_DURATION);
|
||||||
if (adapter.startDiscovery()) {
|
if (adapter.startDiscovery()) {
|
||||||
|
LOG.debug("Discovery starting successful");
|
||||||
|
bluetoothProgress.setVisibility(View.VISIBLE);
|
||||||
|
setIsScanning(what);
|
||||||
|
} else {
|
||||||
LOG.error("Discovery starting failed");
|
LOG.error("Discovery starting failed");
|
||||||
|
bluetoothProgress.setVisibility(View.GONE);
|
||||||
|
setIsScanning(Scanning.SCANNING_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
bluetoothProgress.setVisibility(View.VISIBLE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopBTDiscovery() {
|
private void stopBTDiscovery() {
|
||||||
|
Loading…
Reference in New Issue
Block a user