Fixed bug 1606 - SDL does not implement SDL_GetPowerInfo() for Android.

Philipp Wiesemann 2012-09-22 05:26:11 PDT

currently SDL (HG) does not implement the power management functionality of
SDL_GetPowerInfo() for Android.

I attached a patch which tries to implement this functionality (JNI only, API
5). It supports plugged state and battery percent return values but not
remaining seconds (which are not available on Android).
This commit is contained in:
Sam Lantinga 2012-09-23 01:37:44 -07:00
parent aeb2100823
commit 82b0ec31cd
5 changed files with 102 additions and 1 deletions

View file

@ -36,6 +36,7 @@ SDL_bool SDL_GetPowerInfo_MacOSX(SDL_PowerState *, int *, int *);
SDL_bool SDL_GetPowerInfo_BeOS(SDL_PowerState *, int *, int *);
SDL_bool SDL_GetPowerInfo_NintendoDS(SDL_PowerState *, int *, int *);
SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *, int *, int *);
SDL_bool SDL_GetPowerInfo_Android(SDL_PowerState *, int *, int *);
#ifndef SDL_POWER_DISABLED
#ifdef SDL_POWER_HARDWIRED
@ -73,6 +74,9 @@ static SDL_GetPowerInfo_Impl implementations[] = {
#ifdef SDL_POWER_BEOS /* handles BeOS, Zeta, with euc.jp apm driver. */
SDL_GetPowerInfo_BeOS,
#endif
#ifdef SDL_POWER_ANDROID /* handles Android. */
SDL_GetPowerInfo_Android,
#endif
#ifdef SDL_POWER_HARDWIRED
SDL_GetPowerInfo_Hardwired,
#endif