Use device information from the database for GBDevices

fixes offline charts not displaying heartrate for Mi1S
This commit is contained in:
cpfeiffer 2016-09-29 22:40:16 +02:00
parent 8f36712342
commit 0a4eefcf11
1 changed files with 3 additions and 4 deletions

View File

@ -101,20 +101,19 @@ public class DeviceHelper {
GB.toast(context, context.getString(R.string.bluetooth_is_disabled_), Toast.LENGTH_SHORT, GB.WARN);
}
List<GBDevice> dbDevices = getDatabaseDevices();
// these come first, as they have the most information already
availableDevices.addAll(dbDevices);
if (btAdapter != null) {
List<GBDevice> bondedDevices = getBondedDevices(btAdapter);
availableDevices.addAll(bondedDevices);
}
availableDevices.addAll(dbDevices);
Prefs prefs = GBApplication.getPrefs();
String miAddr = prefs.getString(MiBandConst.PREF_MIBAND_ADDRESS, "");
if (miAddr.length() > 0) {
GBDevice miDevice = new GBDevice(miAddr, "MI", DeviceType.MIBAND);
if (!availableDevices.contains(miDevice)) {
availableDevices.add(miDevice);
}
}
String pebbleEmuAddr = prefs.getString("pebble_emu_addr", "");
String pebbleEmuPort = prefs.getString("pebble_emu_port", "");