Use device information from the database for GBDevices
fixes offline charts not displaying heartrate for Mi1S
This commit is contained in:
parent
8f36712342
commit
0a4eefcf11
|
@ -101,20 +101,19 @@ public class DeviceHelper {
|
||||||
GB.toast(context, context.getString(R.string.bluetooth_is_disabled_), Toast.LENGTH_SHORT, GB.WARN);
|
GB.toast(context, context.getString(R.string.bluetooth_is_disabled_), Toast.LENGTH_SHORT, GB.WARN);
|
||||||
}
|
}
|
||||||
List<GBDevice> dbDevices = getDatabaseDevices();
|
List<GBDevice> dbDevices = getDatabaseDevices();
|
||||||
|
// these come first, as they have the most information already
|
||||||
|
availableDevices.addAll(dbDevices);
|
||||||
if (btAdapter != null) {
|
if (btAdapter != null) {
|
||||||
List<GBDevice> bondedDevices = getBondedDevices(btAdapter);
|
List<GBDevice> bondedDevices = getBondedDevices(btAdapter);
|
||||||
availableDevices.addAll(bondedDevices);
|
availableDevices.addAll(bondedDevices);
|
||||||
}
|
}
|
||||||
availableDevices.addAll(dbDevices);
|
|
||||||
|
|
||||||
Prefs prefs = GBApplication.getPrefs();
|
Prefs prefs = GBApplication.getPrefs();
|
||||||
String miAddr = prefs.getString(MiBandConst.PREF_MIBAND_ADDRESS, "");
|
String miAddr = prefs.getString(MiBandConst.PREF_MIBAND_ADDRESS, "");
|
||||||
if (miAddr.length() > 0) {
|
if (miAddr.length() > 0) {
|
||||||
GBDevice miDevice = new GBDevice(miAddr, "MI", DeviceType.MIBAND);
|
GBDevice miDevice = new GBDevice(miAddr, "MI", DeviceType.MIBAND);
|
||||||
if (!availableDevices.contains(miDevice)) {
|
|
||||||
availableDevices.add(miDevice);
|
availableDevices.add(miDevice);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
String pebbleEmuAddr = prefs.getString("pebble_emu_addr", "");
|
String pebbleEmuAddr = prefs.getString("pebble_emu_addr", "");
|
||||||
String pebbleEmuPort = prefs.getString("pebble_emu_port", "");
|
String pebbleEmuPort = prefs.getString("pebble_emu_port", "");
|
||||||
|
|
Loading…
Reference in New Issue