mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-25 18:15:49 +01:00
Remove obsolte and unused code related to old and unsupported activity database
This commit is contained in:
parent
ad82a75312
commit
7c63f92aaa
@ -34,24 +34,10 @@ import nodomain.freeyourgadget.gadgetbridge.entities.AbstractActivitySample;
|
||||
* @param <T> the device/provider specific sample type (must extend AbstractActivitySample)
|
||||
*/
|
||||
public interface SampleProvider<T extends AbstractActivitySample> {
|
||||
// TODO: these constants can all be removed
|
||||
int PROVIDER_MIBAND = 0;
|
||||
// These are only used for SharedPreferences
|
||||
int PROVIDER_PEBBLE_MORPHEUZ = 1;
|
||||
int PROVIDER_PEBBLE_GADGETBRIDGE = 2; // removed
|
||||
int PROVIDER_PEBBLE_MISFIT = 3;
|
||||
int PROVIDER_PEBBLE_HEALTH = 4;
|
||||
int PROVIDER_MIBAND2 = 5;
|
||||
int PROVIDER_HPLUS = 6;
|
||||
|
||||
int PROVIDER_UNKNOWN = 100;
|
||||
// TODO: can also be removed
|
||||
|
||||
/**
|
||||
* Returns the "id" of this sample provider, as used in Gadgetbridge versions < 0.12.0.
|
||||
* Only used for importing old samples.
|
||||
* @deprecated
|
||||
*/
|
||||
int getID();
|
||||
|
||||
int normalizeType(int rawType);
|
||||
|
||||
|
@ -87,11 +87,6 @@ public class UnknownDeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
public AbstractActivitySample getLatestActivitySample() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getID() {
|
||||
return PROVIDER_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
public UnknownDeviceCoordinator() {
|
||||
|
@ -21,7 +21,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.hplus;
|
||||
*/
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
@ -34,7 +33,6 @@ import de.greenrobot.dao.Property;
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractSampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.HPlusHealthActivityOverlay;
|
||||
@ -58,11 +56,6 @@ public class HPlusHealthSampleProvider extends AbstractSampleProvider<HPlusHealt
|
||||
mDevice = device;
|
||||
}
|
||||
|
||||
public int getID() {
|
||||
|
||||
return SampleProvider.PROVIDER_HPLUS;
|
||||
}
|
||||
|
||||
public int normalizeType(int rawType) {
|
||||
switch (rawType){
|
||||
case HPlusDataRecord.TYPE_DAY_SLOT:
|
||||
|
@ -20,7 +20,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.miband;
|
||||
import java.util.List;
|
||||
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.MiBandActivitySample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.MiBandActivitySampleDao;
|
||||
@ -63,12 +62,6 @@ public class MiBand2SampleProvider extends AbstractMiBandSampleProvider {
|
||||
super(device, session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getID() {
|
||||
return SampleProvider.PROVIDER_MIBAND2;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected List<MiBandActivitySample> getGBActivitySamples(int timestamp_from, int timestamp_to, int activityType) {
|
||||
List<MiBandActivitySample> samples = super.getGBActivitySamples(timestamp_from, timestamp_to, activityType);
|
||||
|
@ -17,7 +17,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.miband;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
|
||||
@ -42,11 +41,6 @@ public class MiBandSampleProvider extends AbstractMiBandSampleProvider {
|
||||
super(device, session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getID() {
|
||||
return SampleProvider.PROVIDER_MIBAND;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int normalizeType(int rawType) {
|
||||
switch (rawType) {
|
||||
|
@ -25,7 +25,6 @@ import de.greenrobot.dao.Property;
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractSampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleHealthActivityOverlay;
|
||||
@ -139,9 +138,4 @@ public class PebbleHealthSampleProvider extends AbstractSampleProvider<PebbleHea
|
||||
public float normalizeIntensity(int rawIntensity) {
|
||||
return rawIntensity / movementDivisor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getID() {
|
||||
return SampleProvider.PROVIDER_PEBBLE_HEALTH;
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.pebble;
|
||||
import de.greenrobot.dao.AbstractDao;
|
||||
import de.greenrobot.dao.Property;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractSampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMisfitSample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMisfitSampleDao;
|
||||
@ -53,11 +52,6 @@ public class PebbleMisfitSampleProvider extends AbstractSampleProvider<PebbleMis
|
||||
return new PebbleMisfitSample();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getID() {
|
||||
return SampleProvider.PROVIDER_PEBBLE_MISFIT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractDao<PebbleMisfitSample, ?> getSampleDao() {
|
||||
return getSession().getPebbleMisfitSampleDao();
|
||||
|
@ -19,7 +19,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.pebble;
|
||||
import de.greenrobot.dao.AbstractDao;
|
||||
import de.greenrobot.dao.Property;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractSampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMorpheuzSample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMorpheuzSampleDao;
|
||||
@ -64,11 +63,6 @@ public class PebbleMorpheuzSampleProvider extends AbstractSampleProvider<PebbleM
|
||||
return rawIntensity / movementDivisor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getID() {
|
||||
return SampleProvider.PROVIDER_PEBBLE_MORPHEUZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int normalizeType(int rawType) {
|
||||
return rawType;
|
||||
|
Loading…
Reference in New Issue
Block a user