mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-25 10:05:49 +01:00
Only import old activity data once per device, not for every provider
This commit is contained in:
parent
fbf06c1fe3
commit
6e98defe94
@ -385,8 +385,11 @@ public class DBHelper {
|
||||
try (SQLiteDatabase oldDB = oldDbHandler.getReadableDatabase()) {
|
||||
User user = DBHelper.getUser(session);
|
||||
for (DeviceCoordinator coordinator : DeviceHelper.getInstance().getAllCoordinators()) {
|
||||
AbstractSampleProvider<? extends AbstractActivitySample> sampleProvider = (AbstractSampleProvider<? extends AbstractActivitySample>) coordinator.getSampleProvider(targetDevice, session);
|
||||
importActivitySamples(oldDB, targetDevice, session, sampleProvider, user);
|
||||
if (coordinator.supports(targetDevice)) {
|
||||
AbstractSampleProvider<? extends AbstractActivitySample> sampleProvider = (AbstractSampleProvider<? extends AbstractActivitySample>) coordinator.getSampleProvider(targetDevice, session);
|
||||
importActivitySamples(oldDB, targetDevice, session, sampleProvider, user);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user