1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-17 02:44:04 +02:00

add .apply()

This commit is contained in:
vanous 2019-09-07 08:41:42 +02:00 committed by Andreas Shimokawa
parent 975b698564
commit cf28ee48f4

View File

@ -75,11 +75,13 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
Prefs prefs = getPrefs();
String lastDevice = prefs.getPreferences().getString("last_device_address","");
if (gbDevice.getAddress() == lastDevice){
prefs.getPreferences().edit().remove("last_device_address");
LOG.debug("#1605 removing last device");
prefs.getPreferences().edit().remove("last_device_address").apply();
}
String macAddress = prefs.getPreferences().getString(MiBandConst.PREF_MIBAND_ADDRESS,"");
if (gbDevice.getAddress() == macAddress){
prefs.getPreferences().edit().remove(MiBandConst.PREF_MIBAND_ADDRESS);
LOG.debug("#1605 removing devel miband");
prefs.getPreferences().edit().remove(MiBandConst.PREF_MIBAND_ADDRESS).apply();
}
try (DBHandler dbHandler = GBApplication.acquireDB()) {
DaoSession session = dbHandler.getDaoSession();