![]() Info += ("Technology: " + technology + "\n") String info = "Battery Level: " + level + "%\n" Log.i("BatteryLevel", bundle.toString()) Int rawlevel = intent.getIntExtra("level", -1) Int status = intent.getIntExtra("status", 0) Int health = intent.getIntExtra("health", 0) Int scale = intent.getIntExtra("scale", -1) Int plugged = intent.getIntExtra("plugged", -1) String technology = intent.getStringExtra("technology") private BroadcastReceiver battery_receiver = new void onReceive(Context context, Intent intent)īoolean isPresent = intent.getBooleanExtra("present", false) r-r-r- root root 4096 13:26 voltage_nowĪnd by looking at the files, all details will be revealed.īy using this code you can get information regarding battery. r-r-r- root root 4096 13:26 voltage_min_design r-r-r- root root 4096 13:26 voltage_max_design r-r-r- root root 4096 13:26 charge_full_design /devices/battery_tm_ctrl.78/power_supply/batt_therm Lrwxrwxrwx root root 14:20 batt_therm ->. The system's BatteryStatsService then registers a listener with healthd (via binder) and then gets the data that is published by healthd,Ĭheck out /sys/class/power_supply, and you'll see: lrwxrwxrwx root root 14:20 ac ->. ![]() It polls continuously (using epoll_wait to run in a timeout loop for periodic updates, as well as netlink notifications for the POWER subsystem - say, for example, if you connect or disconnect a charger). ![]() The Android daemon healthd (as of KK, 4.4.x) picks up this information, and implements an IBatteryPropertiesRegistrar interface on it. Said driver exports information via the sys file system (/sys/class/power_supply, to be exact). To be more specific: The battery health is determined by the driver (in the kernel).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |