Merge "Add function to query last estimate time to Estimate" into qt-dev
am: ade071d6c2
Change-Id: Ie07ee30ac46969e326d914c198955e59f5a1ef18
This commit is contained in:
@@ -77,5 +77,17 @@ class Estimate(
|
||||
Settings.Global.putLong(resolver, Settings.Global.BATTERY_ESTIMATES_LAST_UPDATE_TIME,
|
||||
System.currentTimeMillis())
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns when the estimate was last updated as an Instant
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getLastCacheUpdateTime(context: Context): Instant {
|
||||
return Instant.ofEpochMilli(
|
||||
Settings.Global.getLong(
|
||||
context.contentResolver,
|
||||
Settings.Global.BATTERY_ESTIMATES_LAST_UPDATE_TIME,
|
||||
-1))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user