diff options
author | Maxim Sheronov <maxim.sheronov@gmail.com> | 2017-09-12 22:09:06 +0300 |
---|---|---|
committer | Maxim Sheronov <maxim.sheronov@gmail.com> | 2017-09-13 20:57:07 +0300 |
commit | 0fffa45158bebeb4aaba1df1d271c000fffbe7f7 (patch) | |
tree | 369918b0d7c9f367a7396c3584ac84ab550bd103 /platform/android | |
parent | 69017974beb16dcfa971f9b6f33a4f005be57bef (diff) |
Fix enums bindings
Add missed bindings for enums
Move some enums to class to have correct output of api.json
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/power_android.cpp | 16 | ||||
-rw-r--r-- | platform/android/power_android.h | 6 |
2 files changed, 11 insertions, 11 deletions
diff --git a/platform/android/power_android.cpp b/platform/android/power_android.cpp index 98d4d810b9..48c9377a5a 100644 --- a/platform/android/power_android.cpp +++ b/platform/android/power_android.cpp @@ -198,19 +198,19 @@ bool power_android::GetPowerInfo_Android() { if (Android_JNI_GetPowerInfo(&plugged, &charged, &battery, &this->nsecs_left, &this->percent_left) != -1) { if (plugged) { if (charged) { - this->power_state = POWERSTATE_CHARGED; + this->power_state = OS::POWERSTATE_CHARGED; } else if (battery) { - this->power_state = POWERSTATE_CHARGING; + this->power_state = OS::POWERSTATE_CHARGING; } else { - this->power_state = POWERSTATE_NO_BATTERY; + this->power_state = OS::POWERSTATE_NO_BATTERY; this->nsecs_left = -1; this->percent_left = -1; } } else { - this->power_state = POWERSTATE_ON_BATTERY; + this->power_state = OS::POWERSTATE_ON_BATTERY; } } else { - this->power_state = POWERSTATE_UNKNOWN; + this->power_state = OS::POWERSTATE_UNKNOWN; this->nsecs_left = -1; this->percent_left = -1; } @@ -218,12 +218,12 @@ bool power_android::GetPowerInfo_Android() { return true; } -PowerState power_android::get_power_state() { +OS::PowerState power_android::get_power_state() { if (GetPowerInfo_Android()) { return power_state; } else { WARN_PRINT("Power management is not implemented on this platform, defaulting to POWERSTATE_UNKNOWN"); - return POWERSTATE_UNKNOWN; + return OS::POWERSTATE_UNKNOWN; } } @@ -246,7 +246,7 @@ int power_android::get_power_percent_left() { } power_android::power_android() - : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) { + : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) { } power_android::~power_android() { diff --git a/platform/android/power_android.h b/platform/android/power_android.h index fc618c660d..4c7af1c771 100644 --- a/platform/android/power_android.h +++ b/platform/android/power_android.h @@ -31,7 +31,7 @@ #ifndef PLATFORM_ANDROID_POWER_ANDROID_H_ #define PLATFORM_ANDROID_POWER_ANDROID_H_ -#include "os/power.h" +#include "os/os.h" #include <android/native_window_jni.h> class power_android { @@ -57,7 +57,7 @@ private: int nsecs_left; int percent_left; - PowerState power_state; + OS::PowerState power_state; bool GetPowerInfo_Android(); bool UpdatePowerInfo(); @@ -71,7 +71,7 @@ public: static struct LocalReferenceHolder LocalReferenceHolder_Setup(const char *func); static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder); - PowerState get_power_state(); + OS::PowerState get_power_state(); int get_power_seconds_left(); int get_power_percent_left(); }; |