1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-20 12:00:51 +02:00

Use TypeName for identifying non-LE device when pairing LE counterpart.

Previous changes deprecated the numeric Type property, making the
database query fail when pairing the BT-LE part of a Pebble device.
This commit is contained in:
Stefan Tomanek 2024-02-27 20:40:54 +01:00
parent 08a8b6a8fd
commit e86912e681

View File

@ -143,7 +143,7 @@ public class PebblePairingActivity extends AbstractGBActivity implements Bonding
try (DBHandler dbHandler = GBApplication.acquireDB()) {
DaoSession session = dbHandler.getDaoSession();
DeviceDao deviceDao = session.getDeviceDao();
Query<Device> query = deviceDao.queryBuilder().where(DeviceDao.Properties.Type.eq(1), DeviceDao.Properties.Identifier.like("%" + expectedSuffix)).build();
Query<Device> query = deviceDao.queryBuilder().where(DeviceDao.Properties.TypeName.eq("PEBBLE"), DeviceDao.Properties.Identifier.like("%" + expectedSuffix)).build();
List<Device> devices = query.list();
if (devices.size() == 0) {