Use the field isFullChargeCycleStart in database to get the last full
charge cycle start and remove the unused SharedPreference. Test: make RunSettingsRoboTests + manual Bug: 253553141 Change-Id: I74ef71775fa5d4871077f6d5573467aa5843bc6b
This commit is contained in:
@@ -41,9 +41,11 @@ public interface BatteryStateDao {
|
||||
@Query("SELECT * FROM BatteryState WHERE timestamp > :timestamp ORDER BY timestamp DESC")
|
||||
List<BatteryState> getAllAfter(long timestamp);
|
||||
|
||||
/** Gets the {@link Cursor} of all recorded data from a specific timestamp. */
|
||||
@Query("SELECT * FROM BatteryState WHERE timestamp >= :timestamp ORDER BY timestamp DESC")
|
||||
Cursor getCursorAfter(long timestamp);
|
||||
/** Gets the {@link Cursor} of all recorded data since last full charge within 7 days. */
|
||||
@Query("SELECT * FROM BatteryState WHERE timestamp >= :timestampSixDaysAgo AND timestamp >= "
|
||||
+ "(SELECT MAX(timestamp) FROM BatteryState WHERE isFullChargeCycleStart = 1)"
|
||||
+ " ORDER BY timestamp ASC")
|
||||
Cursor getCursorSinceLastFullCharge(long timestampSixDaysAgo);
|
||||
|
||||
/** Get the count of distinct timestamp after a specific timestamp. */
|
||||
@Query("SELECT COUNT(DISTINCT timestamp) FROM BatteryState WHERE timestamp > :timestamp")
|
||||
|
Reference in New Issue
Block a user