char value[PROPERTY_VALUE_MAX];
property_get("persist.sys.profile.silent", value, "0");
if (atoi(value)== 0){
LOGI("start:persist.sys.profile.silent is soundable");
// start startupsound service
property_set("ctl.start","startupsound");//注
} else {
LOGI("start:persist.sys.profile.silent is silent");
}
}
return NO_ERROR;
}
当 Android 完成 boot 后,关闭动画和开机铃声,代码位于
//源文件 SurfaceFlinger.cpp
void SurfaceFlinger::bootFinished() {
const nsecs_t now = systemTime();
const nsecs_t duration = now - mBootTime;
LOGI("Boot is finished (%ld ms)", long(ns2ms(duration)) );
mBootFinished = true;
//stop bootanim service
property_set("ctl.stop", "bootanim");
char value[PROPERTY_VALUE_MAX];
property_get("persist.sys.profile.silent", value, "0");
if (atoi(value)== 0){
LOGI("stop:persist.sys.profile.silent is soundable");
//stop startupsound service
property_set("ctl.stop","startupsound");
} else {
LOGI("stop:persist.sys.profile.silent is silent");
}
}