openharmony 鸿蒙 changelogs-ces

2023-06-24 浏览 (441)

Common Event Subsystem Changelog

cl.ces.1 Event Enum Change of ohos.commonEvent

Change Impact

For applications developed based on earlier versions, the following common events of the .ohos.commonEvent module must be adapted.

Common Event
COMMON_EVENT_PACKAGE_CACHE_CLEARED
COMMON_EVENT_USB_STATE
COMMON_EVENT_USB_PORT_CHANGED
COMMON_EVENT_VOLUME_REMOVED
COMMON_EVENT_VOLUME_UNMOUNTED
COMMON_EVENT_VOLUME_MOUNTED
COMMON_EVENT_VOLUME_BAD_REMOVAL
COMMON_EVENT_VOLUME_EJECT
COMMON_EVENT_SLOT_CHANGE
COMMON_EVENT_SPN_INFO_CHANGED
COMMON_EVENT_QUICK_FIX_APPLY_RESULT

Key API/Component Changes

Replace the common events in ohos.commonEvent with those in ohos.commonEventManager.

Common Event in ohos.commonEventCommon Event in ohos.commonEventManager
COMMON_EVENT_PACKAGE_CACHE_CLEAREDCOMMON_EVENT_PACKAGE_CACHE_CLEARED
COMMON_EVENT_USB_STATECOMMON_EVENT_USB_STATE
COMMON_EVENT_USB_PORT_CHANGEDCOMMON_EVENT_USB_PORT_CHANGED
COMMON_EVENT_VOLUME_REMOVEDCOMMON_EVENT_VOLUME_REMOVED
COMMON_EVENT_VOLUME_UNMOUNTEDCOMMON_EVENT_VOLUME_UNMOUNTED
COMMON_EVENT_VOLUME_MOUNTEDCOMMON_EVENT_VOLUME_MOUNTED
COMMON_EVENT_VOLUME_BAD_REMOVALCOMMON_EVENT_VOLUME_BAD_REMOVAL
COMMON_EVENT_VOLUME_EJECTCOMMON_EVENT_VOLUME_EJECT
COMMON_EVENT_SLOT_CHANGECOMMON_EVENT_SLOT_CHANGE
COMMON_EVENT_SPN_INFO_CHANGEDCOMMON_EVENT_SPN_INFO_CHANGED
COMMON_EVENT_QUICK_FIX_APPLY_RESULTCOMMON_EVENT_QUICK_FIX_APPLY_RESULT

Adaptation Guide

Replace the events in ohos.commonEvent with those in ohos.commonEventManager.

Before change:

import commonEvent from '@ohos.commonEvent';
let event: string = commonEvent.Support.COMMON_EVENT_PACKAGE_CACHE_CLEARED;

After change:

import commonEventManager from '@ohos.commonEventManager';
let event: string = commonEventManager.Support.COMMON_EVENT_PACKAGE_CACHE_CLEARED;

你可能感兴趣的鸿蒙文章

harmony 鸿蒙App Access Control Subsystem ChangeLog

harmony 鸿蒙Security Subsystem Changelog

harmony 鸿蒙Web Subsystem Changelog

harmony 鸿蒙Account Subsystem Changelog

harmony 鸿蒙ArkUI Subsystem Changelog

harmony 鸿蒙Bundle Manager Subsystem Changelog

harmony 鸿蒙File Management Subsystem Changelog

harmony 鸿蒙Pasteboard Subsystem Changelog

harmony 鸿蒙Power Subsystem Changelog

harmony 鸿蒙Pan-sensor Subsystem Changelog

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/ed0e8e09813e40fa900e7c60a9d7a37b