提交 ac0c3dc8 编写于 作者: G Gloria

Update docs against 13070+13276+13190+13041+13528+13128+13297

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 2d846d87
# 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.
# 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';
```
# 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<CameraManager>): void;<br>function getCameraManager(context: Context): Promise<CameraManager>; | Yes | Deprecated |
| ohos.multimedia.camera | CameraErrorCode | INVALID_ARGUMENT = 7400101,<br>OPERATION_NOT_ALLOWED = 7400102,<br>SESSION_NOT_CONFIG = 7400103,<br>SESSION_NOT_RUNNING = 7400104,<br>SESSION_CONFIG_LOCKED = 7400105,<br>DEVICE_SETTING_LOCKED = 7400106,<br>CONFILICT_CAMERA = 7400107,<br>DEVICE_DISABLED = 7400108,<br>SERVICE_FATAL_ERROR = 7400201 | Yes | Added |
| ohos.multimedia.camera | CameraManager | getSupportedCameras(): Array<CameraDevice>;<br>getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability;<br>createCameraInput(camera: CameraDevice): CameraInput;<br>createCameraInput(position: CameraPosition, type: CameraType): CameraInput;<br>createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput;<br>createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput;<br>createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput;<br>createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): MetadataOutput;<br>createCaptureSession(): CaptureSession; | Yes | Added |
| ohos.multimedia.camera | CameraManager | getSupportedCameras(callback: AsyncCallback<Array<CameraDevice>>): void;<br>getSupportedCameras(): Promise<Array<CameraDevice>>;<br>getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback<CameraOutputCapability>): void;<br>getSupportedOutputCapability(camera: CameraDevice): Promise<CameraOutputCapability>;<br>createCameraInput(camera: CameraDevice, callback: AsyncCallback<CameraInput>): void;<br>createCameraInput(camera: CameraDevice): Promise<CameraInput>;<br>createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback<CameraInput>): void;<br>createCameraInput(position: CameraPosition, type: CameraType): Promise<CameraInput>;<br>createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PreviewOutput>): void;<br>createPreviewOutput(profile: Profile, surfaceId: string): Promise<PreviewOutput>;<br>createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PhotoOutput>): void;<br>createPhotoOutput(profile: Profile, surfaceId: string): Promise<PhotoOutput>;<br>createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback<VideoOutput>): void;<br>createVideoOutput(profile: VideoProfile, surfaceId: string): Promise<VideoOutput>;<br>createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>, callback: AsyncCallback<MetadataOutput>): void;<br>createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): Promise<MetadataOutput>;<br>createCaptureSession(callback: AsyncCallback<CaptureSession>): void;<br>createCaptureSession(): Promise<CaptureSession>; | 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<BusinessError>): void; | Yes | Added |
| ohos.multimedia.camera | CameraInput | release(callback: AsyncCallback<void>): void;<br>release(): Promise<void>;<br>on(type: 'error', camera: CameraDevice, callback: ErrorCallback<CameraInputError>): void; | Yes | Deprecated |
| ohos.multimedia.camera | CameraInputErrorCode | ERROR_UNKNOWN = -1<br>ERROR_NO_PERMISSION = 0<br>ERROR_DEVICE_PREEMPTED = 1<br>ERROR_DEVICE_DISCONNECTED = 2<br>ERROR_DEVICE_IN_USE = 3<br>ERROR_DRIVER_ERROR = 4 | Yes | Deprecated |
| ohos.multimedia.camera | CameraInputError | code: CameraInputErrorCode | Yes | Deprecated |
| ohos.multimedia.camera | CaptureSession | beginConfig(): void;<br>addInput(cameraInput: CameraInput): void;<br>removeInput(cameraInput: CameraInput): void;<br>addOutput(cameraOutput: CameraOutput): void;<br>removeOutput(cameraOutput: CameraOutput): void;<br>hasFlash(): boolean;<br>isFlashModeSupported(flashMode: FlashMode): boolean;<br>getFlashMode(): FlashMode;<br>setFlashMode(flashMode: FlashMode): void;<br>isExposureModeSupported(aeMode: ExposureMode): boolean;<br>getExposureMode(): ExposureMode;<br>setExposureMode(aeMode: ExposureMode): void;<br>getMeteringPoint(): Point;<br>setMeteringPoint(point: Point): void;<br>getExposureBiasRange(): Array<number>;<br>setExposureBias(exposureBias: number): void;<br>getExposureValue(): number;<br>isFocusModeSupported(afMode: FocusMode): boolean;<br>getFocusMode(): FocusMode;<br>setFocusMode(afMode: FocusMode): void;<br>setFocusPoint(point: Point): void;<br>getFocusPoint(): Point;<br>getFocalLength(): number;<br>getZoomRatioRange(): Array<number>;<br>getZoomRatio(): number;<br>setZoomRatio(zoomRatio: number): void;<br>isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean;<br>getActiveVideoStabilizationMode(): VideoStabilizationMode;<br>setVideoStabilizationMode(mode: VideoStabilizationMode): void;<br>on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added |
| ohos.multimedia.camera | CaptureSession | beginConfig(callback: AsyncCallback<void>): void;<br>beginConfig(): Promise<void>;<br>addInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void;<br>addInput(cameraInput: CameraInput): Promise<void>;<br>removeInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void;<br>removeInput(cameraInput: CameraInput): Promise<void>;<br>addOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>addOutput(cameraOutput: CameraOutput): Promise<void>;<br>removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>removeOutput(cameraOutput: CameraOutput): Promise<void>;<br>hasFlash(callback: AsyncCallback<boolean>): void;<br>hasFlash(): Promise<boolean>;<br>isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback<boolean>): void;<br>isFlashModeSupported(flashMode: FlashMode): Promise<boolean>;<br>getFlashMode(callback: AsyncCallback<FlashMode>): void;<br>getFlashMode(): Promise<FlashMode>;<br>setFlashMode(flashMode: FlashMode, callback: AsyncCallback<void>): void;<br>setFlashMode(flashMode: FlashMode): Promise<void>;<br>isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback<boolean>): void;<br>isExposureModeSupported(aeMode: ExposureMode): Promise<boolean>;<br>getExposureMode(callback: AsyncCallback<ExposureMode>): void;<br>getExposureMode(): Promise<ExposureMode>;<br>setExposureMode(aeMode: ExposureMode, callback: AsyncCallback<void>): void;<br>setExposureMode(aeMode: ExposureMode): Promise<void>;<br>getMeteringPoint(callback: AsyncCallback<Point>): void;<br>getMeteringPoint(): Promise<Point>;<br>setMeteringPoint(point: Point, callback: AsyncCallback<void>): void;<br>setMeteringPoint(point: Point): Promise<void>;<br>getExposureBiasRange(callback: AsyncCallback<Array<number>>): void;<br>getExposureBiasRange(): Promise<Array<number>>;<br>setExposureBias(exposureBias: number, callback: AsyncCallback<void>): void;<br>setExposureBias(exposureBias: number): Promise<void>;<br>getExposureValue(callback: AsyncCallback<number>): void;<br>getExposureValue(): Promise<number>;<br>isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean>): void;<br>isFocusModeSupported(afMode: FocusMode): Promise<boolean>;<br>getFocusMode(callback: AsyncCallback<FocusMode>): void;<br>getFocusMode(): Promise<FocusMode>;<br>setFocusMode(afMode: FocusMode, callback: AsyncCallback<void>): void;<br>setFocusMode(afMode: FocusMode): Promise<void>;<br>setFocusPoint(point: Point, callback: AsyncCallback<void>): void;<br>setFocusPoint(point: Point): Promise<void>;<br>getFocusPoint(callback: AsyncCallback<Point>): void;<br>getFocusPoint(): Promise<Point>;<br>getFocalLength(callback: AsyncCallback<number>): void;<br>getFocalLength(): Promise<number>;<br>getZoomRatioRange(callback: AsyncCallback<Array<number>>): void;<br>getZoomRatioRange(): Promise<Array<number>>;<br>getZoomRatio(callback: AsyncCallback<number>): void;<br>getZoomRatio(): Promise<number>;<br>setZoomRatio(zoomRatio: number, callback: AsyncCallback<void>): void;<br>setZoomRatio(zoomRatio: number): Promise<void>;<br>isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback<boolean>): void;<br>isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise<boolean>;<br>getActiveVideoStabilizationMode(callback: AsyncCallback<VideoStabilizationMode>): void;<br>getActiveVideoStabilizationMode(): Promise<VideoStabilizationMode>;<br>setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback<void>): void;<br>setVideoStabilizationMode(mode: VideoStabilizationMode): Promise<void>;<br>on(type: 'error', callback: ErrorCallback<CaptureSessionError>): void; | Yes | Deprecated |
| ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_UNKNOWN = -1<br>ERROR_INSUFFICIENT_RESOURCES = 0<br>ERROR_TIMEOUT = 1 | Yes | Deprecated |
| ohos.multimedia.camera | CaptureSessionError | code: CaptureSessionErrorCode | Yes | Deprecated |
| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added |
| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback<PreviewOutputError>): 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<void>;<br>isMirrorSupported(): boolean;<br>on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added |
| ohos.multimedia.camera | PhotoOutput | isMirrorSupported(callback: AsyncCallback<boolean>): void;<br>isMirrorSupported(): Promise<boolean>;<br>on(type: 'error', callback: ErrorCallback<PhotoOutputError>): void; | Yes | Deprecated |
| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_UNKNOWN = -1<br>ERROR_DRIVER_ERROR = 0<br>ERROR_INSUFFICIENT_RESOURCES = 1<br>ERROR_TIMEOUT = 2 | Yes | Deprecated |
| ohos.multimedia.camera | PhotoOutputError | code: PhotoOutputErrorCode | Yes | Deprecated |
| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added |
| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback<VideoOutputError>): void; | Yes | Deprecated |
| ohos.multimedia.camera | VideoOutputErrorCode | ERROR_UNKNOWN = -1<br>ERROR_DRIVER_ERROR = 0 | Yes | Deprecated |
| ohos.multimedia.camera | VideoOutputError | code: VideoOutputErrorCode | Yes | Deprecated |
| ohos.multimedia.camera | MetadataObject | readonly type: MetadataObjectType;<br>readonly timestamp: number; | Yes | Added |
| ohos.multimedia.camera | MetadataObject | getType(callback: AsyncCallback<MetadataObjectType>): void;<br>getType(): Promise<MetadataObjectType>;<br>getTimestamp(callback: AsyncCallback<number>): void;<br>getTimestamp(): Promise<number>;<br>getBoundingBox(callback: AsyncCallback<Rect>): void;<br>getBoundingBox(): Promise<Rect>; | Yes | Deprecated |
| ohos.multimedia.camera | MetadataFaceObject | readonly boundingBox: Rect | Yes | Added |
| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added |
| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Deprecated |
| ohos.multimedia.camera | MetadataOutputErrorCode | ERROR_UNKNOWN = -1<br>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<void>** 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>): void** and **release(): Promise<void>** 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<MetadataObjectType>): void** in the **MetadataObject** API.
13. Deprecated **getType(): Promise<MetadataObjectType>** in the **MetadataObject** API.
14. Deprecated **getTimestamp(callback: AsyncCallback<number>): void** in the **MetadataObject** API.
15. Deprecated **getTimestamp(): Promise<number>** in the **MetadataObject** API.
16. Deprecated **getBoundingBox(callback: AsyncCallback<Rect>): void** in the **MetadataObject** API.
17. Deprecated **getBoundingBox(): Promise<Rect>** 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<CameraManager>): void** and **getCameraManager(context: Context): Promise<CameraManager>** 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<Array<CameraDevice>>): void** and **getSupportedCameras(): Promise<Array<CameraDevice>>** are changed to **getSupportedCameras(): Array<CameraDevice>**.
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<CameraOutputCapability>): void** and **getSupportedOutputCapability(camera: CameraDevice): Promise<CameraOutputCapability>** 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<CameraInput>): void** and **createCameraInput(camera: CameraDevice): Promise<CameraInput>** 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<CameraInput>): void** and **createCameraInput(position: CameraPosition, type: CameraType): Promise<CameraInput>** 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<PreviewOutput>): void** and **createPreviewOutput(profile: Profile, surfaceId: string): Promise<PreviewOutput>** 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<PhotoOutput>): void** and **createPhotoOutput(profile: Profile, surfaceId: string): Promise<PhotoOutput>** 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<VideoOutput>): void** and **createVideoOutput(profile: VideoProfile, surfaceId: string): Promise<VideoOutput>** 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<MetadataObjectType>, callback: AsyncCallback<MetadataOutput>): void** and **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): Promise<MetadataOutput>** are changed to **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): 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<CaptureSession>): void** and **createCaptureSession(): Promise<CaptureSession>** 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<CameraInputError>): void** is changed to **on(type: 'error', camera: CameraDevice, callback: ErrorCallback<BusinessError>): 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>): void** and **beginConfig(): Promise<void>** 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>): void** and **addInput(cameraInput: CameraInput): Promise<void>** 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>): void** and **removeInput(cameraInput: CameraInput): Promise<void>** 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>): void** and **addOutput(cameraOutput: CameraOutput): Promise<void>** 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>): void** and **removeOutput(cameraOutput: CameraOutput): Promise<void>** 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<boolean>): void** and **hasFlash(): Promise<boolean>** 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<boolean>): void** and **isFlashModeSupported(flashMode: FlashMode): Promise<boolean>** 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<FlashMode>): void** and **getFlashMode(): Promise<FlashMode>** 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<boolean>): void** and **isExposureModeSupported(aeMode: ExposureMode): Promise<boolean>** 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<ExposureMode>): void** and **getExposureMode(): Promise<ExposureMode>** 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>): void** and **setExposureMode(aeMode: ExposureMode): Promise<void>** 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<Point>): void** and **getMeteringPoint(): Promise<Point>** 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>): void** and **setMeteringPoint(point: Point): Promise<void>** 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<Array<number>>): void** and **getExposureBiasRange(): Promise<Array<number>>** are changed to **getExposureBiasRange(): Array<number>**.
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>): void** and **setExposureBias(exposureBias: number): Promise<void>** 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<number>): void** and **getExposureValue(): Promise<number>** 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<boolean>): void** and **isFocusModeSupported(afMode: FocusMode): Promise<boolean>** 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<FocusMode>): void** and **getFocusMode(): Promise<FocusMode>** 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>): void** and **setFocusMode(afMode: FocusMode): Promise<void>** 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>): void** and **setFocusPoint(point: Point): Promise<void>** 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<Point>): void** and **getFocusPoint(): Promise<Point>** 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<number>): void** and **getFocalLength(): Promise<number>** 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<Array<number>>): void** and **getZoomRatioRange(): Promise<Array<number>>** are changed to **getZoomRatioRange(): Array<number>**.
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<number>): void** and **getZoomRatio(): Promise<number>** 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>): void** and **setZoomRatio(zoomRatio: number): Promise<void>** 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<boolean>): void** and **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise<boolean>** 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<VideoStabilizationMode>): void** and **getActiveVideoStabilizationMode(): Promise<VideoStabilizationMode>** 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>): void** and **setVideoStabilizationMode(mode: VideoStabilizationMode): Promise<void>** 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<CaptureSessionError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<CaptureSessionError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**.
The sample code is as follows:
```
captureSession.on('error', (BusinessError) => {
})
```
42. Changed the **on(type:'error') callback** type in PreviewOutput, from **ErrorCallback<PreviewOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<PreviewOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): 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<boolean>): void** and **isMirrorSupported(): Promise<boolean>** 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<PhotoOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<PhotoOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**.
The sample code is as follows:
```
PhotoOutput.on('error', (BusinessError) => {
})
```
45. Changed the **on(type:'error') callback** type in VideoOutput, from **ErrorCallback<VideoOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<VideoOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**.
The sample code is as follows:
```
VideoOutput.on('error', (BusinessError) => {
})
```
46. Changed the **on(type:'error') callback** type in MetadataOutput, from **ErrorCallback<MetadataOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<MetadataOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**.
The sample code is as follows:
```
MetadataOutput.on('error', (BusinessError) => {
})
```
\ No newline at end of file
...@@ -273,6 +273,7 @@ Use the **HapModuleInfo** structure of API version 9 for modules imported for bu ...@@ -273,6 +273,7 @@ Use the **HapModuleInfo** structure of API version 9 for modules imported for bu
## cl.bundlemanager.7 ModuleInfo Structure Changes ## 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 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). 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** **Change Impacts**
...@@ -759,3 +760,5 @@ The import module does not change. The new API is directly used to adapt excepti ...@@ -759,3 +760,5 @@ The import module does not change. The new API is directly used to adapt excepti
``` ```
import zlib form '@ohos.zlib' import zlib form '@ohos.zlib'
``` ```
<!--no_check-->
\ No newline at end of file
# 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<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 stopBackgroundRunning(context: Context, callback: AsyncCallback<void>): 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<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, callback: AsyncCallback<void>): 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<void>): 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<number>; | 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<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 | 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**<br>
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<boolean>): void; | Deprecated and migrated to **usageStatistics.isIdleState** |
| bundleState | method | function isIdleState(bundleName: string): Promise<boolean>; | Deprecated and migrated to **usageStatistics.isIdleState** |
| bundleState | method | function queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void; | Deprecated and changed to **function queryAppGroup(callback: AsyncCallback<number>): void;**|
| bundleState | method | function queryAppUsagePriorityGroup(): Promise<number>; | Deprecated and changed to **function queryAppGroup(): Promise<number>;** |
| bundleState | method | function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback<BundleActiveInfoResponse>): void; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback<BundleStatsMap>): void;**|
| bundleState | method | function queryBundleStateInfos(begin: number, end: number): Promise<BundleActiveInfoResponse>; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number): Promise<BundleStatsMap>;**|
| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array<BundleStateInfo>>; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array<BundleStatsInfo>>;**|
| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback<Array<BundleStateInfo>>): void; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback<Array<BundleStatsInfo>>): void;**|
| bundleState | method | function queryBundleActiveStates(begin: number, end: number): Promise<Array<BundleActiveState>>; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number): Promise<Array<BundleEvents>>;**|
| bundleState | method | function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveState>>): void; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number, callback: AsyncCallback<Array<BundleEvents>>): void;**|
| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number): Promise<Array<BundleActiveState>>; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number): Promise<Array<BundleEvents>>;**|
| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveState>>): void; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback<Array<BundleEvents>>): void;**|
| bundleState | method | function getRecentlyUsedModules(maxNum?: number): Promise<Array<BundleActiveModuleInfo>>; | Deprecated and changed to the following two APIs: **function QueryModuleUsageRecords(maxNum: number): Promise<Array<HapModuleInfo>>;** and **function QueryModuleUsageRecords(): Promise<Array<HapModuleInfo>>;**|
| bundleState | method | function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback<Array<BundleActiveModuleInfo>>): void; | Deprecated and changed to the following two APIs: **function QueryModuleUsageRecords(maxNum: number, callback: AsyncCallback<Array<HapModuleInfo>>): void;** and **function QueryModuleUsageRecords(callback: AsyncCallback<Array<HapModuleInfo>>): void;**|
| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string): Promise<number>; | Deprecated and changed to **function queryAppGroup(bundleName: string): Promise<number>;**|
| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback<number>): void; | Deprecated and changed to **function queryAppGroup(bundleName: string, callback: AsyncCallback<number>): void;**|
| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback<void>): void; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback<void>): void;**|
| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType): Promise<void>; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType): Promise<void>;**|
| bundleState | method | function registerGroupCallBack(callback: Callback<BundleActiveGroupCallbackInfo>, callback: AsyncCallback<void>): void; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback<AppGroupCallbackInfo>, callback: AsyncCallback<void>): void;**|
| bundleState | method | function registerGroupCallBack(callback: Callback<BundleActiveGroupCallbackInfo>): Promise<void>; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback<AppGroupCallbackInfo>): Promise<void>;**|
| bundleState | method | function unRegisterGroupCallBack(callback: AsyncCallback<void>): void; | Deprecated and changed to **function unregisterAppGroupCallBack(): Promise<void>;**|
| bundleState | method | function unRegisterGroupCallBack(): Promise<void>; | Deprecated and changed to **function unregisterAppGroupCallBack(): Promise<void>;**|
| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void; | Changed to **function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback<Array<DeviceEventStats>>): void;**|
| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number): Promise<Array<BundleActiveEventState>>; | Changed in API version 9 and later versions to **function queryDeviceEventStats(begin: number, end: number): Promise<Array<DeviceEventStats>>;**|
| bundleState | method | function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void; | Changed in API version 9 and later versions to **function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback<Array<NotificationEventStats >>): void;**|
| bundleState | method | function queryAppNotificationNumber(begin: number, end: number): Promise<Array<BundleActiveEventState>>; | Changed in API version 9 and later versions to **function queryNotificationEventStats(begin: number, end: number): Promise<Array<NotificationEventStats >>;**|
| 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<BundleActiveFormInfo> | Changed to **formRecords: Array<HapModuleInfo>** |
| 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**<br>
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<void>): 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<Array<WorkInfo>>; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file|
| workScheduler | method | function obtainAllWorks(callback: AsyncCallback<void>): Array<WorkInfo>; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file|
| workScheduler | method | function getWorkStatus(workId: number): Promise<WorkInfo>; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file|
| workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback<WorkInfo>): 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**<br>
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<number>): void; | Deprecated and migrated to **reminderAgentManager**|
| reminderAgent | method | publishReminder(reminderReq: ReminderRequest): Promise<number>; | Deprecated and migrated to **reminderAgentManager**|
| reminderAgent | method | cancelReminder(reminderId: number, callback: AsyncCallback<void>): void; | Deprecated and migrated to **reminderAgentManager**|
| reminderAgent | method | cancelReminder(reminderId: number): Promise<void>; | Deprecated and migrated to **reminderAgentManager**|
| reminderAgent | method | getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void; | Deprecated and migrated to **reminderAgentManager**|
| reminderAgent | method | getValidReminders(): Promise<Array<ReminderRequest>>; | Deprecated and migrated to **reminderAgentManager**|
| reminderAgent | method | cancelAllReminders(callback: AsyncCallback<void>): void; | Deprecated and migrated to **reminderAgentManager**|
| reminderAgent | method | cancelAllReminders(): Promise<void>; | Deprecated and migrated to **reminderAgentManager**|
| reminderAgent | method | addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void; | Deprecated and migrated to **reminderAgentManager**|
| reminderAgent | method | addNotificationSlot(slot: NotificationSlot): Promise<void>; | Deprecated and migrated to **reminderAgentManager**|
| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback<void>): void; | Deprecated and migrated to **reminderAgentManager**|
| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType): Promise<void>; | 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<number> | Deprecated and migrated to **reminderAgentManager.ReminderRequestCalendar**|
| reminderAgent.ReminderRequestCalendar | field | repeatDays?:Array<number> | 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<number> | 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**<br>
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).
# 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>): void | Asynchronous callback |
| @ohos.app.ability.abilityManager.d.ts | updateConfiguration(config: Configuration): Promise<void> | Asynchronous callback |
| @ohos.app.ability.abilityManager.d.ts | getAbilityRunningInfos(): Promise<Array<AbilityRunningInfo>> | Asynchronous callback |
| @ohos.app.ability.abilityManager.d.ts | getAbilityRunningInfos(callback: AsyncCallback<Array<AbilityRunningInfo>>): void | Asynchronous callback |
| @ohos.app.ability.abilityManager.d.ts | getExtensionRunningInfos(upperLimit: number): Promise<Array<ExtensionRunningInfo>> | Asynchronous callback |
| @ohos.app.ability.abilityManager.d.ts | getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback<Array<ExtensionRunningInfo>>): void | Asynchronous callback |
| @ohos.app.ability.abilityManager.d.ts | getTopAbility(): Promise<ElementName> | Exception |
| @ohos.app.ability.abilityManager.d.ts | getTopAbility(callback: AsyncCallback<ElementName>): 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<string>): number | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | off(type: "applicationState", observerId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | off(type: "applicationState", observerId: number): Promise<void> | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | getForegroundApplications(callback: AsyncCallback<Array<AppStateData>>): void | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | getForegroundApplications(): Promise<Array<AppStateData>> | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | killProcessWithAccount(bundleName: string, accountId: number): Promise<void> | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | killProcessesByBundleName(bundleName: string): Promise<void> | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | killProcessesByBundleName(bundleName: string, callback: AsyncCallback<void>) | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | clearUpApplicationData(bundleName: string): Promise<void> | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | clearUpApplicationData(bundleName: string, callback: AsyncCallback<void>) | 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>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | off(type: "mission", listenerId: number): Promise<void> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback<MissionInfo>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getMissionInfo(deviceId: string, missionId: number): Promise<MissionInfo> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback<Array<MissionInfo>>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getMissionInfos(deviceId: string, numMax: number): Promise<Array<MissionInfo>> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback<MissionSnapshot>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getMissionSnapShot(deviceId: string, missionId: number): Promise<MissionSnapshot> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback<MissionSnapshot>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise<MissionSnapshot> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | lockMission(missionId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | lockMission(missionId: number): Promise<void> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | unlockMission(missionId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | unlockMission(missionId: number): Promise<void> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | clearMission(missionId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | clearMission(missionId: number): Promise<void> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | clearAllMissions(callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | clearAllMissions(): Promise<void> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, options?: StartOptions): Promise<void> | Asynchronous callback |
| @ohos.app.ability.quickFixManager.d.ts | applyQuickFix(hapModuleQuickFixFiles: Array<string>, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.quickFixManager.d.ts | applyQuickFix(hapModuleQuickFixFiles: Array<string>): Promise<void> | Asynchronous callback |
| @ohos.app.ability.quickFixManager.d.ts | getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback<ApplicationQuickFixInfo>): void | Asynchronous callback |
| @ohos.app.ability.quickFixManager.d.ts | getApplicationQuickFixInfo(bundleName: string): Promise<ApplicationQuickFixInfo> | Asynchronous callback |
| @ohos.app.ability.wantAgent.d.ts | getWant(agent: WantAgent, callback: AsyncCallback<Want>): void | Asynchronous callback |
| @ohos.app.ability.wantAgent.d.ts | getWant(agent: WantAgent): Promise<Want> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | deleteForm(formId: string, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | deleteForm(formId: string): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, isReleaseCache: boolean, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, isReleaseCache?: boolean): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | requestForm(formId: string, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | requestForm(formId: string): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | castToNormalForm(formId: string, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | castToNormalForm(formId: string): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyVisibleForms(formIds: Array<string>, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyVisibleForms(formIds: Array<string>): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyInvisibleForms(formIds: Array<string>, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyInvisibleForms(formIds: Array<string>): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | enableFormsUpdate(formIds: Array<string>, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | enableFormsUpdate(formIds: Array<string>): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | disableFormsUpdate(formIds: Array<string>, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | disableFormsUpdate(formIds: Array<string>): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | isSystemReady(callback: AsyncCallback<void>): void | Exception |
| @ohos.app.form.formHost.d.ts | isSystemReady(): Promise<void> | Exception |
| @ohos.app.form.formHost.d.ts | getAllFormsInfo(callback: AsyncCallback<Array<formInfo.FormInfo>>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | getAllFormsInfo(): Promise<Array<formInfo.FormInfo>> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, callback: AsyncCallback<Array<formInfo.FormInfo>>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback<Array<formInfo.FormInfo>>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, moduleName?: string): Promise<Array<formInfo.FormInfo>> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | deleteInvalidForms(formIds: Array<string>, callback: AsyncCallback<number>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | deleteInvalidForms(formIds: Array<string>): Promise<number> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | acquireFormState(want: Want, callback: AsyncCallback<formInfo.FormStateInfo>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | acquireFormState(want: Want): Promise<formInfo.FormStateInfo> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | on(type: "formUninstall", callback: Callback<string>): void | Exception |
| @ohos.app.form.formHost.d.ts | off(type: "formUninstall", callback?: Callback<string>): void | Exception |
| @ohos.app.form.formHost.d.ts | notifyFormsVisible(formIds: Array<string>, isVisible: boolean, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyFormsVisible(formIds: Array<string>, isVisible: boolean): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyFormsEnableUpdate(formIds: Array<string>, isEnableUpdate: boolean, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyFormsEnableUpdate(formIds: Array<string>, isEnableUpdate: boolean): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | shareForm(formId: string, deviceId: string, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | shareForm(formId: string, deviceId: string): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyFormsPrivacyProtected(formIds: Array<string>, isProtected: boolean, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyFormsPrivacyProtected(formIds: Array<string>, isProtected: boolean): Promise<void> | Asynchronous callback |
| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback<string>): void | Asynchronous callback |
| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, callback: AsyncCallback<string>): void | Asynchronous callback |
| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, formBindingData?: formBindingData.FormBindingData): Promise<string> | Asynchronous callback |
| @ohos.app.form.formProvider.d.ts | isRequestPublishFormSupported(callback: AsyncCallback<boolean>): void | Exception |
| @ohos.app.form.formProvider.d.ts | isRequestPublishFormSupported(): Promise<boolean> | Exception |
| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<void>): void | Asynchronous callback |
| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<void> | Asynchronous callback |
| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback<AbilityResult>): void | Exception |
| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<AbilityResult>): void | Exception |
| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<AbilityResult> | Exception |
| UIAbilityContext.d.ts | startServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void | Asynchronous callback |
| UIAbilityContext.d.ts | startServiceExtensionAbility(want: Want): Promise<void> | Asynchronous callback |
| UIAbilityContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| UIAbilityContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void> | Asynchronous callback |
| UIAbilityContext.d.ts | stopServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void | Asynchronous callback |
| UIAbilityContext.d.ts | stopServiceExtensionAbility(want: Want): Promise<void> | Asynchronous callback |
| UIAbilityContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| UIAbilityContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void> | 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>): void | Asynchronous callback |
| UIAbilityContext.d.ts | setMissionIcon(icon: image.PixelMap): Promise<void> | Asynchronous callback |
| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<void>): void | Asynchronous callback |
| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<void> | Asynchronous callback |
| ServiceExtensionContext.d.ts | startServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void | Asynchronous callback |
| ServiceExtensionContext.d.ts | startServiceExtensionAbility(want: Want): Promise<void> | Asynchronous callback |
| ServiceExtensionContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| ServiceExtensionContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void> | Asynchronous callback |
| ServiceExtensionContext.d.ts | stopServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void | Asynchronous callback |
| ServiceExtensionContext.d.ts | stopServiceExtensionAbility(want: Want): Promise<void> | Asynchronous callback |
| ServiceExtensionContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| ServiceExtensionContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void> | 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>): void | Asynchronous callback |
| FormExtensionContext.d.ts | startAbility(want: Want): Promise<void> | Asynchronous callback |
# Media Subsystem ChangeLog
## cl.media.1 API Change of the Playback Function
Added the [AVPlayer](../../../application-dev/reference/apis/js-apis-media.md#avplayer9)<sup>9+</sup> 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)<sup>6+</sup> and [VideoPlayer](../../../application-dev/reference/apis/js-apis-media.md#videoplayer)<sup>8+</sup>.
**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\<AVPlayer>): void |
| media | createAVPlayer() : Promise\<AVPlayer> |
| media.AVPlayer | interface AVPlayer |
| media.AVPlayer | videoScaleType ?: VideoScaleType |
| media.AVPlayer | url ?: string |
| media.AVPlayer | surfaceId ?: string |
| media.AVPlayer | stop(callback: AsyncCallback\<void>): void |
| media.AVPlayer | stop(): Promise\<void> |
| 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>): void |
| media.AVPlayer | reset(): Promise\<void> |
| media.AVPlayer | release(callback: AsyncCallback\<void>): void |
| media.AVPlayer | release(): Promise\<void> |
| 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>): void |
| media.AVPlayer | prepare(): Promise\<void> |
| media.AVPlayer | play(callback: AsyncCallback\<void>): void |
| media.AVPlayer | play(): Promise\<void> |
| media.AVPlayer | pause(callback: AsyncCallback\<void>): void |
| media.AVPlayer | pause(): Promise\<void> |
| media.AVPlayer | on(type: 'volumeChange', callback: Callback\<number>): void |
| media.AVPlayer | on(type: 'videoSizeChange', callback: (width: number, height: number) => void): void |
| media.AVPlayer | on(type: 'timeUpdate', callback: Callback\<number>): void |
| media.AVPlayer | on(type: 'stateChange', callback: (state: AVPlayerState, reason: StateChangeReason) => void): void |
| media.AVPlayer | on(type: 'startRenderFrame', callback: Callback\<void>): void |
| media.AVPlayer | on(type: 'speedDone', callback: Callback\<number>): void |
| media.AVPlayer | on(type: 'seekDone', callback: Callback\<number>): void |
| media.AVPlayer | on(type: 'error', callback: ErrorCallback): void |
| media.AVPlayer | on(type: 'endOfStream', callback: Callback\<void>): void |
| media.AVPlayer | on(type: 'durationUpdate', callback: Callback\<number>): void |
| media.AVPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void |
| media.AVPlayer | on(type: 'bitrateDone', callback: Callback\<number>): void |
| media.AVPlayer | on(type: 'availableBitrates', callback: (bitrates: Array\<number>) => 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\<Array\<MediaDescription>>): void |
| media.AVPlayer | getTrackDescription() : Promise\<Array\<MediaDescription>> |
| 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\<VideoPlayer>): void |
| media | createVideoPlayer() : Promise\<VideoPlayer> |
| 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\<Array\<MediaDescription>>): void |
| media.AudioPlayer | getTrackDescription() : Promise\<Array\<MediaDescription>> |
| 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\<number>): 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>): void |
| media.VideoPlayer | play(): Promise\<void> |
| media.VideoPlayer | prepare(callback: AsyncCallback\<void>): void |
| media.VideoPlayer | prepare(): Promise\<void> |
| media.VideoPlayer | release(callback: AsyncCallback\<void>): void |
| media.VideoPlayer | release(): Promise\<void> |
| media.VideoPlayer | audioInterruptMode ?: audio.InterruptMode |
| media.VideoPlayer | fdSrc: AVFileDescriptor |
| media.VideoPlayer | seek(timeMs: number, callback: AsyncCallback\<number>): void |
| media.VideoPlayer | seek(timeMs: number, mode:SeekMode, callback: AsyncCallback\<number>): void |
| media.VideoPlayer | seek(timeMs: number, mode?:SeekMode): Promise\<number> |
| media.VideoPlayer | readonly duration: number |
| media.VideoPlayer | loop: boolean |
| media.VideoPlayer | videoScaleType ?: VideoScaleType |
| media.VideoPlayer | readonly state: VideoPlayState |
| media.VideoPlayer | getTrackDescription(callback: AsyncCallback\<Array\<MediaDescription>>): void |
| media.VideoPlayer | getTrackDescription() : Promise\<Array\<MediaDescription>> |
| media.VideoPlayer | readonly height: number |
| media.VideoPlayer | on(type: 'playbackCompleted', callback: Callback\<void>): void |
| media.VideoPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void |
| media.VideoPlayer | on(type: 'startRenderFrame', callback: Callback\<void>): 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>): void |
| media.VideoPlayer | setDisplaySurface(surfaceId: string): Promise\<void> |
| media.VideoPlayer | setVolume(vol: number, callback: AsyncCallback\<void>): void |
| media.VideoPlayer | setVolume(vol: number): Promise\<void> |
| media.VideoPlayer | url: string |
| media.VideoPlayer | pause(callback: AsyncCallback\<void>): void |
| media.VideoPlayer | pause(): Promise\<void> |
| media.VideoPlayer | readonly currentTime: number |
| media.VideoPlayer | setSpeed(speed:number, callback: AsyncCallback\<number>): void |
| media.VideoPlayer | setSpeed(speed:number): Promise\<number> |
| media.VideoPlayer | stop(callback: AsyncCallback\<void>): void |
| media.VideoPlayer | stop(): Promise\<void> |
| media.VideoPlayer | readonly width: number |
| media.VideoPlayer | reset(callback: AsyncCallback\<void>): void |
| media.VideoPlayer | reset(): Promise\<void> |
| 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)<sup>9+</sup> 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)<sup>6+</sup> and [VideoRecorder](../../../application-dev/reference/apis/js-apis-media.md#videorecorder9)<sup>9+</sup>.
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)<sup>6+</sup> and [VideoRecorder](../../../application-dev/reference/apis/js-apis-media.md#videorecorder9)<sup>9+</sup> 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)<sup>9+</sup> API instead.
**Key API/Component Changes**
Added APIs
| Class | Declaration |
| ----------------------- | ------------------------------------------------------------ |
| media | createAVRecorder(callback: AsyncCallback\<AVRecorder>): void |
| media | createAVRecorder() : Promise\<AVRecorder> |
| media.AVRecorder | interface AVRecorder |
| media.AVRecorder | prepare(config: AVRecorderConfig, callback: AsyncCallback\<void>): void |
| media.AVRecorder | prepare(config: AVRecorderConfig): Promise\<void> |
| media.AVRecorder | release(callback: AsyncCallback\<void>): void |
| media.AVRecorder | release(): Promise\<void> |
| 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>): void |
| media.AVRecorder | resume(): Promise\<void> |
| media.AVRecorder | start(callback: AsyncCallback\<void>): void |
| media.AVRecorder | start(): Promise\<void> |
| media.AVRecorder | off(type: 'stateChange'): void |
| media.AVRecorder | off(type: 'error'): void |
| media.AVRecorder | pause(callback: AsyncCallback\<void>): void |
| media.AVRecorder | pause(): Promise\<void> |
| media.AVRecorder | stop(callback: AsyncCallback\<void>): void |
| media.AVRecorder | stop(): Promise\<void> |
| media.AVRecorder | reset(callback: AsyncCallback\<void>): void |
| media.AVRecorder | reset(): Promise\<void> |
| media.AVRecorder | getInputSurface(callback: AsyncCallback\<string>): void |
| media.AVRecorder | getInputSurface(): Promise\<string> |
| 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\<VideoRecorder>): void |
| media | createVideoRecorder(): Promise\<VideoRecorder> |
| 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>): void |
| media.VideoRecorder | prepare(config: VideoRecorderConfig): Promise\<void> |
| media.VideoRecorder | release(callback: AsyncCallback\<void>): void |
| media.VideoRecorder | release(): Promise\<void> |
| media.VideoRecorder | readonly state: VideoRecordState |
| media.VideoRecorder | on(type: 'error', callback: ErrorCallback): void |
| media.VideoRecorder | resume(callback: AsyncCallback\<void>): void |
| media.VideoRecorder | resume(): Promise\<void> |
| media.VideoRecorder | start(callback: AsyncCallback\<void>): void |
| media.VideoRecorder | start(): Promise\<void> |
| media.VideoRecorder | pause(callback: AsyncCallback\<void>): void |
| media.VideoRecorder | pause(): Promise\<void> |
| media.VideoRecorder | stop(callback: AsyncCallback\<void>): void |
| media.VideoRecorder | stop(): Promise\<void> |
| media.VideoRecorder | reset(callback: AsyncCallback\<void>): void |
| media.VideoRecorder | reset(): Promise\<void> |
| media.VideoRecorder | getInputSurface(callback: AsyncCallback\<string>): void |
| media.VideoRecorder | getInputSurface(): Promise\<string> |
| 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)<sup>9+</sup> that replaces the original error code enumeration type [MediaErrorCode](../../../application-dev/reference/apis/js-apis-media.md#mediaerrorcode)<sup>8+</sup>.
**Change Impacts**
The error code enumeration type [MediaErrorCode](../../../application-dev/reference/apis/js-apis-media.md#mediaerrorcode)<sup>8+</sup> is still used for original APIs. [AVErrorCode9](../../../application-dev/reference/apis/js-apis-media.md#averrorcode)<sup>9+</sup> 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_check-->
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册