if (!charging && percent == 100) { // Fully charged
__lastFullTime = currentTime;
__lastHeartAccessTime = currentTime;
- _I("Fully charged. Last fully charged time: %d", __lastFullTime);
+ _I("Fully charged. Last fully charged time: %lld",(long long int)__lastFullTime);
__updateLastInfo();
} else if (__lastFullTime == 0) { // Never fully charged yet
__lastFullTime = currentTime;
- _I("Device has not fully charged until now. Start time of recent battery usage will be %d", __lastFullTime);
+ _I("Device has not fully charged until now. Start time of recent battery usage will be %lld",(long long int)__lastFullTime);
__updateLastInfo();
} else if (__lastFullTime > currentTime || currentTime - __lastFullTime > LOG_RETENTION_PERIOD) {
__lastFullTime = currentTime;
__lastHeartAccessTime = currentTime;
- _I("Last fully charged time changed: %d", __lastFullTime);
+ _I("Last fully charged time changed: %lld", (long long int)__lastFullTime);
__updateLastInfo();
}
__needSync = true;
instance->__lastFullTime = CURRENT_TIME;
- _I("Charger is disconnected after fully charged. Last fully charged time: %d", instance->__lastFullTime);
+ _I("Charger is disconnected after fully charged. Last fully charged time: %lld", (long long int)instance->__lastFullTime);
if (!instance->__updateLastInfo())
_E("Failed to update last reset time and last percent time");
__lastHeartAccessTime = currentTime - DEFAULT_TIME_DIFF;
__lastFullTime = currentTime - DEFAULT_TIME_DIFF;
__updateLastInfo();
- _W("Last fully charged time & last heart access time changed(%d)", __lastFullTime);
+ _W("Last fully charged time & last heart access time changed(%lld)", (long long int)__lastFullTime);
}
// Read from heart cpu table
IF_FAIL_RETURN_TAG(ret, true, _E, "Cannot read from heart cpu table");
IF_FAIL_RETURN_TAG(heartCpuLog.size() > 0, true, _W, "Heart cpu data is not prepared");
- _D("Read %d rows from heart cpu table from %d", heartCpuLog.size(), __lastHeartAccessTime);
+ _D("Read %zd rows from heart cpu table from %ld", heartCpuLog.size(),(long int)__lastHeartAccessTime);
__lastHeartAccessTime = heartCpuLog.back()[BATTERY_TIMESTAMP].asInt64();
__updateLastInfo();
+ " WHERE EndTime < " + std::to_string(CURRENT_TIME - LOG_RETENTION_PERIOD)
+ " OR EndTime > " + std::to_string(CURRENT_TIME) + ";";
- _D("Insert %d rows of per app battery usage", usage.size());
+ _D("Insert %zd rows of per app battery usage", usage.size());
return __database->execute(query.c_str(), NULL);
}
query += ", ";
}
- _D("Insert %d rows in app last times table", usage.size());
+ _D("Insert %lu rows in app last times table", (long unsigned)usage.size());
query = query.substr(0, query.size() - 2);
return __database->execute(query.c_str(), NULL);
}