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)
|
* @param <T> the device/provider specific sample type (must extend AbstractActivitySample)
|
||||||
*/
|
*/
|
||||||
public interface SampleProvider<T extends AbstractActivitySample> {
|
public interface SampleProvider<T extends AbstractActivitySample> {
|
||||||
// TODO: these constants can all be removed
|
// These are only used for SharedPreferences
|
||||||
int PROVIDER_MIBAND = 0;
|
|
||||||
int PROVIDER_PEBBLE_MORPHEUZ = 1;
|
int PROVIDER_PEBBLE_MORPHEUZ = 1;
|
||||||
int PROVIDER_PEBBLE_GADGETBRIDGE = 2; // removed
|
|
||||||
int PROVIDER_PEBBLE_MISFIT = 3;
|
int PROVIDER_PEBBLE_MISFIT = 3;
|
||||||
int PROVIDER_PEBBLE_HEALTH = 4;
|
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);
|
int normalizeType(int rawType);
|
||||||
|
|
||||||
|
@ -87,11 +87,6 @@ public class UnknownDeviceCoordinator extends AbstractDeviceCoordinator {
|
|||||||
public AbstractActivitySample getLatestActivitySample() {
|
public AbstractActivitySample getLatestActivitySample() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getID() {
|
|
||||||
return PROVIDER_UNKNOWN;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public UnknownDeviceCoordinator() {
|
public UnknownDeviceCoordinator() {
|
||||||
|
@ -21,7 +21,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.hplus;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -34,7 +33,6 @@ import de.greenrobot.dao.Property;
|
|||||||
import de.greenrobot.dao.query.QueryBuilder;
|
import de.greenrobot.dao.query.QueryBuilder;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
|
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractSampleProvider;
|
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractSampleProvider;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.HPlusHealthActivityOverlay;
|
import nodomain.freeyourgadget.gadgetbridge.entities.HPlusHealthActivityOverlay;
|
||||||
@ -58,11 +56,6 @@ public class HPlusHealthSampleProvider extends AbstractSampleProvider<HPlusHealt
|
|||||||
mDevice = device;
|
mDevice = device;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getID() {
|
|
||||||
|
|
||||||
return SampleProvider.PROVIDER_HPLUS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int normalizeType(int rawType) {
|
public int normalizeType(int rawType) {
|
||||||
switch (rawType){
|
switch (rawType){
|
||||||
case HPlusDataRecord.TYPE_DAY_SLOT:
|
case HPlusDataRecord.TYPE_DAY_SLOT:
|
||||||
|
@ -20,7 +20,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.miband;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import de.greenrobot.dao.query.QueryBuilder;
|
import de.greenrobot.dao.query.QueryBuilder;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.MiBandActivitySample;
|
import nodomain.freeyourgadget.gadgetbridge.entities.MiBandActivitySample;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.MiBandActivitySampleDao;
|
import nodomain.freeyourgadget.gadgetbridge.entities.MiBandActivitySampleDao;
|
||||||
@ -63,12 +62,6 @@ public class MiBand2SampleProvider extends AbstractMiBandSampleProvider {
|
|||||||
super(device, session);
|
super(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getID() {
|
|
||||||
return SampleProvider.PROVIDER_MIBAND2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<MiBandActivitySample> getGBActivitySamples(int timestamp_from, int timestamp_to, int activityType) {
|
protected List<MiBandActivitySample> getGBActivitySamples(int timestamp_from, int timestamp_to, int activityType) {
|
||||||
List<MiBandActivitySample> samples = super.getGBActivitySamples(timestamp_from, timestamp_to, 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/>. */
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
package nodomain.freeyourgadget.gadgetbridge.devices.miband;
|
package nodomain.freeyourgadget.gadgetbridge.devices.miband;
|
||||||
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
|
import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
|
||||||
@ -42,11 +41,6 @@ public class MiBandSampleProvider extends AbstractMiBandSampleProvider {
|
|||||||
super(device, session);
|
super(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getID() {
|
|
||||||
return SampleProvider.PROVIDER_MIBAND;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int normalizeType(int rawType) {
|
public int normalizeType(int rawType) {
|
||||||
switch (rawType) {
|
switch (rawType) {
|
||||||
|
@ -25,7 +25,6 @@ import de.greenrobot.dao.Property;
|
|||||||
import de.greenrobot.dao.query.QueryBuilder;
|
import de.greenrobot.dao.query.QueryBuilder;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
|
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractSampleProvider;
|
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractSampleProvider;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleHealthActivityOverlay;
|
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleHealthActivityOverlay;
|
||||||
@ -139,9 +138,4 @@ public class PebbleHealthSampleProvider extends AbstractSampleProvider<PebbleHea
|
|||||||
public float normalizeIntensity(int rawIntensity) {
|
public float normalizeIntensity(int rawIntensity) {
|
||||||
return rawIntensity / movementDivisor;
|
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.AbstractDao;
|
||||||
import de.greenrobot.dao.Property;
|
import de.greenrobot.dao.Property;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractSampleProvider;
|
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractSampleProvider;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMisfitSample;
|
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMisfitSample;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMisfitSampleDao;
|
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMisfitSampleDao;
|
||||||
@ -53,11 +52,6 @@ public class PebbleMisfitSampleProvider extends AbstractSampleProvider<PebbleMis
|
|||||||
return new PebbleMisfitSample();
|
return new PebbleMisfitSample();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getID() {
|
|
||||||
return SampleProvider.PROVIDER_PEBBLE_MISFIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AbstractDao<PebbleMisfitSample, ?> getSampleDao() {
|
public AbstractDao<PebbleMisfitSample, ?> getSampleDao() {
|
||||||
return getSession().getPebbleMisfitSampleDao();
|
return getSession().getPebbleMisfitSampleDao();
|
||||||
|
@ -19,7 +19,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.pebble;
|
|||||||
import de.greenrobot.dao.AbstractDao;
|
import de.greenrobot.dao.AbstractDao;
|
||||||
import de.greenrobot.dao.Property;
|
import de.greenrobot.dao.Property;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractSampleProvider;
|
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractSampleProvider;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMorpheuzSample;
|
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMorpheuzSample;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMorpheuzSampleDao;
|
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleMorpheuzSampleDao;
|
||||||
@ -64,11 +63,6 @@ public class PebbleMorpheuzSampleProvider extends AbstractSampleProvider<PebbleM
|
|||||||
return rawIntensity / movementDivisor;
|
return rawIntensity / movementDivisor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getID() {
|
|
||||||
return SampleProvider.PROVIDER_PEBBLE_MORPHEUZ;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int normalizeType(int rawType) {
|
public int normalizeType(int rawType) {
|
||||||
return rawType;
|
return rawType;
|
||||||
|
Loading…
Reference in New Issue
Block a user