关键点

移除掉SystemUI-ScreenLock.hap后,再把foundation.cfg中的bootevent.lockscreen.ready(两处)移除掉即可。

实操

移除SystemUI-ScreenLock.hap

applications/standard/hap/BUILD.gn中删除或注释掉以下代码

ohos_prebuilt_etc("screenLock_hap") {
  source = "Dhht_LockScreen.hap"
  module_install_dir = "app/com.dhht.screenlock"
  part_name = "prebuilt_hap"
  subsystem_name = "applications"
}

...
"//applications/standard/hap:screenLock_hap",

移除bootevent.lockscreen.ready事件

foundation/systemabilitymgr/safwk/etc/profile/foundation.cfg中找到bootevent.lockscreen.ready并删除即可(共两处)

原理

仅当在.cfg文件中注册的以bootevent.开头的事件对应的param都被设置为true才算系统启动完毕,而开机动画在监听到系统启动完毕后才会关闭。

bootevent.lockscreen.ready是在SystemUI-ScreenLock.hap启动后被设置为true的,单纯删除SystemUI-ScreenLock.hap就卡开机动画了。

非源码环境

SystemUI-ScreenLock.hap/system/app/com.ohos.systemui/
foundation.cfg/system/etc/init/

Logo

社区规范:仅讨论OpenHarmony相关问题。

更多推荐