harmony 鸿蒙应用变更说明

  • 2025-06-16
  • 浏览 (5)

应用变更说明

cl.screenlock.1 EventType新增系统事件类型

访问级别

系统接口

变更原因

强认证和禁用锁屏功能需要新增系统事件类型新增系统事件类型strongAuthChanged和screenLockDisabledChanged,新增后开发者可以使用强认证功能和禁用锁屏功能

变更影响

该变更为兼容性变更。

变更前:不支持strongAuthChanged和screenLockDisabledChanged这两种系统事件。

变更后:支持strongAuthChanged和screenLockDisabledChanged这两种系统事件。

起始API Level

API12

变更发生版本

从OpenHarmony 5.0.0.38 版本开始。

适配指导 下面是接收新的事件类型的Sample代码.

try {
  let isSuccess = screenLock.onSystemEvent((event: screenLock.SystemEvent) => {
    console.log(`Succeeded in Registering the system event which related to screenlock. eventType: ${event.eventType}`)
  });
} catch (err) {
  let error = err as BusinessError;
  console.error(`Failed to register the system event which related to screenlock, Code: ${error.code}, message: ${error.message}`)
}

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Arkts子系统变更说明

harmony 鸿蒙ArkUI子系统Changelog

harmony 鸿蒙全局资源调度子系统Changelog

harmony 鸿蒙分布式数据管理子系统ChangeLog

harmony 鸿蒙输入法子系统Changelog

harmony 鸿蒙媒体子系统Changelog

harmony 鸿蒙多模输入子系统变更说明

harmony 鸿蒙网络子系统Changelog

harmony 鸿蒙文件子系统变更说明

harmony 鸿蒙窗口子系统变更说明

0  赞