BatteryWarning 电池预警
MTK BatteryWarning
在mediatek/external/batterywarning下,会编译生成一个可执行文件:batterywraning
main()函数中,会间断读取 /sys/devices/platform/mt-battery/BatteryNotify 文件(该文件中记录的当前电池所处的环境),根据读取的值来判断电池所处的环境:
CHARGER_OVER_VOLTAGE 1
BATTER_OVER_TEMPERATURE 2
OVER_CURRENT_PROTECTION 4
BATTER_OVER_VOLTAGE 8
SAGETY_TIMER_TIMEOUT 16
根据读取的值来启动上层提示框:
system("am start -n com.mediatek.batterywarning/com.mediatek.batterywarning.BatteryWarningActivity --ei tyep X -- activity-clear-top");