1e41f4b71Sopenharmony_ci# Common Event and Notification Subsystem ChangeLog 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci## cl.notification.1 API Exception Handling Method Changes 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ciCertain event notification APIs use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ci**Change Impacts** 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ciThe application developed based on earlier versions needs to adapt the new APIs and their method for returning API error information. Otherwise, the original service logic will be affected. 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci**Key API/Component Changes** 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ciFor adaptation to the unified API exception handling mode, certain event notification APIs are deprecated (original APIs in the following table) and corresponding new APIs in the following table are added. The newly added APIs support unified error code handling specifications and function the same as the original APIs. 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci| Original API | New API | 16e41f4b71Sopenharmony_ci| ----------------------- | -------------------------------- | 17e41f4b71Sopenharmony_ci| @ohos.commonEvent.d.ts | @ohos.commonEventManager.d.ts | 18e41f4b71Sopenharmony_ci| @ohos.notification.d.ts | @ohos.notificationManager.d.ts | 19e41f4b71Sopenharmony_ci| @ohos.notification.d.ts | @ohos.notificationSubscribe.d.ts | 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci**Adaptation Guide** 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ciThe original APIs are only migrated to the new namespace. Therefore, you can modify **import** to solve the adaptation problem. 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ciIf the original API uses **@ohos.commonEvent**: 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci```js 28e41f4b71Sopenharmony_ciimport commonEvent from '@ohos.commonEvent'; 29e41f4b71Sopenharmony_ci``` 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ciYou can directly modify **import** to switch to the new namespace: 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci```js 34e41f4b71Sopenharmony_ciimport commonEvent from '@ohos.commonEventManager'; 35e41f4b71Sopenharmony_ci``` 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci**@ohos.notification** is split into two namespaces. You need to select a new namespace for adaptation. 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ciIn addition, exception handling is needed. For details, see the API reference for the new APIs. 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ci## cl.notification.2 API Changes 42e41f4b71Sopenharmony_ci 43e41f4b71Sopenharmony_ciThe names of some event notification APIs are changed. 44e41f4b71Sopenharmony_ci 45e41f4b71Sopenharmony_ci**Key API/Component Changes** 46e41f4b71Sopenharmony_ci 47e41f4b71Sopenharmony_ci| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| 48e41f4b71Sopenharmony_ci| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | 49e41f4b71Sopenharmony_ci| @ohos.notification | notification | **function** enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | 50e41f4b71Sopenharmony_ci| @ohos.notification | notification | **function** enableNotification(bundle: BundleOption, enable: boolean): Promise<**void**>; | Deprecated | 51e41f4b71Sopenharmony_ci| @ohos.notificationManager | notificationManager | **function** setNotificationEnable(bundle: BundleOption, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Added | 52e41f4b71Sopenharmony_ci| @ohos.notificationManager | notificationManager | **function** setNotificationEnable(bundle: BundleOption, enable: boolean): Promise<**void**>; | Added | 53e41f4b71Sopenharmony_ci| @ohos.notification | notification | **function** enableNotificationSlot(bundle: BundleOption, **type**: SlotType, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | 54e41f4b71Sopenharmony_ci| @ohos.notification | notification | **function** enableNotificationSlot(bundle: BundleOption, **type**: SlotType, enable: boolean): Promise<**void**>; | Deprecated | 55e41f4b71Sopenharmony_ci| @ohos.notificationManager | notificationManager | **function** setNotificationEnableSlot(bundle: BundleOption, **type**: SlotType, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Added | 56e41f4b71Sopenharmony_ci| @ohos.notificationManager | notificationManager | **function** setNotificationEnableSlot(bundle: BundleOption, **type**: SlotType, enable: boolean): Promise<**void**>; | Added | 57e41f4b71Sopenharmony_ci| @ohos.notification | notification | **function** enableDistributed(enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | 58e41f4b71Sopenharmony_ci| @ohos.notification | notification | **function** enableDistributed(enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | 59e41f4b71Sopenharmony_ci| @ohos.notificationManager | notificationManager | **function** setDistributedEnable(enable: boolean, callback: AsyncCallback<**void**>): **void**; | Added | 60e41f4b71Sopenharmony_ci| @ohos.notificationManager | notificationManager | **function** setDistributedEnable(enable: boolean): Promise<**void**>; | Added | 61e41f4b71Sopenharmony_ci| @ohos.notification | notification | **function** enableDistributedByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | 62e41f4b71Sopenharmony_ci| @ohos.notification | notification | **function** enableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise<**void**>; | Deprecated | 63e41f4b71Sopenharmony_ci| @ohos.notificationManager | notificationManager | **function** setDistributedEnableByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Added | 64e41f4b71Sopenharmony_ci| @ohos.notificationManager | notificationManager | **function** setDistributedEnableByBundle(bundle: BundleOption, enable: boolean): Promise<**void**>; | Added | 65