Use a BroadcastReceiver to get the battery info instead of polling

This commit is contained in:
Guillaume Meunier
2024-11-01 14:13:58 +01:00
parent c011c18411
commit a5fda396b9
7 changed files with 55 additions and 88 deletions
+2 -1
View File
@@ -17,6 +17,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "android/battery.h"
#define IMGUI_DEFINE_MATH_OPERATORS
#include "application.h"
@@ -1113,7 +1114,7 @@ void scenes::lobby::draw_features_status(XrTime predicted_display_time)
#ifdef __ANDROID__
// Battery status
auto status = battery_tracker.get();
auto status = get_battery_status();
const char * battery_icon = nullptr;
if (status.charge)