![]() SetBatteryLevelText(info + "\n\n" + bundle. Info += ("Temp: "+getTempStatus(temp,intent)+"\n") Info += ("Status: " + getStatusString(status) + "\n") ![]() Info += ("Health: " + getHealthString(health) + "\n") Info += ("Plugged: " + getPlugTypeString(plugged) + "\n") Info += ("Technology: " + technology + "\n") Now, scroll down till you see the Battery and device care section. String info = "Battery Level: " + level + "%\n" How to Check Battery Health on Samsung Devices From the notifications panel, launch the Settings menu on your Samsung device. Log.i("BatteryLevel", bundle.toString()) If you see Battery Information in the menu, tap. As soon as you tap the key, the Android Testing menu should pop up. Int rawlevel = intent.getIntExtra("level", -1) Open the dialler app and punch in the following code: 4636. 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 |