We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1606

Summary: SDL does not implement SDL_GetPowerInfo() for Android.
Product: SDL Reporter: Philipp Wiesemann <philipp.wiesemann>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: Android (All)   
Attachments: patch with power management implementation for Android

Description Philipp Wiesemann 2012-09-22 05:26:11 UTC
Created attachment 954 [details]
patch with power management implementation for Android

Hello,

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).
Comment 1 Sam Lantinga 2012-09-23 01:38:15 UTC
Thanks for the patch!
http://hg.libsdl.org/SDL/rev/64a6297a8b93
Comment 2 Philipp Wiesemann 2013-02-16 02:32:50 UTC
Thank you for applying my patch. I did not add the SDL license comment at the top of the new file SDL_syspower.c only to keep the patch smaller. Now this makes the file inconsistent with the remaining source.
Comment 3 Sam Lantinga 2013-02-16 13:34:11 UTC
Got it, thanks!