[RK3288][Android6.0] 除錯筆記 --- 開機動畫時間的確定
阿新 • • 發佈:2019-02-11
Platform: Rockchip
OS: Android 6.0
Kernel: 3.10.92
開機動畫的退出是靠property即
#define EXIT_PROP_NAME "service.bootanim.exit"
來判斷的,見函式checkExit()
BootAnimation.cpp
void BootAnimation::checkExit() {
if(mShutdown){
return ;
}
// Allow surface flinger to gracefully request shutdown
char value[PROPERTY_VALUE_MAX];
property_get(EXIT_PROP_NAME, value, "0");
int exitnow = atoi(value);
if (exitnow) {
requestExit();
if (mAudioPlayer != NULL) {
mAudioPlayer->requestExit();
}
}
}
而設定個property的地方是在
SurfaceFlinger.cpp
void SurfaceFlinger::bootFinished()
{
const nsecs_t now = systemTime();
const nsecs_t duration = now - mBootTime;
ALOGI("Boot is finished (%ld ms)", long(ns2ms(duration)) );
mBootFinished = true;
// wait patiently for the window manager death
const String16 name("window");
sp<IBinder> window(defaultServiceManager()->getService(name));
if (window != 0) {
window->linkToDeath(static_cast<IBinder::DeathRecipient*>(this));
}
// stop boot animation
// formerly we would just kill the process, but we now ask it to exit so it
// can choose where to stop the animation.
property_set("service.bootanim.exit", "1");
}
當顯示模組boot完成後,會呼叫
property_set("service.bootanim.exit", "1");
告訴bootanimation模組退出動畫顯示。
所以從開機動畫開始顯示到SurfaceFlinger boot完成,這個時間就是視訊最少時間。
驗證測試大概在30s左右。