mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 12:56:49 +01:00
Use try-with-resources to close the db
This commit is contained in:
parent
e9982ccd56
commit
3763a4ef6b
@ -88,8 +88,7 @@ public class AlarmUtils {
|
||||
Set<String> stringAlarms = prefs.getStringSet(MiBandConst.PREF_MIBAND_ALARMS, new HashSet<String>());
|
||||
List<Alarm> alarms = new ArrayList<>(stringAlarms.size());
|
||||
|
||||
try {
|
||||
DBHandler db = GBApplication.acquireDB();
|
||||
try (DBHandler db = GBApplication.acquireDB()) {
|
||||
DaoSession daoSession = db.getDaoSession();
|
||||
User user = DBHelper.getUser(daoSession);
|
||||
Device device = DBHelper.getDevice(gbDevice, daoSession);
|
||||
|
Loading…
Reference in New Issue
Block a user