using namespace ctx;
+static int __bootingTime = 0;
static int __lastResetTime = 0;
static int __lastPercent = -1;
static int __lastPercentTime = 0;
bool BatteryMonitor::__loadLastInfo()
{
+ __bootingTime = CURRENT_TIME;
+
device_battery_is_charging(&__isCharging);
std::vector<Json> records;
return __dbMgr.executeSync(query.c_str(), NULL);
}
+// Used for Recent Battery Usage
int BatteryMonitor::getLastResetTime()
{
- IF_FAIL_RETURN_TAG(__lastResetTime != 0, CURRENT_TIME, _D, "Last reset time doesn't exist");
+ if (__lastResetTime == 0) {
+ _I("Device has not fully charged until now. Start time of recent battery usage will be booting time");
+ return __bootingTime;
+ }
+
return __lastResetTime;
}