1, kernel command line: androidboot.mode = charger
2, command line androidboot.xxx 转换成 ro.boot.xxx
/system/core/init/init.cppmain() -> process_kernel_cmdline() -> import_kernel_cmdline() -> import_kernel_nv()
androidboot.mode => ro.boot.mode
3, ro.boot.mode => ro.bootmode
/system/core/init/init.cppmain() -> export_kernel_boot_props()
4, /system/core/init/init.cpp: main()
// Don't mount filesystems or start core system services in charger mode.std::string bootmode = property_get("ro.bootmode");
if (bootmode == "charger") {
am.QueueEventTrigger("charger");
&nbs