1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-22 23:02:33 +02:00

Fix discovery on devices with Android version < Lollipop

also reduce the amount of lines logged in discovery activity.
This commit is contained in:
Daniele Gobbetti 2018-07-22 14:52:17 +02:00
parent 290c6c53fb
commit a5dd88df53

View File

@ -231,9 +231,7 @@ public class DiscoveryActivity extends AbstractGBActivity implements AdapterView
public void logMessageContent(byte[] value) { public void logMessageContent(byte[] value) {
if (value != null) { if (value != null) {
for (byte b : value) { LOG.warn("DATA: " + GB.hexdump(value, 0, value.length));
LOG.warn("DATA: " + String.format("0x%2x", b) + " - " + (char) (b & 0xff));
}
} }
} }
@ -630,7 +628,7 @@ public class DiscoveryActivity extends AbstractGBActivity implements AdapterView
super.onPause(); super.onPause();
stopBTDiscovery(); stopBTDiscovery();
stopBTLEDiscovery(); stopBTLEDiscovery();
if (GB.supportsBluetoothLE()) { if (GBApplication.isRunningLollipopOrLater()) {
stopNewBTLEDiscovery(); stopNewBTLEDiscovery();
} }
} }