Fix the issue that no data is returned when there is no full charge data
in the database. Test: make RunSettingsRoboTests + manual Bug: 260938983 Bug: 253553141 Change-Id: Ie12f239ce83a6ac2cd95c1663cd82e2974a7eaf3
This commit is contained in:
@@ -43,8 +43,8 @@ public interface BatteryStateDao {
|
||||
|
||||
/** 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")
|
||||
+ "(SELECT IFNULL((SELECT MAX(timestamp) FROM BatteryState "
|
||||
+ "WHERE isFullChargeCycleStart = 1), 0)) ORDER BY timestamp ASC")
|
||||
Cursor getCursorSinceLastFullCharge(long timestampSixDaysAgo);
|
||||
|
||||
/** Get the count of distinct timestamp after a specific timestamp. */
|
||||
|
Reference in New Issue
Block a user