Implementation principle of Android 8.0 slow charging and fast charging prompt

@H_ 419_ 2@1. Prompt for slow and fast charging

\frameworks\base\packages\systemUI\res-keyguard\values-zh-rCN

Chinese prompt

English prompt

\frameworks\base\packages\systemUI\res-keyguard\values

1. Fast charging charger charging - display fast charging string

2. Ordinary charging appliance - display charging, the same as 7.0 and its previous characteristics

3. Computer or notebook display - slow charging

2. Principle

According to the current maximum voltage and current, the current speed is calculated and classified into slow charging, charging and fast charging

2.1 original data in source code

Send the "battery broadcast" position to send the maximum current and voltage to the application layer. Here are some new data above 8.1. There was this data before 7.0, but the framework layer was not used

2.2 ADB shell viewing Linux file nodes

• get current

• get the current voltage

• specific source code

2.3 upper layer receiving broadcast

frameworks/base/packages/systemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java

Focus on the algorithm rules of maxchartingmicroamp and maxchartingmicrovolt

2.4 display string

frameworks/base/packages/systemUI/src/com/android/systemUI/statusbar/KeyguardIndicationController.java

Event reception

display string

@H_ 419_ 2 @ summary

The above is the implementation principle of Android 8.0 slow charging and fast charging prompt introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>