mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-14 19:57:32 +01:00
Actually remove that implicit "current date" handling
We now manage days explicitly in the UI.
This commit is contained in:
parent
d791054e42
commit
c49c795b1d
@ -272,9 +272,6 @@ public abstract class AbstractChartFragment extends AbstractGBFragment {
|
|||||||
* @param tsTo
|
* @param tsTo
|
||||||
*/
|
*/
|
||||||
protected List<ActivitySample> getAllSamples(DBHandler db, GBDevice device, int tsFrom, int tsTo) {
|
protected List<ActivitySample> getAllSamples(DBHandler db, GBDevice device, int tsFrom, int tsTo) {
|
||||||
if (tsFrom == -1) {
|
|
||||||
tsFrom = getTSLast24Hours(tsTo);
|
|
||||||
}
|
|
||||||
SampleProvider provider = getProvider(device);
|
SampleProvider provider = getProvider(device);
|
||||||
return db.getAllActivitySamples(tsFrom, tsTo, provider);
|
return db.getAllActivitySamples(tsFrom, tsTo, provider);
|
||||||
}
|
}
|
||||||
@ -284,18 +281,12 @@ public abstract class AbstractChartFragment extends AbstractGBFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected List<ActivitySample> getActivitySamples(DBHandler db, GBDevice device, int tsFrom, int tsTo) {
|
protected List<ActivitySample> getActivitySamples(DBHandler db, GBDevice device, int tsFrom, int tsTo) {
|
||||||
if (tsFrom == -1) {
|
|
||||||
tsFrom = getTSLast24Hours(tsTo);
|
|
||||||
}
|
|
||||||
SampleProvider provider = getProvider(device);
|
SampleProvider provider = getProvider(device);
|
||||||
return db.getActivitySamples(tsFrom, tsTo, provider);
|
return db.getActivitySamples(tsFrom, tsTo, provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected List<ActivitySample> getSleepSamples(DBHandler db, GBDevice device, int tsFrom, int tsTo) {
|
protected List<ActivitySample> getSleepSamples(DBHandler db, GBDevice device, int tsFrom, int tsTo) {
|
||||||
if (tsFrom == -1) {
|
|
||||||
tsFrom = getTSLast24Hours(tsTo);
|
|
||||||
}
|
|
||||||
SampleProvider provider = getProvider(device);
|
SampleProvider provider = getProvider(device);
|
||||||
return db.getSleepSamples(tsFrom, tsTo, provider);
|
return db.getSleepSamples(tsFrom, tsTo, provider);
|
||||||
}
|
}
|
||||||
|
@ -162,8 +162,11 @@ public class ActivityDatabaseHandler extends SQLiteOpenHelper implements DBHandl
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private ArrayList<ActivitySample> getGBActivitySamples(int timestamp_from, int timestamp_to, int activityTypes, SampleProvider provider) {
|
private ArrayList<ActivitySample> getGBActivitySamples(int timestamp_from, int timestamp_to, int activityTypes, SampleProvider provider) {
|
||||||
if (timestamp_to == -1) {
|
if (timestamp_to < 0) {
|
||||||
timestamp_to = Integer.MAX_VALUE; // dont know what happens when I use more than max of a signed int
|
throw new IllegalArgumentException("negative timestamp_to");
|
||||||
|
}
|
||||||
|
if (timestamp_from < 0) {
|
||||||
|
throw new IllegalArgumentException("negative timestamp_from");
|
||||||
}
|
}
|
||||||
ArrayList<ActivitySample> samples = new ArrayList<ActivitySample>();
|
ArrayList<ActivitySample> samples = new ArrayList<ActivitySample>();
|
||||||
final String where = "(provider=" + provider.getID() + " and timestamp>=" + timestamp_from + " and timestamp<=" + timestamp_to + getWhereClauseFor(activityTypes, provider) + ")";
|
final String where = "(provider=" + provider.getID() + " and timestamp>=" + timestamp_from + " and timestamp<=" + timestamp_to + getWhereClauseFor(activityTypes, provider) + ")";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user