From ac0c3dc83e984162f932207d6553ed0d1320275f Mon Sep 17 00:00:00 2001 From: Gloria Date: Wed, 1 Feb 2023 11:28:23 +0800 Subject: [PATCH] Update docs against 13070+13276+13190+13041+13528+13128+13297 Signed-off-by: wusongqing --- .../changelogs-bundlemanager.md | 42 ++ .../changelogs-bundlemanager.md | 21 + .../changelogs-camera-sync.md | 522 ++++++++++++++++++ .../changelog-bundlemanager.md | 3 + .../changelog-resourceschedule.md | 318 +++++++++++ .../OpenHarmony_4.0.2.1/changelogs-ability.md | 140 +++++ .../OpenHarmony_4.0.2.1/changelogs-media.md | 314 +++++++++++ 7 files changed, 1360 insertions(+) create mode 100644 en/release-notes/changelogs/OpenHarmony_3.2.10.2/changelogs-bundlemanager.md create mode 100644 en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-bundlemanager.md create mode 100644 en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-camera-sync.md create mode 100644 en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-resourceschedule.md create mode 100644 en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-ability.md create mode 100644 en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-media.md diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.2/changelogs-bundlemanager.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.2/changelogs-bundlemanager.md new file mode 100644 index 0000000000..4542c0a871 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.2/changelogs-bundlemanager.md @@ -0,0 +1,42 @@ +# Bundle Manager Subsystem ChangeLog + +## cl.bundlemanager.1 Field Change of the ApplicationInfo Structure in API Version 9 + +The **ApplicationInfo** structure [[bundleManager/applicationInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/applicationInfo.d.ts)] in API version 9 has field changes, with the **systemApp** field being added and the **entryDir** field being deleted. + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs. + +**Key API/Component Changes** + +The following table describes the changed fields in the **ApplicationInfo** structure. + +| Deleted Field | Added or Changed Field in API Version 9| Type | +| -------- | -------------- | ------- | +| None | systemApp | boolean | +| entryDir | None | string | + +**Adaptation Guide** + +Import the bundle manager query module and use the **systemApp** field in the **ApplicationInfo** structure of API version 9. If the **entryDir** field is used, change the field because it is redundant in features where HAP decompression is not required. + +## cl.bundlemanager.2 Field Change of the HapModuleInfo Structure in API Version 9 + +The **moduleSourceDir** field is deleted from the **HapModuleInfo** structure [[bundleManager/hapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/hapModuleInfo.d.ts)] in API version 9. + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs. + +**Key API/Component Changes** + +The following table describes the changed fields in the **HapModuleInfo** structure. + +| Deleted Field | Added or Changed Field in API Version 9| Type | +| --------------- | -------------- | ------ | +| moduleSourceDir | None | string | + +**Adaptation Guide** + +Import the bundle manager query module and do not use the **moduleSourceDir** field in the **HapModuleInfo** structure of API version 9. If the **moduleSourceDir** field is used, change the field because it is redundant in features where HAP decompression is not required. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-bundlemanager.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-bundlemanager.md new file mode 100644 index 0000000000..ed95a11140 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-bundlemanager.md @@ -0,0 +1,21 @@ +# Bundle Manager Subsystem ChangeLog + +## cl.bundlemanager.1 Name Change of the Bundle Manager Distributed Query Module + +The name of the bundle manager distributed query module in API version 9 is changed from **ohos.bundle.distributedBundle** to **[ohos.bundle.distributedBundleManager](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.distributedBundleManager.d.ts)**. The APIs remain unchanged. + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt the new module. + +**Key API/Component Changes** + +The name of the bundle manager distributed query module is changed from **ohos.bundle.distributedBundle** to **ohos.bundle.distributedBundleManager**. The APIs remain unchanged. + +**Adaptation Guide** + +Change the module to import from **@ohos.bundle.distributedBundle** to **@ohos.bundle.distributedBundleManager**. + +```ts +import distributedBundle form '@ohos.bundle.distributedBundleManager'; +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-camera-sync.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-camera-sync.md new file mode 100644 index 0000000000..c20c9e4c50 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-camera-sync.md @@ -0,0 +1,522 @@ +# Multimedia Subsystem ChangeLog + +Compared with OpenHarmony 3.2 Beta4, OpenHarmony3.2.10.3 has the following changes in APIs of the camera component in the multimedia subsystem. + +## cl.subsystemname.1 Camera API Changed +1. All the APIs of the camera component are changed to system APIs in the API version 9. +2. Some functional APIs are added and some others are deprecated to: + +- Improve the usability of camera APIs. +- Help you quickly understand camera APIs and use them for development. +- Facilitate expansion of framework functions in later versions, and reduce coupling between framework modules. + +You need to refer to the following change description to adapt your application. + +**Change Impacts** + +JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enum/Constant | Is System API| Change Type| +| ---------------------- | ----------------------- | ------------------------------------------------------------ | --------------- | -------- | +| ohos.multimedia.camera | camera | function getCameraManager(context: Context): CameraManager; | Yes | Added | +| ohos.multimedia.camera | camera | function getCameraManager(context: Context, callback: AsyncCallback): void;
function getCameraManager(context: Context): Promise; | Yes | Deprecated | +| ohos.multimedia.camera | CameraErrorCode | INVALID_ARGUMENT = 7400101,
OPERATION_NOT_ALLOWED = 7400102,
SESSION_NOT_CONFIG = 7400103,
SESSION_NOT_RUNNING = 7400104,
SESSION_CONFIG_LOCKED = 7400105,
DEVICE_SETTING_LOCKED = 7400106,
CONFILICT_CAMERA = 7400107,
DEVICE_DISABLED = 7400108,
SERVICE_FATAL_ERROR = 7400201 | Yes | Added | +| ohos.multimedia.camera | CameraManager | getSupportedCameras(): Array;
getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability;
createCameraInput(camera: CameraDevice): CameraInput;
createCameraInput(position: CameraPosition, type: CameraType): CameraInput;
createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput;
createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput;
createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput;
createMetadataOutput(metadataObjectTypes: Array): MetadataOutput;
createCaptureSession(): CaptureSession; | Yes | Added | +| ohos.multimedia.camera | CameraManager | getSupportedCameras(callback: AsyncCallback>): void;
getSupportedCameras(): Promise>;
getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback): void;
getSupportedOutputCapability(camera: CameraDevice): Promise;
createCameraInput(camera: CameraDevice, callback: AsyncCallback): void;
createCameraInput(camera: CameraDevice): Promise;
createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void;
createCameraInput(position: CameraPosition, type: CameraType): Promise;
createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void;
createPreviewOutput(profile: Profile, surfaceId: string): Promise;
createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void;
createPhotoOutput(profile: Profile, surfaceId: string): Promise;
createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback): void;
createVideoOutput(profile: VideoProfile, surfaceId: string): Promise;
createMetadataOutput(metadataObjectTypes: Array, callback: AsyncCallback): void;
createMetadataOutput(metadataObjectTypes: Array): Promise;
createCaptureSession(callback: AsyncCallback): void;
createCaptureSession(): Promise; | Yes | Deprecated | +| ohos.multimedia.camera | CameraType | CAMERA_TYPE_DEFAULT = 0 | Yes | Added | +| ohos.multimedia.camera | CameraType | CAMERA_TYPE_UNSPECIFIED = 0 | Yes | Deprecated | +| ohos.multimedia.camera | CameraInput | on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; | Yes | Added | +| ohos.multimedia.camera | CameraInput | release(callback: AsyncCallback): void;
release(): Promise;
on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; | Yes | Deprecated | +| ohos.multimedia.camera | CameraInputErrorCode | ERROR_UNKNOWN = -1
ERROR_NO_PERMISSION = 0
ERROR_DEVICE_PREEMPTED = 1
ERROR_DEVICE_DISCONNECTED = 2
ERROR_DEVICE_IN_USE = 3
ERROR_DRIVER_ERROR = 4 | Yes | Deprecated | +| ohos.multimedia.camera | CameraInputError | code: CameraInputErrorCode | Yes | Deprecated | +| ohos.multimedia.camera | CaptureSession | beginConfig(): void;
addInput(cameraInput: CameraInput): void;
removeInput(cameraInput: CameraInput): void;
addOutput(cameraOutput: CameraOutput): void;
removeOutput(cameraOutput: CameraOutput): void;
hasFlash(): boolean;
isFlashModeSupported(flashMode: FlashMode): boolean;
getFlashMode(): FlashMode;
setFlashMode(flashMode: FlashMode): void;
isExposureModeSupported(aeMode: ExposureMode): boolean;
getExposureMode(): ExposureMode;
setExposureMode(aeMode: ExposureMode): void;
getMeteringPoint(): Point;
setMeteringPoint(point: Point): void;
getExposureBiasRange(): Array;
setExposureBias(exposureBias: number): void;
getExposureValue(): number;
isFocusModeSupported(afMode: FocusMode): boolean;
getFocusMode(): FocusMode;
setFocusMode(afMode: FocusMode): void;
setFocusPoint(point: Point): void;
getFocusPoint(): Point;
getFocalLength(): number;
getZoomRatioRange(): Array;
getZoomRatio(): number;
setZoomRatio(zoomRatio: number): void;
isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean;
getActiveVideoStabilizationMode(): VideoStabilizationMode;
setVideoStabilizationMode(mode: VideoStabilizationMode): void;
on(type: 'error', callback: ErrorCallback): void; | Yes | Added | +| ohos.multimedia.camera | CaptureSession | beginConfig(callback: AsyncCallback): void;
beginConfig(): Promise;
addInput(cameraInput: CameraInput, callback: AsyncCallback): void;
addInput(cameraInput: CameraInput): Promise;
removeInput(cameraInput: CameraInput, callback: AsyncCallback): void;
removeInput(cameraInput: CameraInput): Promise;
addOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void;
addOutput(cameraOutput: CameraOutput): Promise;
removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void;
removeOutput(cameraOutput: CameraOutput): Promise;
hasFlash(callback: AsyncCallback): void;
hasFlash(): Promise;
isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void;
isFlashModeSupported(flashMode: FlashMode): Promise;
getFlashMode(callback: AsyncCallback): void;
getFlashMode(): Promise;
setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void;
setFlashMode(flashMode: FlashMode): Promise;
isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback): void;
isExposureModeSupported(aeMode: ExposureMode): Promise;
getExposureMode(callback: AsyncCallback): void;
getExposureMode(): Promise;
setExposureMode(aeMode: ExposureMode, callback: AsyncCallback): void;
setExposureMode(aeMode: ExposureMode): Promise;
getMeteringPoint(callback: AsyncCallback): void;
getMeteringPoint(): Promise;
setMeteringPoint(point: Point, callback: AsyncCallback): void;
setMeteringPoint(point: Point): Promise;
getExposureBiasRange(callback: AsyncCallback>): void;
getExposureBiasRange(): Promise>;
setExposureBias(exposureBias: number, callback: AsyncCallback): void;
setExposureBias(exposureBias: number): Promise;
getExposureValue(callback: AsyncCallback): void;
getExposureValue(): Promise;
isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void;
isFocusModeSupported(afMode: FocusMode): Promise;
getFocusMode(callback: AsyncCallback): void;
getFocusMode(): Promise;
setFocusMode(afMode: FocusMode, callback: AsyncCallback): void;
setFocusMode(afMode: FocusMode): Promise;
setFocusPoint(point: Point, callback: AsyncCallback): void;
setFocusPoint(point: Point): Promise;
getFocusPoint(callback: AsyncCallback): void;
getFocusPoint(): Promise;
getFocalLength(callback: AsyncCallback): void;
getFocalLength(): Promise;
getZoomRatioRange(callback: AsyncCallback>): void;
getZoomRatioRange(): Promise>;
getZoomRatio(callback: AsyncCallback): void;
getZoomRatio(): Promise;
setZoomRatio(zoomRatio: number, callback: AsyncCallback): void;
setZoomRatio(zoomRatio: number): Promise;
isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback): void;
isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise;
getActiveVideoStabilizationMode(callback: AsyncCallback): void;
getActiveVideoStabilizationMode(): Promise;
setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback): void;
setVideoStabilizationMode(mode: VideoStabilizationMode): Promise;
on(type: 'error', callback: ErrorCallback): void; | Yes | Deprecated | +| ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_UNKNOWN = -1
ERROR_INSUFFICIENT_RESOURCES = 0
ERROR_TIMEOUT = 1 | Yes | Deprecated | +| ohos.multimedia.camera | CaptureSessionError | code: CaptureSessionErrorCode | Yes | Deprecated | +| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback): void; | Yes | Added | +| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback): void; | Yes | Deprecated | +| ohos.multimedia.camera | PreviewOutputErrorCode | ERROR_UNKNOWN = -1 | Yes | Deprecated | +| ohos.multimedia.camera | PreviewOutputError | code: PreviewOutputErrorCode | Yes | Deprecated | +| ohos.multimedia.camera | PhotoOutput | capture(): Promise;
isMirrorSupported(): boolean;
on(type: 'error', callback: ErrorCallback): void; | Yes | Added | +| ohos.multimedia.camera | PhotoOutput | isMirrorSupported(callback: AsyncCallback): void;
isMirrorSupported(): Promise;
on(type: 'error', callback: ErrorCallback): void; | Yes | Deprecated | +| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_UNKNOWN = -1
ERROR_DRIVER_ERROR = 0
ERROR_INSUFFICIENT_RESOURCES = 1
ERROR_TIMEOUT = 2 | Yes | Deprecated | +| ohos.multimedia.camera | PhotoOutputError | code: PhotoOutputErrorCode | Yes | Deprecated | +| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback): void; | Yes | Added | +| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback): void; | Yes | Deprecated | +| ohos.multimedia.camera | VideoOutputErrorCode | ERROR_UNKNOWN = -1
ERROR_DRIVER_ERROR = 0 | Yes | Deprecated | +| ohos.multimedia.camera | VideoOutputError | code: VideoOutputErrorCode | Yes | Deprecated | +| ohos.multimedia.camera | MetadataObject | readonly type: MetadataObjectType;
readonly timestamp: number; | Yes | Added | +| ohos.multimedia.camera | MetadataObject | getType(callback: AsyncCallback): void;
getType(): Promise;
getTimestamp(callback: AsyncCallback): void;
getTimestamp(): Promise;
getBoundingBox(callback: AsyncCallback): void;
getBoundingBox(): Promise; | Yes | Deprecated | +| ohos.multimedia.camera | MetadataFaceObject | readonly boundingBox: Rect | Yes | Added | +| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback): void; | Yes | Added | +| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback): void; | Yes | Deprecated | +| ohos.multimedia.camera | MetadataOutputErrorCode | ERROR_UNKNOWN = -1
ERROR_INSUFFICIENT_RESOURCES = 0 | Yes | Deprecated | +| ohos.multimedia.camera | MetadataOutputError | code: MetadataOutputErrorCode | Yes | Deprecated | + +**Adaptation Guide** + +In addition to the new APIs and deprecated APIs, you need to adapt your application to the changed APIs. + +In Beta4 and later versions, the following APIs are changed. + +**New APIs** + +1. **CameraErrorCode** enums + + Enum: INVALID_ARGUMENT; value: 7400101 + + Enum: OPERATION_NOT_ALLOWED; value: 7400102 + + Enum: SESSION_NOT_CONFIG; value: 7400103 + + Enum: SESSION_NOT_RUNNING; value: 7400104 + + Enum: SESSION_CONFIG_LOCKED; value: 7400105 + + Enum: DEVICE_SETTING_LOCKED; value: 7400106 + + Enum: CONFILICT_CAMERA; value: 7400107 + + Enum: DEVICE_DISABLED; value: 7400108 + + Enum: SERVICE_FATAL_ERROR; value: 7400201 + +2. Added **capture(): Promise** to the **PhotoOutput** API. + +3. Added the readonly type **MetadataObjectType** to the **MetadataObject** API. + +4. Added **readonly timestamp: number** to the **MetadataObject** API. + +5. Added **readonly boundingBox: Rect** to the **MetadataObject** API. + +**Deprecated APIs** + +1. Deprecated the **release(callback: AsyncCallback): void** and **release(): Promise** APIs in **CameraInput**. + +2. Deprecated the **CameraInputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_NO_PERMISSION** = **0**, **ERROR_DEVICE_PREEMPTED** = **1**, **ERROR_DEVICE_DISCONNECTED** = **2**, **ERROR_DEVICE_IN_USE** = **3**, **ERROR_DRIVER_ERROR** = **4** + +3. Deprecated the **CameraInputError** API and its attribute **CameraInputErrorCode**. + +4. Deprecated the **CaptureSessionErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_INSUFFICIENT_RESOURCES** = **0**, **ERROR_TIMEOUT** = **1** + +5. Deprecated the **CaptureSessionError** API and its attribute **CaptureSessionErrorCode**. + +6. Deprecated the **PreviewOutputErrorCode** enum and its value: **ERROR_UNKNOWN** = **-1** + +7. Deprecated the **PreviewOutputError** API and its attribute **PreviewOutputErrorCode**. + +8. Deprecated the **PhotoOutputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_DRIVER_ERROR** = **0**, **ERROR_INSUFFICIENT_RESOURCES** = **1**, **ERROR_TIMEOUT** = **2** + +9. Deprecated the **PhotoOutputError** API and its attribute **PhotoOutputErrorCode**. + +10. Deprecated the **VideoOutputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_DRIVER_ERROR** = **0** + +11. Deprecated the **VideoOutputError** API and its attribute **VideoOutputErrorCode**. + +12. Deprecated **getType(callback: AsyncCallback): void** in the **MetadataObject** API. + +13. Deprecated **getType(): Promise** in the **MetadataObject** API. + +14. Deprecated **getTimestamp(callback: AsyncCallback): void** in the **MetadataObject** API. + +15. Deprecated **getTimestamp(): Promise** in the **MetadataObject** API. + +16. Deprecated **getBoundingBox(callback: AsyncCallback): void** in the **MetadataObject** API. + +17. Deprecated **getBoundingBox(): Promise** in the **MetadataObject** API. + +18. Deprecated the **MetadataOutputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_INSUFFICIENT_RESOURCES** = **0** + +19. Deprecated the **MetadataOutputError** API and its attribute **MetadataOutputErrorCode**. + +**Changed APIs** + +1. Changed the return modes of the **getCameraManager** API in the camera module from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getCameraManager(context: Context, callback: AsyncCallback): void** and **getCameraManager(context: Context): Promise** are changed to **getCameraManager(context: Context): CameraManager**. + + The sample code is as follows: + + ``` + let cameraManager = camera.getCameraManager(context); + ``` + +2. Changed the return modes of the **getSupportedCameras** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedCameras(callback: AsyncCallback>): void** and **getSupportedCameras(): Promise>** are changed to **getSupportedCameras(): Array**. + + The sample code is as follows: + + ``` + let cameras = cameraManager.getSupportedCameras(); + ``` + +3. Changed the return modes of the **getSupportedOutputCapability** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback): void** and **getSupportedOutputCapability(camera: CameraDevice): Promise** are changed to **getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability**. + + The sample code is as follows: + + ``` + let cameraDevice = cameras[0]; + let CameraOutputCapability = cameraManager.getSupportedOutputCapability(cameraDevice); + ``` + +4. Changed the return modes of the **createCameraInput(camera: CameraDevice)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(camera: CameraDevice, callback: AsyncCallback): void** and **createCameraInput(camera: CameraDevice): Promise** are changed to **createCameraInput(camera: CameraDevice): CameraInput**. + + The sample code is as follows: + + ``` + let cameraDevice = cameras[0]; + let cameraInput = cameraManager.createCameraInput(cameraDevice); + ``` + +5. Changed the return modes of the **createCameraInput(position: CameraPosition, type: CameraType)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void** and **createCameraInput(position: CameraPosition, type: CameraType): Promise** are changed to **createCameraInput(position: CameraPosition, type: CameraType): CameraInput**. + + The sample code is as follows: + + ``` + let cameraDevice = cameras[0]; + let position = cameraDevice.cameraPosition; + let type = cameraDevice.cameraType; + let cameraInput = cameraManager.createCameraInput(position, type); + ``` + +6. Changed the return modes of the **createPreviewOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void** and **createPreviewOutput(profile: Profile, surfaceId: string): Promise** are changed to **createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput**. + + The sample code is as follows: + + ``` + let profile = cameraoutputcapability.previewProfiles[0]; + let previewOutput = cameraManager.createPreviewOutput(profile, surfaceId); + ``` + +7. Changed the return modes of the **createPhotoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void** and **createPhotoOutput(profile: Profile, surfaceId: string): Promise** are changed to **createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput**. + + The sample code is as follows: + + ``` + let profile = cameraoutputcapability.photoProfiles[0]; + let photoOutput = cameraManager.createPhotoOutput(profile, surfaceId); + ``` + +8. Changed the return modes of the **createVideoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback): void** and **createVideoOutput(profile: VideoProfile, surfaceId: string): Promise** are changed to **createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput**. + + The sample code is as follows: + + ``` + let profile = cameraoutputcapability.videoProfiles[0]; + let videoOutput = cameraManager.createVideoOutput(profile, surfaceId); + ``` + +9. Changed the return modes of the **createMetadataOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createMetadataOutput(metadataObjectTypes: Array, callback: AsyncCallback): void** and **createMetadataOutput(metadataObjectTypes: Array): Promise** are changed to **createMetadataOutput(metadataObjectTypes: Array): MetadataOutput**. + + The sample code is as follows: + + ``` + let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes; + let metadataOutput = cameraManager.createMetadataOutput(metadataObjectTypes); + ``` + +10. Changed the return modes of the **createCaptureSession** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCaptureSession(callback: AsyncCallback): void** and **createCaptureSession(): Promise** are changed to **createCaptureSession(): CaptureSession**. + + The sample code is as follows: + + ``` + let captureSession = cameraManager.createCaptureSession(); + ``` + +11. Changed the enum **CAMERA_TYPE_UNSPECIFIED** of **CameraType** to **CAMERA_TYPE_DEFAULT**. + +12. Changed the return value type of the **on** API in CameraInput from **CameraInputError** to **BusinessError**. Therefore, the original API **on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void** is changed to **on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void**. + + The sample code is as follows: + + ``` + let cameraDevice = cameras[0]; + cameraInput.on('error', cameraDevice, (BusinessError) => { + + }) + ``` + +13. Changed the return modes of the **beginConfig** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **beginConfig(callback: AsyncCallback): void** and **beginConfig(): Promise** are changed to **beginConfig(): void**. + + The sample code is as follows: + + ``` + captureSession.beginConfig(); + ``` + +14. Changed the return modes of the **addInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addInput(cameraInput: CameraInput, callback: AsyncCallback): void** and **addInput(cameraInput: CameraInput): Promise** are changed to **addInput(cameraInput: CameraInput): void**. + + The sample code is as follows: + + ``` + captureSession.addInput(cameraInput); + ``` + +15. Changed the return modes of the **removeInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeInput(cameraInput: CameraInput, callback: AsyncCallback): void** and **removeInput(cameraInput: CameraInput): Promise** are changed to **removeInput(cameraInput: CameraInput): void**. + + The sample code is as follows: + + ``` + captureSession.removeInput(cameraInput); + ``` + +16. Changed the return modes of the **addOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void** and **addOutput(cameraOutput: CameraOutput): Promise** are changed to **addOutput(cameraOutput: CameraOutput): void**. + + The sample code is as follows: + + ``` + captureSession.addOutput(previewOutput); + ``` + +17. Changed the return modes of the **removeOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void** and **removeOutput(cameraOutput: CameraOutput): Promise** are changed to **removeOutput(cameraOutput: CameraOutput): void**. + + The sample code is as follows: + + ``` + captureSession.removeOutput(previewOutput); + ``` + +18. Changed the return modes of the **hasFlash** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **hasFlash(callback: AsyncCallback): void** and **hasFlash(): Promise** are changed to **hasFlash(): boolean**. + + The sample code is as follows: + + ``` + let status = captureSession.hasFlash(); + ``` + +19. Changed the return modes of the **isFlashModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void** and **isFlashModeSupported(flashMode: FlashMode): Promise** are changed to **isFlashModeSupported(flashMode: FlashMode): boolean**. + + The sample code is as follows: + + ``` + let status = captureSession.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO); + ``` + +20. Changed the return modes of the **getFlashMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFlashMode(callback: AsyncCallback): void** and **getFlashMode(): Promise** are changed to **getFlashMode(): FlashMode**. + + The sample code is as follows: + + ``` + let flashMode = captureSession.getFlashMode(); + ``` + +21. Changed the return modes of the **isExposureModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback): void** and **isExposureModeSupported(aeMode: ExposureMode): Promise** are changed to **isExposureModeSupported(aeMode: ExposureMode): boolean**. + + The sample code is as follows: + + ``` + let isSupported = captureSession.isExposureModeSupported(camera.ExposureMode.EXPOSURE_MODE_LOCKED); + ``` + +22. Changed the return modes of the **getExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureMode(callback: AsyncCallback): void** and **getExposureMode(): Promise** are changed to **getExposureMode(): ExposureMode**. + + The sample code is as follows: + + ``` + let exposureMode = captureSession.getExposureMode(); + ``` + +23. Changed the return modes of the **setExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureMode(aeMode: ExposureMode, callback: AsyncCallback): void** and **setExposureMode(aeMode: ExposureMode): Promise** are changed to **setExposureMode(aeMode: ExposureMode): void**. + + The sample code is as follows: + + ``` + captureSession.setExposureMode(camera.ExposureMode.EXPOSURE_MODE_LOCKED); + ``` + +24. Changed the return modes of the **getMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getMeteringPoint(callback: AsyncCallback): void** and **getMeteringPoint(): Promise** are changed to **getMeteringPoint(): Point**. + + The sample code is as follows: + + ``` + let exposurePoint = captureSession.getMeteringPoint(); + ``` + +25. Changed the return modes of the **setMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setMeteringPoint(point: Point, callback: AsyncCallback): void** and **setMeteringPoint(point: Point): Promise** are changed to **setMeteringPoint(point: Point): void**. + + The sample code is as follows: + + ``` + let Point2 = {x: 2, y: 2}; + captureSession.setMeteringPoint(Point2); + ``` + +26. Changed the return modes of the **getExposureBiasRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureBiasRange(callback: AsyncCallback>): void** and **getExposureBiasRange(): Promise>** are changed to **getExposureBiasRange(): Array**. + + The sample code is as follows: + + ``` + let biasRangeArray = captureSession.getExposureBiasRange(); + ``` + +27. Changed the return modes of the **setExposureBias** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureBias(exposureBias: number, callback: AsyncCallback): void** and **setExposureBias(exposureBias: number): Promise** are changed to **setExposureBias(exposureBias: number): void**. + + The sample code is as follows: + + ``` + let exposureBias = biasRangeArray[0]; + captureSession.setExposureBias(exposureBias); + ``` + +28. Changed the return modes of the **getExposureValue** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureValue(callback: AsyncCallback): void** and **getExposureValue(): Promise** are changed to **getExposureValue(): number**. + + The sample code is as follows: + + ``` + let exposureValue = captureSession.getExposureValue(); + ``` + +29. Changed the return modes of the **isFocusModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void** and **isFocusModeSupported(afMode: FocusMode): Promise** are changed to **isFocusModeSupported(afMode: FocusMode): boolean**. + + The sample code is as follows: + + ``` + let status = captureSession.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_AUTO); + ``` + +30. Changed the return modes of the **getFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusMode(callback: AsyncCallback): void** and **getFocusMode(): Promise** are changed to **getFocusMode(): FocusMode**. + + The sample code is as follows: + + ``` + let afMode = captureSession.getFocusMode(); + ``` + +31. Changed the return modes of the **setFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusMode(afMode: FocusMode, callback: AsyncCallback): void** and **setFocusMode(afMode: FocusMode): Promise** are changed to **setFocusMode(afMode: FocusMode): void**. + + The sample code is as follows: + + ``` + captureSession.setFocusMode(camera.FocusMode.FOCUS_MODE_AUTO); + ``` + +32. Changed the return modes of the **setFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusPoint(point: Point, callback: AsyncCallback): void** and **setFocusPoint(point: Point): Promise** are changed to **setFocusPoint(point: Point): void**. + + The sample code is as follows: + + ``` + let Point2 = {x: 2, y: 2}; + captureSession.setFocusPoint(Point2); + ``` + +33. Changed the return modes of the **getFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusPoint(callback: AsyncCallback): void** and **getFocusPoint(): Promise** are changed to **getFocusPoint(): Point**. + + The sample code is as follows: + + ``` + let point = captureSession.getFocusPoint(); + ``` + +34. Changed the return modes of the **getFocalLength** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocalLength(callback: AsyncCallback): void** and **getFocalLength(): Promise** are changed to **getFocalLength(): number**. + + The sample code is as follows: + + ``` + let focalLength = captureSession.getFocalLength(); + ``` + +35. Changed the return modes of the **getZoomRatioRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatioRange(callback: AsyncCallback>): void** and **getZoomRatioRange(): Promise>** are changed to **getZoomRatioRange(): Array**. + + The sample code is as follows: + + ``` + let zoomRatioRange = captureSession.getZoomRatioRange(); + ``` + +36. Changed the return modes of the **getZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatio(callback: AsyncCallback): void** and **getZoomRatio(): Promise** are changed to **getZoomRatio(): number**. + + The sample code is as follows: + + ``` + let zoomRatio = captureSession.getZoomRatio(); + ``` + +37. Changed the return modes of the **setZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setZoomRatio(zoomRatio: number, callback: AsyncCallback): void** and **setZoomRatio(zoomRatio: number): Promise** are changed to **setZoomRatio(zoomRatio: number): void**. + + The sample code is as follows: + + ``` + let zoomRatio = zoomRatioRange[0]; + captureSession.setZoomRatio(zoomRatio); + ``` + +38. Changed the return modes of the **isVideoStabilizationModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback): void** and **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise** are changed to **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean**. + + The sample code is as follows: + + ``` + let isSupported = captureSession.isVideoStabilizationModeSupported(camera.VideoStabilizationMode.OFF); + ``` + +39. Changed the return modes of the **getActiveVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getActiveVideoStabilizationMode(callback: AsyncCallback): void** and **getActiveVideoStabilizationMode(): Promise** are changed to **getActiveVideoStabilizationMode(): VideoStabilizationMode**. + + The sample code is as follows: + + ``` + let vsMode = captureSession.getActiveVideoStabilizationMode(); + ``` + +40. Changed the return modes of the **setVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback): void** and **setVideoStabilizationMode(mode: VideoStabilizationMode): Promise** are changed to **setVideoStabilizationMode(mode: VideoStabilizationMode): void**. + + The sample code is as follows: + + ``` + captureSession.setVideoStabilizationMode(camera.VideoStabilizationMode.OFF); + ``` + +41. Changed the **on(type:'error') callback** type in CaptureSession from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. + + The sample code is as follows: + + ``` + captureSession.on('error', (BusinessError) => { + + }) + ``` + +42. Changed the **on(type:'error') callback** type in PreviewOutput, from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. + + The sample code is as follows: + + ``` + previewOutput.on('error', (BusinessError) => { + + }) + ``` + +43. Changed the return modes of the **isMirrorSupported** API in PhotoOutput from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isMirrorSupported(callback: AsyncCallback): void** and **isMirrorSupported(): Promise** are changed to **isMirrorSupported(): boolean**. + + The sample code is as follows: + + ``` + let isSupported = photoOutput.isMirrorSupported(); + ``` + +44. Changed the **on(type:'error') callback** type in PhotoOutput, from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. + + The sample code is as follows: + + ``` + PhotoOutput.on('error', (BusinessError) => { + + }) + ``` + +45. Changed the **on(type:'error') callback** type in VideoOutput, from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. + + The sample code is as follows: + + ``` + VideoOutput.on('error', (BusinessError) => { + + }) + ``` + +46. Changed the **on(type:'error') callback** type in MetadataOutput, from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. + + The sample code is as follows: + + ``` + MetadataOutput.on('error', (BusinessError) => { + + }) + ``` \ No newline at end of file diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-bundlemanager.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-bundlemanager.md index 8643663fa2..24146a66cd 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-bundlemanager.md +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-bundlemanager.md @@ -273,6 +273,7 @@ Use the **HapModuleInfo** structure of API version 9 for modules imported for bu ## cl.bundlemanager.7 ModuleInfo Structure Changes The original **bundle/hapModuleInfo.d.ts** and **moduleInfo.d.ts** fields in the bundle manager are deprecated, and the files are changed to [bundleManager/hapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/hapModuleInfo.d.ts), involving field changes. + The **ModuleInfo** structure is deprecated and replaced by **HapModuleInfo** in [bundleManager/hapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/hapModuleInfo.d.ts). **Change Impacts** @@ -759,3 +760,5 @@ The import module does not change. The new API is directly used to adapt excepti ``` import zlib form '@ohos.zlib' ``` + + \ No newline at end of file diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-resourceschedule.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-resourceschedule.md new file mode 100644 index 0000000000..f109d28cec --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-resourceschedule.md @@ -0,0 +1,318 @@ +# Resource Scheduler Subsystem ChangeLog + +## cl.resourceschedule.backgroundTaskManager + +Rectified original APIs of **backgroundTaskManager** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. + +**Change Impacts** + +The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +The following methods, attributes, enumerations, and constants are changed in API version 9 and later versions. The **@ohos.backgroundTaskManager.d.ts** file is deprecated and related APIs are migrated to the newly added **@ohos.resourceschedule.backgroundTaskManager.d.ts** file. + +| Class| API Type| Declaration| Description| +| -- | -- | -- | -- | +| backgroundTaskManager | namespace | declare namespace backgroundTaskManager | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function resetAllEfficiencyResources(): void; | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function applyEfficiencyResources(request: EfficiencyResourcesRequest): bool; | This API is changed in API version 9 to **function applyEfficiencyResources(request: EfficiencyResourcesRequest): void;** and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function stopBackgroundRunning(context: Context): Promise; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number): Promise; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function cancelSuspendDelay(requestId: number): void; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | export enum BackgroundMode | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | DATA_TRANSFER = 1 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | AUDIO_PLAYBACK = 2 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | AUDIO_RECORDING = 3 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | LOCATION = 4 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | BLUETOOTH_INTERACTION = 5 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | MULTI_DEVICE_CONNECTION = 6 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | WIFI_INTERACTION = 7 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | VOIP = 8 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | TASK_KEEPING = 9 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.DelaySuspendInfo | interface | interface DelaySuspendInfo | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.DelaySuspendInfo | field | requestId: number | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.DelaySuspendInfo | field | actualDelayTime: number | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | export enum ResourceType | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | CPU = 1 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | COMMON_EVENT = 1 << 1 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | TIMER = 1 << 2 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | WORK_SCHEDULER = 1 << 3 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | BLUETOOTH = 1 << 4 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | GPS = 1 << 5 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | AUDIO = 1 << 6 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | interface | export interface EfficiencyResourcesRequest | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | reason: string | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isProcess?: bool | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isPersist?: bool | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | timeOut: number | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isApply: bool | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | resourceTypes: number | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| + + +**Adaptation Guide**
+ +Import the **backgroundTaskManager** module. +``` +import bundle form '@ohos.resourceschedule.backgroundTaskManager' +``` +Exception handling also needs to be adapted. For details, see the [backgroundTaskManager API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md). + +## c2.resourceschedule.usageStatistics + +Rectified original APIs of **deviceUsageStatistics** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. + +**Change Impacts** + +The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +The following methods, attributes, enumerations, and constants are changed in API version 9 and later versions. The **@ohos.bundleState.d.ts** file is deprecated, the **@ohos.resourceschedule.usageStatistics.d.ts** file is added, and the class name is changed from **bundleState** to **usageStatistics**. + +| Class | API Type | Method/Attribute/Enumeration/Constant | Change Type | +| ----------------------------------------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| bundleState | method | function isIdleState(bundleName: string, callback: AsyncCallback): void; | Deprecated and migrated to **usageStatistics.isIdleState** | +| bundleState | method | function isIdleState(bundleName: string): Promise; | Deprecated and migrated to **usageStatistics.isIdleState** | +| bundleState | method | function queryAppUsagePriorityGroup(callback: AsyncCallback): void; | Deprecated and changed to **function queryAppGroup(callback: AsyncCallback): void;**| +| bundleState | method | function queryAppUsagePriorityGroup(): Promise; | Deprecated and changed to **function queryAppGroup(): Promise;** | +| bundleState | method | function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback): void;**| +| bundleState | method | function queryBundleStateInfos(begin: number, end: number): Promise; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number): Promise;**| +| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>;**| +| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void;**| +| bundleState | method | function queryBundleActiveStates(begin: number, end: number): Promise>; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number): Promise>;**| +| bundleState | method | function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number, callback: AsyncCallback>): void;**| +| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number): Promise>;**| +| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback>): void;**| +| bundleState | method | function getRecentlyUsedModules(maxNum?: number): Promise>; | Deprecated and changed to the following two APIs: **function QueryModuleUsageRecords(maxNum: number): Promise>;** and **function QueryModuleUsageRecords(): Promise>;**| +| bundleState | method | function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback>): void; | Deprecated and changed to the following two APIs: **function QueryModuleUsageRecords(maxNum: number, callback: AsyncCallback>): void;** and **function QueryModuleUsageRecords(callback: AsyncCallback>): void;**| +| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string): Promise; | Deprecated and changed to **function queryAppGroup(bundleName: string): Promise;**| +| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void; | Deprecated and changed to **function queryAppGroup(bundleName: string, callback: AsyncCallback): void;**| +| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void;**| +| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType): Promise;**| +| bundleState | method | function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback, callback: AsyncCallback): void;**| +| bundleState | method | function registerGroupCallBack(callback: Callback): Promise; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback): Promise;**| +| bundleState | method | function unRegisterGroupCallBack(callback: AsyncCallback): void; | Deprecated and changed to **function unregisterAppGroupCallBack(): Promise;**| +| bundleState | method | function unRegisterGroupCallBack(): Promise; | Deprecated and changed to **function unregisterAppGroupCallBack(): Promise;**| +| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback>): void; | Changed to **function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback>): void;**| +| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number): Promise>; | Changed in API version 9 and later versions to **function queryDeviceEventStats(begin: number, end: number): Promise>;**| +| bundleState | method | function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; | Changed in API version 9 and later versions to **function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback>): void;**| +| bundleState | method | function queryAppNotificationNumber(begin: number, end: number): Promise>; | Changed in API version 9 and later versions to **function queryNotificationEventStats(begin: number, end: number): Promise>;**| +| bundleState.BundleActiveGroupCallbackInfo | interface | interface BundleActiveGroupCallbackInfo | Changed to **usageStatistics.AppGroupCallbackInfo** | +| bundleState.BundleActiveGroupCallbackInfo | field | bundleName: string | Changed and migrated to **usageStatistics.AppGroupCallbackInfo** | +| bundleState.BundleActiveGroupCallbackInfo | field | changeReason: number | Changed and migrated to **usageStatistics.AppGroupCallbackInfo** | +| bundleState.BundleActiveGroupCallbackInfo | field | userId: number | Changed and migrated to **usageStatistics.AppGroupCallbackInfo** | +| bundleState.BundleActiveGroupCallbackInfo | field | appUsageNewGroup: number | Deprecated and changed to **appNewGroup** | +| bundleState.BundleActiveGroupCallbackInfo | field | appUsageOldGroup: number | Deprecated and changed to **appOldGroup** | +| bundleState.BundleActiveEventState | interface | interface BundleActiveEventState | Deprecated and changed to **usageStatistics.DeviceEventStats** | +| bundleState.BundleActiveEventState | field | count: number | Changed and migrated to **usageStatistics.DeviceEventStats** | +| bundleState.BundleActiveEventState | field | eventId: number | Changed and migrated to **usageStatistics.DeviceEventStats** | +| bundleState.BundleActiveEventState | field | name: string | Changed and migrated to **usageStatistics.DeviceEventStats** | +| bundleState.BundleActiveModuleInfo | interface | interface BundleActiveModuleInfo | Changed in API version 9 and later versions to **usageStatistics.HapModuleInfo** | +| bundleState.BundleActiveModuleInfo | field | formRecords: Array | Changed to **formRecords: Array** | +| bundleState.BundleActiveModuleInfo | field | lastModuleUsedTime: number | Changed and migrated to **usageStatistics.HapModuleInfo** | +| bundleState.BundleActiveModuleInfo | field | launchedCount: number | Changed and migrated to **usageStatistics.HapModuleInfo** | +| bundleState.BundleActiveModuleInfo | field | abilityIconId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | +| bundleState.BundleActiveModuleInfo | field | abilityDescriptionId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | +| bundleState.BundleActiveModuleInfo | field | abilityLableId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | +| bundleState.BundleActiveModuleInfo | field | descriptionId?: number; | Changed and migrated to **usageStatistics.HapModuleInfo** | +| bundleState.BundleActiveModuleInfo | field | labelId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | +| bundleState.BundleActiveModuleInfo | field | appLabelId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | +| bundleState.BundleActiveModuleInfo | field | abilityName?: string | Changed and migrated to **usageStatistics.HapModuleInfo** | +| bundleState.BundleActiveModuleInfo | field | moduleName: string | Changed and migrated to **usageStatistics.HapModuleInfo** | +| bundleState.BundleActiveModuleInfo | field | bundleName: string | Changed and migrated to **usageStatistics.HapModuleInfo** | +| bundleState.BundleActiveModuleInfo | field | deviceId?: string | Changed and migrated to **usageStatistics.HapModuleInfo** | +| bundleState.GroupType | enum | enum GroupType | Changed and migrated to **usageStatistics.GroupType** | +| bundleState.GroupType | enum | ACTIVE_GROUP_ALIVE | Deprecated and changed to **ALIVE_GROUP** | +| bundleState.GroupType | enum | ACTIVE_GROUP_DAILY | Deprecated and changed to **DAILY_GROUP** | +| bundleState.GroupType | enum | ACTIVE_GROUP_FIXED | Deprecated and changed to **FIXED_GROUP** | +| bundleState.GroupType | enum | ACTIVE_GROUP_RARE | Deprecated and changed to **RARE_GROUP** | +| bundleState.GroupType | enum | ACTIVE_GROUP_LIMIT | Deprecated and changed to **LIMITED_GROUP** | +| bundleState.GroupType | enum | ACTIVE_GROUP_NEVER | Deprecated and changed to **NEVER_GROUP** | +| bundleState.IntervalType | enum | enum IntervalType | Deprecated and migrated to **usageStatistics.IntervalType** | +| bundleState.IntervalType | enum | BY_OPTIMIZED | Deprecated and migrated to **usageStatistics.IntervalType** | +| bundleState.IntervalType | enum | BY_DAILY | Deprecated and migrated to **usageStatistics.IntervalType** | +| bundleState.IntervalType | enum | BY_WEEKLY | Deprecated and migrated to **usageStatistics.IntervalType** | +| bundleState.IntervalType | enum | BY_MONTHLY | Deprecated and migrated to **usageStatistics.IntervalType** | +| bundleState.IntervalType | enum | BY_ANNUALLY | Deprecated and migrated to **usageStatistics.IntervalType** | +| bundleState.BundleActiveInfoResponse | interface | interface BundleActiveInfoResponse | Deprecated and changed to **usageStatistics.BundleStatsMap** | +| bundleState.BundleActiveState | interface | interface BundleActiveState | Deprecated and changed to **usageStatistics.BundleEvents** | +| bundleState.BundleActiveState | field | stateType?: number | Deprecated and changed to **eventId** | +| bundleState.BundleActiveState | field | stateOccurredTime?: number | Deprecated and changed to **eventOccurredTime** | +| bundleState.BundleActiveState | field | nameOfClass?: string | Deprecated and migrated to **usageStatistics.BundleEvents** | +| bundleState.BundleActiveState | field | indexOfLink?: string | Deprecated and migrated to **usageStatistics.BundleEvents** | +| bundleState.BundleActiveState | field | bundleName?: string | Deprecated and migrated to **usageStatistics.BundleEvents** | +| bundleState.BundleActiveState | field | appUsagePriorityGroup?: number | Deprecated and changed to **appGroup** | +| bundleState.BundleStateInfo | interface | interface BundleStateInfo | Deprecated and changed to **usageStatistics.BundleStatsInfo** | +| bundleState.BundleStateInfo | method | merge(toMerge: BundleStateInfo): void | Deprecated | +| bundleState.BundleStateInfo | field | infosEndTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | +| bundleState.BundleStateInfo | field | infosBeginTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | +| bundleState.BundleStateInfo | field | fgAbilityPrevAccessTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | +| bundleState.BundleStateInfo | field | fgAbilityAccessTotalTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | +| bundleState.BundleStateInfo | field | bundleName?: string | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | +| bundleState.BundleStateInfo | field | abilitySeenTotalTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | +| bundleState.BundleStateInfo | field | abilityPrevSeenTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | +| bundleState.BundleStateInfo | field | abilityPrevAccessTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | +| bundleState.BundleStateInfo | field | abilityInFgTotalTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | +| bundleState.BundleStateInfo | field | id: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | +| bundleState | namespace | declare namespace bundleState | Deprecated and changed to **usageStatistics**, and migrated to **ohos.resourceschedule.usageStatistics.d.ts**| + + +**Adaptation Guide**
+ +Import the **usageStatistics** module. +``` +import bundle form '@ohos.resourceschedule.usageStatistics' +``` +Exception handling also needs to be adapted. For details, see the [usageStatistics API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md). + + +## c3.resourceschedule.workScheduler + +Rectified original APIs of **workScheduler** of the resource scheduler subsystem. The original APIs in API version 9 are changed to new APIs in API version 9. The new APIs in API version 9 comply with the error code specifications. + +**Change Impacts** + +The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +The following methods, attributes, enumerations, and constants are changed in API version 9 and later versions. The **@ohos.workScheduler.d.ts** file is deprecated and related APIs are migrated to the newly added **@ohos.resourceschedule.workScheduler.d.ts** file. + +| Class| API Type| Declaration| Change Type| +| -- | -- | -- | -- | +| workScheduler | namespace | declare namespace workScheduler | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | interface | export interface WorkInfo | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | idleWaitTime?: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | isDeepIdle?: boolean | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | repeatCount?: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | isRepeat?: boolean | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | repeatCycleTime?: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | storageRequest?: StorageRequest | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | batteryStatus?: BatteryStatus | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | batteryLevel?: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | chargerType?: ChargingType | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | isCharging?: boolean | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | networkType?: NetworkType | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | isPersisted?: boolean | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | abilityName: string | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | bundleName: string | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.WorkInfo | field | workId: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler | method | function isLastWorkTimeOut(workId: number): Promise; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler | method | function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler | method | function stopAndClearWorks(): boolean; | Changed in API version 8 to **function stopAndClearWorks(): boolean;** and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler | method | function obtainAllWorks(): Promise>; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler | method | function obtainAllWorks(callback: AsyncCallback): Array; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler | method | function getWorkStatus(workId: number): Promise; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback): void; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler | method | function stopWork(work: WorkInfo, needCancel?: boolean): boolean; | Changed in API version 8 to **function stopWork(work: WorkInfo, needCancel?: boolean): void;** and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler | method | function startWork(work: WorkInfo): boolean; | Changed in API version 9 to **function startWork(work: WorkInfo): void;** and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.NetworkType | enum | export enum NetworkType | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.NetworkType | enum | NETWORK_TYPE_ANY = 0 | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.NetworkType | enum | NETWORK_TYPE_MOBILE | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.NetworkType | enum | NETWORK_TYPE_BLUETOOTH | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI_P2P | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.NetworkType | enum | NETWORK_TYPE_ETHERNET | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.ChargingType | enum | export enum ChargingType | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_ANY = 0 | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_AC | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_USB | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_WIRELESS | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.BatteryStatus | enum | export enum BatteryStatus | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW = 0 | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_OKAY | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW_OR_OKAY | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.StorageRequest | enum | export enum StorageRequest | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW = 0 | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_OKAY | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW_OR_OKAY | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| + + +**Adaptation Guide**
+ +Import the **workScheduler** module. +``` +import bundle form '@ohos.resourceschedule.workScheduler' +``` +Exception handling also needs to be adapted. For details, see the [workScheduler API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md). + + +## c4.resourceschedule.reminderAgent + +Rectified original APIs of **reminderAgent** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. + +**Change Impacts** + +The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +The following methods, attributes, enumerations, and constants are changed in API version 9 and later versions. The **@ohos.reminderAgent.d.ts** file is deprecated, the **@ohos.reminderAgentManager.d.ts** file is added, and the class name is changed from **reminderAgent** to **reminderAgentManager**. + +| Class | API Type | Method/Attribute/Enumeration/Constant | Change Type | +| --------------------- | ----------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| reminderAgent | method | publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback): void; | Deprecated and migrated to **reminderAgentManager**| +| reminderAgent | method | publishReminder(reminderReq: ReminderRequest): Promise; | Deprecated and migrated to **reminderAgentManager**| +| reminderAgent | method | cancelReminder(reminderId: number, callback: AsyncCallback): void; | Deprecated and migrated to **reminderAgentManager**| +| reminderAgent | method | cancelReminder(reminderId: number): Promise; | Deprecated and migrated to **reminderAgentManager**| +| reminderAgent | method | getValidReminders(callback: AsyncCallback>): void; | Deprecated and migrated to **reminderAgentManager**| +| reminderAgent | method | getValidReminders(): Promise>; | Deprecated and migrated to **reminderAgentManager**| +| reminderAgent | method | cancelAllReminders(callback: AsyncCallback): void; | Deprecated and migrated to **reminderAgentManager**| +| reminderAgent | method | cancelAllReminders(): Promise; | Deprecated and migrated to **reminderAgentManager**| +| reminderAgent | method | addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback): void; | Deprecated and migrated to **reminderAgentManager**| +| reminderAgent | method | addNotificationSlot(slot: NotificationSlot): Promise; | Deprecated and migrated to **reminderAgentManager**| +| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void; | Deprecated and migrated to **reminderAgentManager**| +| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType): Promise; | Deprecated and migrated to **reminderAgentManager**| +| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_CLOSE | Deprecated and migrated to **reminderAgentManager.ActionButtonType**| +| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_SNOOZE | Deprecated and migrated to **reminderAgentManager.ActionButtonType**| +| reminderAgent.ReminderType | enum | REMINDER_TYPE_TIMER | Deprecated and migrated to **reminderAgentManager.ReminderType**| +| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and migrated to **reminderAgentManager.ReminderType**| +| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and migrated to **reminderAgentManager.ReminderType**| +| reminderAgent.ActionButton | field | title:string | Deprecated and migrated to **reminderAgentManager.ActionButton**| +| reminderAgent.ActionButton | field | type:ActionButtonType | Deprecated and migrated to **reminderAgentManager.ActionButton**| +| reminderAgent.WantAgent | field | pkgName:string | Deprecated and migrated to **reminderAgentManager.WantAgent**| +| reminderAgent.WantAgent | field | abilityName:string | Deprecated and migrated to **reminderAgentManager.WantAgent**| +| reminderAgent.MaxScreenWantAgent | field | pkgName:string | Deprecated and migrated to **reminderAgentManager.MaxScreenWantAgent**| +| reminderAgent.MaxScreenWantAgent | field | abilityName:string | Deprecated and migrated to **reminderAgentManager.MaxScreenWantAgent**| +| reminderAgent.ReminderRequest | field | reminderType:ReminderType | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| +| reminderAgent.ReminderRequest | field | actionButton?:ActionButton | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| +| reminderAgent.ReminderRequest | field | wantAgent?:WantAgent | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| +| reminderAgent.ReminderRequest | field | maxScreenWantAgent?:MaxScreenWantAgent | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| +| reminderAgent.ReminderRequest | field | ringDuration?:number | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| +| reminderAgent.ReminderRequest | field | snoozeTimes?:number | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| +| reminderAgent.ReminderRequest | field | timeInterval?:number | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| +| reminderAgent.ReminderRequest | field | title?:string | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| +| reminderAgent.ReminderRequest | field | content?:string | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| +| reminderAgent.ReminderRequest | field | expiredContent?:string | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| +| reminderAgent.ReminderRequest | field | snoozeContent?:string | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| +| reminderAgent.ReminderRequest | field | notificationId?:number | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| +| reminderAgent.ReminderRequest | field | slotType?: notification.SlotType | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| +| reminderAgent.ReminderRequestCalendar | field | dateTime:LocalDateTime | Deprecated and migrated to **reminderAgentManager.ReminderRequestCalendar**| +| reminderAgent.ReminderRequestCalendar | field | repeatMonths?:Array | Deprecated and migrated to **reminderAgentManager.ReminderRequestCalendar**| +| reminderAgent.ReminderRequestCalendar | field | repeatDays?:Array | Deprecated and migrated to **reminderAgentManager.ReminderRequestCalendar**| +| reminderAgent.ReminderRequestAlarm | field | hour:number | Deprecated and migrated to **reminderAgentManager.ReminderRequestAlarm**| +| reminderAgent.ReminderRequestAlarm | field | minute:number | Deprecated and migrated to **reminderAgentManager.ReminderRequestAlarm**| +| reminderAgent.ReminderRequestAlarm | field | daysOfWeek?:Array | Deprecated and migrated to **reminderAgentManager.ReminderRequestAlarm**| +| reminderAgent.ReminderRequestTimer | field | triggerTimeInSeconds:number | Deprecated and migrated to **reminderAgentManager.ReminderRequestTimer**| +| reminderAgent.LocalDateTime | field | year:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| +| reminderAgent.LocalDateTime | field | month:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| +| reminderAgent.LocalDateTime | field | day:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| +| reminderAgent.LocalDateTime | field | hour:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| +| reminderAgent.LocalDateTime | field | minute:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| +| reminderAgent.LocalDateTime | field | second?:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| + + +**Adaptation Guide**
+ +Import the **reminderAgentManager** module. +``` +import bundle form '@ohos.reminderAgentManager' +``` +Exception handling also needs to be adapted. For details, see the [reminderAgentManager API reference](../../../application-dev/reference/apis/js-apis-reminderAgentManager.md). diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-ability.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-ability.md new file mode 100644 index 0000000000..773d443972 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-ability.md @@ -0,0 +1,140 @@ +# Ability Subsystem ChangeLog + +## cl.ability.1 System API Usage Rule Change + +System application verification is not performed for system APIs provided by the ability when they are called. The APIs can be used by a third-party application using the full SDK, which brings security risks. Therefore, application identity verification is added to OpenHarmony 4.0.2.1 and later versions. + +**Change Impacts** + +System APIs are available to only system applications. When a third-party application tries to use a system API, the **202** error will be returned via either an exception or asynchronous callback. + +**Key API/Component Changes** + +Below are the system APIs. + +| Module | API | Error Code Return Mode| +| -------------------------------------- | ------------------------------------------------------------ | -------------- | +| @ohos.app.ability.abilityManager.d.ts | updateConfiguration(config: Configuration, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.abilityManager.d.ts | updateConfiguration(config: Configuration): Promise | Asynchronous callback | +| @ohos.app.ability.abilityManager.d.ts | getAbilityRunningInfos(): Promise> | Asynchronous callback | +| @ohos.app.ability.abilityManager.d.ts | getAbilityRunningInfos(callback: AsyncCallback>): void | Asynchronous callback | +| @ohos.app.ability.abilityManager.d.ts | getExtensionRunningInfos(upperLimit: number): Promise> | Asynchronous callback | +| @ohos.app.ability.abilityManager.d.ts | getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void | Asynchronous callback | +| @ohos.app.ability.abilityManager.d.ts | getTopAbility(): Promise | Exception | +| @ohos.app.ability.abilityManager.d.ts | getTopAbility(callback: AsyncCallback): void | Exception | +| @ohos.app.ability.appManager.d.ts | on(type: "applicationState", observer: ApplicationStateObserver): number | Asynchronous callback | +| @ohos.app.ability.appManager.d.ts | on(type: "applicationState", observer: ApplicationStateObserver, bundleNameList: Array): number | Asynchronous callback | +| @ohos.app.ability.appManager.d.ts | off(type: "applicationState", observerId: number, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.appManager.d.ts | off(type: "applicationState", observerId: number): Promise | Asynchronous callback | +| @ohos.app.ability.appManager.d.ts | getForegroundApplications(callback: AsyncCallback>): void | Asynchronous callback | +| @ohos.app.ability.appManager.d.ts | getForegroundApplications(): Promise> | Asynchronous callback | +| @ohos.app.ability.appManager.d.ts | killProcessWithAccount(bundleName: string, accountId: number): Promise | Asynchronous callback | +| @ohos.app.ability.appManager.d.ts | killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.appManager.d.ts | killProcessesByBundleName(bundleName: string): Promise | Asynchronous callback | +| @ohos.app.ability.appManager.d.ts | killProcessesByBundleName(bundleName: string, callback: AsyncCallback) | Asynchronous callback | +| @ohos.app.ability.appManager.d.ts | clearUpApplicationData(bundleName: string): Promise | Asynchronous callback | +| @ohos.app.ability.appManager.d.ts | clearUpApplicationData(bundleName: string, callback: AsyncCallback) | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | on(type: "mission", listener: MissionListener): number | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | off(type: "mission", listenerId: number, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | off(type: "mission", listenerId: number): Promise | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | getMissionInfo(deviceId: string, missionId: number): Promise | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback>): void | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | getMissionInfos(deviceId: string, numMax: number): Promise> | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | getMissionSnapShot(deviceId: string, missionId: number): Promise | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | lockMission(missionId: number, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | lockMission(missionId: number): Promise | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | unlockMission(missionId: number, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | unlockMission(missionId: number): Promise | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | clearMission(missionId: number, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | clearMission(missionId: number): Promise | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | clearAllMissions(callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | clearAllMissions(): Promise | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, options?: StartOptions): Promise | Asynchronous callback | +| @ohos.app.ability.quickFixManager.d.ts | applyQuickFix(hapModuleQuickFixFiles: Array, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.quickFixManager.d.ts | applyQuickFix(hapModuleQuickFixFiles: Array): Promise | Asynchronous callback | +| @ohos.app.ability.quickFixManager.d.ts | getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.quickFixManager.d.ts | getApplicationQuickFixInfo(bundleName: string): Promise | Asynchronous callback | +| @ohos.app.ability.wantAgent.d.ts | getWant(agent: WantAgent, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.ability.wantAgent.d.ts | getWant(agent: WantAgent): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | deleteForm(formId: string, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | deleteForm(formId: string): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, isReleaseCache: boolean, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, isReleaseCache?: boolean): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | requestForm(formId: string, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | requestForm(formId: string): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | castToNormalForm(formId: string, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | castToNormalForm(formId: string): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | notifyVisibleForms(formIds: Array, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | notifyVisibleForms(formIds: Array): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | notifyInvisibleForms(formIds: Array, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | notifyInvisibleForms(formIds: Array): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | enableFormsUpdate(formIds: Array, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | enableFormsUpdate(formIds: Array): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | disableFormsUpdate(formIds: Array, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | disableFormsUpdate(formIds: Array): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | isSystemReady(callback: AsyncCallback): void | Exception | +| @ohos.app.form.formHost.d.ts | isSystemReady(): Promise | Exception | +| @ohos.app.form.formHost.d.ts | getAllFormsInfo(callback: AsyncCallback>): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | getAllFormsInfo(): Promise> | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, callback: AsyncCallback>): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback>): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, moduleName?: string): Promise> | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | deleteInvalidForms(formIds: Array, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | deleteInvalidForms(formIds: Array): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | acquireFormState(want: Want, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | acquireFormState(want: Want): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | on(type: "formUninstall", callback: Callback): void | Exception | +| @ohos.app.form.formHost.d.ts | off(type: "formUninstall", callback?: Callback): void | Exception | +| @ohos.app.form.formHost.d.ts | notifyFormsVisible(formIds: Array, isVisible: boolean, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | notifyFormsVisible(formIds: Array, isVisible: boolean): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | shareForm(formId: string, deviceId: string, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | shareForm(formId: string, deviceId: string): Promise | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formHost.d.ts | notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean): Promise | Asynchronous callback | +| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, callback: AsyncCallback): void | Asynchronous callback | +| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, formBindingData?: formBindingData.FormBindingData): Promise | Asynchronous callback | +| @ohos.app.form.formProvider.d.ts | isRequestPublishFormSupported(callback: AsyncCallback): void | Exception | +| @ohos.app.form.formProvider.d.ts | isRequestPublishFormSupported(): Promise | Exception | +| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Asynchronous callback | +| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void | Asynchronous callback | +| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise | Asynchronous callback | +| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Exception | +| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void | Exception | +| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise | Exception | +| UIAbilityContext.d.ts | startServiceExtensionAbility(want: Want, callback: AsyncCallback): void | Asynchronous callback | +| UIAbilityContext.d.ts | startServiceExtensionAbility(want: Want): Promise | Asynchronous callback | +| UIAbilityContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Asynchronous callback | +| UIAbilityContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise | Asynchronous callback | +| UIAbilityContext.d.ts | stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void | Asynchronous callback | +| UIAbilityContext.d.ts | stopServiceExtensionAbility(want: Want): Promise | Asynchronous callback | +| UIAbilityContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Asynchronous callback | +| UIAbilityContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise | Asynchronous callback | +| UIAbilityContext.d.ts | connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number | Asynchronous callback | +| UIAbilityContext.d.ts | setMissionIcon(icon: image.PixelMap, callback: AsyncCallback): void | Asynchronous callback | +| UIAbilityContext.d.ts | setMissionIcon(icon: image.PixelMap): Promise | Asynchronous callback | +| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Asynchronous callback | +| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void | Asynchronous callback | +| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise | Asynchronous callback | +| ServiceExtensionContext.d.ts | startServiceExtensionAbility(want: Want, callback: AsyncCallback): void | Asynchronous callback | +| ServiceExtensionContext.d.ts | startServiceExtensionAbility(want: Want): Promise | Asynchronous callback | +| ServiceExtensionContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Asynchronous callback | +| ServiceExtensionContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise | Asynchronous callback | +| ServiceExtensionContext.d.ts | stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void | Asynchronous callback | +| ServiceExtensionContext.d.ts | stopServiceExtensionAbility(want: Want): Promise | Asynchronous callback | +| ServiceExtensionContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Asynchronous callback | +| ServiceExtensionContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise | Asynchronous callback | +| ServiceExtensionContext.d.ts | connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number | Asynchronous callback | +| Context.d.ts | createBundleContext(bundleName: string): Context | Exception | +| Context.d.ts | createModuleContext(bundleName: string, moduleName: string): Context | Exception | +| FormExtensionContext.d.ts | startAbility(want: Want, callback: AsyncCallback): void | Asynchronous callback | +| FormExtensionContext.d.ts | startAbility(want: Want): Promise | Asynchronous callback | diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-media.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-media.md new file mode 100644 index 0000000000..01455e8774 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-media.md @@ -0,0 +1,314 @@ +# Media Subsystem ChangeLog + +## cl.media.1 API Change of the Playback Function + +Added the [AVPlayer](../../../application-dev/reference/apis/js-apis-media.md#avplayer9)9+ API for audio and video playback, with the updated state machine and error codes, which is recommended. The following APIs for audio playback and video playback are no longer maintained: [AudioPlayer](../../../application-dev/reference/apis/js-apis-media.md#audioplayer)6+ and [VideoPlayer](../../../application-dev/reference/apis/js-apis-media.md#videoplayer)8+. + +**Change Impacts** + +The original APIs can still be used but are no longer maintained. You are advised to use the new API instead. + +**Key API/Component Changes** + +Added APIs + +| Class | Declaration | +| -------------- | ------------------------------------------------------------ | +| media | createAVPlayer(callback: AsyncCallback\): void | +| media | createAVPlayer() : Promise\ | +| media.AVPlayer | interface AVPlayer | +| media.AVPlayer | videoScaleType ?: VideoScaleType | +| media.AVPlayer | url ?: string | +| media.AVPlayer | surfaceId ?: string | +| media.AVPlayer | stop(callback: AsyncCallback\): void | +| media.AVPlayer | stop(): Promise\ | +| media.AVPlayer | setVolume(volume: number): void | +| media.AVPlayer | setSpeed(speed: PlaybackSpeed): void | +| media.AVPlayer | setBitrate(bitrate: number): void | +| media.AVPlayer | seek(timeMs: number, mode?:SeekMode): void | +| media.AVPlayer | reset(callback: AsyncCallback\): void | +| media.AVPlayer | reset(): Promise\ | +| media.AVPlayer | release(callback: AsyncCallback\): void | +| media.AVPlayer | release(): Promise\ | +| media.AVPlayer | readonly width: number | +| media.AVPlayer | readonly state: AVPlayerState | +| media.AVPlayer | readonly height: number | +| media.AVPlayer | readonly duration: number | +| media.AVPlayer | readonly currentTime: number | +| media.AVPlayer | prepare(callback: AsyncCallback\): void | +| media.AVPlayer | prepare(): Promise\ | +| media.AVPlayer | play(callback: AsyncCallback\): void | +| media.AVPlayer | play(): Promise\ | +| media.AVPlayer | pause(callback: AsyncCallback\): void | +| media.AVPlayer | pause(): Promise\ | +| media.AVPlayer | on(type: 'volumeChange', callback: Callback\): void | +| media.AVPlayer | on(type: 'videoSizeChange', callback: (width: number, height: number) => void): void | +| media.AVPlayer | on(type: 'timeUpdate', callback: Callback\): void | +| media.AVPlayer | on(type: 'stateChange', callback: (state: AVPlayerState, reason: StateChangeReason) => void): void | +| media.AVPlayer | on(type: 'startRenderFrame', callback: Callback\): void | +| media.AVPlayer | on(type: 'speedDone', callback: Callback\): void | +| media.AVPlayer | on(type: 'seekDone', callback: Callback\): void | +| media.AVPlayer | on(type: 'error', callback: ErrorCallback): void | +| media.AVPlayer | on(type: 'endOfStream', callback: Callback\): void | +| media.AVPlayer | on(type: 'durationUpdate', callback: Callback\): void | +| media.AVPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void | +| media.AVPlayer | on(type: 'bitrateDone', callback: Callback\): void | +| media.AVPlayer | on(type: 'availableBitrates', callback: (bitrates: Array\) => void): void | +| media.AVPlayer | on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void | +| media.AVPlayer | off(type: 'volumeChange'): void | +| media.AVPlayer | off(type: 'videoSizeChange'): void | +| media.AVPlayer | off(type: 'timeUpdate'): void | +| media.AVPlayer | off(type: 'stateChange'): void | +| media.AVPlayer | off(type: 'startRenderFrame'): void | +| media.AVPlayer | off(type: 'speedDone'): void | +| media.AVPlayer | off(type: 'seekDone'): void | +| media.AVPlayer | off(type: 'error'): void | +| media.AVPlayer | off(type: 'endOfStream'): void | +| media.AVPlayer | off(type: 'durationUpdate'): void | +| media.AVPlayer | off(type: 'bufferingUpdate'): void | +| media.AVPlayer | off(type: 'bitrateDone'): void | +| media.AVPlayer | off(type: 'availableBitrates'): void | +| media.AVPlayer | off(type: 'audioInterrupt'): void | +| media.AVPlayer | loop: boolean | +| media.AVPlayer | getTrackDescription(callback: AsyncCallback\>): void | +| media.AVPlayer | getTrackDescription() : Promise\> | +| media.AVPlayer | fdSrc ?: AVFileDescriptor | +| media.AVPlayer | audioInterruptMode ?: audio.InterruptMode | +| unnamed | type AVPlayerState = 'idle' \| 'initialized' \| 'prepared' \| 'playing' \| 'paused' \| 'completed' \| 'stopped' \| 'released' \| 'error' | + +APIs no longer maintained + +| Class | Declaration | +| ----------------- | ------------------------------------------------------------ | +| media | createVideoPlayer(callback: AsyncCallback\): void | +| media | createVideoPlayer() : Promise\ | +| media | createAudioPlayer(): AudioPlayer | +| media.AudioPlayer | interface AudioPlayer | +| media.AudioPlayer | play(): void | +| media.AudioPlayer | release(): void | +| media.AudioPlayer | audioInterruptMode ?: audio.InterruptMode | +| media.AudioPlayer | fdSrc: AVFileDescriptor | +| media.AudioPlayer | seek(timeMs: number): void | +| media.AudioPlayer | readonly duration: number | +| media.AudioPlayer | loop: boolean | +| media.AudioPlayer | readonly state: AudioState | +| media.AudioPlayer | getTrackDescription(callback: AsyncCallback\>): void | +| media.AudioPlayer | getTrackDescription() : Promise\> | +| media.AudioPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void | +| media.AudioPlayer | on(type: 'play' \| 'pause' \| 'stop' \| 'reset' \| 'dataLoad' \| 'finish' \| 'volumeChange', callback: () => void): void | +| media.AudioPlayer | on(type: 'timeUpdate', callback: Callback\): void | +| media.AudioPlayer | on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void | +| media.AudioPlayer | on(type: 'error', callback: ErrorCallback): void | +| media.AudioPlayer | setVolume(vol: number): void | +| media.AudioPlayer | pause(): void | +| media.AudioPlayer | readonly currentTime: number | +| media.AudioPlayer | stop(): void | +| media.AudioPlayer | reset(): void | +| media.AudioPlayer | src: string | +| media.VideoPlayer | interface VideoPlayer | +| media.VideoPlayer | play(callback: AsyncCallback\): void | +| media.VideoPlayer | play(): Promise\ | +| media.VideoPlayer | prepare(callback: AsyncCallback\): void | +| media.VideoPlayer | prepare(): Promise\ | +| media.VideoPlayer | release(callback: AsyncCallback\): void | +| media.VideoPlayer | release(): Promise\ | +| media.VideoPlayer | audioInterruptMode ?: audio.InterruptMode | +| media.VideoPlayer | fdSrc: AVFileDescriptor | +| media.VideoPlayer | seek(timeMs: number, callback: AsyncCallback\): void | +| media.VideoPlayer | seek(timeMs: number, mode:SeekMode, callback: AsyncCallback\): void | +| media.VideoPlayer | seek(timeMs: number, mode?:SeekMode): Promise\ | +| media.VideoPlayer | readonly duration: number | +| media.VideoPlayer | loop: boolean | +| media.VideoPlayer | videoScaleType ?: VideoScaleType | +| media.VideoPlayer | readonly state: VideoPlayState | +| media.VideoPlayer | getTrackDescription(callback: AsyncCallback\>): void | +| media.VideoPlayer | getTrackDescription() : Promise\> | +| media.VideoPlayer | readonly height: number | +| media.VideoPlayer | on(type: 'playbackCompleted', callback: Callback\): void | +| media.VideoPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void | +| media.VideoPlayer | on(type: 'startRenderFrame', callback: Callback\): void | +| media.VideoPlayer | on(type: 'videoSizeChanged', callback: (width: number, height: number) => void): void | +| media.VideoPlayer | on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void | +| media.VideoPlayer | on(type: 'error', callback: ErrorCallback): void | +| media.VideoPlayer | setDisplaySurface(surfaceId: string, callback: AsyncCallback\): void | +| media.VideoPlayer | setDisplaySurface(surfaceId: string): Promise\ | +| media.VideoPlayer | setVolume(vol: number, callback: AsyncCallback\): void | +| media.VideoPlayer | setVolume(vol: number): Promise\ | +| media.VideoPlayer | url: string | +| media.VideoPlayer | pause(callback: AsyncCallback\): void | +| media.VideoPlayer | pause(): Promise\ | +| media.VideoPlayer | readonly currentTime: number | +| media.VideoPlayer | setSpeed(speed:number, callback: AsyncCallback\): void | +| media.VideoPlayer | setSpeed(speed:number): Promise\ | +| media.VideoPlayer | stop(callback: AsyncCallback\): void | +| media.VideoPlayer | stop(): Promise\ | +| media.VideoPlayer | readonly width: number | +| media.VideoPlayer | reset(callback: AsyncCallback\): void | +| media.VideoPlayer | reset(): Promise\ | +| unnamed | type AudioState = 'idle' \| 'playing' \| 'paused' \| 'stopped' \| 'error' | +| unnamed | type VideoPlayState = 'idle' \| 'prepared' \| 'playing' \| 'paused' \| 'stopped' \| 'error' | + +**Adaptation Guide** + +For details, see the [reference](../../../application-dev/reference/apis/js-apis-media.md) for each API. + +## cl.media.2 API Change of the Recording Function + +Added the [AVRecorder](../../../application-dev/reference/apis/js-apis-media.md#avrecorder9)9+ API for audio and video recording, with the updated state machine and error codes, which is recommended. The following APIs for audio recording and video recording are no longer maintained: [AudioRecorder](../../../application-dev/reference/apis/js-apis-media.md#audiorecorder)6+ and [VideoRecorder](../../../application-dev/reference/apis/js-apis-media.md#videorecorder9)9+. + +The [AudioSourceType](../../../application-dev/reference/apis/js-apis-media.md#audiosourcetype9) and [VideoSourceType](../../../application-dev/reference/apis/js-apis-media.md#videosourcetype9) APIs shared by the old and new recording APIs are changed to non-system APIs. + +**Change Impacts** + +The [AudioRecorder](../../../application-dev/reference/apis/js-apis-media.md#audiorecorder)6+ and [VideoRecorder](../../../application-dev/reference/apis/js-apis-media.md#videorecorder9)9+ APIs can still be used but are no longer maintained. You are advised to use the [AVRecorder](../../../application-dev/reference/apis/js-apis-media.md#avrecorder9)9+ API instead. + +**Key API/Component Changes** + +Added APIs + +| Class | Declaration | +| ----------------------- | ------------------------------------------------------------ | +| media | createAVRecorder(callback: AsyncCallback\): void | +| media | createAVRecorder() : Promise\ | +| media.AVRecorder | interface AVRecorder | +| media.AVRecorder | prepare(config: AVRecorderConfig, callback: AsyncCallback\): void | +| media.AVRecorder | prepare(config: AVRecorderConfig): Promise\ | +| media.AVRecorder | release(callback: AsyncCallback\): void | +| media.AVRecorder | release(): Promise\ | +| media.AVRecorder | readonly state: AVRecorderState | +| media.AVRecorder | on(type: 'stateChange', callback: (state: AVRecorderState, reason: StateChangeReason) => void): void | +| media.AVRecorder | on(type: 'error', callback: ErrorCallback): void | +| media.AVRecorder | resume(callback: AsyncCallback\): void | +| media.AVRecorder | resume(): Promise\ | +| media.AVRecorder | start(callback: AsyncCallback\): void | +| media.AVRecorder | start(): Promise\ | +| media.AVRecorder | off(type: 'stateChange'): void | +| media.AVRecorder | off(type: 'error'): void | +| media.AVRecorder | pause(callback: AsyncCallback\): void | +| media.AVRecorder | pause(): Promise\ | +| media.AVRecorder | stop(callback: AsyncCallback\): void | +| media.AVRecorder | stop(): Promise\ | +| media.AVRecorder | reset(callback: AsyncCallback\): void | +| media.AVRecorder | reset(): Promise\ | +| media.AVRecorder | getInputSurface(callback: AsyncCallback\): void | +| media.AVRecorder | getInputSurface(): Promise\ | +| media.AVRecorderConfig | videoSourceType?: VideoSourceType | +| media.AVRecorderConfig | audioSourceType?: AudioSourceType | +| media.AVRecorderConfig | profile: AVRecorderProfile | +| media.AVRecorderConfig | rotation?: number | +| media.AVRecorderConfig | url: string | +| media.AVRecorderConfig | location?: Location | +| media.AVRecorderConfig | interface AVRecorderConfig | +| media.AVRecorderProfile | videoBitrate?: number | +| media.AVRecorderProfile | videoCodec?: CodecMimeType | +| media.AVRecorderProfile | audioCodec?: CodecMimeType | +| media.AVRecorderProfile | videoFrameRate?: number | +| media.AVRecorderProfile | videoFrameHeight?: number | +| media.AVRecorderProfile | audioSampleRate?: number | +| media.AVRecorderProfile | audioBitrate?: number | +| media.AVRecorderProfile | videoFrameWidth?: number | +| media.AVRecorderProfile | audioChannels?: number | +| media.AVRecorderProfile | fileFormat: ContainerFormatType | +| media.AVRecorderProfile | interface AVRecorderProfile | +| unnamed | type AVRecorderState = 'idle' \| 'prepared' \| 'started' \| 'paused' \| 'stopped' \| 'released' \| 'error' | + +APIs no longer maintained + +| Class | Declaration | +| -------------------------- | ------------------------------------------------------------ | +| media | createVideoRecorder(callback: AsyncCallback\): void | +| media | createVideoRecorder(): Promise\ | +| media | createAudioRecorder(): AudioRecorder | +| media.AudioRecorder | interface AudioRecorder | +| media.AudioRecorder | prepare(config: AudioRecorderConfig): void | +| media.AudioRecorder | release(): void | +| media.AudioRecorder | on(type: 'prepare' \| 'start' \| 'pause' \| 'resume' \| 'stop' \| 'release' \| 'reset', callback: () => void): void | +| media.AudioRecorder | on(type: 'error', callback: ErrorCallback): void | +| media.AudioRecorder | resume(): void | +| media.AudioRecorder | start(): void | +| media.AudioRecorder | pause(): void | +| media.AudioRecorder | stop(): void | +| media.AudioRecorder | reset(): void | +| media.AudioRecorderConfig | audioSampleRate?: number | +| media.AudioRecorderConfig | location?: Location | +| media.AudioRecorderConfig | fileFormat?: ContainerFormatType | +| media.AudioRecorderConfig | interface AudioRecorderConfig | +| media.AudioRecorderConfig | audioEncoder?: AudioEncoder | +| media.AudioRecorderConfig | audioEncodeBitRate?: number | +| media.AudioRecorderConfig | numberOfChannels?: number | +| media.AudioRecorderConfig | format?: AudioOutputFormat | +| media.AudioRecorderConfig | uri: string | +| media.AudioRecorderConfig | audioEncoderMime?: CodecMimeType | +| media.VideoRecorder | interface VideoRecorder | +| media.VideoRecorder | prepare(config: VideoRecorderConfig, callback: AsyncCallback\): void | +| media.VideoRecorder | prepare(config: VideoRecorderConfig): Promise\ | +| media.VideoRecorder | release(callback: AsyncCallback\): void | +| media.VideoRecorder | release(): Promise\ | +| media.VideoRecorder | readonly state: VideoRecordState | +| media.VideoRecorder | on(type: 'error', callback: ErrorCallback): void | +| media.VideoRecorder | resume(callback: AsyncCallback\): void | +| media.VideoRecorder | resume(): Promise\ | +| media.VideoRecorder | start(callback: AsyncCallback\): void | +| media.VideoRecorder | start(): Promise\ | +| media.VideoRecorder | pause(callback: AsyncCallback\): void | +| media.VideoRecorder | pause(): Promise\ | +| media.VideoRecorder | stop(callback: AsyncCallback\): void | +| media.VideoRecorder | stop(): Promise\ | +| media.VideoRecorder | reset(callback: AsyncCallback\): void | +| media.VideoRecorder | reset(): Promise\ | +| media.VideoRecorder | getInputSurface(callback: AsyncCallback\): void | +| media.VideoRecorder | getInputSurface(): Promise\ | +| media.VideoRecorderConfig | videoSourceType: VideoSourceType | +| media.VideoRecorderConfig | audioSourceType?: AudioSourceType | +| media.VideoRecorderConfig | profile: VideoRecorderProfile | +| media.VideoRecorderConfig | rotation?: number | +| media.VideoRecorderConfig | url: string | +| media.VideoRecorderConfig | location?: Location | +| media.VideoRecorderConfig | interface VideoRecorderConfig | +| media.VideoRecorderProfile | readonly videoBitrate: number | +| media.VideoRecorderProfile | readonly videoCodec: CodecMimeType | +| media.VideoRecorderProfile | readonly audioCodec: CodecMimeType | +| media.VideoRecorderProfile | readonly videoFrameRate: number | +| media.VideoRecorderProfile | readonly videoFrameHeight: number | +| media.VideoRecorderProfile | readonly audioSampleRate: number | +| media.VideoRecorderProfile | readonly audioBitrate: number | +| media.VideoRecorderProfile | readonly videoFrameWidth: number | +| media.VideoRecorderProfile | readonly audioChannels: number | +| media.VideoRecorderProfile | readonly fileFormat: ContainerFormatType | +| media.VideoRecorderProfile | interface VideoRecorderProfile | +| unnamed | type VideoRecordState = 'idle' \| 'prepared' \| 'playing' \| 'paused' \| 'stopped' \| 'error' | + +Changed APIs + +| Class | Declaration | Capability Before Change | Capability After Change | Whether a System API Before Change| Whether a System API After Change| +| --------------------- | ------------------------------------------------------------ | ----------------------------------------------- | -------------------------------------------- | -------------------- | -------------------- | +| media.AudioSourceType | enum AudioSourceType { /** * default audio source type. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ AUDIO_SOURCE_TYPE_DEFAULT = 0, /** * source type mic. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ AUDIO_SOURCE_TYPE_MIC = 1, } | SystemCapability.Multimedia.Media.VideoRecorder | SystemCapability.Multimedia.Media.AVRecorder | Yes | No | +| media.VideoSourceType | enum VideoSourceType { /** * surface raw data. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ VIDEO_SOURCE_TYPE_SURFACE_YUV = 0, /** * surface ES data. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ VIDEO_SOURCE_TYPE_SURFACE_ES = 1, } | SystemCapability.Multimedia.Media.VideoRecorder | SystemCapability.Multimedia.Media.AVRecorder | Yes | No | + +**Adaptation Guide** + +For details, see the [reference](../../../application-dev/reference/apis/js-apis-media.md) for each API. + +## cl.media.3 Error Code Change + +Added the standard error code enumeration type [AVErrorCode9](../../../application-dev/reference/apis/js-apis-media.md#averrorcode)9+ that replaces the original error code enumeration type [MediaErrorCode](../../../application-dev/reference/apis/js-apis-media.md#mediaerrorcode)8+. + +**Change Impacts** + +The error code enumeration type [MediaErrorCode](../../../application-dev/reference/apis/js-apis-media.md#mediaerrorcode)8+ is still used for original APIs. [AVErrorCode9](../../../application-dev/reference/apis/js-apis-media.md#averrorcode)9+ is used for newly added APIs. + +**Key API/Component Changes** + +Added API + +| Class | Declaration | +| ----------------- | ------------------------------------------------------------ | +| media.AVErrorCode | enum AVErrorCode { /** * operation success. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_OK = 0, /** * permission denied. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_NO_PERMISSION = 201, /** * invalid parameter. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_INVALID_PARAMETER = 401, /** * the api is not supported in the current version * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_UNSUPPORT_CAPABILITY = 801, /** * the system memory is insufficient or the number of services reaches the upper limit * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_NO_MEMORY = 5400101, /** * current status does not allow or do not have permission to perform this operation * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_OPERATE_NOT_PERMIT = 5400102, /** * data flow exception information * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_IO = 5400103, /** * system or network response timeout. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_TIMEOUT = 5400104, /** * service process died. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_SERVICE_DIED = 5400105, /** * unsupported media format * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_UNSUPPORT_FORMAT = 5400106, } | + +API no longer maintained + +| Class | Declaration | +| -------------------- | ------------------------------------------------------------ | +| media.MediaErrorCode | enum MediaErrorCode { /** * operation success. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_OK = 0, /** * malloc or new memory failed. maybe system have no memory. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_NO_MEMORY = 1, /** * no permission for the operation. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_OPERATION_NOT_PERMIT = 2, /** * invalid argument. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_INVALID_VAL = 3, /** * an I/O error occurred. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_IO = 4, /** * operation time out. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_TIMEOUT = 5, /** * unknown error. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_UNKNOWN = 6, /** * media service died. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_SERVICE_DIED = 7, /** * operation is not permit in current state. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_INVALID_STATE = 8, /** * operation is not supported in current version. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_UNSUPPORTED = 9, } | + + \ No newline at end of file -- GitLab