diff --git a/en/release-notes/changelogs/v3.2-beta4/Readme-EN.md b/en/release-notes/changelogs/v3.2-beta4/Readme-EN.md index 0a7f3f1f2184f7d696f8254cdc1eea8b05c997f5..a376c048c99bdf7b2073f41547ad5766c2322af5 100644 --- a/en/release-notes/changelogs/v3.2-beta4/Readme-EN.md +++ b/en/release-notes/changelogs/v3.2-beta4/Readme-EN.md @@ -1,2 +1,29 @@ # Readme +- [Ability framework](changelogs-ability.md) +- [Account subsystem](changelogs-account_os_account.md) +- [ArkUI development framework](changelogs-arkui.md) +- [Multimedia subsystem - camera](changelogs-camera.md) +- [Device management subsystem](changelogs-device-manager.md) +- [USB](changelogs-device-usb.md) +- [Distributed scheduler subsystem](changelogs-dmsfwk.md) +- [DSoftBus](changelogs-dsoftbus.md) +- [Customization subsystem](changelogs-enterprise_device_management.md) +- [File management subsystem](changelogs-filemanagement.md) +- [Location subsystem](changelogs-geolocation.md) +- [Globalization subsystem](changelogs-global.md) +- [Input method framework](changelogs-inputmethod-framworks.md) +- [Multimedia subsystem](changelogs-multimedia.md) +- [Multimodal input subsystem](changelogs-multimodalinput.md) +- [Common event and notification subsystem](changelogs-notification.md) +- [Power management subsystem](changelogs-power.md) +- [Upload and download](changelogs-request.md) +- [Resource manager subsystem](changelogs-resource-manager.md) +- [Resource scheduler subsystem](changelogs-resourceschedule.md) +- [Telephony subsystem](changelogs-telephony.md) +- [Test subsystem](changelogs-testfwk_arkxtest.md) +- [Theme](changelogs-theme.md) +- [User IAM subsystem](changelogs-useriam.md) +- [Ability framework - WantAgent](changelogs-wantAgent.md) +- [Web subsystem](changelogs-web.md) +- [Communication subsystem - WiFi](changelogs-wifi.md) diff --git a/en/release-notes/changelogs/v3.2-beta4/Readme.md b/en/release-notes/changelogs/v3.2-beta4/Readme.md deleted file mode 100644 index c4cbaa0b55900265b5e82e7cdb60e90936489ed1..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/v3.2-beta4/Readme.md +++ /dev/null @@ -1,8 +0,0 @@ -# Readme - -- [Account](changelogs-account_os_account.md) -- [Distributed Scheduler](changelogs-dmsfwk.md) -- [DSoftBus](changelogs-dsoftbus.md) -- [File Management](changelogs-filemanagement.md) -- [User IAM](changelogs-useriam.md) -- [Wi-Fi](changelogs-wifi.md) diff --git a/en/release-notes/changelogs/v3.2-beta4/changelog-x-x.md b/en/release-notes/changelogs/v3.2-beta4/changelog-x-x.md new file mode 100644 index 0000000000000000000000000000000000000000..dcc7cd9aabb636ed248b5a37383410d4218b346f --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelog-x-x.md @@ -0,0 +1,28 @@ +# *Example* Subsystem Changelog + +Changes that affect contract compatibility of the last version should be described in the changelog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions. + +## cl.subsystemname.x xxx Function Change (Example: DeviceType Attribute Change or Camera Permission Change. Use a short description.) + +Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of changelog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order). +Describe the changes in terms of functions. Example: *n* and *m* of the *a* function are changed. Developers need to adapt their applications based on the change description. +If there is a requirement or design document corresponding to the change, attach the requirement number or design document number in the description. + +**Change Impact** + +Describe whether released APIs (JS or native APIs) are affected or API behavior is changed. +Describe whether available applications are affected, that is, whether an adaptation is required for building the application code in the SDK environment of the new version. + +**Key API/Component Changes** + +List the API/component changes involved in the function change. + +**Adaptation Guide** + +Provide guidance for developers on how to adapt their application to the changes to be compatible with the new version. +Example: +Change parameter *n* to *m* in the *a* file. + +``` +sample code +``` diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-ability.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-ability.md new file mode 100644 index 0000000000000000000000000000000000000000..111e725be013af24299c340cd541d385000f182c --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-ability.md @@ -0,0 +1,375 @@ +# Ability Framework Changelog + +## cl.ability.1 Application Component Startup Rule Change + +The rules for starting application components are changed in the following scenarios: + + - Start an application component when the application is in the background. + - Start an invisible application component across applications. + - Start a ServiceAbility and DataAbility of the FA model across applications. + - Use the **startAbilityByCall** API. + +You need to adapt your application. + + +**Change Impact** + +If new rules are not adapted, application components cannot be started in the previous scenarios. +> **NOTE** +> +> Starting application components refers to any behavior starting or connecting to an ability. +> +> 1. Start an ability using APIs such as **startAbility**, **startServiceExtensionAbility**, and **startAbilityByCall**. +> 2. Connect to an ability using APIs such as **connectAbility**, **connectServiceExtensionAbility**, **acquireDataAbilityHelper**, and **createDataShareHelper**. + +**Key API/Component Changes** + + - Involved application components + - Stage model + - Ability + - ServiceExtension + - DataShareExtension + - FA model + - PageAbility + - ServiceAbility + - DataAbility + - Involved APIs + - Stage model + - startAbility(want: Want, callback: AsyncCallback): void; + - startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; + - startAbility(want: Want, options?: StartOptions): Promise; + - startAbilityByCall(want: Want): Promise; + - startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + - startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + - startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; + - startAbilityForResult(want: Want, callback: AsyncCallback): void; + - startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; + - startAbilityForResult(want: Want, options?: StartOptions): Promise; + - startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + - startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + - startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; + - startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + - startServiceExtensionAbility(want: Want): Promise; + - startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + - startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; + - stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + - stopServiceExtensionAbility(want: Want): Promise; + - stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + - stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; + - connectAbility(want: Want, options: ConnectOptions): number; + - connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; + - createDataShareHelper(context: Context, uri: string, callback: AsyncCallback): void + - FA model + - startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; + - startAbility(parameter: StartAbilityParameter): Promise; + - startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback): void; + - startAbilityForResult(parameter: StartAbilityParameter): Promise; + - acquireDataAbilityHelper(uri: string): DataAbilityHelper; + - connectAbility(request: Want, options:ConnectOptions ): number; + +**Adaptation Guide** + +Startup rules for different scenarios are as follows: + - **Starting an application component when the application is in the background** + - Rule in OpenHarmony 3.2 Beta3: + + - There is no restriction. + - Rule in OpenHarmony 3.2 Beta4: + - Authentication is required. The following permissions must be configured: + - ```json + { + "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false + } + ``` + > **NOTE** + > + > 1. Starting an application component of the same application is also restricted by this rule. + > 2. For SDKs of API version 8 or earlier, starting a ServiceAbility and DataAbility is not restricted by this rule. + + - **Starting an invisible application component across applications** + + - Rule in OpenHarmony 3.2 Beta3: + + - For applications whose APL is normal, invisible application components cannot be started across applications. + - Rule in OpenHarmony 3.2 Beta4: + - For all applications, starting an invisible application component across applications requires authentication. The following permissions must be configured: + - ```json + { + "name": "ohos.permission.START_INVISIBLE_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_core", + "provisionEnable": true, + "distributedSceneEnable": false + } + ``` + + - **Starting a ServiceAbility and DataAbility of the FA model across applications** + + - Rule in OpenHarmony 3.2 Beta3: + - There is no restriction. + - Rule in OpenHarmony 3.2 Beta4: + - Associated startup must be configured for the provider of the ServiceAbility and DataAbility. Otherwise, they cannot be started across applications. (Associated startup cannot be configured for common applications.) + + + - **Using the startAbilityByCall API** + - Rule in OpenHarmony 3.2 Beta3: + + - This is no restriction. + - Rule in OpenHarmony 3.2 Beta4: + + - The **startAbilityByCall** API cannot be called by the same application. + - Calling the **startAbilityByCall** API across applications requires authentication. The following permissions must be configured: + + - ```json + { + "name": "ohos.permission.ABILITY_BACKGROUND_COMMUNICATION", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false + } + ``` + > **NOTE** + > + > Using the **startAbilityByCall** API is also restricted by the background startup and across-application invisible component startup rules. + +## cl.ability.2 Cross-Device Application Component Startup Rule Change (for System Applications Only) + +The rules for starting cross-device application components are changed in the following scenarios: + + - Start an application component when the application is in the background. + - Start an invisible application component across applications. + - Start a ServiceAbility of the FA model across applications. + +You need to adapt your application. + + +**Change Impact** + +If new rules are not adapted, application components cannot be started in the previous scenarios. +> **NOTE** +> +> Starting application components refers to any behavior starting or connecting to an ability. +> +> 1. Start an ability using APIs such as **startAbility**, **startAbilityForResult**, and **startAbilityByCall**. +> 2. Connect to an ability using APIs such as **connectAbility**. + +**Key API/Component Changes** + + - Involved application components + - Stage model + - Ability + - ServiceExtension + - FA model + - PageAbility + - ServiceAbility + - Involved APIs + - Stage model + - startAbility(want: Want, callback: AsyncCallback): void; + - startAbilityByCall(want: Want): Promise; + - startAbilityForResult(want: Want, callback: AsyncCallback): void; + - connectAbility(want: Want, options: ConnectOptions): number; + - FA model + - startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; + - startAbility(parameter: StartAbilityParameter): Promise; + - startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback): void; + - startAbilityForResult(parameter: StartAbilityParameter): Promise; + - connectAbility(request: Want, options:ConnectOptions ): number; + +**Adaptation Guide** + +Startup rules for different scenarios are as follows: + - **Starting an application component when the application is in the background** + - Rule in OpenHarmony 3.2 Beta3: + + - There is no restriction. + - Rule in OpenHarmony 3.2 Beta4: + - Authentication is required. The following permissions must be configured: + - ```json + { + "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false + } + ``` + > **NOTE** + 1. Starting an application component of the same application is also restricted by this rule. + 2. For SDKs of API version 8 or earlier, starting a ServiceAbility is not restricted by this rule. + + - **Starting an invisible application component across applications** + + - Rule in OpenHarmony 3.2 Beta3: + + - Invisible application components cannot be started across applications. + - Rule in OpenHarmony 3.2 Beta4: + - Authentication is required. The following permissions must be configured: + - ```json + { + "name": "ohos.permission.START_INVISIBLE_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_core", + "provisionEnable": true, + "distributedSceneEnable": false + } + ``` + + - **Starting a ServiceAbility of the FA model across applications** + + - Rule in OpenHarmony 3.2 Beta3: + + - There is no restriction. + - Rule in OpenHarmony 3.2 Beta4: + - Associated startup needs to be configured for the provider of the ServiceAbility. Otherwise, the ServiceAbility cannot be started across applications. (Associated startup cannot be configured for common applications.) + - Configure associated startup as follows: + - ```json + { + "bundleName": "", + "app_signature": ["xxxxxxxxxxxxxxxxxxx"], + "associatedWakeUp": true + } + ``` + +## cl.ability.3 API Exception Handling Method Change + +Certain APIs of the ability subsystem use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. + +**Change Impact** + +The application developed based on earlier versions needs to be adapted. Otherwise, the service logic will be affected. + +**Key API/Component Changes** + +For adaptation to the unified API exception handling mode, certain ability subsystem APIs are deprecated (original APIs in the following table) and corresponding new APIs in the following table are added. (In the following table, original APIs in API version 9 will be deleted, and APIs in API version 8 and earlier will be deprecated.) The newly added APIs support unified error code handling specifications and function the same as the original APIs. + +| Original API | New API | +| ----------------------------------------------- | ----------------------------------------------- | +| @ohos.ability.wantConstant.d.ts | @ohos.app.ability.wantConstant.d.ts | +| @ohos.application.Ability.d.ts | @ohos.app.ability.UIAbility.d.ts | +| @ohos.application.AbilityConstant.d.ts | @ohos.app.ability.AbilityConstant.d.ts | +| @ohos.application.abilityDelegatorRegistry.d.ts | @ohos.app.ability.abilityDelegatorRegistry.d.ts | +| @ohos.application.AbilityLifecycleCallback.d.ts | @ohos.app.ability.AbilityLifecycleCallback.d.ts | +| @ohos.application.abilityManager.d.ts | @ohos.app.ability.abilityManager.d.ts | +| @ohos.application.AbilityStage.d.ts | @ohos.app.ability.AbilityStage.d.ts | +| @ohos.application.appManager.d.ts | @ohos.app.ability.appManager.d.ts | +| @ohos.application.Configuration.d.ts | @ohos.app.ability.Configuration.d.ts | +| @ohos.application.ConfigurationConstant.d.ts | @ohos.app.ability.ConfigurationConstant.d.ts | +| @ohos.application.context.d.ts | @ohos.app.ability.common.d.ts | +| @ohos.application.EnvironmentCallback.d.ts | @ohos.app.ability.EnvironmentCallback.d.ts | +| @ohos.application.errorManager.d.ts | @ohos.app.ability.errorManager.d.ts | +| @ohos.application.ExtensionAbility.d.ts | @ohos.app.ability.ExtensionAbility.d.ts | +| @ohos.application.formBindingData.d.ts | @ohos.app.form.formBindingData.d.ts | +| @ohos.application.FormExtension.d.ts | @ohos.app.form.FormExtensionAbility.d.ts | +| @ohos.application.formHost.d.ts | @ohos.app.form.formHost.d.ts | +| @ohos.application.formInfo.d.ts | @ohos.app.form.formInfo.d.ts | +| @ohos.application.formProvider.d.ts | @ohos.app.form.formProvider.d.ts | +| @ohos.application.missionManager.d.ts | @ohos.app.ability.missionManager.d.ts | +| @ohos.application.quickFixManager.d.ts | @ohos.app.ability.quickFixManager.d.ts | +| @ohos.application.ServiceExtensionAbility.d.ts | @ohos.app.ability.ServiceExtensionAbility.d.ts | +| @ohos.application.StartOptions.d.ts | @ohos.app.ability.StartOptions.d.ts | +| @ohos.application.Want.d.ts | @ohos.app.ability.Want.d.ts | +| @ohos.wantAgent.d.ts | @ohos.app.ability.wantAgent.d.ts | + +**Adaptation Guide** + +The original APIs are only moved to the new namespace. Therefore, you can modify **import** to solve the adaptation problem. + +If the original API uses **@ohos.application.missionManager**: + +```js +import missionManager from '@ohos.application.missionManager'; +``` + +You can directly modify **import** to switch to the new namespace: + +```js +import missionManager from '@ohos.app.ability.missionManager'; +``` + +In addition, exception handling is needed. For details, see the API reference for the new APIs. + +## cl.ability.4 API Change + +The names of certain ability subsystem APIs are changed. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enum/Constant | Change Type| +| ----------------------------------------- | ----------------------- | ------------------------------------------------------------ | -------- | +| @ohos.application.Ability | Caller | onRelease(callback: OnReleaseCallBack): **void**; | Deprecated | +| @ohos.app.ability.UIAbility | Caller | on(**type**: "release", callback: OnReleaseCallBack): **void**; | Added | +| @ohos.application.Ability | Ability | dump(params: Array<**string**>): Array<**string**>; | Deprecated | +| @ohos.app.ability.UIAbility | UIAbility | onDump(params: Array<**string**>): Array<**string**>; | Added | +| @ohos.application.appManager | appManager | **function** registerApplicationStateObserver(observer: ApplicationStateObserver): **number**; | Deprecated | +| @ohos.application.appManager | appManager | **function** registerApplicationStateObserver(observer: ApplicationStateObserver, bundleNameList: Array<**string**>): **number**; | Deprecated | +| @ohos.application.appManager | appManager | **function** unregisterApplicationStateObserver(observerId: **number**, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.application.appManager | appManager | **function** unregisterApplicationStateObserver(observerId: **number**): Promise<**void**>; | Deprecated | +| @ohos.app.ability.appManager | appManager | **function** on(**type**: "applicationState", observer: ApplicationStateObserver): **number**; | Added | +| @ohos.app.ability.appManager | appManager | **function** on(**type**: "applicationState", observer: ApplicationStateObserver, bundleNameList: Array<**string**>): **number**; | Added | +| @ohos.app.ability.appManager | appManager | **function** off(**type**: "applicationState", observerId: **number**, callback: AsyncCallback<**void**>): **void**; | Added | +| @ohos.app.ability.appManager | appManager | **function** off(**type**: "applicationState", observerId: **number**): Promise<**void**>; | Added | +| @ohos.application.errorManager | errorManager | **function** registerErrorObserver(observer: ErrorObserver): **number**; | Deprecated | +| @ohos.application.errorManager | errorManager | **function** unregisterErrorObserver(observerId: **number**, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.application.errorManager | errorManager | **function** unregisterErrorObserver(observerId: **number**): Promise<**void**>; | Deprecated | +| @ohos.app.ability.errorManager | errorManager | **function** on(**type**: "error", observer: ErrorObserver): **number**; | Added | +| @ohos.app.ability.errorManager | errorManager | **function** off(**type**: "error", observerId: **number**, callback: AsyncCallback<**void**>): **void**; | Added | +| @ohos.app.ability.errorManager | errorManager | **function** off(**type**: "error", observerId: **number**): Promise<**void**>; | Added | +| @ohos.application.missionManager | missionManager | **function** registerMissionListener(listener: MissionListener): **number**; | Deprecated | +| @ohos.application.missionManager | missionManager | **function** unregisterMissionListener(listenerId: **number**, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.application.missionManager | missionManager | **function** unregisterMissionListener(listenerId: **number**): Promise<**void**>; | Deprecated | +| @ohos.app.ability.missionManager | missionManager | **function** on(**type**: "mission", listener: MissionListener): **number**; | Added | +| @ohos.app.ability.missionManager | missionManager | **function** off(**type**: "mission", listenerId: **number**, callback: AsyncCallback<**void**>): **void**; | Added | +| @ohos.app.ability.missionManager | missionManager | **function** off(**type**: "mission", listenerId: **number**): Promise<**void**>; | Added | +| @ohos.application.FormExtension | FormExtension | onCreate(want: Want): formBindingData.FormBindingData; | Deprecated | +| @ohos.application.FormExtension | FormExtension | onCastToNormal(formId: **string**): **void**; | Deprecated | +| @ohos.application.FormExtension | FormExtension | onUpdate(formId: **string**): **void**; | Deprecated | +| @ohos.application.FormExtension | FormExtension | onVisibilityChange(newStatus: { [key: **string**]: **number** }): **void**; | Deprecated | +| @ohos.application.FormExtension | FormExtension | onEvent(formId: **string**, message: **string**): **void**; | Deprecated | +| @ohos.application.FormExtension | FormExtension | onDestroy(formId: **string**): **void**; | Deprecated | +| @ohos.application.FormExtension | FormExtension | onShare?(formId: **string**): {[key: **string**]: **any**}; | Deprecated | +| @ohos.app.form.FormExtensionAbility | FormExtensionAbility | onAddForm(want: Want): formBindingData.FormBindingData; | Added | +| @ohos.app.form.FormExtensionAbility | FormExtensionAbility | onCastToNormalForm(formId: **string**): **void**; | Added | +| @ohos.app.form.FormExtensionAbility | FormExtensionAbility | onUpdateForm(formId: **string**): **void**; | Added | +| @ohos.app.form.FormExtensionAbility | FormExtensionAbility | onChangeFormVisibility(newStatus: { [key: **string**]: **number** }): **void**; | Added | +| @ohos.app.form.FormExtensionAbility | FormExtensionAbility | onFormEvent(formId: **string**, message: **string**): **void**; | Added | +| @ohos.app.form.FormExtensionAbility | FormExtensionAbility | onRemoveForm(formId: **string**): **void**; | Added | +| @ohos.app.form.FormExtensionAbility | FormExtensionAbility | onShareForm?(formId: **string**): {[key: **string**]: **any**}; | Added | +| @ohos.application.formHost.d.ts | formHost | **function** castTempForm(formId: **string**, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.application.formHost.d.ts | formHost | **function** castTempForm(formId: **string**): Promise<**void**>; | Deprecated | +| @ohos.app.form.formHost.d.ts | formHost | **function** castToNormalForm(formId: **string**, callback: AsyncCallback<**void**>): **void**; | Added | +| @ohos.app.form.formHost.d.ts | formHost | **function** castToNormalForm(formId: **string**): Promise<**void**>; | Added | +| @ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | dump(params: Array<**string**>): Array<**string**>; | Deprecated | +| @ohos.app.ability.ServiceExtensionAbility | ServiceExtensionAbility | onDump(params: Array<**string**>): Array<**string**>; | Added | +| application/AbilityContext | AbilityContext | connectAbility(want: Want, options: ConnectOptions): **number**; | Deprecated | +| application/AbilityContext | AbilityContext | connectAbilityWithAccount(want: Want, accountId: **number**, options: ConnectOptions): **number**; | Deprecated | +| application/AbilityContext | AbilityContext | disconnectAbility(connection: **number**, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| application/AbilityContext | AbilityContext | disconnectAbility(connection: **number**): Promise<**void**>; | Deprecated | +| application/UIAbilityContext | UIAbilityContext | connectServiceExtensionAbilityWithAccount(want: Want, accountId: **number**, options: ConnectOptions): **number**; | Added | +| application/UIAbilityContext | UIAbilityContext | connectServiceExtensionAbilityWithAccount(want: Want, accountId: **number**, options: ConnectOptions): **number**; | Added | +| application/UIAbilityContext | UIAbilityContext | disconnectServiceExtensionAbility(connection: **number**, callback: AsyncCallback<**void**>): **void**; | Added | +| application/UIAbilityContext | UIAbilityContext | disconnectServiceExtensionAbility(connection: **number**): Promise<**void**>; | Added | +| application/ApplicationContext | ApplicationContext | registerAbilityLifecycleCallback(callback: AbilityLifecycleCallback): **number**; | Deprecated | +| application/ApplicationContext | ApplicationContext | unregisterAbilityLifecycleCallback(callbackId: **number**, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| application/ApplicationContext | ApplicationContext | unregisterAbilityLifecycleCallback(callbackId: **number**): Promise<**void**>; | Deprecated | +| application/ApplicationContext | ApplicationContext | registerEnvironmentCallback(callback: EnvironmentCallback): **number**; | Deprecated | +| application/ApplicationContext | ApplicationContext | unregisterEnvironmentCallback(callbackId: **number**, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| application/ApplicationContext | ApplicationContext | unregisterEnvironmentCallback(callbackId: **number**): Promise<**void**>; | Deprecated | +| application/ApplicationContext | ApplicationContext | on(**type**: "abilityLifecycle", callback: AbilityLifecycleCallback): **number**; | Added | +| application/ApplicationContext | ApplicationContext | off(**type**: "abilityLifecycle", callbackId: **number**, callback: AsyncCallback<**void**>): **void**; | Added | +| application/ApplicationContext | ApplicationContext | off(**type**: "abilityLifecycle", callbackId: **number**): Promise<**void**>; | Added | +| application/ApplicationContext | ApplicationContext | on(**type**: "environment", callback: EnvironmentCallback): **number**; | Added | +| application/ApplicationContext | ApplicationContext | off(**type**: "environment", callbackId: **number**, callback: AsyncCallback<**void**>): **void**; | Added | +| application/ApplicationContext | ApplicationContext | off(**type**: "environment", callbackId: **number**): Promise<**void**>; | Added | +| application/ServiceExtensionContext | ServiceExtensionContext | connectAbility(want: Want, options: ConnectOptions): **number**; | Deprecated | +| application/ServiceExtensionContext | ServiceExtensionContext | connectAbilityWithAccount(want: Want, accountId: **number**, options: ConnectOptions): **number**; | Deprecated | +| application/ServiceExtensionContext | ServiceExtensionContext | disconnectAbility(connection: **number**, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| application/ServiceExtensionContext | ServiceExtensionContext | disconnectAbility(connection: **number**): Promise<**void**>; | Deprecated | +| application/ServiceExtensionContext | ServiceExtensionContext | connectServiceExtensionAbility(want: Want, options: ConnectOptions): **number**; | Added | +| application/ServiceExtensionContext | ServiceExtensionContext | connectServiceExtensionAbilityWithAccount(want: Want, accountId: **number**, options: ConnectOptions): **number**; | Added | +| application/ServiceExtensionContext | ServiceExtensionContext | disconnectServiceExtensionAbility(connection: **number**, callback: AsyncCallback<**void**>): **void**; | Added | +| application/ServiceExtensionContext | ServiceExtensionContext | disconnectServiceExtensionAbility(connection: **number**): Promise<**void**>; | Added | diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-camera.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-camera.md new file mode 100644 index 0000000000000000000000000000000000000000..f7acbc22c91eed241e6ddfa34e041f87ece63130 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-camera.md @@ -0,0 +1,781 @@ +# Multimedia Subsystem Changelog + +## Camera API Changes +Some functional APIs are added and some others are deprecated to: +1. Improve the usability of camera APIs. +2. Help you quickly understand camera APIs and use them for development. +3. 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 Impact** + +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 | Change Type| +| ---------------------- | ----------------------- | ------------------------------------------------------------ | -------- | +| ohos.multimedia.camera | Profile | readonly format:CameraFormat; | Added | +| ohos.multimedia.camera | Profile | readonly size: Size; | Added | +| ohos.multimedia.camera | FrameRateRange | readonly min: number; | Added | +| ohos.multimedia.camera | FrameRateRange | readonly max: number; | Added | +| ohos.multimedia.camera | VideoProfile | readonly frameRateRange: FrameRateRange; | Added | +| ohos.multimedia.camera | CameraOutputCapability | readonly previewProfiles: Array; | Added | +| ohos.multimedia.camera | CameraOutputCapability | readonly photoProfiles: Array; | Added | +| ohos.multimedia.camera | CameraOutputCapability | readonly videoProfiles: Array; | Added | +| ohos.multimedia.camera | CameraOutputCapability | readonly supportedMetadataObjectTypes: Array; | Added | +| ohos.multimedia.camera | CameraManager | getSupportedCameras(callback: AsyncCallback>): void;
getSupportedCameras(): Promise>; | Added | +| ohos.multimedia.camera | CameraManager | getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback): void;
getSupportedOutputCapability(camera: CameraDevice): Promise; | Added | +| ohos.multimedia.camera | CameraManager | isCameraMuted(): boolean; | Added | +| ohos.multimedia.camera | CameraManager | isCameraMuteSupported(): boolean; | Added | +| ohos.multimedia.camera | CameraManager | muteCamera(mute: boolean): void; | Added | +| ohos.multimedia.camera | CameraManager | createCameraInput(camera: CameraDevice, callback: AsyncCallback): void;
createCameraInput(camera: CameraDevice): Promise; | Added | +| ohos.multimedia.camera | CameraManager | createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void;
createPreviewOutput(profile: Profile, surfaceId: string): Promise; | Added | +| ohos.multimedia.camera | CameraManager | createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void;
createPhotoOutput(profile: Profile, surfaceId: string): Promise; | Added | +| ohos.multimedia.camera | CameraManager | createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback): void;
createVideoOutput(profile: VideoProfile, surfaceId: string): Promise; | Added | +| ohos.multimedia.camera | CameraManager | createMetadataOutput(metadataObjectTypes: Array, callback: AsyncCallback): void;
createMetadataOutput(metadataObjectTypes: Array): Promise; | Added | +| ohos.multimedia.camera | CameraManager | createCaptureSession(callback: AsyncCallback): void;
createCaptureSession(): Promise; | Added | +| ohos.multimedia.camera | CameraManager | on(type: 'cameraMute', callback: AsyncCallback): void; | Added | +| ohos.multimedia.camera | CameraManager | getCameras(callback: AsyncCallback>): void;
getCameras(): Promise>; | Deprecated | +| ohos.multimedia.camera | CameraManager | createCameraInput(cameraId: string, callback: AsyncCallback): void;
createCameraInput(cameraId: string): Promise; | Deprecated | +| ohos.multimedia.camera | CameraManager | createCaptureSession(context: Context, callback: AsyncCallback): void;
createCaptureSession(context: Context): Promise; | Deprecated | +| ohos.multimedia.camera | CameraManager | createPreviewOutput(surfaceId: string, callback: AsyncCallback): void;
createPreviewOutput(surfaceId: string): Promise; | Deprecated | +| ohos.multimedia.camera | CameraManager | CreatePhotoOutput(surfaceId: string, callback: AsyncCallback): void;
CreatePhotoOutput(surfaceId: string): Promise; | Deprecated | +| ohos.multimedia.camera | CameraManager | createVideoOutput(surfaceId: string, callback: AsyncCallback): void;
createVideoOutput(surfaceId: string): Promise; | Deprecated | +| ohos.multimedia.camera | CameraManager | createMetadataOutput(callback: AsyncCallback): void;
createVideoOutput(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraStatusInfo | camera: CameraDevice; | Added | +| ohos.multimedia.camera | CameraStatusInfo | camera: Camera; | Deprecated | +| ohos.multimedia.camera | CameraDevice | interface CameraDevice | Added | +| ohos.multimedia.camera | Camera | interface Camera | Deprecated | +| ohos.multimedia.camera | CameraInput | open(callback: AsyncCallback): void;
open(): Promise; | Added | +| ohos.multimedia.camera | CameraInput | close(callback: AsyncCallback): void;
close(): Promise; | Added | +| ohos.multimedia.camera | CameraInput | on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; | Added | +| ohos.multimedia.camera | CameraInput | isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void;
isFocusModeSupported(afMode: FocusMode): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | getFocusMode(callback: AsyncCallback): void;
getFocusMode(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | setFocusMode(afMode: FocusMode, callback: AsyncCallback): void;
setFocusMode(afMode: FocusMode): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | getZoomRatioRange(callback: AsyncCallback>): void;
getZoomRatioRange(): Promise>; | Deprecated | +| ohos.multimedia.camera | CameraInput | getZoomRatio(callback: AsyncCallback): void;
getZoomRatio(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | setZoomRatio(zoomRatio: number, callback: AsyncCallback): void;
setZoomRatio(zoomRatio: number): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | getCameraId(callback: AsyncCallback): void;
getCameraId(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | getExposurePoint(callback: AsyncCallback): void;
getExposurePoint(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | setExposurePoint(exposurePoint: Point, callback: AsyncCallback): void;
setExposurePoint(exposurePoint: Point): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | hasFlash(callback: AsyncCallback): void;
hasFlash(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void;
isFlashModeSupported(flashMode: FlashMode): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | getFlashMode(callback: AsyncCallback): void;
getFlashMode(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void;
setFlashMode(flashMode: FlashMode): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback): void;
isExposureModeSupported(aeMode: ExposureMode): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | getExposureMode(callback: AsyncCallback): void;
getExposureMode(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | setExposureMode(aeMode: ExposureMode, callback: AsyncCallback): void;
setExposureMode(aeMode: ExposureMode): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | getMeteringPoint(callback: AsyncCallback): void;
getMeteringPoint(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | setMeteringPoint(point: Point, callback: AsyncCallback): void;
setMeteringPoint(point: Point): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | getExposureBiasRange(callback: AsyncCallback>): void;
getExposureBiasRange(): Promise>; | Deprecated | +| ohos.multimedia.camera | CameraInput | setExposureBias(exposureBias: number, callback: AsyncCallback): void;
setExposureBias(exposureBias: number): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | getExposureValue(callback: AsyncCallback): void;
getExposureValue(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void;
isFocusModeSupported(afMode: FocusMode): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | getFocusMode(callback: AsyncCallback): void;
getFocusMode(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | setFocusMode(afMode: FocusMode, callback: AsyncCallback): void;
setFocusMode(afMode: FocusMode): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | setFocusPoint(point: Point, callback: AsyncCallback): void;
setFocusPoint(point: Point): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | getFocusPoint(callback: AsyncCallback): void;
getFocusPoint(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | getFocalLength(callback: AsyncCallback): void;
getFocalLength(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | getZoomRatioRange(callback: AsyncCallback>): void;
getZoomRatioRange(): Promise>; | Deprecated | +| ohos.multimedia.camera | CameraInput | getZoomRatio(callback: AsyncCallback): void;
getZoomRatio(): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | setZoomRatio(zoomRatio: number, callback: AsyncCallback): void;
setZoomRatio(zoomRatio: number): Promise; | Deprecated | +| ohos.multimedia.camera | CameraInput | on(type: 'focusStateChange', callback: AsyncCallback): void; | Deprecated | +| ohos.multimedia.camera | CameraInput | on(type: 'exposureStateChange', callback: AsyncCallback): void; | Deprecated | +| ohos.multimedia.camera | CameraInput | on(type: 'error', callback: ErrorCallback): void; | Deprecated | +| ohos.multimedia.camera | CameraInputErrorCode | ERROR_NO_PERMISSION = 0 | Added | +| ohos.multimedia.camera | CameraInputErrorCode | ERROR_DEVICE_PREEMPTED = 1 | Added | +| ohos.multimedia.camera | CameraInputErrorCode | ERROR_DEVICE_DISCONNECTED = 2 | Added | +| ohos.multimedia.camera | CameraInputErrorCode | ERROR_DEVICE_IN_USE = 3 | Added | +| ohos.multimedia.camera | CameraInputErrorCode | ERROR_DRIVER_ERROR = 4 | Added | +| ohos.multimedia.camera | CameraFormat | CAMERA_FORMAT_RGBA_8888 = 3 | Added | +| ohos.multimedia.camera | ExposureMode | EXPOSURE_MODE_AUTO = 1 | Added | +| ohos.multimedia.camera | ExposureMode | EXPOSURE_MODE_CONTINUOUS_AUTO = 2 | Added | +| ohos.multimedia.camera | ExposureMode | EXPOSURE_MODE_AUTO | Deprecated | +| ohos.multimedia.camera | ExposureMode | EXPOSURE_MODE_CONTINUOUS_AUTO | Deprecated | +| ohos.multimedia.camera | VideoStabilizationMode | LOW = 1 | Added | +| ohos.multimedia.camera | VideoStabilizationMode | MIDDLE = 2 | Added | +| ohos.multimedia.camera | VideoStabilizationMode | HIGH = 3 | Added | +| ohos.multimedia.camera | VideoStabilizationMode | AUTO = 4 | Added | +| ohos.multimedia.camera | VideoStabilizationMode | LOW | Deprecated | +| ohos.multimedia.camera | VideoStabilizationMode | MIDDLE | Deprecated | +| ohos.multimedia.camera | VideoStabilizationMode | HIGH | Deprecated | +| ohos.multimedia.camera | VideoStabilizationMode | AUTO | Deprecated | +| ohos.multimedia.camera | CaptureSession | addOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void;
addOutput(cameraOutput: CameraOutput): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void;
removeOutput(cameraOutput: CameraOutput): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback): void;
isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | getActiveVideoStabilizationMode(callback: AsyncCallback): void;
getActiveVideoStabilizationMode(): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback): void;
setVideoStabilizationMode(mode: VideoStabilizationMode): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | on(type: 'focusStateChange', callback: AsyncCallback): void; | Added | +| ohos.multimedia.camera | CaptureSession | hasFlash(callback: AsyncCallback): void;
hasFlash(): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void;
isFlashModeSupported(flashMode: FlashMode): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | getFlashMode(callback: AsyncCallback): void;
getFlashMode(): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void;
setFlashMode(flashMode: FlashMode): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback): void;
isExposureModeSupported(aeMode: ExposureMode): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | getExposureMode(callback: AsyncCallback): void;
getExposureMode(): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | setExposureMode(aeMode: ExposureMode, callback: AsyncCallback): void;
setExposureMode(aeMode: ExposureMode): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | getMeteringPoint(callback: AsyncCallback): void;
getMeteringPoint(): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | setMeteringPoint(point: Point, callback: AsyncCallback): void;
setMeteringPoint(point: Point): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | getExposureBiasRange(callback: AsyncCallback>): void;
getExposureBiasRange(): Promise>; | Added | +| ohos.multimedia.camera | CaptureSession | setExposureBias(exposureBias: number, callback: AsyncCallback): void;
setExposureBias(exposureBias: number): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | getExposureValue(callback: AsyncCallback): void;
getExposureValue(): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void;
isFocusModeSupported(afMode: FocusMode): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | getFocusMode(callback: AsyncCallback): void;
getFocusMode(): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | setFocusMode(afMode: FocusMode, callback: AsyncCallback): void;
setFocusMode(afMode: FocusMode): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | setFocusPoint(point: Point, callback: AsyncCallback): void;
setFocusPoint(point: Point): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | getFocusPoint(callback: AsyncCallback): void;
getFocusPoint(): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | getFocalLength(callback: AsyncCallback): void;
getFocalLength(): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | getZoomRatioRange(callback: AsyncCallback>): void;
getZoomRatioRange(): Promise>; | Added | +| ohos.multimedia.camera | CaptureSession | getZoomRatio(callback: AsyncCallback): void;
getZoomRatio(): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | setZoomRatio(zoomRatio: number, callback: AsyncCallback): void;
setZoomRatio(zoomRatio: number): Promise; | Added | +| ohos.multimedia.camera | CaptureSession | addOutput(previewOutput: PreviewOutput, callback: AsyncCallback): void;
addOutput(previewOutput: PreviewOutput): Promise;
addOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void;
addOutput(photoOutput: PhotoOutput): Promise;
addOutput(videoOutput: VideoOutput, callback: AsyncCallback): void;
addOutput(videoOutput: VideoOutput): Promise; | Deprecated | +| ohos.multimedia.camera | CaptureSession | removeOutput(previewOutput: PreviewOutput, callback: AsyncCallback): void;
removeOutput(previewOutput: PreviewOutput): Promise;
removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void;
removeOutput(photoOutput: PhotoOutput): Promise;removeOutput(videoOutput: VideoOutput, callback: AsyncCallback): void;
removeOutput(videoOutput: VideoOutput): Promise;
removeOutput(metadataOutput: MetadataOutput, callback: AsyncCallback): void;
removeOutput(metadataOutput: MetadataOutput): Promise; | Deprecated | +| ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_INSUFFICIENT_RESOURCES = 0 | Added | +| ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_TIMEOUT = 1 | Added | +| ohos.multimedia.camera | CameraOutput | release(callback: AsyncCallback): void;
release(): Promise; | Added | +| ohos.multimedia.camera | PreviewOutput | start(callback: AsyncCallback): void;
start(): Promise; | Added | +| ohos.multimedia.camera | PreviewOutput | stop(callback: AsyncCallback): void;
stop(): Promise; | Added | +| ohos.multimedia.camera | PreviewOutput | release(callback: AsyncCallback): void;
release(): Promise; | Deprecated | +| ohos.multimedia.camera | PhotoOutput | release(callback: AsyncCallback): void;
release(): Promise; | Deprecated | +| ohos.multimedia.camera | VideoOutput | release(callback: AsyncCallback): void;
release(): Promise; | Deprecated | +| ohos.multimedia.camera | PhotoCaptureSetting | mirror?: boolean; | Added | +| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_DRIVER_ERROR = 0 | Added | +| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_INSUFFICIENT_RESOURCES = 1 | Added | +| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_TIMEOUT = 2 | Added | +| ohos.multimedia.camera | VideoOutputErrorCode | ERROR_DRIVER_ERROR = 0 | Added | +| ohos.multimedia.camera | MetadataObjectType | FACE_DETECTION = 0 | Added | +| ohos.multimedia.camera | MetadataObjectType | FACE = 0 | Deprecated | +| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback): void; | Added | +| ohos.multimedia.camera | MetadataOutput | setCapturingMetadataObjectTypes(metadataObjectTypes: Array, callback: AsyncCallback): void;
setCapturingMetadataObjectTypes(metadataObjectTypes: Array): Promise; | Deprecated | +| ohos.multimedia.camera | MetadataOutput | getSupportedMetadataObjectTypes(callback: AsyncCallback>): void;
getSupportedMetadataObjectTypes(): Promise>; | Deprecated | +| ohos.multimedia.camera | MetadataOutputErrorCode | ERROR_UNKNOWN = -1 | Added | +| ohos.multimedia.camera | MetadataOutputErrorCode | ERROR_INSUFFICIENT_RESOURCES = 0 | Added | +| ohos.multimedia.camera | MetadataOutputError | code: MetadataOutputErrorCode; | Added | + +**Adaptation Guide** + +In addition to new APIs and deprecated APIs, you need to adapt your application to changed APIs. + +In Beta4 and later versions, the following APIs are changed. + +**New APIs** + +1. **Profile** API + + Attribute 1: readonly format; type: CameraFormat + + Attribute 2: readonly size; type: Size + +2. **FrameRateRange** API + + Attribute 1: readonly min; type: number + + Attribute 2: readonly max; type: number + +3. **VideoProfile** API (inherited from **Profile**) + + Attribute: readonly frameRateRange; type: FrameRateRange + +4. **CameraOutputCapability** API + + Attribute 1: readonly previewProfiles; type: Array + + Attribute 2: readonly photoProfiles; type: Array + + Attribute 3: readonly videoProfiles; type: Array + + Attribute 4: readonly supportedMetadataObjectTypes; type: Array + +5. The following APIs are added to **CameraManager**: + + getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback): void; + + getSupportedOutputCapability(camera: CameraDevice): Promise; + + The code snippet is as follows: + + ``` + cameraManager.getSupportedCameras().then((cameras) => { + let cameraDevice = cameras[0]; + cameraManager.getSupportedOutputCapability(cameraDevice, (err, CameraOutputCapability) => { + if (err) { + console.error(`Failed to get the outputCapability. ${err.message}`); + return; + } + console.log('Callback returned with an array of supported outputCapability'); + }) + }) + ``` + + ``` + cameraManager.getSupportedCameras().then((cameras) => { + let cameraDevice = cameras[0]; + cameraManager.getSupportedOutputCapability(cameraDevice).then((cameraoutputcapability) => { + console.log('Promise returned with an array of supported outputCapability'); + }) + }) + ``` + +6. The **isCameraMuted(): boolean;** API is added to **CameraManager**. + + The code snippet is as follows: + + ``` + let ismuted = cameraManager.isCameraMuted(); + ``` + +7. The **isCameraMuteSupported(): boolean;** API is added to **CameraManager**. + + The code snippet is as follows: + + ``` + let ismutesuppotred = cameraManager.isCameraMuteSupported(); + ``` + +8. The **muteCamera(mute: boolean): void;** API is added to **CameraManager**. + + The code snippet is as follows: + + ``` + let mute = true; + cameraManager.muteCamera(mute); + ``` + +9. The **on(type: 'cameraMute', callback: AsyncCallback): void;** API is added to **CameraManager**. + + The code snippet is as follows: + + ``` + cameraManager.on('cameraMute', (err, curMuetd) => { + if (err) { + console.error(`Failed to get cameraMute callback. ${err.message}`); + return; + } + }) + ``` + +10. The **open(callback: AsyncCallback): void;** and **open(): Promise;** APIs are added to **CameraInput**. + + The code snippet is as follows: + + ``` + cameraInput.open((err) => { + if (err) { + console.error(`Failed to open the camera. ${err.message}`); + return; + } + console.log('Callback returned with camera opened.'); + }) + ``` + + ``` + cameraInput.open().then(() => { + console.log('Promise returned with camera opened.'); + }) + ``` + +11. The **close(callback: AsyncCallback): void;** and **close(): Promise;** APIs are added to **CameraInput**. + + The code snippet is as follows: + + ``` + cameraInput.close((err) => { + if (err) { + console.error(`Failed to close the cameras. ${err.message}`); + return; + } + console.log('Callback returned with camera closed.'); + }) + ``` + + ``` + cameraInput.close().then(() => { + console.log('Promise returned with camera closed.'); + }) + ``` + +12. The following enums are added to **CameraInputErrorCode**: + + Enum: ERROR_NO_PERMISSION; value: 0 + + Enum: ERROR_DEVICE_PREEMPTED; value: 1 + + Enum: ERROR_DEVICE_DISCONNECTED; value: 2 + + Enum: ERROR_DEVICE_IN_USE; value: 3 + + Enum: ERROR_DRIVER_ERROR; value: 4 + +13. The following enum is added to **CameraFormat**: + + Enum: CAMERA_FORMAT_RGBA_8888; value: 3 + +14. The **getMeteringPoint(callback: AsyncCallback): void;** and **getMeteringPoint(): Promise;** APIs are added to **CaptureSession**. + + The code snippet is as follows: + + ``` + captureSession.getMeteringPoint((err, exposurePoint) => { + if (err) { + console.log(`Failed to get the current exposure point ${err.message}`); + return ; + } + console.log(`Callback returned with current exposure point: ${exposurePoint}`); + }) + ``` + + ``` + captureSession.getMeteringPoint().then((exposurePoint) => { + console.log(`Promise returned with current exposure point : ${exposurePoint}`); + }) + ``` + +15. The **setMeteringPoint(point: Point, callback: AsyncCallback): void;** and **setMeteringPoint(point: Point): Promise;** APIs are added to **CaptureSession**. + + The code snippet is as follows: + + ``` + const Point1 = {x: 1, y: 1}; + + captureSession.setMeteringPoint(Point1,(err) => { + if (err) { + console.log(`Failed to set the exposure point ${err.message}`); + return ; + } + console.log('Callback returned with the successful execution of setMeteringPoint'); + }) + ``` + + ``` + const Point2 = {x: 2, y: 2}; + + captureSession.setMeteringPoint(Point2).then(() => { + console.log('Promise returned with the successful execution of setMeteringPoint'); + }) + ``` + +16. The following enums are added to **CaptureSessionErrorCode**: + + Enum: ERROR_INSUFFICIENT_RESOURCES; value: 0 + + Enum: ERROR_TIMEOUT; value: 1 + +17. The **CameraOutput** API is added and contains the **release(callback: AsyncCallback): void;** and **release(): Promise;** methods. + + The sample code (for **previewOutput**) is as follows: + + ``` + previewOutput.release((err) => { + if (err) { + console.error(`Failed to release the PreviewOutput instance ${err.message}`); + return; + } + console.log('Callback invoked to indicate that the PreviewOutput instance is released successfully.'); + }); + ``` + + ``` + previewOutput.release().then(() => { + console.log('Promise returned to indicate that the PreviewOutput instance is released successfully.'); + }) + ``` + +18. The **start(callback: AsyncCallback): void;** and **start(): Promise;** APIs are added to **PreviewOutput**. + + The code snippet is as follows: + + ``` + previewOutput.start((err) => { + if (err) { + console.error(`Failed to start the previewOutput. ${err.message}`); + return; + } + console.log('Callback returned with previewOutput started.'); + }) + ``` + + ``` + previewOutput.start().then(() => { + console.log('Promise returned with previewOutput started.'); + }) + ``` + +19. The **stop(callback: AsyncCallback): void;** and **stop(): Promise;** APIs are added to **PreviewOutput**. + + The code snippet is as follows: + + ``` + previewOutput.stop((err) => { + if (err) { + console.error(`Failed to stop the previewOutput. ${err.message}`); + return; + } + console.log('Callback returned with previewOutput stopped.'); + }) + ``` + + ``` + previewOutput.stop().then(() => { + console.log('Callback returned with previewOutput stopped.'); + }) + ``` + +20. **PhotoCaptureSetting** API + + Attribute 1: mirror?; type: boolean + +21. The following enums are added to **PhotoOutputErrorCode**: + + Enum: ERROR_DRIVER_ERROR; value: 0 + + Enum: ERROR_INSUFFICIENT_RESOURCES; value: 1 + + Enum: ERROR_TIMEOUT; value: 2 + +22. The following enum is added to **VideoOutputErrorCode**: + + Enum: ERROR_DRIVER_ERROR; value: 0 + +23. The **on(type: 'error', callback: ErrorCallback): void;** API is added to **MetadataOutput**. + + The code snippet is as follows: + + ``` + metadataOutput.on('error', (metadataOutputError) => { + console.log(`Metadata output error code: ${metadataOutputError.code}`); + }) + ``` + +24. The following enums are added to **MetadataOutputErrorCode**. + + Enum: ERROR_UNKNOWN; value: -1 + + Enum: ERROR_INSUFFICIENT_RESOURCES; value: 0 + +25. **MetadataOutputError** API + + Attribute: code; value: MetadataOutputErrorCode + +**Deprecated APIs** + +1. The **on(type: 'exposureStateChange', callback: AsyncCallback): void;** API in **CameraInput** is deprecated. + +2. The **release(callback: AsyncCallback): void;** and **release(): Promise;** APIs in **previewOutput** are deprecated. + +3. The following APIs in **metadataOutput** are deprecated: + + setCapturingMetadataObjectTypes(metadataObjectTypes: Array, callback: AsyncCallback): void;
setCapturingMetadataObjectTypes(metadataObjectTypes: Array): Promise; + +4. The following APIs in **metadataOutput** are deprecated: + + getSupportedMetadataObjectTypes(callback: AsyncCallback>): void;
getSupportedMetadataObjectTypes(): Promise>; + +5. The **release(callback: AsyncCallback): void;** and **release(): Promise;** APIs in **PreviewOutput** are deprecated. + +6. The **release(callback: AsyncCallback): void;** and **release(): Promise;** APIs in **PhotoOutput** are deprecated. + +7. The **release(callback: AsyncCallback): void;** and **release(): Promise;** APIs in **VideoOutput** are deprecated. + +8. The **getCameraId(callback: AsyncCallback): void;** and **getCameraId(): Promise;** APIs in **CameraInput** are deprecated. + +9. The **getExposurePoint(callback: AsyncCallback): void;** and **getExposurePoint(): Promise;** APIs in **CameraInput** are deprecated. + +10. The **setExposurePoint(exposurePoint: Point, callback: AsyncCallback): void;** and **setExposurePoint(exposurePoint: Point): Promise;** APIs in **CameraInput** are deprecated. + +**Changed APIs** + +1. In **CameraManager**, the return value of **getCameras** is changed from **Array** to **Array**, and the API name is changed from **getCameras** to **getSupportedCameras**. Therefore, the **getCameras(callback: AsyncCallback>): void;** and **getCameras(): Promise>;** APIs are changed to **getSupportedCameras(callback: AsyncCallback>): void** and **getSupportedCameras(): Promise>;**. + + The code snippet is as follows: + + ``` + cameraManager.getSupportedCameras((err, cameras) => { + if (err) { + console.error(`Failed to get the cameras. ${err.message}`); + return; + } + console.log(`Callback returned with an array of supported cameras: ${cameras.length}`); + }) + ``` + + ``` + cameraManager.getSupportedCameras().then((cameras) => { + console.log(`Promise returned with an array of supported cameras: ${cameras.length}`); + }) + ``` + +2. In **CameraManager**, the input parameter of **createCameraInput** is changed from **cameraId: string** to **camera: CameraDevice**. Therefore, the **createCameraInput(cameraId: string, callback: AsyncCallback): void;** and **createCameraInput(cameraId: string): Promise;** APIs are changed to **createCameraInput(camera: CameraDevice, callback: AsyncCallback): void;** and **createCameraInput(camera: CameraDevice): Promise;**. + + The code snippet is as follows: + + ``` + let cameraDevice = cameras[0]; + cameraManager.createCameraInput(cameraDevice, (err, cameraInput) => { + if (err) { + console.error(`Failed to create the CameraInput instance. ${err.message}`); + return; + } + console.log('Callback returned with the CameraInput instance.'); + }) + ``` + + ``` + let cameraDevice = cameras[0]; + cameraManager.createCameraInput(cameraDevice).then((cameraInput) => { + console.log('Promise returned with the CameraInput instance'); + }) + ``` + +3. In **CameraManager**, the input parameter **profile: Profile** is added to **createPreviewOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **createPreviewOutput(surfaceId: string, callback: AsyncCallback): void;** and **createPreviewOutput(surfaceId: string): Promise;** APIs are changed to **createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void;** and **createPreviewOutput(profile: Profile, surfaceId: string): Promise;**. + + The code snippet is as follows: + + ``` + let profile = cameraoutputcapability.previewProfiles[0]; + cameraManager.createPreviewOutput(profile, surfaceId, (err, previewOutput) => { + if (err) { + console.error(`Failed to gcreate previewOutput. ${err.message}`); + return; + } + console.log('Callback returned with previewOutput created.'); + }) + ``` + + ``` + let profile = cameraoutputcapability.previewProfiles[0]; + cameraManager.createPreviewOutput(profile, surfaceId).then((previewOutput) => { + console.log('Promise returned with previewOutput created.'); + }) + ``` + +4. In **CameraManager**, the input parameter **profile: Profile** is added to **createPhotoOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **CreatePhotoOutput(surfaceId: string, callback: AsyncCallback): void;** and **CreatePhotoOutput(surfaceId: string): Promise;** APIs are changed to **createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void;** and **createPhotoOutput(profile: Profile, surfaceId: string): Promise;**. + + The code snippet is as follows: + + ``` + let profile = cameraoutputcapability.photoProfiles[0]; + cameraManager.createPhotoOutput(profile, surfaceId, (err, photoOutput) => { + if (err) { + console.error(`Failed to create photoOutput. ${err.message}`); + return; + } + console.log('Callback returned with photoOutput created.'); + }) + ``` + + ``` + let profile = cameraoutputcapability.photoProfiles[0]; + cameraManager.createPhotoOutput(profile, surfaceId).then((photoOutput) => { + console.log('Promise returned with photoOutput created.'); + }) + ``` + +5. In **CameraManager**, the input parameter **profile: Profile** is added to **createVideoOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **createVideoOutput(surfaceId: string, callback: AsyncCallback): void;** and **createVideoOutput(surfaceId: string): Promise;** APIs are changed to **createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback): void;** and **createVideoOutput(profile: VideoProfile, surfaceId: string): Promise;**. + + The code snippet is as follows: + + ``` + let profile = cameraoutputcapability.videoProfiles[0]; + cameraManager.createVideoOutput(profile, surfaceId, (err, videoOutput) => { + if (err) { + console.error(`Failed to create videoOutput. ${err.message}`); + return; + } + console.log('Callback returned with an array of supported outputCapability' ); + }) + ``` + + ``` + let profile = cameraoutputcapability.videoProfiles[0]; + cameraManager.createVideoOutput(profile, surfaceId).then((videoOutput) => { + console.log('Promise returned with videoOutput created.'); + }) + ``` + +6. In **CameraManager**, the input parameter **metadataObjectTypes: Array** is added to **createMetadataOutput**, and the **metadataObjectTypes** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **function createMetadataOutput(callback: AsyncCallback): void;** and **function createMetadataOutput(): Promise;** APIs are changed to **createMetadataOutput(metadataObjectTypes: Array, callback: AsyncCallback): void;** and **createMetadataOutput(metadataObjectTypes: Array): Promise;**. + + The code snippet is as follows: + + ``` + let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes; + cameraManager.createMetadataOutput(metadataObjectTypes, (err, metadataOutput) => { + if (err) { + console.error(`Failed to create metadataOutput. ${err.message}`); + return; + } + console.log('Callback returned with metadataOutput created.'); + }) + ``` + + ``` + let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes; + cameraManager.createMetadataOutput(metadataObjectTypes).then((metadataOutput) => { + console.log('Promise returned with metadataOutput created.'); + }) + ``` + +7. In **CameraManager**, **createCaptureSession** does not need to consider the context attribute. Therefore, the **createCaptureSession(context: Context, callback: AsyncCallback): void;** and **createCaptureSession(context: Context): Promise;** APIs are changed to **createCaptureSession(callback: AsyncCallback): void;** and **createCaptureSession(): Promise;**. + + The code snippet is as follows: + + ```typescript + cameraManager.createCaptureSession((err, captureSession) => { + if (err) { + console.error(`Failed to create captureSession. ${err.message}`); + return; + } + console.log('Callback returned with captureSession created.'); + }) + ``` + + ``` + cameraManager.createCaptureSession().then((captureSession) => { + console.log('Promise returned with captureSession created.'); + }) + ``` + +8. The type of the **camera** attribute of the **CameraStatusInfo** API is changed from **Camera** to **CameraDevice**. + +9. In **CameraInput**, the input parameter **camera: CameraDevice** is added to the **on(type: 'error')** API. Therefore, the **on(type: 'error', callback: ErrorCallback): void;** API is changed to **on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void;**. + + The code snippet is as follows: + + ``` + let cameraDevice = cameras[0]; + cameraInput.on('error', cameraDevice, (cameraInputError) => { + console.log(`Camera input error code: ${cameraInputError.code}`); + }) + ``` + +10. The following APIs are moved from **CameraInput** to **CaptureSession**: + + hasFlash(callback: AsyncCallback): void;
hasFlash(): Promise;
+ + isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void;
isFlashModeSupported(flashMode: FlashMode): Promise;
+ + getFlashMode(callback: AsyncCallback): void;
getFlashMode(): Promise;
+ + setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void;
setFlashMode(flashMode: FlashMode): Promise;
+ + isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback): void;
isExposureModeSupported(aeMode: ExposureMode): Promise;
+ + getExposureMode(callback: AsyncCallback): void;
getExposureMode(): Promise;
+ + setExposureMode(aeMode: ExposureMode, callback: AsyncCallback): void;
setExposureMode(aeMode: ExposureMode): Promise;
+ + getMeteringPoint(callback: AsyncCallback): void;
getMeteringPoint(): Promise;
+ + setMeteringPoint(point: Point, callback: AsyncCallback): void;
setMeteringPoint(point: Point): Promise;
+ + getExposureBiasRange(callback: AsyncCallback>): void;
getExposureBiasRange(): Promise>;
+ + setExposureBias(exposureBias: number, callback: AsyncCallback): void;
setExposureBias(exposureBias: number): Promise;
+ + getExposureValue(callback: AsyncCallback): void;
getExposureValue(): Promise;
+ + isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void;
isFocusModeSupported(afMode: FocusMode): Promise;
+ + getFocusMode(callback: AsyncCallback): void;
getFocusMode(): Promise;
+ + setFocusMode(afMode: FocusMode, callback: AsyncCallback): void;
setFocusMode(afMode: FocusMode): Promise;
+ + setFocusPoint(point: Point, callback: AsyncCallback): void;
setFocusPoint(point: Point): Promise;
+ + getFocusPoint(callback: AsyncCallback): void;
getFocusPoint(): Promise;
+ + getFocalLength(callback: AsyncCallback): void;
getFocalLength(): Promise;
+ + getZoomRatioRange(callback: AsyncCallback>): void;
getZoomRatioRange(): Promise>;
+ + getZoomRatio(callback: AsyncCallback): void;
getZoomRatio(): Promise;
+ + setZoomRatio(zoomRatio: number, callback: AsyncCallback): void;
setZoomRatio(zoomRatio: number): Promise; + +11. The **on(type: 'focusStateChange', callback: AsyncCallback): void;** API is moved from **CameraInput** to **CaptureSession**. + + The code snippet is as follows: + + ``` + captureSession.on('focusStateChange', (focusState) => { + console.log(`Focus state : ${focusState}`); + }) + ``` + +12. The following enums are added to **ExposureMode**: + + Enum: EXPOSURE_MODE_AUTO; initial value: changed from the default value to **1** + + Enum: EXPOSURE_MODE_CONTINUOUS_AUTO; initial value: changed from the default value to **2** + +13. The following enums are added to **VideoStabilizationMode**: + + Enum: LOW; initial value: changed from the default value to **1** + + Enum: MIDDLE; initial value: changed from the default value to **2** + + Enum: HIGH; initial value: changed from the default value to **3** + + Enum: AUTO; initial value: changed from the default value to **4** + +14. In **CaptureSession**, the parameter of the **addOutput** API is changed from the original child class type (**PreviewOutput**, **PhotoOutput**, **VideoOutput**, and **MetadataOutput**) to the base class type (**CameraOutput**). After the change, the number of APIs is reduced from 8 to 2. + + APIs before change: + + addOutput(previewOutput: PreviewOutput, callback: AsyncCallback): void;
addOutput(previewOutput: PreviewOutput): Promise;
addOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void;
addOutput(photoOutput: PhotoOutput): Promise;
addOutput(videoOutput: VideoOutput, callback: AsyncCallback): void;
addOutput(videoOutput: VideoOutput): Promise;
addOutput(metadataOutput: MetadataOutput, callback: AsyncCallback): void;
addOutput(metadataOutput: MetadataOutput): Promise; + + APIs after change: + + addOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void;
addOutput(cameraOutput: CameraOutput): Promise; + + The sample code (for **previewOutput**) is as follows: + + ``` + captureSession.addOutput(previewOutput, (err) => { + if (err) { + console.error(`Failed to add output. ${err.message}`); + return; + } + console.log('Callback returned with output added.'); + }) + ``` + + ``` + captureSession.addOutput(previewOutput).then(() => { + console.log('Promise returned with cameraOutput added.'); + }) + ``` + +15. In **CaptureSession**, the parameter of the **removeOutput** API is changed from the original child class type (**PreviewOutput**, **PhotoOutput**, **VideoOutput**, and **MetadataOutput**) to the base class type (**CameraOutput**). After the change, the number of APIs is reduced from 8 to 2. + + APIs before change: + + removeOutput(previewOutput: PreviewOutput, callback: AsyncCallback): void;
removeOutput(previewOutput: PreviewOutput): Promise;
removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void;
removeOutput(photoOutput: PhotoOutput): Promise;
removeOutput(videoOutput: VideoOutput, callback: AsyncCallback): void;
removeOutput(videoOutput: VideoOutput): Promise;
removeOutput(metadataOutput: MetadataOutput, callback: AsyncCallback): void;
removeOutput(metadataOutput: MetadataOutput): Promise; + + APIs after change: + + removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void;
removeOutput(cameraOutput: CameraOutput): Promise; + + The sample code (for **previewOutput**) is as follows: + + ``` + captureSession.removeOutput(previewOutput, (err) => { + if (err) { + console.error(`Failed to remove the CameraOutput instance. ${err.message}`); + return; + } + console.log('Callback invoked to indicate that the CameraOutput instance is removed.'); + }); + ``` + + ``` + captureSession.removeOutput(previewOutput).then(() => { + console.log('Promise returned to indicate that the CameraOutput instance is removed.'); + }) + ``` + +16. The following enum in **MetadataObjectType** is changed: + + The enum value name is changed from **FACE** to **FACE_DETECTION**. + +17. The name of the **Camera** API is changed to **CameraDevice**. diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-multimedia.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-multimedia.md new file mode 100644 index 0000000000000000000000000000000000000000..aa585ed0e8922116000a5aa0cf766e1e04a6dcb1 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-multimedia.md @@ -0,0 +1,262 @@ +# Multimedia Subsystem Changelog + +## cl.multimedia.audio.001 Call Mode Change of getRoutingManager() + +**getRoutingManager()** is changed from asynchronous to synchronous. + +**Change Impact** + +If the new mode is not used, an error will be reported during compilation. + +**Key API/Component Changes** + +Before change: +```js +getRoutingManager(callback: AsyncCallback): void; +getRoutingManager(): Promise; +``` +After change: +```js +getRoutingManager(): AudioRoutingManager; +``` + + +## cl.multimedia.audio.002 Call Mode Change of getStreamManager() + +**getStreamManager()** is changed from asynchronous to synchronous. + +**Change Impact** + +If the new mode is not used, an error will be reported during compilation. + +**Key API/Component Changes** + +Before change: +```js +getStreamManager(callback: AsyncCallback): void; +getStreamManager(): Promise; +``` +After change: +```js +getStreamManager(): AudioStreamManager; +``` + + +## cl.multimedia.audio.003 Registration Mode Change of micStateChange + +In the original **AudioRoutingManager**, the registration mode of the **micStateChange** listener of the **on()** function is changed. + +**Change Impact** + +If the new mode is not used, an error will be reported during compilation. + +**Key API/Component Changes** + +Before change: + +```js +interface AudioRoutingManager { + on(type: 'micStateChange', callback: Callback): void; +} +``` +After change: +```js +interface AudioVolumeGroupManager { + on(type: 'micStateChange', callback: Callback): void; +} +``` + + +## cl.multimedia.audio.004 Call Mode Change of getVolumeGroups() + +The call mode of **getVolumeGroups()** is changed. + +**Change Impact** + +If the new mode is not used, an error will be reported during compilation. + +**Key API/Component Changes** + +Before change: +```js +getVolumeGroups(networkId: string, callback:AsyncCallback): void; +getVolumeGroups(networkId: string): Promise; +``` +After change: +```js +getVolumeManager(): AudioVolumeManager; +interface AudioVolumeManager{ + getVolumeGroupInfos(networkId: string, callback: AsyncCallback): void; + getVolumeGroupInfos(networkId: string): Promise; +} +``` + + +## cl.multimedia.audio.005 Call Mode Change of getGroupManager() + +The call mode of **getGroupManager()** is changed. + +**Change Impact** + +If the new mode is not used, an error will be reported during compilation. + +**Key API/Component Changes** + +Before change: +```js +getGroupManager(groupId: number, callback: AsyncCallback): void; +getGroupManager(groupId: number): Promise; +``` +After change: +```js +getVolumeManager(): AudioVolumeManager; +interface AudioVolumeManager{ + getVolumeGroupManager(groupId: number, callback: AsyncCallback): void; + getVolumeGroupManager(groupId: number): Promise; +} +``` + + +## cl.multimedia.audio.006 FocusType Member Name Change + +**FOCUS_TYPE_RECORDING** of **FocusType** is renamed as **FOCUS_TYPE_DEFAULT**. + +**Change Impact** + +If the new mode is not used, an error will be reported during compilation. + +**Key API/Component Changes** + +Before change: +```js +enum FocusType { + FOCUS_TYPE_RECORDING = 0, +} +``` +After change: +```js +enum InterruptRequestType { + INTERRUPT_REQUEST_TYPE_DEFAULT = 0, +} +``` + + +## cl.multimedia.audio.007 Listener Registration Name Change of interrupt + +The listener registration name of **interrupt** of the **on()** function in **AudioRenderer** is changed. + +**Change Impact** + +If the new mode is not used, an error will be reported during compilation. + +**Key API/Component Changes** + +Before change: +```js +interface AudioRenderer { + on(type: 'interrupt', callback: Callback): void; +} +``` +After change: +```js +interface AudioRenderer { + on(type: 'audioInterrupt', callback: Callback): void; +} +``` + + +## cl.multimedia.media.001 Change of VideoRecorder APIs to System APIs + +In the MR version, the formal **AVRecorder** APIs (integrating audio and video) will be provided for external use. +**VideoRecorder** APIs in API version 9 are changed to system APIs, which are available only to system users. In the future, **VideoRecorder** APIs will be deprecated after system users switch to **AVRecorder**. + +**Change Impact** + +If the **VideoRecorder** caller is not a system user, the call will fail. +Involved APIs and enums: +function createVideoRecorder(callback: AsyncCallback): void; +function createVideoRecorder(): Promise; +type VideoRecordState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error'; +interface VideoRecorder{ + prepare(config: VideoRecorderConfig, callback: AsyncCallback): void; + prepare(config: VideoRecorderConfig): Promise; + getInputSurface(callback: AsyncCallback): void; + getInputSurface(): Promise; + start(callback: AsyncCallback): void; + start(): Promise; + pause(callback: AsyncCallback): void; + pause(): Promise; + resume(callback: AsyncCallback): void; + resume(): Promise; + stop(callback: AsyncCallback): void; + stop(): Promise; + release(callback: AsyncCallback): void; + release(): Promise; + reset(callback: AsyncCallback): void; + reset(): Promise; + on(type: 'error', callback: ErrorCallback): void; + readonly state: VideoRecordState; +} +interface VideoRecorderProfile { + readonly audioBitrate: number; + readonly audioChannels: number; + readonly audioCodec: CodecMimeType; + readonly audioSampleRate: number; + readonly fileFormat: ContainerFormatType; + readonly videoBitrate: number; + readonly videoCodec: CodecMimeType; + readonly videoFrameWidth: number; + readonly videoFrameHeight: number; + readonly videoFrameRate: number; +} +enum AudioSourceType { + AUDIO_SOURCE_TYPE_DEFAULT = 0, + AUDIO_SOURCE_TYPE_MIC = 1, +} +enum VideoSourceType { + VIDEO_SOURCE_TYPE_SURFACE_YUV = 0, + VIDEO_SOURCE_TYPE_SURFACE_ES = 1, +} +enum VideoRecorderConfig { + audioSourceType?: AudioSourceType; + videoSourceType: VideoSourceType; + profile: VideoRecorderProfile; + url: string; + rotation?: number; + location?: Location; +} + +## cl.multimedia.media.002 No Externally Provided Bit Rate Selection API in VideoPlayer + +In API version 9, **VideoPlayer** does not externally provide the bit rate selection API. Such an API will be provided by **AVPlayer** in the MR version. + +**Change Impact** + +Bit rate selection cannot be performed in the multi-bit rate scenario of **VideoPlayer**. Relevant functions will be provided by **AVPlayer**. + +**Key API/Component Changes** + +Deleted APIs: +interface VideoPlayer { + selectBitrate(bitrate: number): Promise; + selectBitrate(bitrate: number, callback: AsyncCallback): void; + on(type: 'availableBitratesCollect', callback: (bitrates: Array) => void): void; +} + +## cl.multimedia.media.003 Error Information Change of VideoRecorder + +Original error codes of **VideoRecorder** are changed because they do not comply with the error code specifications. + +**Change Impact** + +Error codes returned from **VideoRecorder** are changed. + +**Key API/Component Changes** + +**VideoRecorder** APIs remain unchanged, but the returned error codes are changed. + +**Adaptation Guide** + +For details about exception handling, see the following documents: +https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-media.md +https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/errorcodes/errorcode-media.md diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-resource-manager.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-resource-manager.md new file mode 100644 index 0000000000000000000000000000000000000000..03dab54c4eef959f6e1a7fbccf01d8caa3f4def5 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-resource-manager.md @@ -0,0 +1,68 @@ +# Resource Manager Changelog + +## cl.resourceManager.1 Name Change of Some Multi-Project APIs in API Version 9 of Resource Manager + +The resource manager can return error codes and error information for APIs in API version 9 and later. Some multi-project APIs in API version 9 need to be adapted. The following changes are made in API version 9: + +Some multi-project APIs of the resource manager need to be replaced with new APIs, and the parameters remain unchanged. + +**Change Impact** + +For applications developed based on earlier versions, relevant JavaScript multi-project APIs need to be replaced with new APIs. + +**Key API/Component Changes** + +| **Original API** | **New API**| +| ---------------- | ------------ | +| getString(resource: Resource,
callback: AsyncCallback\): void; | getStringValue(resource: Resource,
callback: AsyncCallback\): void; | +| getString(resource: Resource): Promise\; | getStringValue(resource: Resource): Promise\; | +| getStringArray(resource: Resource,
callback: AsyncCallback\>): void; | getStringArrayValue(resource: Resource,
callback: AsyncCallback\>): void; | +| getStringArray(resource: Resource): Promise\>; | getStringArrayValue(resource: Resource): Promise\>; | +| getMedia(resource: Resource,
callback: AsyncCallback\): void; | getMediaContent(resource: Resource,
callback: AsyncCallback\): void; | +| getMedia(resource: Resource): Promise\; | getMediaContent(resource: Resource): Promise\; | +| getMediaBase64(resource: Resource,
callback: AsyncCallback\): void; | getMediaContentBase64(resource: Resource,
callback: AsyncCallback\): void; | +| getMediaBase64(resource: Resource): Promise\; | getMediaContentBase64(resource: Resource): Promise\; | +| getPluralString(resource: Resource, num: number,
callback: AsyncCallback): void; | getPluralStringValue(resource: Resource, num: number,
callback: AsyncCallback\): void; | +| getPluralString(resource: Resource, num: number): Promise\; | getPluralStringValue(resource: Resource, num: number): Promise\; | + +**Adaptation Guide** + +The following describes how to change **getMedia** to **getMediaContent** in callback mode. The promise mode is similar. You only need to change the function name, add the error code and error information, and keep other information unchanged. The code snippet is as follows: + +- Before the change: **getMedia(resource: Resource, callback: AsyncCallback): void;** + + ```ts + let resource = { + bundleName: "com.example.myapplication", + moduleName: "entry", + id: $r('app.media.test').id + }; + this.context.resourceManager.getMedia(resource, (error, value) => { + if (error != null) { + console.log("error is " + error); + } else { + let media = value; + } + }); + ``` + +- After the change: **getMediaContent(resource: Resource, callback: AsyncCallback): void;** + + ```ts + let resource = { + bundleName: "com.example.myapplication", + moduleName: "entry", + id: $r('app.media.test').id + }; + try { + this.context.resourceManager.getMediaContent(resource, (error, value) => { + if (error != null) { + console.log("error is " + error); + } else { + let media = value; + } + }); + } catch (error) { + console.error(`callback getMediaContent failed, error code: ${error.code}, message: ${error.message}.`) + } + ``` \ No newline at end of file diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-resourceschedule.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-resourceschedule.md new file mode 100644 index 0000000000000000000000000000000000000000..73ffb069e25875d25b14dd6c199996b4af8cdf2b --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-resourceschedule.md @@ -0,0 +1,314 @@ +# 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 Impact** + +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, enums, and constants are changed in API version 9 and later versions. The **@ohos.backgroundTaskManager.d.ts** file is deprecated and related APIs are moved to the newly added **@ohos.resourceschedule.backgroundTaskManager.d.ts** file. + +| Class| API Type| Declaration| Description| +| -- | -- | -- | -- | +| backgroundTaskManager | namespace | declare namespace backgroundTaskManager | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function resetAllEfficiencyResources(): void; | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function applyEfficiencyResources(request: EfficiencyResourcesRequest): bool; | Changed in API version 9 to **function applyEfficiencyResources(request: EfficiencyResourcesRequest): void;** and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function stopBackgroundRunning(context: Context): Promise; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number): Promise; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function cancelSuspendDelay(requestId: number): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | export enum BackgroundMode | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | DATA_TRANSFER = 1 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | AUDIO_PLAYBACK = 2 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | AUDIO_RECORDING = 3 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | LOCATION = 4 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | BLUETOOTH_INTERACTION = 5 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | MULTI_DEVICE_CONNECTION = 6 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | WIFI_INTERACTION = 7 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | VOIP = 8 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | TASK_KEEPING = 9 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.DelaySuspendInfo | interface | interface DelaySuspendInfo | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.DelaySuspendInfo | field | requestId: number | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.DelaySuspendInfo | field | actualDelayTime: number | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | export enum ResourceType | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | CPU = 1 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | COMMON_EVENT = 1 << 1 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | TIMER = 1 << 2 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | WORK_SCHEDULER = 1 << 3 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | BLUETOOTH = 1 << 4 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | GPS = 1 << 5 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | AUDIO = 1 << 6 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | interface | export interface EfficiencyResourcesRequest | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | reason: string | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isProcess?: bool | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isPersist?: bool | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | timeOut: number | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isApply: bool | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | resourceTypes: number | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| + + +**Adaptation Guide** + +Import the **backgroundTaskManager** module. +``` +import bundle form '@ohos.resourceschedule.backgroundTaskManager' +``` +Exception handling also needs to be adapted. For details, see the [backgroundTaskManager API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md). + +## c2.resourceschedule.usageStatistics +Rectified original APIs of **deviceUsageStatistics** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. + +**Change Impact** + +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, enums, 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/Enum/Constant | Change Type | +| ----------------------------------------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| bundleState | method | function isIdleState(bundleName: string, callback: AsyncCallback): void; | Deprecated and moved to **usageStatistics.isIdleState**. | +| bundleState | method | function isIdleState(bundleName: string): Promise; | Deprecated and moved to **usageStatistics.isIdleState**. | +| bundleState | method | function queryAppUsagePriorityGroup(callback: AsyncCallback): void; | Deprecated and changed to **function queryAppGroup(callback: AsyncCallback): void;**.| +| bundleState | method | function queryAppUsagePriorityGroup(): Promise; | Deprecated and changed to **function queryAppGroup(): Promise;**. | +| bundleState | method | function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback): void;**.| +| bundleState | method | function queryBundleStateInfos(begin: number, end: number): Promise; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number): Promise;**.| +| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>;**.| +| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void;**.| +| bundleState | method | function queryBundleActiveStates(begin: number, end: number): Promise>; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number): Promise>;**.| +| bundleState | method | function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number, callback: AsyncCallback>): void;**.| +| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number): Promise>;**.| +| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback>): void;**.| +| bundleState | method | function getRecentlyUsedModules(maxNum?: number): Promise>; | Deprecated and changed to **function QueryModuleUsageRecords(maxNum: number): Promise>;** and **function QueryModuleUsageRecords(): Promise>;**.| +| bundleState | method | function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback>): void; | Deprecated and changed to **function QueryModuleUsageRecords(maxNum: number, callback: AsyncCallback>): void;** and **function QueryModuleUsageRecords(callback: AsyncCallback>): void;**.| +| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string): Promise; | Deprecated and changed to **function queryAppGroup(bundleName: string): Promise;**.| +| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void; | Deprecated and changed to **function queryAppGroup(bundleName: string, callback: AsyncCallback): void;**.| +| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void;**.| +| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType): Promise;**.| +| bundleState | method | function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback, callback: AsyncCallback): void;**.| +| bundleState | method | function registerGroupCallBack(callback: Callback): Promise; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback): Promise;**.| +| bundleState | method | function unRegisterGroupCallBack(callback: AsyncCallback): void; | Changed to **function unregisterAppGroupCallBack(): Promise;**.| +| bundleState | method | function unRegisterGroupCallBack(): Promise; | Changed to **function unregisterAppGroupCallBack(): Promise;**.| +| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback>): void; | Changed to **function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback>): void;**| +| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number): Promise>; | Changed in API version 9 to **function queryDeviceEventStats(begin: number, end: number): Promise>;**.| +| bundleState | method | function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; | Changed in API version 9 to **function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback>): void;**.| +| bundleState | method | function queryAppNotificationNumber(begin: number, end: number): Promise>; | Changed in API version 9 to **function queryNotificationEventStats(begin: number, end: number): Promise>;**.| +| bundleState.BundleActiveGroupCallbackInfo | interface | interface BundleActiveGroupCallbackInfo | Moved to **usageStatistics.AppGroupCallbackInfo**. | +| bundleState.BundleActiveGroupCallbackInfo | field | bundleName: string | Moved to **usageStatistics.AppGroupCallbackInfo**. | +| bundleState.BundleActiveGroupCallbackInfo | field | changeReason: number | Moved to **usageStatistics.AppGroupCallbackInfo**. | +| bundleState.BundleActiveGroupCallbackInfo | field | userId: number | Moved 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 | Moved to **usageStatistics.DeviceEventStats**. | +| bundleState.BundleActiveEventState | field | eventId: number | Moved to **usageStatistics.DeviceEventStats**. | +| bundleState.BundleActiveEventState | field | name: string | Moved to **usageStatistics.DeviceEventStats**. | +| bundleState.BundleActiveModuleInfo | interface | interface BundleActiveModuleInfo | Changed in API version 9 to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | formRecords: Array | Changed to **formRecords: Array**. | +| bundleState.BundleActiveModuleInfo | field | lastModuleUsedTime: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | launchedCount: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | abilityIconId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | abilityDescriptionId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | abilityLableId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | descriptionId?: number; | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | labelId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | appLabelId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | abilityName?: string | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | moduleName: string | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | bundleName: string | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | deviceId?: string | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.GroupType | enum | enum GroupType | Moved 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 moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_OPTIMIZED | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_DAILY | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_WEEKLY | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_MONTHLY | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_ANNUALLY | Deprecated and moved 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 moved to **usageStatistics.BundleEvents**. | +| bundleState.BundleActiveState | field | indexOfLink?: string | Deprecated and moved to **usageStatistics.BundleEvents**. | +| bundleState.BundleActiveState | field | bundleName?: string | Deprecated and moved 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 moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | infosBeginTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | fgAbilityPrevAccessTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | fgAbilityAccessTotalTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | bundleName?: string | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | abilitySeenTotalTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | abilityPrevSeenTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | abilityPrevAccessTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | abilityInFgTotalTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | id: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState | namespace | declare namespace bundleState | Deprecated and changed to **usageStatistics**, and moved to **ohos.resourceschedule.usageStatistics.d.ts**.| + + +**Adaptation Guide** + +Import the **usageStatistics** module. +``` +import bundle form '@ohos.resourceschedule.usageStatistics' +``` +Exception handling also needs to be adapted. For details, see the [usageStatistics API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md). + + +## c3.resourceschedule.workScheduler +Rectified original APIs of **workScheduler** of the resource scheduler subsystem. The original APIs in API version 9 are changed to new APIs in API version 9. The new APIs in API version 9 comply with the error code specifications. + +**Change Impact** + +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, enums, and constants are changed in API version 9 and later versions. The **@ohos.workScheduler.d.ts** file is deprecated and related APIs are moved 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 moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | interface | export interface WorkInfo | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | idleWaitTime?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isDeepIdle?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | repeatCount?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isRepeat?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | repeatCycleTime?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | storageRequest?: StorageRequest | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | batteryStatus?: BatteryStatus | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | batteryLevel?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | chargerType?: ChargingType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isCharging?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | networkType?: NetworkType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isPersisted?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | abilityName: string | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | bundleName: string | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | workId: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function isLastWorkTimeOut(workId: number): Promise; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function stopAndClearWorks(): boolean; | Changed in API version 8 to **function stopAndClearWorks(): boolean;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function obtainAllWorks(): Promise>; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function obtainAllWorks(callback: AsyncCallback): Array; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function getWorkStatus(workId: number): Promise; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback): void; | Changed in API version 9 and moved 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 moved 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 moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | export enum NetworkType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_ANY = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_MOBILE | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_BLUETOOTH | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI_P2P | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_ETHERNET | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | export enum ChargingType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_ANY = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_AC | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_USB | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_WIRELESS | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | export enum BatteryStatus | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW_OR_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.StorageRequest | enum | export enum StorageRequest | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW_OR_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| + + +**Adaptation Guide** + +Import the **workScheduler** module. +``` +import bundle form '@ohos.resourceschedule.workScheduler' +``` +Exception handling also needs to be adapted. For details, see the [workScheduler API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md). + + +## c4.resourceschedule.reminderAgent +Rectified original APIs of **reminderAgent** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. + +**Change Impact** + +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, enums, 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/Enum/Constant | Change Type | +| --------------------- | ----------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| reminderAgent | method | publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | publishReminder(reminderReq: ReminderRequest): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | cancelReminder(reminderId: number, callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | cancelReminder(reminderId: number): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | getValidReminders(callback: AsyncCallback>): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | getValidReminders(): Promise>; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | cancelAllReminders(callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | cancelAllReminders(): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | addNotificationSlot(slot: NotificationSlot): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_CLOSE | Deprecated and moved to **reminderAgentManager.ActionButtonType**.| +| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_SNOOZE | Deprecated and moved to **reminderAgentManager.ActionButtonType**.| +| reminderAgent.ReminderType | enum | REMINDER_TYPE_TIMER | Deprecated and moved to **reminderAgentManager.ReminderType**.| +| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and moved to **reminderAgentManager.ReminderType**.| +| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and moved to **reminderAgentManager.ReminderType**.| +| reminderAgent.ActionButton | field | title:string | Deprecated and moved to **reminderAgentManager.ActionButton**.| +| reminderAgent.ActionButton | field | type:ActionButtonType | Deprecated and moved to **reminderAgentManager.ActionButton**.| +| reminderAgent.WantAgent | field | pkgName:string | Deprecated and moved to **reminderAgentManager.WantAgent**.| +| reminderAgent.WantAgent | field | abilityName:string | Deprecated and moved to **reminderAgentManager.WantAgent**.| +| reminderAgent.MaxScreenWantAgent | field | pkgName:string | Deprecated and moved to **reminderAgentManager.MaxScreenWantAgent**.| +| reminderAgent.MaxScreenWantAgent | field | abilityName:string | Deprecated and moved to **reminderAgentManager.MaxScreenWantAgent**.| +| reminderAgent.ReminderRequest | field | reminderType:ReminderType | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | actionButton?:ActionButton | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | wantAgent?:WantAgent | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | maxScreenWantAgent?:MaxScreenWantAgent | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | ringDuration?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | snoozeTimes?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | timeInterval?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | title?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | content?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | expiredContent?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | snoozeContent?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | notificationId?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | slotType?: notification.SlotType | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequestCalendar | field | dateTime:LocalDateTime | Deprecated and moved to **reminderAgentManager.ReminderRequestCalendar**.| +| reminderAgent.ReminderRequestCalendar | field | repeatMonths?:Array | Deprecated and moved to **reminderAgentManager.ReminderRequestCalendar**.| +| reminderAgent.ReminderRequestCalendar | field | repeatDays?:Array | Deprecated and moved to **reminderAgentManager.ReminderRequestCalendar**.| +| reminderAgent.ReminderRequestAlarm | field | hour:number | Deprecated and moved to **reminderAgentManager.ReminderRequestAlarm**.| +| reminderAgent.ReminderRequestAlarm | field | minute:number | Deprecated and moved to **reminderAgentManager.ReminderRequestAlarm**.| +| reminderAgent.ReminderRequestAlarm | field | daysOfWeek?:Array | Deprecated and moved to **reminderAgentManager.ReminderRequestAlarm**.| +| reminderAgent.ReminderRequestTimer | field | triggerTimeInSeconds:number | Deprecated and moved to **reminderAgentManager.ReminderRequestTimer**.| +| reminderAgent.LocalDateTime | field | year:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | month:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | day:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | hour:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | minute:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | second?:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| + + +**Adaptation Guide** + +Import the **reminderAgentManager** module. +``` +import bundle form '@ohos.reminderAgentManager' +``` +Exception handling also needs to be adapted. For details, see the [reminderAgentManager API reference](../../../application-dev/reference/apis/js-apis-reminderAgentManager.md). diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-wantAgent.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-wantAgent.md new file mode 100644 index 0000000000000000000000000000000000000000..0700c6585be1ac90b3371ba7b230ef821a4d43ee --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-wantAgent.md @@ -0,0 +1,88 @@ +# WantAgent JS API Changelog + +## cl.url.1 Trigger API Changes +trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback): void ; + +This API has been deleted, because some functions have not been implemented. Your application can call the following API: + + trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback): void + +**Change Impact** + +Released JS APIs are affected. The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. + +**Key API/Component Changes** + +| OpenHarmony 3.2.8.1 API | OpenHarmony 3.2.9.1 SP8 API | +| ------------------------------------------------------------ | ------------------------------------------------------------ | +| trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback): void ; | trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback): void | + +**Adaptation Guide** + +The following illustrates how to call the alternative **trigger** API in your application. + +Example: + +```ts +import WantAgent from '@ohos.app.ability.wantAgent'; +// WantAgent object +var wantAgent; +// triggerInfo +var triggerInfo = { + code: 0 + } +// WantAgentInfo object +var wantAgentInfo = { + wants: [ + { + deviceId: "deviceId", + bundleName: "com.neu.setResultOnAbilityResultTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + } + ], + operationType: WantAgent.OperationType.START_ABILITIES, + requestCode: 0, + wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] +} + +// getWantAgent callback +function getWantAgentCallback(err, data) { + if (err == undefined) { + wantAgent = data; + } else { + console.info('getWantAgent failed' + JSON.stringify(wantAgent)); + } + // getUid callback + function triggerCallback(err, data) { + if(err) { + console.info('getUid failed!' + JSON.stringify(err.code) + JSON.stringify(err.message)); + } else { + console.info('getUid ok!' + JSON.stringify(data)); + } + } + try { + WantAgent.trigger(wantAgent, triggerInfo, triggerCallback); + } catch(err) { + console.info('getUid failed!' + JSON.stringify(err.code) + JSON.stringify(err.message)); + } +} +try{ + WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); +} catch(err){ + console.info('getWantAgent failed!' + JSON.stringify(err.code) + JSON.stringify(err.message)); +} +``` diff --git a/en/release-notes/changelogs/v3.2-beta5/Readme-EN.md b/en/release-notes/changelogs/v3.2-beta5/Readme-EN.md index 0a7f3f1f2184f7d696f8254cdc1eea8b05c997f5..5cd308068528c40ac7dd04530d53c166906df752 100644 --- a/en/release-notes/changelogs/v3.2-beta5/Readme-EN.md +++ b/en/release-notes/changelogs/v3.2-beta5/Readme-EN.md @@ -1,2 +1,27 @@ # Readme +- [Ability framework](changelogs-ability.md) +- [Account subsystem](changelogs-account_os_account.md) +- [ArkUI development framework](changelogs-arkui.md) +- [Multimedia subsystem - camera](changelogs-camera-sync.md) +- [Common library subsystem - container](changelogs-container.md) +- [Distributed data management](changelogs-distributeddatamgr.md) +- [File management subsystem](changelogs-filemanagement.md) +- [Input method framework](changelogs-inputmethod-framworks.md) +- [File management subsystem - MediaLibrary](changelogs-mediaLibrary.md) +- [Multimedia subsystem](changelogs-multimedia.md) +- [Communication subsystem - NFC](changelogs-nfc.md) +- [Common event and notification subsystem](changelogs-notification.md) +- Location subsystem + - [ohos.geoLocationManager](changelogs-ohos-geoLocationManager.md) + - [ohos.geoLocation](changelogs-ohos-geoLocation.md) + - [system.geolocation](changelogs-system-geolocation.md) +- [Upload and download](changelogs-request.md) +- [Resource scheduler subsystem](changelogs-resourceschedule.md) +- [Security subsystem](changelogs-security.md) +- [Telephony subsystem](changelogs-telephony.md) +- [Time service](changelogs-time.md) +- [Common library subsystem - URL](changelogs-url.md) +- [User IAM subsystem](changelogs-useriam.md) +- [Window manager subsystem](changelogs-window.md) + diff --git a/en/release-notes/changelogs/v3.2-beta5/Readme.md b/en/release-notes/changelogs/v3.2-beta5/Readme.md deleted file mode 100644 index 7ab2c8021d2b1768d8149817079777dbab3de33e..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/v3.2-beta5/Readme.md +++ /dev/null @@ -1,6 +0,0 @@ -# Readme -- [Account](changelogs-account_os_account.md) -- [Distributed Data Management](changelogs-distributeddatamgr.md) -- [File Management](changelogs-filemanagement.md) -- [User IAM](changelogs-useriam.md) - diff --git a/en/release-notes/changelogs/v3.2-beta5/changelog-x-x.md b/en/release-notes/changelogs/v3.2-beta5/changelog-x-x.md new file mode 100644 index 0000000000000000000000000000000000000000..dcc7cd9aabb636ed248b5a37383410d4218b346f --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelog-x-x.md @@ -0,0 +1,28 @@ +# *Example* Subsystem Changelog + +Changes that affect contract compatibility of the last version should be described in the changelog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions. + +## cl.subsystemname.x xxx Function Change (Example: DeviceType Attribute Change or Camera Permission Change. Use a short description.) + +Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of changelog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order). +Describe the changes in terms of functions. Example: *n* and *m* of the *a* function are changed. Developers need to adapt their applications based on the change description. +If there is a requirement or design document corresponding to the change, attach the requirement number or design document number in the description. + +**Change Impact** + +Describe whether released APIs (JS or native APIs) are affected or API behavior is changed. +Describe whether available applications are affected, that is, whether an adaptation is required for building the application code in the SDK environment of the new version. + +**Key API/Component Changes** + +List the API/component changes involved in the function change. + +**Adaptation Guide** + +Provide guidance for developers on how to adapt their application to the changes to be compatible with the new version. +Example: +Change parameter *n* to *m* in the *a* file. + +``` +sample code +``` diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-ability.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-ability.md new file mode 100644 index 0000000000000000000000000000000000000000..e480077668e2a0e214720dd83ad07cf567956b87 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-ability.md @@ -0,0 +1,168 @@ +# Ability Framework Changelog + +## cl.ability.1 API Migration +The **requestPermissionsFromUser** API of **UIAbilityContext** is migrated from the ability subsystem to the security subsystem. + +Previously, the permission popup was implemented based on **UIAbility**, which used the **startAbilityForResult** API of **UIAbilityContext** to return the permission authorization result to the caller. Therefore, **requestPermissionsFromUser** was temporarily placed in **UIAbilityContext**. The permission popup is now implemented based on **ServiceExtensionAbility**, which no longer requires **startAbilityForResult** of **UIAbilityContext**. Therefore, **requestPermissionsFromUser** is migrated to the security subsystem. + +You need to adapt your application based on the following information. + + **Change Impact** + +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 | Change Type| +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| application/UIAbilityContext | UIAbilityContext | requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback): void; | Deleted | +| application/UIAbilityContext | UIAbilityContext | requestPermissionsFromUser(permissions: Array): Promise; | Deleted | +| @ohos.abilityAccessCtrl | AtManager | requestPermissionsFromUser(context: Context, permissions: Array, requestCallback: AsyncCallback) : void; | Added | +| @ohos.abilityAccessCtrl | AtManager | requestPermissionsFromUser(context: Context, permissions: Array) : Promise; | Added | + + +**Adaptation Guide** + +The following illustrates how **requestPermissionsFromUser** is called to show a permission popup. + +Stage model: + +```ts +import abilityAccessCtrl from '@ohos.abilityAccessCtrl.d.ts'; +// onWindowStageCreate lifecycle of UIAbility. +onWindowStageCreate() { + let AtManager = abilityAccessCtrl.createAtManager(); + // requestPermissionsFromUser determines whether to display a popup based on the permission authorization status. + AtManager.requestPermissionsFromUser(this.context, ["ohos.permission.MANAGE_DISPOSED_APP_STATUS"]).then((data) => { + console.log("data type:" + typeof(data)); + console.log("data:" + data); + console.log("data permissions:" + data.permissions); + console.log("data result:" + data.authResults); + }).catch((err) => { + console.error('Failed to start ability', err.code); + }) +} +``` + + + +## cl.ability.2 Deletion of Deprecated APIs in API Version 9 + +In the [Ability Exception Rectification](../OpenHarmony_3.2.8.3/changelogs-ability.md) document, some APIs in API version 9 have been marked as deprecated. According to API specifications of OpenHarmony, these APIs should be deleted. + +**Change Impact** + +The application developed based on earlier versions needs to use new APIs to replace the deleted ones. Otherwise, the application compilation will be affected. + +**Key API/Component Changes** + +API files are deleted. + +| Deleted API | New API | +| ----------------------------------------------- | ----------------------------------------------- | +| @ohos.application.Ability.d.ts | @ohos.app.ability.UIAbility.d.ts | +| @ohos.application.AbilityConstant.d.ts | @ohos.app.ability.AbilityConstant.d.ts | +| @ohos.application.AbilityLifecycleCallback.d.ts | @ohos.app.ability.AbilityLifecycleCallback.d.ts | +| @ohos.application.AbilityStage.d.ts | @ohos.app.ability.AbilityStage.d.ts | +| @ohos.application.EnvironmentCallback.d.ts | @ohos.app.ability.EnvironmentCallback.d.ts | +| @ohos.application.ExtensionAbility.d.ts | @ohos.app.ability.ExtensionAbility.d.ts | +| @ohos.application.FormExtension.d.ts | @ohos.app.form.FormExtensionAbility.d.ts | +| @ohos.application.ServiceExtensionAbility.d.ts | @ohos.app.ability.ServiceExtensionAbility.d.ts | +| @ohos.application.StartOptions.d.ts | @ohos.app.ability.StartOptions.d.ts | +| @ohos.application.context.d.ts | @ohos.app.ability.common.d.ts | +| @ohos.application.errorManager.d.ts | @ohos.app.ability.errorManager.d.ts | + +APIs or attributes are deleted: + +- @ohos.application.Configuration.d.ts + - **direction**, **screenDensity**, **displayId**, and **hasPointerDevice** of **Configuration** are deleted. Use **Configuration** of **@ohos.app.ability.Configuration.d.ts**. +- @ohos.application.ConfigurationConstant.d.ts + - **Direction** and **ScreenDensity** are deleted. Use **Direction** and **ScreenDensity** of **@ohos.app.ability.ConfigurationConstant.d.ts**. +- @ohos.application.abilityManager.d.ts + - **getExtensionRunningInfos** and **getTopAbility** are deleted. Use the APIs with the same name in **@ohos.app.ability.abilityManager.d.ts**. +- @ohos.application.appManager.d.ts + - **ApplicationState** and **ProcessState** are deleted. Use **ApplicationState** and **ProcessState** of **@ohos.app.ability.appManager.d.ts**. + - **registerApplicationStateObserver** and **getProcessRunningInformation** are deleted. Use the APIs with the same name in **@ohos.app.ability.appManager.d.ts**. +- @ohos.application.formHost.d.ts + - **shareForm** and **notifyFormsPrivacyProtected** are deleted. Use the APIs with the same name in **@ohos.app.form.formHost.d.ts**. +- @ohos.application.formInfo.d.ts + - **eTS** of **FormType** is deleted. Use **eTS** of **FormType** in **@ohos.app.form.formInfo.d.ts**. + - **IDENTITY_KEY**, **BUNDLE_NAME_KEY**, **ABILITY_NAME_KEY**, and **DEVICE_ID_KEY** of **FormParam** are deleted. Use the enums with the same name in **@ohos.app.form.formInfo.d.ts**. + - **FormInfoFilter** is deleted. Use **FormInfoFilter** of **@ohos.app.form.formInfo.d.ts**. + - **FormDimension** is deleted. Use **FormDimension** of **@ohos.app.form.formInfo.d.ts**. + - **VisibilityType** is deleted. Use **VisibilityType** of **@ohos.app.form.formInfo.d.ts**. +- @ohos.wantAgent.d.ts + - **trigger** and **getOperationType** are deleted. Use the APIs with the same name in **@ohos.app.ability.wantAgent.d.ts**. +- application/ApplicationContext.d.ts + - **registerAbilityLifecycleCallback**, **unregisterAbilityLifecycleCallback**, **registerEnvironmentCallback**, and **unregisterEnvironmentCallback** are deleted. Use **on** and **off**. +- application/ServiceExtensionContext.d.ts + - **connectAbility**, **connectAbilityWithAccount**, and **disconnectAbility** are deleted. Use **connectServiceExtensionAbility**, **connectServiceExtensionAbilityWithAccount**, and **disconnectServiceExtensionAbility**. +- @ohos.application.FormExtension.d.ts + - **onCreate**, **onCastToNormal**, **onUpdate**, **onVisibilityChange**, **onEvent**, **onDestroy**, **onAcquireFormState**, and **onShare** are deleted. Use the following lifecycle methods of **@ohos.app.form.FormExtensionAbility.d.ts**: **onAddForm**, **onCastToNormalForm**, **onUpdateForm**, **onChangeFormVisibility**, **onFormEvent**, **onRemoveForm**, **onAcquireFormState**, and **onShareForm**. +- @ohos.application.abilityDelegatorRegistry.d.ts + - **AbilityDelegator**, **AbilityDelegatorArgs**, **AbilityMonitor**, and **ShellCmdResult** are deleted. Use the classes with the same name in **@ohos.app.ability.abilityDelegatorRegistry.d.ts**. +- @ohos.application.abilityManager.d.ts + - **AbilityRunningInfo** and **ExtensionRunningInfo** are deleted. Use the classes with the same name in **@ohos.app.ability.abilityManager.d.ts**. +- @ohos.application.appManager.d.ts + - **AbilityStateData**, **AppStateData**, **ApplicationStateObserver**, **ProcessRunningInfo**, and **ProcessRunningInformation** are deleted. Use the classes with the same name in **@ohos.app.ability.appManager.d.ts**. +- @ohos.application.missionManager.d.ts + - **MissionInfo**, **MissionListener**, and **MissionSnapshot** are deleted. Use the classes with the same name in **@ohos.app.ability.missionManager.d.ts**. +- @ohos.wantAgent.d.ts + - **TriggerInfo** and **WantAgentInfo** are deleted. Use the classes with the same name in **@ohos.app.ability.wantAgent.d.ts**. + +**Adaptation Guide** + +As mentioned above, only several APIs have their names changed in terms of, for example, the registration callbacks (**registerAbilityLifecycleCallback**, **unregisterAbilityLifecycleCallback**, **registerEnvironmentCallback**, and **unregisterEnvironmentCallback**) and connection and disconnection **ServiceExtensionAbility** (**connectAbility**, **connectAbilityWithAccount**, and **disconnectAbility**). For such APIs, replace their names with those of their corresponding new APIs in the lifecycle callbacks. + +Most APIs are moved to the new namespace. Therefore, you can modify **import** for adaptation. + +For example, the original API uses **@ohos.application.Ability**: + +```js +import Ability from '@ohos.application.Ability'; +``` + +You can directly modify **import** to switch to the new namespace: + +```js +import Ability from '@ohos.app.ability.UIAbility'; +``` + +In addition, exception handling is needed. For details, see the API reference for the new APIs. + +## cl.ability.2 RestartFlag Attribute Names Changed and Unsupported Attribute Deleted in appRecovery + +In the **appRecovery** API, the enum names of **RestartFlag** are changed from **NO_RESTART** upon a specific fault to **RESTART** upon a specific fault. +The **CPP_CRASH_NO_RESTART** enum is deleted. + +**Change Impact** + +If your application uses the **CPP_CRASH_NO_RESTART**, **JS_CRASH_NO_RESTART**, or **APP_FREEZE_NO_RESTART** attribute in versions earlier than 3.2.10.6, its behavior will change after an upgrade to 3.2.10.6. + +**Key API/Component Changes** + +**RestartFlag** 9+ + +Before change + +| Name | Value | Description | +| --------------------- | ------ | -------------------------------- | +| ALWAYS_RESTART | 0 | The application is restarted in all cases. | +| CPP_CRASH_NO_RESTART | 0x0001 | The application is **not restarted** in the case of CPP_CRASH. | +| JS_CRASH_NO_RESTART | 0x0002 | The application is **not restarted** in the case of JS_CRASH. | +| APP_FREEZE_NO_RESTART | 0x0004 | The application is **not restarted** in the case of APP_FREEZE.| +| NO_RESTART | 0xFFFF | The application is not restarted in any case. | + +After change + +| Name | Value | Description | +| ----------------------- | ------ | ------------------------------ | +| ALWAYS_RESTART | 0 | The application is restarted in all cases. | +| CPP_CRASH_NO_RESTART | NA | **Deleted.** The restart in this scenario is not supported.| +| RESTART_WHEN_JS_CRASH | 0x0001 | The application is **restarted** in the case of JS_CRASH. | +| RESTART_WHEN_APP_FREEZE | 0x0002 | The application is **restarted** in the case of APP_FREEZE.| +| NO_RESTART | 0xFFFF | The application is not restarted in any case. | + +**Adaptation Guide** + +Perform adaptation based on the new semantics. diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-camera-sync.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-camera-sync.md new file mode 100644 index 0000000000000000000000000000000000000000..ef66b7500c4b5fccde024c10c95beeca5b6cbd5d --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-camera-sync.md @@ -0,0 +1,520 @@ +# Multimedia Subsystem Changelog + +## 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 Impact** + +JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enum/Constant | Is System API| Change Type| +| ---------------------- | ----------------------- | ------------------------------------------------------------ | --------------- | -------- | +| ohos.multimedia.camera | camera | function getCameraManager(context: Context): CameraManager; | Yes | Added | +| ohos.multimedia.camera | camera | function getCameraManager(context: Context, callback: AsyncCallback): void;
function getCameraManager(context: Context): Promise; | Yes | Deprecated | +| ohos.multimedia.camera | CameraErrorCode | INVALID_ARGUMENT = 7400101,
OPERATION_NOT_ALLOWED = 7400102,
SESSION_NOT_CONFIG = 7400103,
SESSION_NOT_RUNNING = 7400104,
SESSION_CONFIG_LOCKED = 7400105,
DEVICE_SETTING_LOCKED = 7400106,
CONFILICT_CAMERA = 7400107,
DEVICE_DISABLED = 7400108,
SERVICE_FATAL_ERROR = 7400201 | Yes | Added | +| ohos.multimedia.camera | CameraManager | getSupportedCameras(): Array;
getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability;
createCameraInput(camera: CameraDevice): CameraInput;
createCameraInput(position: CameraPosition, type: CameraType): CameraInput;
createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput;
createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput;
createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput;
createMetadataOutput(metadataObjectTypes: Array): MetadataOutput;
createCaptureSession(): CaptureSession; | Yes | Added | +| ohos.multimedia.camera | CameraManager | getSupportedCameras(callback: AsyncCallback>): void;
getSupportedCameras(): Promise>;
getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback): void;
getSupportedOutputCapability(camera: CameraDevice): Promise;
createCameraInput(camera: CameraDevice, callback: AsyncCallback): void;
createCameraInput(camera: CameraDevice): Promise;
createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void;
createCameraInput(position: CameraPosition, type: CameraType): Promise;
createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void;
createPreviewOutput(profile: Profile, surfaceId: string): Promise;
createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void;
createPhotoOutput(profile: Profile, surfaceId: string): Promise;
createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback): void;
createVideoOutput(profile: VideoProfile, surfaceId: string): Promise;
createMetadataOutput(metadataObjectTypes: Array, callback: AsyncCallback): void;
createMetadataOutput(metadataObjectTypes: Array): Promise;
createCaptureSession(callback: AsyncCallback): void;
createCaptureSession(): Promise; | Yes | Deprecated | +| ohos.multimedia.camera | CameraType | CAMERA_TYPE_DEFAULT = 0 | Yes | Added | +| ohos.multimedia.camera | CameraType | CAMERA_TYPE_UNSPECIFIED = 0 | Yes | Deprecated | +| ohos.multimedia.camera | CameraInput | on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; | Yes | Added | +| ohos.multimedia.camera | CameraInput | release(callback: AsyncCallback): void;
release(): Promise;
on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; | Yes | Deprecated | +| ohos.multimedia.camera | CameraInputErrorCode | ERROR_UNKNOWN = -1
ERROR_NO_PERMISSION = 0
ERROR_DEVICE_PREEMPTED = 1
ERROR_DEVICE_DISCONNECTED = 2
ERROR_DEVICE_IN_USE = 3
ERROR_DRIVER_ERROR = 4 | Yes | Deprecated | +| ohos.multimedia.camera | CameraInputError | code: CameraInputErrorCode | Yes | Deprecated | +| ohos.multimedia.camera | CaptureSession | beginConfig(): void;
addInput(cameraInput: CameraInput): void;
removeInput(cameraInput: CameraInput): void;
addOutput(cameraOutput: CameraOutput): void;
removeOutput(cameraOutput: CameraOutput): void;
hasFlash(): boolean;
isFlashModeSupported(flashMode: FlashMode): boolean;
getFlashMode(): FlashMode;
setFlashMode(flashMode: FlashMode): void;
isExposureModeSupported(aeMode: ExposureMode): boolean;
getExposureMode(): ExposureMode;
setExposureMode(aeMode: ExposureMode): void;
getMeteringPoint(): Point;
setMeteringPoint(point: Point): void;
getExposureBiasRange(): Array;
setExposureBias(exposureBias: number): void;
getExposureValue(): number;
isFocusModeSupported(afMode: FocusMode): boolean;
getFocusMode(): FocusMode;
setFocusMode(afMode: FocusMode): void;
setFocusPoint(point: Point): void;
getFocusPoint(): Point;
getFocalLength(): number;
getZoomRatioRange(): Array;
getZoomRatio(): number;
setZoomRatio(zoomRatio: number): void;
isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean;
getActiveVideoStabilizationMode(): VideoStabilizationMode;
setVideoStabilizationMode(mode: VideoStabilizationMode): void;
on(type: 'error', callback: ErrorCallback): void; | Yes | Added | +| ohos.multimedia.camera | CaptureSession | beginConfig(callback: AsyncCallback): void;
beginConfig(): Promise;
addInput(cameraInput: CameraInput, callback: AsyncCallback): void;
addInput(cameraInput: CameraInput): Promise;
removeInput(cameraInput: CameraInput, callback: AsyncCallback): void;
removeInput(cameraInput: CameraInput): Promise;
addOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void;
addOutput(cameraOutput: CameraOutput): Promise;
removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void;
removeOutput(cameraOutput: CameraOutput): Promise;
hasFlash(callback: AsyncCallback): void;
hasFlash(): Promise;
isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void;
isFlashModeSupported(flashMode: FlashMode): Promise;
getFlashMode(callback: AsyncCallback): void;
getFlashMode(): Promise;
setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void;
setFlashMode(flashMode: FlashMode): Promise;
isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback): void;
isExposureModeSupported(aeMode: ExposureMode): Promise;
getExposureMode(callback: AsyncCallback): void;
getExposureMode(): Promise;
setExposureMode(aeMode: ExposureMode, callback: AsyncCallback): void;
setExposureMode(aeMode: ExposureMode): Promise;
getMeteringPoint(callback: AsyncCallback): void;
getMeteringPoint(): Promise;
setMeteringPoint(point: Point, callback: AsyncCallback): void;
setMeteringPoint(point: Point): Promise;
getExposureBiasRange(callback: AsyncCallback>): void;
getExposureBiasRange(): Promise>;
setExposureBias(exposureBias: number, callback: AsyncCallback): void;
setExposureBias(exposureBias: number): Promise;
getExposureValue(callback: AsyncCallback): void;
getExposureValue(): Promise;
isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void;
isFocusModeSupported(afMode: FocusMode): Promise;
getFocusMode(callback: AsyncCallback): void;
getFocusMode(): Promise;
setFocusMode(afMode: FocusMode, callback: AsyncCallback): void;
setFocusMode(afMode: FocusMode): Promise;
setFocusPoint(point: Point, callback: AsyncCallback): void;
setFocusPoint(point: Point): Promise;
getFocusPoint(callback: AsyncCallback): void;
getFocusPoint(): Promise;
getFocalLength(callback: AsyncCallback): void;
getFocalLength(): Promise;
getZoomRatioRange(callback: AsyncCallback>): void;
getZoomRatioRange(): Promise>;
getZoomRatio(callback: AsyncCallback): void;
getZoomRatio(): Promise;
setZoomRatio(zoomRatio: number, callback: AsyncCallback): void;
setZoomRatio(zoomRatio: number): Promise;
isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback): void;
isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise;
getActiveVideoStabilizationMode(callback: AsyncCallback): void;
getActiveVideoStabilizationMode(): Promise;
setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback): void;
setVideoStabilizationMode(mode: VideoStabilizationMode): Promise;
on(type: 'error', callback: ErrorCallback): void; | Yes | Deprecated | +| ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_UNKNOWN = -1
ERROR_INSUFFICIENT_RESOURCES = 0
ERROR_TIMEOUT = 1 | Yes | Deprecated | +| ohos.multimedia.camera | CaptureSessionError | code: CaptureSessionErrorCode | Yes | Deprecated | +| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback): void; | Yes | Added | +| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback): void; | Yes | Deprecated | +| ohos.multimedia.camera | PreviewOutputErrorCode | ERROR_UNKNOWN = -1 | Yes | Deprecated | +| ohos.multimedia.camera | PreviewOutputError | code: PreviewOutputErrorCode | Yes | Deprecated | +| ohos.multimedia.camera | PhotoOutput | capture(): Promise;
isMirrorSupported(): boolean;
on(type: 'error', callback: ErrorCallback): void; | Yes | Added | +| ohos.multimedia.camera | PhotoOutput | isMirrorSupported(callback: AsyncCallback): void;
isMirrorSupported(): Promise;
on(type: 'error', callback: ErrorCallback): void; | Yes | Deprecated | +| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_UNKNOWN = -1
ERROR_DRIVER_ERROR = 0
ERROR_INSUFFICIENT_RESOURCES = 1
ERROR_TIMEOUT = 2 | Yes | Deprecated | +| ohos.multimedia.camera | PhotoOutputError | code: PhotoOutputErrorCode | Yes | Deprecated | +| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback): void; | Yes | Added | +| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback): void; | Yes | Deprecated | +| ohos.multimedia.camera | VideoOutputErrorCode | ERROR_UNKNOWN = -1
ERROR_DRIVER_ERROR = 0 | Yes | Deprecated | +| ohos.multimedia.camera | VideoOutputError | code: VideoOutputErrorCode | Yes | Deprecated | +| ohos.multimedia.camera | MetadataObject | readonly type: MetadataObjectType;
readonly timestamp: number; | Yes | Added | +| ohos.multimedia.camera | MetadataObject | getType(callback: AsyncCallback): void;
getType(): Promise;
getTimestamp(callback: AsyncCallback): void;
getTimestamp(): Promise;
getBoundingBox(callback: AsyncCallback): void;
getBoundingBox(): Promise; | Yes | Deprecated | +| ohos.multimedia.camera | MetadataFaceObject | readonly boundingBox: Rect | Yes | Added | +| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback): void; | Yes | Added | +| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback): void; | Yes | Deprecated | +| ohos.multimedia.camera | MetadataOutputErrorCode | ERROR_UNKNOWN = -1
ERROR_INSUFFICIENT_RESOURCES = 0 | Yes | Deprecated | +| ohos.multimedia.camera | MetadataOutputError | code: MetadataOutputErrorCode | Yes | Deprecated | + +**Adaptation Guide** + +In addition to new APIs and deprecated APIs, you need to adapt your application to changed APIs. + +In Beta4 and later versions, the following APIs are changed. + +**New APIs** + +1. **CameraErrorCode** enums + + Enum: INVALID_ARGUMENT; value: 7400101 + + Enum: OPERATION_NOT_ALLOWED; value: 7400102 + + Enum: SESSION_NOT_CONFIG; value: 7400103 + + Enum: SESSION_NOT_RUNNING; value: 7400104 + + Enum: SESSION_CONFIG_LOCKED; value: 7400105 + + Enum: DEVICE_SETTING_LOCKED; value: 7400106 + + Enum: CONFILICT_CAMERA; value: 7400107 + + Enum: DEVICE_DISABLED; value: 7400108 + + Enum: SERVICE_FATAL_ERROR; value: 7400201 + +2. Added **capture(): Promise** to the **PhotoOutput** API. + +3. Added the readonly type **MetadataObjectType** to the **MetadataObject** API. + +4. Added **readonly timestamp: number** to the **MetadataObject** API. + +5. Added **readonly boundingBox: Rect** to the **MetadataObject** API. + +**Deprecated APIs** + +1. Deprecated the **release(callback: AsyncCallback): void** and **release(): Promise** APIs in **CameraInput**. + +2. Deprecated the **CameraInputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_NO_PERMISSION** = **0**, **ERROR_DEVICE_PREEMPTED** = **1**, **ERROR_DEVICE_DISCONNECTED** = **2**, **ERROR_DEVICE_IN_USE** = **3**, **ERROR_DRIVER_ERROR** = **4** + +3. Deprecated the **CameraInputError** API and its attribute **CameraInputErrorCode**. + +4. Deprecated the **CaptureSessionErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_INSUFFICIENT_RESOURCES** = **0**, **ERROR_TIMEOUT** = **1** + +5. Deprecated the **CaptureSessionError** API and its attribute **CaptureSessionErrorCode**. + +6. Deprecated the **PreviewOutputErrorCode** enum and its value: **ERROR_UNKNOWN** = **-1** + +7. Deprecated the **PreviewOutputError** API and its attribute **PreviewOutputErrorCode**. + +8. Deprecated the **PhotoOutputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_DRIVER_ERROR** = **0**, **ERROR_INSUFFICIENT_RESOURCES** = **1**, **ERROR_TIMEOUT** = **2** + +9. Deprecated the **PhotoOutputError** API and its attribute **PhotoOutputErrorCode**. + +10. Deprecated the **VideoOutputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_DRIVER_ERROR** = **0** + +11. Deprecated the **VideoOutputError** API and its attribute **VideoOutputErrorCode**. + +12. Deprecated **getType(callback: AsyncCallback): void** in the **MetadataObject** API. + +13. Deprecated **getType(): Promise** in the **MetadataObject** API. + +14. Deprecated **getTimestamp(callback: AsyncCallback): void** in the **MetadataObject** API. + +15. Deprecated **getTimestamp(): Promise** in the **MetadataObject** API. + +16. Deprecated **getBoundingBox(callback: AsyncCallback): void** in the **MetadataObject** API. + +17. Deprecated **getBoundingBox(): Promise** in the **MetadataObject** API. + +18. Deprecated the **MetadataOutputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_INSUFFICIENT_RESOURCES** = **0** + +19. Deprecated the **MetadataOutputError** API and its attribute **MetadataOutputErrorCode**. + +**Changed APIs** + +1. Changed the return modes of the **getCameraManager** API in the camera module from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getCameraManager(context: Context, callback: AsyncCallback): void** and **getCameraManager(context: Context): Promise** are changed to **getCameraManager(context: Context): CameraManager**. + + The code snippet is as follows: + + ``` + let cameraManager = camera.getCameraManager(context); + ``` + +2. Changed the return modes of the **getSupportedCameras** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedCameras(callback: AsyncCallback>): void** and **getSupportedCameras(): Promise>** are changed to **getSupportedCameras(): Array**. + + The code snippet is as follows: + + ``` + let cameras = cameraManager.getSupportedCameras(); + ``` + +3. Changed the return modes of the **getSupportedOutputCapability** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback): void** and **getSupportedOutputCapability(camera: CameraDevice): Promise** are changed to **getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability**. + + The code snippet is as follows: + + ``` + let cameraDevice = cameras[0]; + let CameraOutputCapability = cameraManager.getSupportedOutputCapability(cameraDevice); + ``` + +4. Changed the return modes of the **createCameraInput(camera: CameraDevice)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(camera: CameraDevice, callback: AsyncCallback): void** and **createCameraInput(camera: CameraDevice): Promise** are changed to **createCameraInput(camera: CameraDevice): CameraInput**. + + The code snippet is as follows: + + ``` + let cameraDevice = cameras[0]; + let cameraInput = cameraManager.createCameraInput(cameraDevice); + ``` + +5. Changed the return modes of the **createCameraInput(position: CameraPosition, type: CameraType)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void** and **createCameraInput(position: CameraPosition, type: CameraType): Promise** are changed to **createCameraInput(position: CameraPosition, type: CameraType): CameraInput**. + + The code snippet is as follows: + + ``` + let cameraDevice = cameras[0]; + let position = cameraDevice.cameraPosition; + let type = cameraDevice.cameraType; + let cameraInput = cameraManager.createCameraInput(position, type); + ``` + +6. Changed the return modes of the **createPreviewOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void** and **createPreviewOutput(profile: Profile, surfaceId: string): Promise** are changed to **createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput**. + + The code snippet is as follows: + + ``` + let profile = cameraoutputcapability.previewProfiles[0]; + let previewOutput = cameraManager.createPreviewOutput(profile, surfaceId); + ``` + +7. Changed the return modes of the **createPhotoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void** and **createPhotoOutput(profile: Profile, surfaceId: string): Promise** are changed to **createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput**. + + The code snippet is as follows: + + ``` + let profile = cameraoutputcapability.photoProfiles[0]; + let photoOutput = cameraManager.createPhotoOutput(profile, surfaceId); + ``` + +8. Changed the return modes of the **createVideoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback): void** and **createVideoOutput(profile: VideoProfile, surfaceId: string): Promise** are changed to **createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput**. + + The code snippet is as follows: + + ``` + let profile = cameraoutputcapability.videoProfiles[0]; + let videoOutput = cameraManager.createVideoOutput(profile, surfaceId); + ``` + +9. Changed the return modes of the **createMetadataOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createMetadataOutput(metadataObjectTypes: Array, callback: AsyncCallback): void** and **createMetadataOutput(metadataObjectTypes: Array): Promise** are changed to **createMetadataOutput(metadataObjectTypes: Array): MetadataOutput**. + + The code snippet is as follows: + + ``` + let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes; + let metadataOutput = cameraManager.createMetadataOutput(metadataObjectTypes); + ``` + +10. Changed the return modes of the **createCaptureSession** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCaptureSession(callback: AsyncCallback): void** and **createCaptureSession(): Promise** are changed to **createCaptureSession(): CaptureSession**. + + The code snippet is as follows: + + ``` + let captureSession = cameraManager.createCaptureSession(); + ``` + +11. Changed the enum **CAMERA_TYPE_UNSPECIFIED** of **CameraType** to **CAMERA_TYPE_DEFAULT**. + +12. Changed the return value type of the **on** API in CameraInput from **CameraInputError** to **BusinessError**. Therefore, the original API **on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void** is changed to **on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void**. + + The code snippet is as follows: + + ``` + let cameraDevice = cameras[0]; + cameraInput.on('error', cameraDevice, (BusinessError) => { + + }) + ``` + +13. Changed the return modes of the **beginConfig** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **beginConfig(callback: AsyncCallback): void** and **beginConfig(): Promise** are changed to **beginConfig(): void**. + + The code snippet is as follows: + + ``` + captureSession.beginConfig(); + ``` + +14. Changed the return modes of the **addInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addInput(cameraInput: CameraInput, callback: AsyncCallback): void** and **addInput(cameraInput: CameraInput): Promise** are changed to **addInput(cameraInput: CameraInput): void**. + + The code snippet is as follows: + + ``` + captureSession.addInput(cameraInput); + ``` + +15. Changed the return modes of the **removeInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeInput(cameraInput: CameraInput, callback: AsyncCallback): void** and **removeInput(cameraInput: CameraInput): Promise** are changed to **removeInput(cameraInput: CameraInput): void**. + + The code snippet is as follows: + + ``` + captureSession.removeInput(cameraInput); + ``` + +16. Changed the return modes of the **addOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void** and **addOutput(cameraOutput: CameraOutput): Promise** are changed to **addOutput(cameraOutput: CameraOutput): void**. + + The code snippet is as follows: + + ``` + captureSession.addOutput(previewOutput); + ``` + +17. Changed the return modes of the **removeOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void** and **removeOutput(cameraOutput: CameraOutput): Promise** are changed to **removeOutput(cameraOutput: CameraOutput): void**. + + The code snippet is as follows: + + ``` + captureSession.removeOutput(previewOutput); + ``` + +18. Changed the return modes of the **hasFlash** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **hasFlash(callback: AsyncCallback): void** and **hasFlash(): Promise** are changed to **hasFlash(): boolean**. + + The code snippet is as follows: + + ``` + let status = captureSession.hasFlash(); + ``` + +19. Changed the return modes of the **isFlashModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void** and **isFlashModeSupported(flashMode: FlashMode): Promise** are changed to **isFlashModeSupported(flashMode: FlashMode): boolean**. + + The code snippet is as follows: + + ``` + let status = captureSession.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO); + ``` + +20. Changed the return modes of the **getFlashMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFlashMode(callback: AsyncCallback): void** and **getFlashMode(): Promise** are changed to **getFlashMode(): FlashMode**. + + The code snippet is as follows: + + ``` + let flashMode = captureSession.getFlashMode(); + ``` + +21. Changed the return modes of the **isExposureModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback): void** and **isExposureModeSupported(aeMode: ExposureMode): Promise** are changed to **isExposureModeSupported(aeMode: ExposureMode): boolean**. + + The code snippet is as follows: + + ``` + let isSupported = captureSession.isExposureModeSupported(camera.ExposureMode.EXPOSURE_MODE_LOCKED); + ``` + +22. Changed the return modes of the **getExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureMode(callback: AsyncCallback): void** and **getExposureMode(): Promise** are changed to **getExposureMode(): ExposureMode**. + + The code snippet is as follows: + + ``` + let exposureMode = captureSession.getExposureMode(); + ``` + +23. Changed the return modes of the **setExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureMode(aeMode: ExposureMode, callback: AsyncCallback): void** and **setExposureMode(aeMode: ExposureMode): Promise** are changed to **setExposureMode(aeMode: ExposureMode): void**. + + The code snippet is as follows: + + ``` + captureSession.setExposureMode(camera.ExposureMode.EXPOSURE_MODE_LOCKED); + ``` + +24. Changed the return modes of the **getMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getMeteringPoint(callback: AsyncCallback): void** and **getMeteringPoint(): Promise** are changed to **getMeteringPoint(): Point**. + + The code snippet is as follows: + + ``` + let exposurePoint = captureSession.getMeteringPoint(); + ``` + +25. Changed the return modes of the **setMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setMeteringPoint(point: Point, callback: AsyncCallback): void** and **setMeteringPoint(point: Point): Promise** are changed to **setMeteringPoint(point: Point): void**. + + The code snippet is as follows: + + ``` + let Point2 = {x: 2, y: 2}; + captureSession.setMeteringPoint(Point2); + ``` + +26. Changed the return modes of the **getExposureBiasRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureBiasRange(callback: AsyncCallback>): void** and **getExposureBiasRange(): Promise>** are changed to **getExposureBiasRange(): Array**. + + The code snippet is as follows: + + ``` + let biasRangeArray = captureSession.getExposureBiasRange(); + ``` + +27. Changed the return modes of the **setExposureBias** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureBias(exposureBias: number, callback: AsyncCallback): void** and **setExposureBias(exposureBias: number): Promise** are changed to **setExposureBias(exposureBias: number): void**. + + The code snippet is as follows: + + ``` + let exposureBias = biasRangeArray[0]; + captureSession.setExposureBias(exposureBias); + ``` + +28. Changed the return modes of the **getExposureValue** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureValue(callback: AsyncCallback): void** and **getExposureValue(): Promise** are changed to **getExposureValue(): number**. + + The code snippet is as follows: + + ``` + let exposureValue = captureSession.getExposureValue(); + ``` + +29. Changed the return modes of the **isFocusModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void** and **isFocusModeSupported(afMode: FocusMode): Promise** are changed to **isFocusModeSupported(afMode: FocusMode): boolean**. + + The code snippet is as follows: + + ``` + let status = captureSession.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_AUTO); + ``` + +30. Changed the return modes of the **getFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusMode(callback: AsyncCallback): void** and **getFocusMode(): Promise** are changed to **getFocusMode(): FocusMode**. + + The code snippet is as follows: + + ``` + let afMode = captureSession.getFocusMode(); + ``` + +31. Changed the return modes of the **setFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusMode(afMode: FocusMode, callback: AsyncCallback): void** and **setFocusMode(afMode: FocusMode): Promise** are changed to **setFocusMode(afMode: FocusMode): void**. + + The code snippet is as follows: + + ``` + captureSession.setFocusMode(camera.FocusMode.FOCUS_MODE_AUTO); + ``` + +32. Changed the return modes of the **setFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusPoint(point: Point, callback: AsyncCallback): void** and **setFocusPoint(point: Point): Promise** are changed to **setFocusPoint(point: Point): void**. + + The code snippet is as follows: + + ``` + let Point2 = {x: 2, y: 2}; + captureSession.setFocusPoint(Point2); + ``` + +33. Changed the return modes of the **getFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusPoint(callback: AsyncCallback): void** and **getFocusPoint(): Promise** are changed to **getFocusPoint(): Point**. + + The code snippet is as follows: + + ``` + let point = captureSession.getFocusPoint(); + ``` + +34. Changed the return modes of the **getFocalLength** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocalLength(callback: AsyncCallback): void** and **getFocalLength(): Promise** are changed to **getFocalLength(): number**. + + The code snippet is as follows: + + ``` + let focalLength = captureSession.getFocalLength(); + ``` + +35. Changed the return modes of the **getZoomRatioRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatioRange(callback: AsyncCallback>): void** and **getZoomRatioRange(): Promise>** are changed to **getZoomRatioRange(): Array**. + + The code snippet is as follows: + + ``` + let zoomRatioRange = captureSession.getZoomRatioRange(); + ``` + +36. Changed the return modes of the **getZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatio(callback: AsyncCallback): void** and **getZoomRatio(): Promise** are changed to **getZoomRatio(): number**. + + The code snippet is as follows: + + ``` + let zoomRatio = captureSession.getZoomRatio(); + ``` + +37. Changed the return modes of the **setZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setZoomRatio(zoomRatio: number, callback: AsyncCallback): void** and **setZoomRatio(zoomRatio: number): Promise** are changed to **setZoomRatio(zoomRatio: number): void**. + + The code snippet is as follows: + + ``` + let zoomRatio = zoomRatioRange[0]; + captureSession.setZoomRatio(zoomRatio); + ``` + +38. Changed the return modes of the **isVideoStabilizationModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback): void** and **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise** are changed to **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean**. + + The code snippet is as follows: + + ``` + let isSupported = captureSession.isVideoStabilizationModeSupported(camera.VideoStabilizationMode.OFF); + ``` + +39. Changed the return modes of the **getActiveVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getActiveVideoStabilizationMode(callback: AsyncCallback): void** and **getActiveVideoStabilizationMode(): Promise** are changed to **getActiveVideoStabilizationMode(): VideoStabilizationMode**. + + The code snippet is as follows: + + ``` + let vsMode = captureSession.getActiveVideoStabilizationMode(); + ``` + +40. Changed the return modes of the **setVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback): void** and **setVideoStabilizationMode(mode: VideoStabilizationMode): Promise** are changed to **setVideoStabilizationMode(mode: VideoStabilizationMode): void**. + + The code snippet is as follows: + + ``` + captureSession.setVideoStabilizationMode(camera.VideoStabilizationMode.OFF); + ``` + +41. Changed the **on(type:'error') callback** type in CaptureSession from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. + + The code snippet is as follows: + + ``` + captureSession.on('error', (BusinessError) => { + + }) + ``` + +42. Changed the **on(type:'error') callback** type in PreviewOutput, from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. + + The code snippet is as follows: + + ``` + previewOutput.on('error', (BusinessError) => { + + }) + ``` + +43. Changed the return modes of the **isMirrorSupported** API in PhotoOutput from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isMirrorSupported(callback: AsyncCallback): void** and **isMirrorSupported(): Promise** are changed to **isMirrorSupported(): boolean**. + + The code snippet is as follows: + + ``` + let isSupported = photoOutput.isMirrorSupported(); + ``` + +44. Changed the **on(type:'error') callback** type in PhotoOutput, from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. + + The code snippet is as follows: + + ``` + PhotoOutput.on('error', (BusinessError) => { + + }) + ``` + +45. Changed the **on(type:'error') callback** type in VideoOutput, from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. + + The code snippet is as follows: + + ``` + VideoOutput.on('error', (BusinessError) => { + + }) + ``` + +46. Changed the **on(type:'error') callback** type in MetadataOutput, from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. + + The code snippet is as follows: + + ``` + MetadataOutput.on('error', (BusinessError) => { + + }) + ``` \ No newline at end of file diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-container.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-container.md new file mode 100644 index 0000000000000000000000000000000000000000..6bd06001584f34addcbec3f81a80d47d482e7ffe --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-container.md @@ -0,0 +1,21 @@ +# Common Library Subsystem Changelog + +## cl.commonlibrary.1 Error Code and Information Change +The error codes and information returned by APIs of the **ArrayList**, **List**, **LinkedList**, **Stack**, **Queue**, **Deque**, **PlainArray**, **LightWeightMap**, **LightWeightSet**, **HashMap**, **HashSet**, **TreeMap**, and **TreeSet** classes are changed. + +For details about the changed error codes, see [Utils Error Codes](../../../application-dev/reference/errorcodes/errorcode-utils.md). + +No adaptation is required for applications developed using these APIs. + +**Key API/Component Changes** +Error code information is redefined for APIs in these classes and marked using **'@throws'** in the *.d.ts file of the corresponding module. +The sample code is as follows: +**ArrayList** class before the change: +constructor(); +**ArrayList** class after the change: +@throws { BusinessError } 10200012 - The ArrayList's constructor cannot be directly invoked. +constructor(); + +**Change Impact** + +No impact. diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-mediaLibrary.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-mediaLibrary.md new file mode 100644 index 0000000000000000000000000000000000000000..459adbacf8a02fbb45ef82ee6bb6dba706633258 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-mediaLibrary.md @@ -0,0 +1,116 @@ +# File Management Subsystem Changelog + +## cl.file.1 mediaLibrary APIs Changed + +The **MediaLibrary** class of the multimedia component is replaced by the **FilePicker** class. + +**Change Impact** + +For applications developed based on earlier versions, pay attention to the changes of APIs. **FilePicker** is a system application preset in OpenHarmony. You can use it to select and save files. + +**Key API/Component Changes** + +The APIs of **MediaLibrary**, located in **@ohos.multimedia.medialibrary**, are deprecated. The **FilePicker** class, located in [@ohos.file.picker](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.file.picker.d.ts) is used. + +| Module | Method/Attribute/Enum/Constant | Change Type| +| ------------------------- | ------------------------------------------------------------ | -------- | +| medialibrary | **function** getMediaLibrary(): MediaLibrary; | Deprecated | +| medialibrary | **function** getMediaLibrary(context: Context): MediaLibrary; | Deprecated | +| medialibrary | **function** getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** getFileAssets(options: MediaFetchOptions): Promise\ | Deprecated | +| medialibrary | **function** on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void | Deprecated | +| medialibrary | **function** off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void | Deprecated | +| medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise\ | Deprecated | +| medialibrary | **function** deleteAsset(uri: string): Promise\ | Deprecated | +| medialibrary | **function** deleteAsset(uri: string, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** getPublicDirectory(type: DirectoryType, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** getPublicDirectory(type: DirectoryType): Promise\ | Deprecated | +| medialibrary | **function** getAlbums(options: MediaFetchOptions, callback: AsyncCallback\\>): void | Deprecated | +| medialibrary | **function** getAlbums(options: MediaFetchOptions): Promise\\> | Deprecated | +| medialibrary | **function** release(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** release(): Promise\ | Deprecated | +| medialibrary | **function** storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** storeMediaAsset(option: MediaAssetOption): Promise\ | Deprecated | +| medialibrary | **function** startImagePreview(images: Array\, index: number, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** startImagePreview(images: Array\, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** startImagePreview(images: Array\, index?: number): Promise\ | Deprecated | +| medialibrary | **function** startMediaSelect(option: MediaSelectOption, callback: AsyncCallback\\>): void | Deprecated | +| medialibrary | **function** startMediaSelect(option: MediaSelectOption): Promise\\> | Deprecated | +| medialibrary | **function** getActivePeers(): Promise\\>; | Deprecated | +| medialibrary | **function** getActivePeers(callback: AsyncCallback\\>): void; | Deprecated | +| medialibrary | **function** getAllPeers(): Promise\\>; | Deprecated | +| medialibrary | **function** FileAsset.isDirectory(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.isDirectory():Promise\ | Deprecated | +| medialibrary | **function** FileAsset.commitModify(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.commitModify(): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.open(mode: string, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.open(mode: string): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.close(fd: number, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.close(fd: number): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.getThumbnail(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.getThumbnail(size: Size, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.getThumbnail(size?: Size): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.favorite(isFavorite: boolean, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.favorite(isFavorite: boolean): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.isFavorite(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.isFavorite():Promise\ | Deprecated | +| medialibrary | **function** FileAsset.trash(isTrash: boolean, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.trash(isTrash: boolean): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.isTrash(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.isTrash():Promise\ | Deprecated | +| medialibrary | **function** FetchFileResult.getCount(): number | Deprecated | +| medialibrary | **function** FetchFileResult.isAfterLast(): boolean | Deprecated | +| medialibrary | **function** FetchFileResult.close(): void | Deprecated | +| medialibrary | **function** FetchFileResult.getFirstObject(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FetchFileResult.getFirstObject(): Promise\ | Deprecated | +| medialibrary | **function** FetchFileResult.getNextObject(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FetchFileResult.getNextObject(): Promise\ | Deprecated | +| medialibrary | **function** FetchFileResult.getLastObject(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FetchFileResult.getLastObject(): Promise\ | Deprecated | +| medialibrary | **function** FetchFileResult.getPositionObject(index: number, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FetchFileResult.getPositionObject(index: number): Promise\ | Deprecated | +| medialibrary | **function** FetchFileResult.getAllObject(callback: AsyncCallback\\>): void | Deprecated | +| medialibrary | **function** FetchFileResult.getAllObject(): Promise\\> | Deprecated | +| medialibrary | **function** Album.commitModify(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** Album.commitModify(): Promise\ | Deprecated | +| medialibrary | **function** Album.getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** Album.getFileAssets(options?: MediaFetchOptions): Promise\ | Deprecated | +| medialibrary | **enum** DeviceType | Deprecated | +| medialibrary | **enum** FileKey | Deprecated | +| medialibrary | **enum** DirectoryType | Deprecated | +| medialibrary | **enum** MediaType | Deprecated | +| medialibrary | **interface** PeerInfo | Deprecated | +| medialibrary | **interface** Size | Deprecated | +| medialibrary | **interface** MediaFetchOptions | Deprecated | +| medialibrary | **interface** MediaAssetOption | Deprecated | +| medialibrary | **interface** MediaSelectOption | Deprecated | +| medialibrary | **interface** FileAsset | Deprecated | + +**Adaptation Guide** + +For example, refer to the code snippet below to call an API to select an image: + +```js +import picker from '@ohos.file.picker'; + +async function example() { + try { + let PhotoSelectOptions = new picker.PhotoSelectOptions(); + PhotoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE; + PhotoSelectOptions.maxSelectNumber = 1; + let photoPicker = new picker.PhotoViewPicker(); + photoPicker.select(PhotoSelectOptions).then((PhotoSelectResult) => { + if (PhotoSelectResult !== undefined) { + console.info("PhotoViewPicker.select pass, PhotoSelectResult uri: " + JSON.stringify(PhotoSelectResult)); + } else { + console.error("PhotoViewPicker.select PhotoSelectResult is undefined"); + } + }).catch((err) => { + console.error("PhotoViewPicker.select fail, err: " + err); + }); + } catch (err) { + console.error("PhotoViewPicker fail, err: " + err); + } +} +``` diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-multimedia.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-multimedia.md new file mode 100644 index 0000000000000000000000000000000000000000..ffeb68c714639f07a5b53a0bacaca16be2aab81a --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-multimedia.md @@ -0,0 +1,53 @@ +## cl.multimedia.av_session.001 Change of All av_session APIs to System APIs + +All av_session APIs are changed to system APIs. + +**Change Impact** + +Non-system applications and applications without system API permission cannot call system APIs. + +**Key API/Component Changes** + +All APIs are changed to system APIs. The table below describes the APIs. + +| API/Enum/Variable| Type| Is System API| +| -------- | -------- | ------- | +| SessionToken | interface | Yes| +| AVMetadata | interface | Yes| +| AVPlaybackState | interface | Yes| +| PlaybackPosition | interface | Yes| +| OutputDeviceInfo | interface | Yes| +| AVSessionDescriptor | interface | Yes| +| AVSessionController | interface | Yes| +| AVControlCommand | interface | Yes| +| createAVSession | function | Yes| +| getAllSessionDescriptors | function | Yes| +| createController | function | Yes| +| castAudio | function | Yes| +| on | function | Yes| +| off | function | Yes| +| sendSystemAVKeyEvent | function | Yes| +| sendSystemControlCommand | function | Yes| +| sessionId | variable | Yes| +| setAVMetadata | function | Yes| +| setAVPlaybackState | function | Yes| +| setLaunchAbility | function | Yes| +| getController | function | Yes| +| getOutputDevice | function | Yes| +| activate | function | Yes| +| deactivate | function | Yes| +| destroy | function | Yes| +| getAVPlaybackState | function | Yes| +| getAVMetadata | function | Yes| +| getOutputDevice | function | Yes| +| sendAVKeyEvent | function | Yes| +| getLaunchAbility | function | Yes| +| getRealPlaybackPositionSync | function | Yes| +| isActive | function | Yes| +| getValidCommands | function | Yes| +| sendControlCommand | function | Yes| +| AVSessionType | type | Yes| +| AVControlCommandType | type | Yes| +| LoopMode | enum | Yes| +| PlaybackState | enum | Yes| +| AVSessionErrorCode | enum | Yes| diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-resourceschedule.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-resourceschedule.md new file mode 100644 index 0000000000000000000000000000000000000000..8df3e6671bd98eb04092412fd0c6e563268fb91d --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-resourceschedule.md @@ -0,0 +1,111 @@ +# Resource Scheduler Subsystem Changelog + +## cl.resourceschedule.backgroundTaskManager +Rectified the original APIs of **backgroundTaskManager** of the resource scheduler subsystem. All APIs of API version 9 in the **@ohos.backgroundTaskManager.d.ts** file are deleted, and the APIs of API version 9 in the **@ohos.resourceschedule.backgroundTaskManager.d.ts** file are used. The new APIs in API version 9 comply with the error code specifications. + +**Change Impacts** + +If your application is developed based on the SDK versions of OpenHarmony 3.2.10.5 and later, adapt to the modules and APIs in API version 9 and the pattern for returning error codes. Otherwise, the service logic will be affected. + +**Key API/Component Changes** + +The following methods, attributes, enums, and constants are changed in API version 9 and later versions. All the APIs in the **@ohos.backgroundTaskManager.d.ts** file are migrated to the **@ohos.resourceschedule.backgroundTaskManager.d.ts** file. + +| Class| API Type| Declaration| Description| +| -- | -- | -- | -- | +| backgroundTaskManager | method | function resetAllEfficiencyResources(): void; | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function applyEfficiencyResources(request: EfficiencyResourcesRequest): bool; | Changed in API version 9 to **function applyEfficiencyResources(request: EfficiencyResourcesRequest): void;** and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | export enum ResourceType | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | CPU = 1 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | COMMON_EVENT = 1 << 1 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | TIMER = 1 << 2 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | WORK_SCHEDULER = 1 << 3 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | BLUETOOTH = 1 << 4 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | GPS = 1 << 5 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | AUDIO = 1 << 6 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | interface | export interface EfficiencyResourcesRequest | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | reason: string | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isProcess?: bool | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isPersist?: bool | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | timeOut: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isApply: bool | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | resourceTypes: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| + + +**Adaptation Guide** + +Import the **backgroundTaskManager** module. +``` +import bundle form '@ohos.resourceschedule.backgroundTaskManager' +``` +Exception handling also needs to be adapted. For details, see the [backgroundTaskManager API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md). + +## c2.resourceschedule.workScheduler +Rectified the original APIs of **workScheduler** of the resource scheduler subsystem. All APIs of API version 9 in the **@ohos.workScheduler.d.ts** file are deleted, and the APIs of API version 9 in the **@ohos.resourceschedule.workScheduler.d.ts** file are used. The new APIs in API version 9 comply with the error code specifications. + +**Change Impacts** + +If your application is developed based on the SDK versions of OpenHarmony 3.2.10.5 and later, adapt to the modules and APIs in API version 9 and the pattern for returning error codes. Otherwise, the service logic will be affected. + +**Key API/Component Changes** + +The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.workScheduler.d.ts** file is deleted, and all the APIs in it are moved to the **@ohos.resourceschedule.workScheduler.d.ts** file. + +| Class| API Type| Declaration| Change Type| +| -- | -- | -- | -- | +| workScheduler | namespace | declare namespace workScheduler | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | interface | export interface WorkInfo | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | idleWaitTime?: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isDeepIdle?: boolean | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | repeatCount?: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isRepeat?: boolean | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | repeatCycleTime?: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | storageRequest?: StorageRequest | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | batteryStatus?: BatteryStatus | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | batteryLevel?: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | chargerType?: ChargingType | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isCharging?: boolean | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | networkType?: NetworkType | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isPersisted?: boolean | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | abilityName: string | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | bundleName: string | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | workId: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function isLastWorkTimeOut(workId: number): Promise; | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function stopAndClearWorks(): boolean; | Changed in API version 8 to **function stopAndClearWorks(): boolean;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler | method | function obtainAllWorks(): Promise>; | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function obtainAllWorks(callback: AsyncCallback): Array; | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function getWorkStatus(workId: number): Promise; | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback): void; | Deleted in API version 9 and moved 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 moved 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 moved to the **ohos.resourceschedule.workScheduler.d.ts** file| +| workScheduler.NetworkType | enum | export enum NetworkType | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_ANY = 0 | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_MOBILE | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_BLUETOOTH | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI_P2P | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_ETHERNET | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | export enum ChargingType | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_ANY = 0 | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_AC | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_USB | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_WIRELESS | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | export enum BatteryStatus | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW = 0 | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_OKAY | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW_OR_OKAY | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.StorageRequest | enum | export enum StorageRequest | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW = 0 | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_OKAY | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW_OR_OKAY | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| + + +**Adaptation Guide** + +Import the **workScheduler** module. +``` +import bundle form '@ohos.resourceschedule.workScheduler' +``` +Exception handling also needs to be adapted. For details, see the [workScheduler API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md). diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-url.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-url.md new file mode 100644 index 0000000000000000000000000000000000000000..4dfc6cacb85bb40bc9f02dab6343a82d4dbf7691 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-url.md @@ -0,0 +1,68 @@ +# Common Library Subsystem Changelog + +## cl.commonlibrary.1 URLParams Class Changes +The constructor function of the **URLParams** class in the URL module of the common library subsystem is changed. + +Specifically, **constructor(init?: string[][] | Record | string | URLSearchParams)** is changed to **constructor(init?: string[][] | Record | string | URLParams)**, and the parameter type is changed from **URLSearchParams** to **URLParams**. + +You need 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 | Change Type| +| :------------------------ | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.url | URLParams | constructor(string[][] \| Record<string, string> \| string \| URLSearchParams) | Deleted | +| @ohos.url | URLParams | constructor(string[][] \| Record<string, string> \| string \| URLParams)| Changed | + +**Adaptation Guide** + +The following illustrates how to create a **URLParams** object in your application. + +Example: + +```ts +import url from '@ohos.url' +try { + let params1 = new Url.URLParams('?user=abc&query=xyz') + let params2 = new Url.URLParams(params1) + var result= params2.toString() + console.log(result) //"user=abc&query=xyz" +} catch (err) { + console.error(`Fail to ceate URLParams.codeis${err.code},message is ${err.message}`); +} +``` +## cl.commonlibrary.2 URL Attribute Changes of URLParams Class APIs +The URL attributes of the URL module in the common library subsystem are changed. + +Specifically, the **searchParams: URLSearchParams** attribute is deprecated, and the **params: URLParams** attribute is added. + +You need 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 | Change Type| +| :------------------------ | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.url | URL | searchParams: URLSearchParams; |Deprecated (in API version 9)
| +| @ohos.url | URL | params: URLParams; | Added | + +**Adaptation Guide** + +The following illustrates how to create a **URLParams** object in your application. + +Example: + +```ts +import url from '@ohos.url' +let that = new Url.URL('http://username:password@host:8080/directory/file?Hello=china#qwer=da') +let params = that.URLParams +var result = params.toString() +console.log(result) //%E4%BD%A0%E5%A5%BD=china +``` diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-window.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-window.md new file mode 100644 index 0000000000000000000000000000000000000000..45f62272f6749f6822179648004f04623401a093 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-window.md @@ -0,0 +1,63 @@ +# Window Manager Subsystem Changelog + +## cl.window.1 Change of Window Stage Lifecycle Listener Types + +Changed the enumerated listener types of the window stage lifecycle in version 3.2.10.5 and later. + +**Change Impacts** + +Application lifecycle listeners developed using **FOREGROUND** and **BACKGROUND** in versions earlier than 3.2.10.5 will be invalidated in version 3.2.10.5 and later. + +**Key API/Component Changes** + +## WindowStageEventType9+ + +Before change + +| Name | Value | Description | +| ---------- | ---- | ---------- | +| FOREGROUND | 1 | The window stage is running in the foreground.| +| BACKGROUND | 4 | The window stage is running in the background.| + +After change +| Name | Value | Description | +| ------ | ---- | ---------- | +| SHOWN | 1 | The window stage is running in the foreground.| +| HIDDEN | 4 | The window stage is running in the background.| + +**Adaptation Guide** + +When registering lifecycle listeners, change the foreground and background event types to **SHOWN** and **HIDDEN**, respectively. + +``` +import Ability from '@ohos.application.Ability'; + +class myAbility extends Ability { + onWindowStageCreate(windowStage) { + console.log('onWindowStageCreate'); + try { + windowStage.on('windowStageEvent', (stageEventType) => { + switch (stageEventType) { + case window.WindowStageEventType.SHOWN: + console.log("windowStage shown"); + break; + case window.WindowStageEventType.ACTIVE: + console.log("windowStage active"); + break; + case window.WindowStageEventType.INACTIVE: + console.log("windowStage inActive"); + break; + case window.WindowStageEventType.HIDDEN: + console.log("windowStage hidden"); + break; + default: + break; + } + } ) + } catch (exception) { + console.error('Failed to enable the listener for window stage event changes. Cause:' + + JSON.stringify(exception)); + }; + } +}; +```