![]() ![]() To get the power_profile.xml for your device, do the following: This value also holds the maximum capacity of the battery. The power_profile.xml also holds a value called battery.capacity which can be read via the API. For guidance on these settings, see Power Values. This profile is defined in platform/frameworks/base/core/res/res/xml/power_profile.xml. The Google documentation says:ĭevice manufacturers must provide a component power profile that defines the current consumption value for the component and the approximate battery drain caused by the component over time. This API uses power profiles to know how much energy every component approximately consumes. You will get the content of this value if you read from the /sys/devices/power_supply/battery/charge_full_design file in the Nexus 5.Ģ.: Another way is provided by the private Android API. The file used for the driver in the Nexus 5 also contains a value called fcc-mah. This information is fixed and usually provided by the smartphone manufacturer. The driver uses additional files to get device specific information. The source code of this driver can be found here. But an app developer can use a few tricks (described here) to get access to this information too.īoth of these methods have their own source for the "charge at full capacity" value.ġ.: In the Nexus 5 this file is created by the driver responsible for handling the chip (Maxim MAX17048) which measures the remaining capcity on the battery. Private in this case means that only system apps (from Google) have access to this information. Reading from the sysfs file in the Android file system ( /sys/devices/power_supply/battery/charge_full_design).The mail describes two possible sources for an app developer to get the information on how high the battery charge is on full capcity: I think the answer in the email is legit, here's why:Īll of the following information is based on the Google Nexus 5, but the general procedure should apply for all Android phones. This would help me understand better and also answer such questions with a good referenceĬan someone point to an authoritative source that supports or offers an alternative explanation ?Įdit: I am looking for generic information, not specific to my device I have been scouring the net, various forums, Android Developers etc to get an authoritative source for this rather than a mail communication. This explanation fits in well with battery capacity being reported differently by apps as also mismatched battery readings using an extended battery ( Note: These two questions are of '14 vintage and based on the location of battery files as mentioned, I have answered) So, the battery capacity and state of battery as reported in percentage depends on from which of these two sources it is being read and the two sources could hold different values (In my case, it was the stock ROM shipped with wrong capacity in the battery profiles) This file amongst other things specifies the path of second source ) An email will be generated to the developer having information about your device, including battery_info.txt. ( To know the path on your device, from 3C Toolbox, tap request support from Help and support menu. The other source is in the kernel, usually under /sys/devices/power_supply/battery/charge_full_design That’s the one of the 2 sources the app uses. In Android, one can get the stock hard-coded battery capacity from battery profiles, an hidden API in Android. I mailed the developer of the app and his reply was on these lines ![]() I was therefore surprised to see 3C Toolbox Pro report the capacity as 4000 mAh. My current device Huawei Honor 6 comes with a 3100 mAh battery. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |