|
|
@ -395,6 +395,14 @@ bool CPhoneDevice::QuerySystemProperties(std::map<std::string, std::string>& pro
|
|
|
|
fs::space_info si = fs::space("/data");
|
|
|
|
fs::space_info si = fs::space("/data");
|
|
|
|
it->second = std::to_string(si.available); // Unit: M
|
|
|
|
it->second = std::to_string(si.available); // Unit: M
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (it->first == PROP_FREE_ROM_PERCENT)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
fs::space_info si = fs::space("/data");
|
|
|
|
|
|
|
|
double fr = ((double)si.available * 100.0f) / ((double)si.capacity);
|
|
|
|
|
|
|
|
char buf[12] = { 0 };
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "%d%%", (int)fr);
|
|
|
|
|
|
|
|
it->second = buf;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (it->first == PROP_TOTAL_ROM)
|
|
|
|
else if (it->first == PROP_TOTAL_ROM)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fs::space_info si = fs::space("/data");
|
|
|
|
fs::space_info si = fs::space("/data");
|
|
|
@ -402,12 +410,19 @@ bool CPhoneDevice::QuerySystemProperties(std::map<std::string, std::string>& pro
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (it->first == PROP_FREE_MEMORY)
|
|
|
|
else if (it->first == PROP_FREE_MEMORY)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fs::space_info si = fs::space("/data");
|
|
|
|
|
|
|
|
it->second = std::to_string(android_os_Process_getFreeMemory()); // Unit: M
|
|
|
|
it->second = std::to_string(android_os_Process_getFreeMemory()); // Unit: M
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (it->first == PROP_FREE_MEMORY_PERCENT)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
long fm = android_os_Process_getFreeMemory();
|
|
|
|
|
|
|
|
long tm = android_os_Process_getTotalMemory();
|
|
|
|
|
|
|
|
double fmp = ((double)fm * 100.0f) / ((double)tm);
|
|
|
|
|
|
|
|
char buf[12] = { 0 };
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "%d%%", (int)fmp);
|
|
|
|
|
|
|
|
it->second = buf; // Unit: M
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (it->first == PROP_TOTAL_MEMORY)
|
|
|
|
else if (it->first == PROP_TOTAL_MEMORY)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fs::space_info si = fs::space("/data");
|
|
|
|
|
|
|
|
it->second = std::to_string(android_os_Process_getTotalMemory()); // Unit: M
|
|
|
|
it->second = std::to_string(android_os_Process_getTotalMemory()); // Unit: M
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (it->first == (PROP_CHARGING_VOLTAGE))
|
|
|
|
else if (it->first == (PROP_CHARGING_VOLTAGE))
|
|
|
|