Я пытаюсь собрать статистику использования энергии для телефона Android G1. Мне интересно знать значения напряжения и тока, а затем собирать статистику, как сообщается в этом PDF.
Я могу получить значение напряжения батареи, зарегистрировав приемник намерения для приема широковещательной передачи для ACTION_BATTERY_CHANGED. Но проблема в том, что Android не раскрывает значение тока через этот интерфейс SDK.
Один из способов, которым я пробовал, - через интерфейс sysfs, где я могу просмотреть текущее значение батареи из оболочки adb, используя следующую команду
$cat /sys/class/power_supply/battery/batt_current
449
Но это тоже работает, только если телефон подключен через USB-интерфейс. Если я отключу телефон, я вижу значение batt_current как "0". Я не уверен, почему значение текущего сообщения равно нулю. Это должно быть больше нуля, верно?
Любое предложение/указатели на получение значения тока аккумулятора? Также, пожалуйста, поправьте меня, если я ошибаюсь.