LA.UM.9.15.2.C3/system/core/healthd/BatteryMonitor.cpp
healthd中chg是AC还是usb充电读取的是/sys/class/power_supply/usb/type
BatteryMonitor::PowerSupplyType BatteryMonitor::readPowerSupplyType(const String8& path) { static SysfsStringEnumMap<int> supplyTypeMap[] = { {"Unknown", ANDROID_POWER_SUPPLY_TYPE_UNKNOWN}, {"Battery", ANDROID_POWER_SUPPLY_TYPE_BATTERY}, {"UPS", ANDROID_POWER_SUPPLY_TYPE_AC}, {"Mains", ANDROID_POWER_SUPPLY_TYPE_AC}, {"USB", ANDROID_POWER_SUPPLY_TYPE_USB}, {"USB_DCP", ANDROID_POWER_SUPPLY_TYPE_AC}, {"USB_HVDCP", ANDROID_POWER_SUPPLY_TYPE_AC}, {"USB_CDP", ANDROID_POWER_SUPPLY_TYPE_AC}, {"USB_ACA", ANDROID_POWER_SUPPLY_TYPE_AC}, {"USB_C", ANDROID_POWER_SUPPLY_TYPE_AC}, {"USB_PD", ANDROID_POWER_SUPPLY_TYPE_AC}, {"USB_PD_DRP", ANDROID_POWER_SUPPLY_TYPE_USB}, {"Wireless", ANDROID_POWER_SUPPLY_TYPE_WIRELESS}, {NULL, 0}, };
标签:AC,USB,POWER,SUPPLY,healthd,充电,ANDROID,识别,TYPE From: https://www.cnblogs.com/yuanqiangfei/p/18293807