mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Refactor querying the battery percentage into a regular sysprop
This commit is contained in:
1 parent
57a91e1f74
commit
ee772bb1e2
8 files changed
+33
-48
No files matched your search
@@ -316,6 +316,8 @@ std::vector<std::string> System_GetPropertyStringVec(SystemProperty prop) {
|
||||
}
|
||||
}
|
||||
|
||||
int Apple_GetCurrentBatteryCapacity();
|
||||
|
||||
int64_t System_GetPropertyInt(SystemProperty prop) {
|
||||
switch (prop) {
|
||||
case SYSPROP_AUDIO_SAMPLE_RATE:
|
||||
@@ -324,6 +326,8 @@ int64_t System_GetPropertyInt(SystemProperty prop) {
|
||||
return DEVICE_TYPE_MOBILE;
|
||||
case SYSPROP_SYSTEMVERSION:
|
||||
return g_iosVersionMajor;
|
||||
case SYSPROP_BATTERY_PERCENTAGE:
|
||||
return Apple_GetCurrentBatteryCapacity();
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
@@ -381,6 +385,9 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
||||
case SYSPROP_SUPPORTS_HTTPS:
|
||||
return true;
|
||||
#endif
|
||||
case SYSPROP_CAN_READ_BATTERY_PERCENTAGE:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user