问题描述:
OpenHarmony4.0开机或者息屏按电源键进入时需要上滑解锁屏幕,其实没有什么大的作用。
上滑解锁
那么如何去调这个锁屏效果呢,本给出一个方法。
以rk3568开发板OpenHarmony4.0为例,分三步:
1、删除源码中SystemUI-ScreenLock.hap
下载OpenHarmony4.0release的源码,删除源码目录下applications\standard\hap下的SystemUI-ScreenLock.hap
2、删除修改源码中BUILD.gn文件里的部分代码
找到源码目录下applications\standard\hap\BUILD.gn文件,打开该文件按如下修改:
(1)找到并删除或注释掉 预置SystemUI-ScreenLock.hap的相关代码,如下所示
...
//ohos_prebuilt_etc("screenLock_hap") {
//source = "SystemUI-ScreenLock.hap"
//module_install_dir = "app/com.ohos.systemui"
//part_name = "prebuilt_hap"
//subsystem_name = "applications"
//}
...
(2)找到并删除或注释与Screenlock依赖的相关代码,如下列代码中的红色部分
group("hap") {
deps = [
":calendarData_hap",
":printspooler_hap",
":systemDialog_hap",
":updateapp_hap",
...
"//applications/standard/hap:photos_hap",
#"//applications/standard/hap:screenLock_hap",
"//applications/standard/hap:screen_shot_hap",
"//applications/standard/hap:settingsData_hap",
"//applications/standard/hap:settings_faceauth_hap",
...
]
if (defined(product_name) && product_name == "watchos") {
deps -= [
":calendarData_hap",
":printspooler_hap",
":systemDialog_hap",
":updateapp_hap",
...
"//applications/standard/hap:photos_hap",
#"//applications/standard/hap:screenLock_hap",
"//applications/standard/hap:screen_shot_hap",
"//applications/standard/hap:settingsData_hap",
...
]
} else if (defined(product_name) && product_name == "rk3568") {
deps +=
[ "//applications/standard/admin_provisioning:adminprovisioning_hap" ]
} else if (defined(product_name) && product_name == "ohos-arm64") {
deps +=
[ "//applications/standard/admin_provisioning:adminprovisioning_hap" ]
}
}
3、将源码重新编译固件,烧录验证即可
预期效果:
去除锁屏进入桌面演示