off charging mode flow
Posted youchihwang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了off charging mode flow相关的知识,希望对你有一定的参考价值。
/system/core/init/init.cpp
.....
.....
.....
int main(int argc, char** argv) {
.....
.....
.....
// Don‘t mount filesystems or start core system services in charger mode.
std::string bootmode = GetProperty("ro.bootmode", "");
if (bootmode == "charger") {
am.QueueEventTrigger("charger");
} else {
am.QueueEventTrigger("late-init");
}
.....
.....
.....
/system/core/rootdir/init.rc
.....
.....
.....
on charger
class_start charger
.....
.....
.....
/system/core/healthd/android.mk
.....
.....
.....
LOCAL_SRC_FILES := charger.cpp
LOCAL_MODULE := charger
.....
.....
.....
/system/core/healthd/charger.cpp
int healthd_charger_main(int argc, char** argv) {
int ch;
healthd_mode_ops = &charger_ops;
while ((ch = getopt(argc, argv, "cr")) != -1) {
switch (ch) {
case ‘c‘:
// -c is now a noop
break;
case ‘r‘:
// force nops for recovery
healthd_mode_ops = &healthd_nops;
break;
case ‘?‘:
default:
KLOG_ERROR(LOG_TAG, "Unrecognized charger option: %c
",
optopt);
exit(1);
}
}
return healthd_main();
}
int main(int argc, char** argv) {
return healthd_charger_main(argc, argv);
}
[To Be Continued]
以上是关于off charging mode flow的主要内容,如果未能解决你的问题,请参考以下文章
解决mysql二进制日志恢复数据报错:@@GLOBAL.GTID_MODE = OFF.
Visual StudioWindows program compatibility mode is on, turn it off……