mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Fixed an UI error when Bluetooth discovery starting fails
This commit is contained in:
+6
-3
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user