参考文章:点击打开链接
PowerManagerService.java
1,原本开机检查开机动画:startWatchingForBootAnimationFinished();在接到开机完成广播后才检查开机动画,把这个方法注释掉
private final class BootCompletedReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// This is our early signal that the system thinks it has finished booting.
// However, the boot animation may still be running for a few more seconds
// since it is ultimately in charge of when it terminates.
// Defer transitioning into the boot completed state until the animation exits.
// We do this so that the screen does not start to dim prematurely before
// the user has actually had a chance to interact with the device.
// startWatchingForBootAnimationFinished();
}
}
2,在 public void systemReady(TwilightService twilight, DreamManagerService dreamManager) {
synchronized (mLock) {
mSystemReady = true;
mDreamManager = dreamManager;
.......
// Go.
readConfigurationLocked();
updateSettingsLocked();
mDirty |= DIRTY_BATTERY_STATE;
updatePowerStateLocked();
// wdh add
startWatchingForBootAnimationFinished();
}
}
结尾处加上这个方法
方法二:归根结底,执行的是handleBootCompletedLocked()这个方法(就是说系统完成启动了),所以
把上面的startWatchingForBootAnimationFinished();方法换成 handleBootCompletedLocked();方法也可以