标签:int mount tin recovery default cas prope top files
/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\n",
optopt);
exit(1);
}
}
return healthd_main();
}
int main(int argc, char** argv) {
return healthd_charger_main(argc, argv);
}
[To Be Continued]
标签:int mount tin recovery default cas prope top files
原文地址:https://www.cnblogs.com/youchihwang/p/9610876.html