diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelog-security.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelog-security.md new file mode 100644 index 0000000000000000000000000000000000000000..970c73c2bdbe4ac56682e6ff8266c9f73f31f658 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelog-security.md @@ -0,0 +1,429 @@ +# Security Subsystem ChangeLog + +## cl.security.1 setSeed API Change of Random from Asynchronous to Synchronous + +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. +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** + +API prototype before change: + +- setSeed(seed : DataBlob, callback : AsyncCallback\) : void; +- setSeed(seed : DataBlob) : Promise\; + +API prototype after change: + +setSeed(seed : DataBlob) : void; + +**Adaptation Guide** + +See the API adaptation guide of **setSeed** in the API reference: [Crypto Framework - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cryptoFramework.md) + + +## cl.security.2 Migration of interface DataArray from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +Migrated **interface DataArray** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. + +**Adaptation Guide** + +Import and use the new .d.ts file: + +import cryptoCert from '@ohos.security.cert'; + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.3 Migration of interface EncodingFormat from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +Migrated **interface EncodingFormat** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. + +**Adaptation Guide** + +Import and use the new .d.ts file: + +import cryptoCert from '@ohos.security.cert'; + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.4 Migration of interface EncodingBlob from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +Migrated **interface EncodingBlob** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. + +**Adaptation Guide** + +Import and use the new .d.ts file: + +import cryptoCert from '@ohos.security.cert'; + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.5 Migration of interface CertChainData from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +Migrated **interface CertChainData** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. + +**Adaptation Guide** + +Import and use the new .d.ts file: + +import cryptoCert from '@ohos.security.cert'; + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.6 Migration of interface X509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +Migrated **interface X509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. + +**Adaptation Guide** + +Import and use the new .d.ts file: + +import cryptoCert from '@ohos.security.cert'; + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.7 Migration of function createX509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +Migrated **function createX509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. + +**Adaptation Guide** + +Import and use the new .d.ts file: + +import cryptoCert from '@ohos.security.cert'; + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.8 Migration of interface X509CrlEntry from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts. +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +Migrated **interface X509CrlEntry** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. + +**Adaptation Guide** + +Import and use the new .d.ts file: + +import cryptoCert from '@ohos.security.cert'; + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.9 Migration of interface X509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +Migrated **interface X509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. + +**Adaptation Guide** + +Import and use the new .d.ts file: + +import cryptoCert from '@ohos.security.cert'; + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.10 Migration of function createX509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +Migrated **function createX509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. + +**Adaptation Guide** + +Import and use the new .d.ts file: + +import cryptoCert from '@ohos.security.cert'; + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.11 Migration of interface CertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +Migrated **interface CertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. + +**Adaptation Guide** + +Import and use the new .d.ts file: + +import cryptoCert from '@ohos.security.cert'; + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.12 Migration of function createCertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +Migrated **function createCertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. + +**Adaptation Guide** + +Import and use the new .d.ts file: + +import cryptoCert from '@ohos.security.cert'; + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.13 getPublicKey API Change of X509Cert from Asynchronous to Synchronous +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +API prototype before change: + +- getPublicKey(callback : AsyncCallback\) : void; +- getPublicKey() : Promise\; + +API prototype after change: + +getPublicKey() : cryptoFramework.PubKey; + +**Adaptation Guide** + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.14 checkValidityWithDate API Change of X509Cert from Asynchronous to Synchronous +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +API prototype before change: + +- checkValidityWithDate(date: string, callback : AsyncCallback\) : void; +- checkValidityWithDate(date: string) : Promise\; + +API prototype after change: + +checkValidityWithDate(date: string) : void; + +**Adaptation Guide** + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.15 getCertIssuer API Change of X509CrlEntry from Asynchronous to Synchronous +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +API prototype before change: + +- getCertIssuer(callback : AsyncCallback\) : void; +- getCertIssuer() : Promise\; + +API prototype after change: + +getCertIssuer() : DataBlob; + +**Adaptation Guide** + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.16 getRevocationDate API Change of X509CrlEntry from Asynchronous to Synchronous +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +API prototype before change: + +- getRevocationDate(callback : AsyncCallback\) : void; +- getRevocationDate() : Promise\; + +API prototype after change: + +getRevocationDate() : string; + +**Adaptation Guide** + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.17 isRevoked API Change of X509Crl from Asynchronous to Synchronous +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +API prototype before change: + +- isRevoked(cert : X509Cert, callback : AsyncCallback\) : void; +- isRevoked(cert : X509Cert) : Promise\; + +API prototype after change: + +isRevoked(cert : X509Cert) : boolean; + +**Adaptation Guide** + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.18 getRevokedCert API Change of X509Crl from Asynchronous to Synchronous +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +API prototype before change: + +- getRevokedCert(serialNumber : number, callback : AsyncCallback\) : void; +- getRevokedCert(serialNumber : number) : Promise\; + +API prototype after change: + +getRevokedCert(serialNumber : number) : X509CrlEntry; + +**Adaptation Guide** + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.19 getRevokedCertWithCert API Change of X509Crl from Asynchronous to Synchronous +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +API prototype before change: + +- getRevokedCertWithCert(cert : X509Cert, callback : AsyncCallback\) : void; +- getRevokedCertWithCert(cert : X509Cert) : Promise\; + +API prototype after change: + +getRevokedCertWithCert(cert : X509Cert) : X509CrlEntry; + +**Adaptation Guide** + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.20 getTbsInfo API Change of X509Crl from Asynchronous to Synchronous +**Change Impacts** + +Behavior of released JavaScript APIs will be changed. + +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** + +API prototype before change: + +- getTbsInfo(callback : AsyncCallback\) : void; +- getTbsInfo() : Promise\; + +API prototype after change: + +getTbsInfo() : DataBlob; + +**Adaptation Guide** + +See the corresponding API adaptation guide in the API reference: [Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) + + \ No newline at end of file diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-ability.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-ability.md new file mode 100644 index 0000000000000000000000000000000000000000..7c8ad6fd675fe69b77298d1253ce2f56f95bb0e4 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-ability.md @@ -0,0 +1,132 @@ +# ChangeLog of JS API Changes of the Ability Subsystem + +Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(Mr) has the following API changes in the ability subsystem: + +## 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 applications based on the following information: + +**Change Impacts** + +JS APIs in API version 9 are affected. The application needs to adapt these APIs so that it can properly implement functions in the SDK environment of the new version. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enumeration/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 Impacts** + +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. Replace it with **Configuration** of **@ohos.app.ability.Configuration.d.ts**. +- @ohos.application.ConfigurationConstant.d.ts + - **Direction** and **ScreenDensity** are deleted. Replace them with **Direction** and **ScreenDensity** of **@ohos.app.ability.ConfigurationConstant.d.ts**. +- @ohos.application.abilityManager.d.ts + - **getExtensionRunningInfos** and **getTopAbility** are deleted. Replace them with synonymous methods of **@ohos.app.ability.abilityManager.d.ts**. +- @ohos.application.appManager.d.ts + - **ApplicationState** and **ProcessState** are deleted. Replace them with **ApplicationState** and **ProcessState** of **@ohos.app.ability.appManager.d.ts**. + - **registerApplicationStateObserver** and **getProcessRunningInformation** are deleted. Replace them with synonymous methods of **@ohos.app.ability.appManager.d.ts**. +- @ohos.application.formHost.d.ts + - **shareForm** and **notifyFormsPrivacyProtected** are deleted. Replace them with synonymous methods of **@ohos.app.form.formHost.d.ts**. +- @ohos.application.formInfo.d.ts + - **eTS** of **FormType** is deleted. Replace it with **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. Replace them with synonymous enumerations of **@ohos.app.form.formInfo.d.ts**. + - **FormInfoFilter** is deleted. Replace it with **FormInfoFilter** of **@ohos.app.form.formInfo.d.ts**. + - **FormDimension** is deleted. Replace it with **FormDimension** of **@ohos.app.form.formInfo.d.ts**. + - **VisibilityType** is deleted. Replace it with **VisibilityType** of **@ohos.app.form.formInfo.d.ts**. +- @ohos.wantAgent.d.ts + - **trigger** and **getOperationType** are deleted. Replace them with synonymous methods of **@ohos.app.ability.wantAgent.d.ts**. +- application/ApplicationContext.d.ts + - **registerAbilityLifecycleCallback**, **unregisterAbilityLifecycleCallback**, **registerEnvironmentCallback**, and **unregisterEnvironmentCallback** are deleted. Replace them with **on** and **off**. +- application/ServiceExtensionContext.d.ts + - **connectAbility**, **connectAbilityWithAccount**, and **disconnectAbility** are deleted. Replace them with **connectServiceExtensionAbility**, **connectServiceExtensionAbilityWithAccount**, and **disconnectServiceExtensionAbility**. +- @ohos.application.ExtensionAbility.d.ts + - **onCreate**, **onCastToNormal**, **onUpdate**, **onVisibilityChange**, **onEvent**, **onDestroy**, **onAcquireFormState**, and **onShare** are deleted. Replace them with 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. Replace them with synonymous classes of **@ohos.app.ability.abilityDelegatorRegistry.d.ts**. +- @ohos.application.abilityManager.d.ts + - **AbilityRunningInfo** and **ExtensionRunningInfo** are deleted. Replace them with synonymous classes of **@ohos.app.ability.abilityManager.d.ts**. +- @ohos.application.appManager.d.ts + - **AbilityStateData**, **AppStateData**, **ApplicationStateObserver**, **ProcessRunningInfo**, and **ProcessRunningInformation** are deleted. Replace them with synonymous classes of **@ohos.app.ability.appManager.d.ts**. +- @ohos.application.missionManager.d.ts + - **MissionInfo**, **MissionListener**, and **MissionSnapshot** are deleted. Replace them with synonymous classes of **@ohos.app.ability.missionManager.d.ts**. +- @ohos.wantAgent.d.ts + - **TriggerInfo** and **WantAgentInfo** are deleted. Replace them with synonymous classes of **@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 adaption. + +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 processing is needed. For details, see the API reference for the new APIs. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-container.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-container.md new file mode 100644 index 0000000000000000000000000000000000000000..c32d54a296c01a18d623c9de9bd9b71ef6cf8bc0 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-container.md @@ -0,0 +1,29 @@ +# ChangeLog of JS API Changes in the commonlibrary Subsystem + +Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(Mr) has the following API changes in the commonlibrary subsystem. + +## cl.commonlibrary.1 Error Code and Information Change +Changed error codes and information returned by APIs of the **ArrayList**, **List**, **LinkedList**, **Stack**, **Queue**, **Deque**, **PlainArray**, **LightWeightMap**, **LightWeightSet**, **HashMap**, **HashSet**, **TreeMap**, and **TreeSet** classes in the commonlibrary subsystem. + +For details about the changed error codes, see [error codes of language basic class libraries](../../../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 Impacts** + +None diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-distributeddatamgr.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-distributeddatamgr.md new file mode 100644 index 0000000000000000000000000000000000000000..df20e8b95ca67a47f89edf2fd6d6f4efa957bb07 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-distributeddatamgr.md @@ -0,0 +1,178 @@ +# ChangeLog of JS API Changes of the Distributed Data Management Subsystem + +Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(Mr) has the following API changes in the distributed data management subsystem: + +## cl.distributeddatamgr.1 API Change +APIs in the **kv_store** component of the distributed data management subsystem are changed: + +**createKVManager** is changed from asynchronous to synchronous, because the execution duration is fixed and short and there is no need to asynchronously wait for the execution result. Therefore, the original APIs **function createKVManager(config: KVManagerConfig): Promise\;** and **function createKVManager(config: KVManagerConfig, callback: AsyncCallback): void;** are changed to **function createKVManager(config: KVManagerConfig): KVManager;**. + +You need to adapt your applications based on the following information: + +**Change Impacts** + +JS APIs in API version 9 are affected. The application needs to adapt these APIs so that it can properly implement functions in the SDK environment of the new version. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| +| ------------------------ | ------------------ | ------------------------------------------------------------ | -------- | +| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): Promise\; | Deleted | +| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): KVManager; | Changed | + + +**Adaptation Guide** + +The following illustrates how to call **createKVManager** to create a **KVManager** object. + +Stage model: + +```ts +import AbilityStage from '@ohos.application.Ability' +let kvManager; +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + let context = this.context + const kvManagerConfig = { + context: context, + bundleName: 'com.example.datamanagertest', + } + try { + kvManager = distributedKVStore.createKVManager(kvManagerConfig); + } catch (e) { + console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`); + } + } +} +``` + +FA model: + +```ts +import featureAbility from '@ohos.ability.featureAbility' +let kvManager; +let context = featureAbility.getContext() +const kvManagerConfig = { + context: context, + bundleName: 'com.example.datamanagertest', +} +try { + kvManager = distributedKVStore.createKVManager(kvManagerConfig); +} catch (e) { + console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`); +} +``` + +## cl.distributeddatamgr.2 Migration of function getRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts. +**Change Impacts** + +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** + +APIs: + +```ts +function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number, callback: AsyncCallback): void; +function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number): Promise; +``` +The APIs are migrated from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**. +``` +function getRdbStore(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; +function getRdbStore(context: Context, config: StoreConfig, version: number): Promise; +``` + +**Adaptation Guide** + + * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`. + * The names of relevant methods should be changed according to the preceding changes. + +## cl.distributeddatamgr.3 Migration of function deleteRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts +**Change Impacts** + +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** + +APIs: + +```ts +function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback): void; +function deleteRdbStoreV9(context: Context, name: string): Promise; +``` +The APIs are migrated from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**. +``` +function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback): void; +function deleteRdbStoreV9(context: Context, name: string): Promise; +``` + +**Adaptation Guide** + * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`. + * The names of relevant methods should be changed according to the preceding changes. + +## cl.distributeddatamgr.4 Migration of interface StoreConfigV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts +**Change Impacts** + +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** + +**interface StoreConfigV9** is migrated from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and is renamed as **interface StoreConfig**. + +**Adaptation Guide** + * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`. + * The names of relevant APIs should be changed according to the preceding changes. + +## cl.distributeddatamgr.5 Migration of enum SecurityLevel from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts +**Change Impacts** + +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** + +**enum SecurityLevel** is migrated from **ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**. + +**Adaptation Guide** + * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`. + * The names of relevant APIs should be changed according to the preceding changes. + +## cl.distributeddatamgr.6 Migration of interface RdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts +**Change Impacts** + +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** + +**interface RdbStoreV9** is migrated from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and is renamed as **interface RdbStore**. + +**Adaptation Guide** + * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`. + * The names of relevant APIs should be changed according to the preceding changes. + +## cl.distributeddatamgr.7 Migration of class RdbPredicatesV9 from ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts +**Change Impacts** + +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** + +**class RdbPredicatesV9** is migrated from **ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and is renamed as **interface RdbPredicates**. + +**Adaptation Guide** + * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`. + * The names of relevant APIs should be changed according to the preceding changes. + +## cl.distributeddatamgr.8 Migration of interface ResultSetV9 from api/@ohos.data.relationalStore.d.ts to @ohos.data.relationalStore.d.ts +**Change Impacts** + +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** + +**interface ResultSetV9** is migrated from **api/data/rdb/resultSet.d.ts** to **@ohos.data.relationalStore.d.ts** and is renamed as **interface ResultSet**. + +**Adaptation Guide** + + * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`. + * The **ResultSetV9** instance is obtained only via **getRdbStoreV9**. After modifications are made according to cl.distributeddatamgr.2, the code can automatically adapt to **ResultSet**. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-multimedia.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-multimedia.md new file mode 100644 index 0000000000000000000000000000000000000000..4b223c8ac73a16fceaa2002167640f8aeb94fabd --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/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 Impacts** + +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, Enumeration, or 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/OpenHarmony_3.2.10.1/changelogs-notification.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-notification.md new file mode 100644 index 0000000000000000000000000000000000000000..9a1113faab7fcf5329564939b5be571da88dec80 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-notification.md @@ -0,0 +1,47 @@ +# Common Event and Notification Subsystem ChangeLog + +## cl.notification.1 Deleting Deprecated APIs (Version 9) + +In the [event notification exception handling rectification](../OpenHarmony_3.2.8.3/changelogs-notification.md), some APIs in API version 9 are marked as deprecated, and these APIs need to be deleted, according to OpenHarmony API specifications. + +**Change Impacts** + +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** + +Deprecated APIs in API version 9 will be deleted, and they will be replaced with new ones with same names. + +| Original API | New API | +| ----------------------- | -------------------------------- | +| @ohos.commonEvent.d.ts | @ohos.commonEventManager.d.ts | +| @ohos.notification.d.ts | @ohos.notificationManager.d.ts | +| @ohos.notification.d.ts | @ohos.notificationSubscribe.d.ts | + +APIs or attributes are deleted: + +- @ohos.notification.d.ts + - The **publishAsBundle**, **cancelAsBundle**, **isNotificationSlotEnabled**, **setSyncNotificationEnabledWithoutApp**, and **getSyncNotificationEnabledWithoutApp** APIs are deleted. Replace them with APIs with same names in **api/@ohos.notificationManager.d.ts**. + - The **enableNotificationSlot** API is deleted. Replace it with **setNotificationEnableSlot** in **api/@ohos.notificationManager.d.ts**. + - The export classes **NotificationActionButton**, **NotificationBasicContent**, **NotificationContent**, **NotificationLongTextContent**, **NotificationMultiLineContent**, **NotificationPictureContent**, **NotificationFlags**, **NotificationFlagStatus**, **NotificationRequest**, **DistributedOptions**, **NotificationSlot**, **NotificationSorting**, **NotificationTemplate**, and **NotificationUserInput** are deleted. Replace them with the export classes with the same names in **api/@ohos.notificationManager.d.ts**. + - The export classes **NotificationSubscribeInfo**, **NotificationSubscriber**, **SubscribeCallbackData**, and **EnabledNotificationCallbackData** are deleted. Replace them with the export classes with the same names in **api/@ohos.notificationSubscribe.d.ts**. + +**Adaptation Guide** + +The original APIs are only migrated to the new namespace. Therefore, you can modify **import** to solve the adaptation problem. + +If the original API uses **@ohos.commonEvent**: + +```js +import commonEvent from '@ohos.commonEvent'; +``` + +You can directly modify **import** to switch to the new namespace: + +```js +import commonEvent from '@ohos.commonEventManager'; +``` + +**@ohos.notification** is split into two namespaces. You need to select a new namespace for adaptation. + +In addition, exception handling is needed. For details, see the API reference for the new APIs. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-time.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-time.md new file mode 100644 index 0000000000000000000000000000000000000000..2d9c3e7995b78e68333bf728fab7c0bdb0be3514 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-time.md @@ -0,0 +1,265 @@ +# Time Subsystem ChangeLog + +## cl.time.1 API Error Change + +Errors thrown by timer APIs of the time subsystem: **202** (non-system application) and **401** (invalid parameters). + +**Change Impacts** + +The API change is forward compatible. Applications developed based on earlier versions can still use the APIs, and corresponding error handling is added. The original functions are not affected. + +**Key API/Component Changes** + +Before change: + - The API throws an error message without an error code. + +After change: + - The API throws an error message with an error code. Error code **202** indicates that the application is not a system application, and error code **401** indicates that the parameters are invalid. + + | Module | Class | Method/Attribute/Enumeration/Constant | Change Type| + | ----------------- | ----------- | ------------------------------------------------------------ | -------- | + | @ohos.systemTimer | systemTimer | function createTimer(options: TimerOptions, callback: AsyncCallback): void | Changed | + | @ohos.systemTimer | systemTimer | function createTimer(options: TimerOptions): Promise | Changed | + | @ohos.systemTimer | systemTimer | function startTimer(timer: number, triggerTime: number, callback: AsyncCallback): void | Changed | + | @ohos.systemTimer | systemTimer | function startTimer(timer: number, triggerTime: number): Promise | Changed | + | @ohos.systemTimer | systemTimer | function stopTimer(timer: number, callback: AsyncCallback): void | Changed | + | @ohos.systemTimer | systemTimer | function stopTimer(timer: number): Promise | Changed | + | @ohos.systemTimer | systemTimer | function destroyTimer(timer: number, callback: AsyncCallback): void | Changed | + | @ohos.systemTimer | systemTimer | function destroyTimer(timer: number): Promise | Changed | + + +**Adaptation Guide** + +Refer to the code below to capture errors when **systemTimer** APIs are called in applications. + +createTimer callback mode: + +**Example**: + +```js +export default { + systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat: false + }; + try { + systemTimer.createTimer(options, (error, data) => { + if (error) { + // Capture the permission denial error. + console.info(`Failed to create timer. message:${error.message}, code:${error.code}`); + } + }); + } catch(e) { + // Capture the parameter verification error. + console.info(`Failed to create timer. message:${e.message}, code:${e.code}`); + } + } +} +``` + +createTimer promise mode: + +**Example**: + +```js +export default { + systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat: false + }; + try { + systemTimer.createTimer(options).then((data) => { + console.info(`Succeeded in creating timer. Data:` + data); + }).catch((error) => { + // Capture the permission denial error. + console.info(`Failed to create timer. message:${error.message}, code:${error.code}`); + }); + } catch(e) { + // Capture the parameter verification error. + console.info(`Failed to create timer. message:${e.message}, code:${e.code}`); + } + } +} +``` + +startTimer callback mode: + +**Example**: + +```js +export default { + async systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + try { + systemTimer.startTimer(timerId, triggerTime, (error) => { + if (error) { + // Capture the permission denial error. + console.error(`Failed to start timer. message:${error.message}, code:${error.code}`); + } + }); + } catch (e) { + // Capture the parameter verification error. + console.info(`Failed to start timer. message:${e.message}, code:${e.code}`); + } + } +} +``` + +startTimer promise mode: + +**Example**: + +```js +export default { + async systemTimer (){ + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + try { + systemTimer.startTimer(timerId, triggerTime).then((data) => { + console.log(`Succeeded in startting timer. Data:` + data); + }).catch((error) => { + // Capture the permission denial error. + console.info(`Failed to start timer. message:${error.message}, code:${error.code}`); + }); + } catch (e) { + // Capture the parameter verification error. + console.info(`Failed to start timer. message:${e.message}, code:${e.code}`); + } + } +} +``` + +stopTimer callback mode: + +**Example**: + +```js +export default { + async systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + systemTimer.startTimer(timerId, triggerTime); + try { + systemTimer.stopTimer(timerId, triggerTime, (error) => { + if (error) { + // Capture the permission denial error. + console.error(`Failed to stop timer. message:${error.message}, code:${error.code}`); + } + }); + } catch (e) { + // Capture the parameter verification error. + console.info(`Failed to stop timer. message:${e.message}, code:${e.code}`); + } + } +} +``` + +stopTimer promise mode: + +**Example**: + +```js +export default { + async systemTimer (){ + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + systemTimer.startTimer(timerId, triggerTime); + try { + systemTimer.stopTimer(timerId, triggerTime).then((data) => { + console.log(`Succeeded in stop timer. Data:` + data); + }).catch((error) => { + // Capture the permission denial error. + console.info(`Failed to stop timer. message:${error.message}, code:${error.code}`); + }); + } catch (e) { + // Capture the parameter verification error. + console.info(`Failed to stop timer. message:${e.message}, code:${e.code}`); + } + } +} +``` + +destroyTimer callback mode: + +**Example**: + +```js +export default { + async systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + systemTimer.startTimer(timerId, triggerTime); + systemTimer.stopTimer(timerId); + try { + systemTimer.destroyTimer(timerId, triggerTime, (error) => { + if (error) { + // Capture the permission denial error. + console.error(`Failed to destroy timer. message:${error.message}, code:${error.code}`); + } + }); + } catch (e) { + // Capture the parameter verification error. + console.info(`Failed to destroy timer. message:${e.message}, code:${e.code}`); + } + } +} +``` + +destroyTimer promise mode: + +**Example**: + +```js +export default { + async systemTimer (){ + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + systemTimer.startTimer(timerId, triggerTime); + systemTimer.stopTimer(timerId); + try { + systemTimer.destroyTimer(timerId, triggerTime).then((data) => { + console.log(`Succeeded in destroy timer. Data:` + data); + }).catch((error) => { + // Capture the permission denial error. + console.info(`Failed to destroy timer. message:${error.message}, code:${error.code}`); + }); + } catch (e) { + // Capture the parameter verification error. + console.info(`Failed to destroy timer. message:${e.message}, code:${e.code}`); + } + } +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-url.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-url.md new file mode 100644 index 0000000000000000000000000000000000000000..655d5f1348b234110937883f1a8d7899ef0e3ca8 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-url.md @@ -0,0 +1,70 @@ +# ChangeLog of JS API Changes in the URL Subsystem + +Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(Mr) has the following API changes in the URL subsystem: + +## cl.url.1 URLParams Class API Changes +APIs in the **URLParams** class in the URL subsystem are changed: + +**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 based on the following information. + +**Change Impacts** + +JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement functions in the SDK environment of the new version. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enumeration/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.url.2 URL Attribute Changes of URLParams Class APIs +URL attributes in the URL subsystem are changed: + +The **searchParams: URLSearchParams** attribute is deprecated, and the **params: URLParams** attribute is added. + +You need to adapt your application based on the following information. + +**Change Impacts** + +JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement functions in the SDK environment of the new version. + +**Key API/Component Changes** + +| Module | Class| Method/Attribute/Enumeration/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/OpenHarmony_3.2.8.1/changelogs-account_os_account.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-account_os_account.md new file mode 100644 index 0000000000000000000000000000000000000000..3459586875dff427f23fceb9bbc9d6c7ce7de00a --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-account_os_account.md @@ -0,0 +1,105 @@ +# Account Subsystem ChangeLog + +## cl.account_os_account.1 Change of Definition and Return Mode of Error Codes + +To solve the issues that error code definitions of the account subsystem APIs were inconsistent and that the return mode of the error codes did not comply with relevant specifications of OpenHarmony, the following changes are made and take effect in API version 9 and later: + +- Added the following unified error code definitions: + - [Account Error Codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-account.md) + - [App Account Error Codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-app-account.md) + +- Returned an error code in either of the following ways, according to the API type: + - Asynchronous API: An error message is returned via **AsyncCallback** or the **error** object of **Promise**. An error message related to the parameter type or quantity is returned via an exception. + - Synchronous API: An error message is returned via an exception. + +**Change Impacts** + +The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +The mentioned changes involve the following APIs: + - class AccountManager + - activateOsAccount(localId: number, callback: AsyncCallback<void>): void; + - removeOsAccount(localId: number, callback: AsyncCallback<void>): void; + - setOsAccountConstraints(localId: number, constraints: Array<string>, enable: boolean, callback: AsyncCallback<void>): void; + - setOsAccountName(localId: number, localName: string, callback: AsyncCallback<void>): void; + - queryMaxOsAccountNumber(callback: AsyncCallback<number>): void; + - queryAllCreatedOsAccounts(callback: AsyncCallback<Array<OsAccountInfo>>): void; + - createOsAccount(localName: string, type: OsAccountType, callback: AsyncCallback<OsAccountInfo>): void; + - createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, callback: AsyncCallback<OsAccountInfo>): void; + - queryOsAccountById(localId: number, callback: AsyncCallback<OsAccountInfo>): void; + - getOsAccountProfilePhoto(localId: number, callback: AsyncCallback<string>): void; + - setOsAccountProfilePhoto(localId: number, photo: string, callback: AsyncCallback<void>): void; + - on(type: 'activate' | 'activating', name: string, callback: Callback<number>): void; + - off(type: 'activate' | 'activating', name: string, callback?: Callback<number>): void; + - isMainOsAccount(callback: AsyncCallback<boolean>): void; + - queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback<Array<ConstraintSourceTypeInfo>>): void; + - class UserAuth + - constructor(); + - getVersion(): number; + - getAvailableStatus(authType: AuthType, authTrustLevel: AuthTrustLevel): number; + - getProperty(request: GetPropertyRequest, callback: AsyncCallback<ExecutorProperty>): void; + - setProperty(request: SetPropertyRequest, callback: AsyncCallback<number>): void; + - auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel, callback: IUserAuthCallback): Uint8Array; + - authUser(userId: number, challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel, callback: IUserAuthCallback): Uint8Array; + - cancelAuth(contextID: Uint8Array): number; + - class PINAuth + - constructor(); + - registerInputer(inputer: IInputer): boolean; + - unregisterInputer(authType: AuthType): void; + - class UserIdentityManager + - constructor(); + - openSession(callback: AsyncCallback<Uint8Array>): void; + - addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void; + - updateCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void; + - closeSession(): void; + - cancel(challenge: Uint8Array): number; + - delUser(token: Uint8Array, callback: IIdmCallback): void; + - delCred(credentialId: Uint8Array, token: Uint8Array, callback: IIdmCallback): void; + - getAuthInfo(callback: AsyncCallback<Array<EnrolledCredInfo>>): void; + - interface IInputData + - onSetData: (authSubType: AuthSubType, data: Uint8Array) => void; + +**Adaptation Guide** + +The following uses **activateOsAccount** as an example to illustrate the error information processing logic of an asynchronous API: + +```ts +import account_osAccount from "@ohos.account.osAccount" +let accountMgr = account_osAccount.getAccountManager() +let callbackFunc = (err) => { + if (err != null) { // Handle the business error. + console.log("account_osAccount failed, error: " + JSON.stringify(err)); + } else { + console.log("account_osAccount successfully"); + } +} +try { + accountMgr.activateOsAccount("100", callbackFunc); +} catch (err) { // Process the error that is related to the parameter type. + console.log("account_osAccount failed for incorrect parameter type, error: " + JSON.stringify(err)); +} +try { + accountMgr.activateOsAccount(); +} catch (err) { // Process the error that is related to the parameter quantity. + console.log("account_osAccount failed for incorrect parameter number, error: " + JSON.stringify(err)); +} +``` + +The following uses **registerInputer** as an example to illustrate the error information processing logic of a synchronous API: + +```ts +import account_osAccount from "@ohos.account.osAccount" +let pinAuth = new account_osAccount.PINAuth() +try { + pinAuth.registerInputer({}) +} catch (err) { // Process the error that is related to the parameter type. + console.log("account_osAccount failed for incorrect parameter type, error: " + JSON.stringify(err)); +} +try { + pinAuth.registerInputer() +} catch (err) { // Process the error that is related to the parameter quantity. + console.log("account_osAccount failed for incorrect parameter number, error: " + JSON.stringify(err)); +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-camera.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-camera.md new file mode 100644 index 0000000000000000000000000000000000000000..16559935d6dba10f19739a84c4fe45c11855298f --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-camera.md @@ -0,0 +1,783 @@ +# ChangeLog of JS API Changes in the Multimedia Subsystem + +Compared with OpenHarmony 3.2 Beta3, OpenHarmony 3.2 Beta4 has the following changes in APIs of the camera component in the multimedia subsystem. + +## 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 Impacts** + +JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement functions in the SDK environment of the new version. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enumeration/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 sample code 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 sample code is as follows: + + ``` + let ismuted = cameraManager.isCameraMuted(); + ``` + +7. The **isCameraMuteSupported(): boolean;** API is added to **CameraManager**. + + The sample code is as follows: + + ``` + let ismutesuppotred = cameraManager.isCameraMuteSupported(); + ``` + +8. The **muteCamera(mute: boolean): void;** API is added to **CameraManager**. + + The sample code is as follows: + + ``` + let mute = true; + cameraManager.muteCamera(mute); + ``` + +9. The **on(type: 'cameraMute', callback: AsyncCallback): void;** API is added to **CameraManager**. + + The sample code 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 sample code 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 sample code 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 enumerations are added to **CameraInputErrorCode**: + + Enumeration: ERROR_NO_PERMISSION; value: 0 + + Enumeration: ERROR_DEVICE_PREEMPTED; value: 1 + + Enumeration: ERROR_DEVICE_DISCONNECTED; value: 2 + + Enumeration: ERROR_DEVICE_IN_USE; value: 3 + + Enumeration: ERROR_DRIVER_ERROR; value: 4 + +13. The following enumeration is added to **CameraFormat**: + + Enumeration: CAMERA_FORMAT_RGBA_8888; value: 3 + +14. The **getMeteringPoint(callback: AsyncCallback): void;** and **getMeteringPoint(): Promise;** APIs are added to **CaptureSession**. + + The sample code 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 sample code 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 enumerations are added to **CaptureSessionErrorCode**: + + Enumeration: ERROR_INSUFFICIENT_RESOURCES; value: 0 + + Enumeration: 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 sample code 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 sample code 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 enumerations are added to **PhotoOutputErrorCode**: + + Enumeration: ERROR_DRIVER_ERROR; value: 0 + + Enumeration: ERROR_INSUFFICIENT_RESOURCES; value: 1 + + Enumeration: ERROR_TIMEOUT; value: 2 + +22. The following enumeration is added to **VideoOutputErrorCode**: + + Enumeration: ERROR_DRIVER_ERROR; value: 0 + +23. The **on(type: 'error', callback: ErrorCallback): void;** API is added to **MetadataOutput**. + + The sample code is as follows: + + ``` + metadataOutput.on('error', (metadataOutputError) => { + console.log(`Metadata output error code: ${metadataOutputError.code}`); + }) + ``` + +24. The following enumerations are added to **MetadataOutputErrorCode**. + + Enumeration: ERROR_UNKNOWN; value: -1 + + Enumeration: 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 sample code 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 sample code 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 sample code 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 sample code 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 sample code 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 sample code 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 sample code 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 sample code 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 sample code is as follows: + + ``` + captureSession.on('focusStateChange', (focusState) => { + console.log(`Focus state : ${focusState}`); + }) + ``` + +12. The following enumerations are added to **ExposureMode**: + + Enumeration: EXPOSURE_MODE_AUTO; initial value: changed from the default value to **1** + + Enumeration: EXPOSURE_MODE_CONTINUOUS_AUTO; initial value: changed from the default value to **2** + +13. The following enumerations are added to **VideoStabilizationMode**: + + Enumeration: LOW; initial value: changed from the default value to **1** + + Enumeration: MIDDLE; initial value: changed from the default value to **2** + + Enumeration: HIGH; initial value: changed from the default value to **3** + + Enumeration: AUTO; initial value: changed from the default value to **4** + +14. In **CaptureSession**, the parameter of the **addOutput** API is changed from the original subclass 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 subclass 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 enumeration in **MetadataObjectType** is changed: + + The enumeration 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/OpenHarmony_3.2.8.1/changelogs-device-manager.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-device-manager.md new file mode 100644 index 0000000000000000000000000000000000000000..d23319a17e6cdbc1d3a82d5b9186f591203833b6 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-device-manager.md @@ -0,0 +1,106 @@ +# Device Manager ChangeLog + +## cl.device_manager.1 Error Information Return Method Change of APIs + +The device manager API uses service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. The following changes are made in API version 9 and later: + +Asynchronous API: An error message is returned via **AsyncCallback** or the **error** object of **Promise**. + +Synchronous API: An error message is returned via an exception. + +**Change Impacts** + +The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +Error code processing is added for the following APIs: + - createDeviceManager(bundleName: string, callback: AsyncCallback<DeviceManager>): void; + - release(): void; + - getTrustedDeviceListSync(): Array<DeviceInfo> + - getTrustedDeviceList(callback:AsyncCallback<Array<DeviceInfo>>): void; + - getTrustedDeviceList(): Promise<Array<DeviceInfo>> + - getLocalDeviceInfoSync(): DeviceInfo; + - getLocalDeviceInfo(callback:AsyncCallback<DeviceInfo>): void; + - getLocalDeviceInfo(): Promise<DeviceInfo> + - startDeviceDiscovery(subscribeInfo: SubscribeInfo): void; + - startDeviceDiscovery(subscribeInfo: SubscribeInfo, filterOptions?: string): void; + - stopDeviceDiscovery(subscribeId: number): void; + - publishDeviceDiscovery(publishInfo: PublishInfo): void; + - unPublishDeviceDiscovery(publishId: number): void; + - authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: AsyncCallback<{deviceId: string, pinToken ?: number}>): void; + - unAuthenticateDevice(deviceInfo: DeviceInfo): void; + - verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback<{deviceId: string, level: number}>): void; + - setUserOperation(operateAction: number, params: string): void; + - on(type: 'uiStateChange', callback: Callback<{ param: string}>): void; + - off(type: 'uiStateChange', callback?: Callback<{ param: string}>): void; + - on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void; + - off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void; + - on(type: 'deviceFound', callback: Callback<{ subscribeId: number, device: DeviceInfo }>): void; + - off(type: 'deviceFound', callback?: Callback<{ subscribeId: number, device: DeviceInfo }>): void; + - on(type: 'discoverFail', callback: Callback<{ subscribeId: number, reason: number }>): void; + - off(type: 'discoverFail', callback?: Callback<{ subscribeId: number, reason: number }>): void; + - on(type: 'publishSuccess', callback: Callback<{ publishId: number }>): void; + - off(type: 'publishSuccess', callback?: Callback<{ publishId: number }>): void; + - on(type: 'publishFail', callback: Callback<{ publishId: number, reason: number }>): void; + - off(type: 'publishFail', callback?: Callback<{ publishId: number, reason: number }>): void; + - on(type: 'serviceDie', callback: () => void): void; + - off(type: 'serviceDie', callback?: () => void): void; + +**Adaptation Guide** + +The following uses **getTrustedDeviceList** as an example for asynchronous APIs: + +```ts +import account_osAccount from "@ohos.distributedHardware.deviceManager" +dmInstance.getTrustedDeviceList((err, data) => { + console.log("getTrustedDeviceList err: " + JSON.stringify(err)); + console.log('get trusted device info: ' + JSON.stringify(data)); +}); + +try { + dmInstance.getTrustedDeviceList((err, data) => { + if (err) { + console.error("getTrustedDeviceList errCode:" + err.code + ",errMessage:" + err.message); + return; + } + console.log('get trusted device info: ' + JSON.stringify(data)); + }); +} catch (err) { + console.error("getTrustedDeviceList errCode:" + err.code + ",errMessage:" + err.message); +} +``` + +The following uses **startDeviceDiscovery** as an example for synchronous APIs: + +```ts +// Automatically generate a unique subscription ID. +var subscribeId = Math.floor(Math.random() * 10000 + 1000); +var subscribeInfo = { + "subscribeId": subscribeId, + "mode": 0xAA, // Active discovery + "medium": 0, // Automatic. Multiple media can be used for device discovery. + "freq": 2, // High frequency + "isSameAccount": false, + "isWakeRemote": false, + "capability": 1 +}; +dmInstance.startDeviceDiscovery(subscribeInfo); // The deviceFound callback is called to notify the application when a device is discovered. + +// Automatically generate a unique subscription ID. +var subscribeId = Math.floor(Math.random() * 10000 + 1000); +var subscribeInfo = { + "subscribeId": subscribeId, + "mode": 0xAA, // Active discovery + "medium": 0, // Automatic. Multiple media can be used for device discovery. + "freq": 2, // High frequency + "isSameAccount": false, + "isWakeRemote": false, + "capability": 1 +}; +try { + dmInstance.startDeviceDiscovery(subscribeInfo); // The deviceFound callback is called to notify the application when a device is discovered. +} catch (err) { + console.error("startDeviceDiscovery errCode:" + err.code + ",errMessage:" + err.message); +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-device-usb.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-device-usb.md new file mode 100644 index 0000000000000000000000000000000000000000..cc7d82ae7758a9be105037bfc60c9ab7eb54b0b1 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-device-usb.md @@ -0,0 +1,27 @@ +# USB Manager ChangeLog + +## cl.usb_manager.1 Error Information Return Method Change of APIs + +The USB manager API uses service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. Beginning from API version 9, error information is returned by throwing exceptions. + +**Change Impacts** + +The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +Changed the USB module name from **@ohos.usb.d.ts** to **@ohos.usbV9.d.ts**, and added error code processing for all APIs in the module. + +**Adaptation Guide** + +Take the **getDevices** API as an example. The sample code is as follows: + +```ts +import usbV9 from '@ohos.usbV9' + +try { +usbV9.getDevices(); // If an improper parameter is passed to this API, an exception will be thrown. +} catch (err) { +console.error("getDevices errCode:" + err.code + ",errMessage:" + err.message); +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-dsoftbus.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-dsoftbus.md new file mode 100644 index 0000000000000000000000000000000000000000..ef64e7d28caf508bcbc0011975071a613e544649 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-dsoftbus.md @@ -0,0 +1,145 @@ +# DSoftBus Subsystem ChangeLog + +## IPC&RPC APIs support the exception handling mode and the selection of synchronous or asynchronous message sending by passing a Boolean value or a numeric value. +1. Some IPC&RPC APIs of DSoftBus use service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. +2. A Boolean value can be passed to specify the mode of sending information as asynchronous or synchronous. +#### Change Impacts + +This version is compatible with earlier versions and no adaptation is required. Newly added APIs can be called to support the following changes: +1. Supports exception handling and return of error codes. +2. Supports selection of synchronous or asynchronous message sending by passing a Boolean value or by passing 0 or a non-0 number. + +#### **Key API/Component Changes** + +For adaptation to the unified API exception handling mode, related IPC&RPC APIs are deprecated, and corresponding new APIs and methods are added. The newly added APIs support unified error code handling specifications and function the same as the original APIs. +| Class| Deprecated API | New Class | New API | +| ------------ | ------------ | ------------ | ------------ | +| MessageParcel | static create(): MessageParcel | MessageSequence | static create(): MessageSequence | +| MessageParcel | reclaim(): void | MessageSequence | reclaim(): void | +| MessageParcel | writeRemoteObject(object: IRemoteObject): boolean| MessageSequence |writeRemoteObject(object: IRemoteObject): void| +| MessageParcel | readRemoteObject(): IRemoteObject | MessageSequence | readRemoteObject(): IRemoteObject | +| MessageParcel | writeInterfaceToken(token: string): boolean | MessageSequence | writeInterfaceToken(token: string): void | +| MessageParcel | readInterfaceToken(): string | MessageSequence | readInterfaceToken(): string | +| MessageParcel | getSize(): number | MessageSequence | getSize(): number | +| MessageParcel | getCapacity(): number | MessageSequence | getCapacity(): number| +| MessageParcel | setSize(size: number): boolean | MessageSequence | setCapacity(size: number): void | +| MessageParcel | getReadableBytes(): number | MessageSequence | getReadableBytes(): number | +| MessageParcel | getReadPosition(): number | MessageSequence | getReadPosition(): number | +| MessageParcel | getWritePosition(): number | MessageSequence | getWritePosition(): number | +| MessageParcel | rewindRead(pos: number): boolean | MessageSequence | rewindRead(pos: number): void | +| MessageParcel | rewindWrite(pos: number): boolean | MessageSequence | rewindWrite(pos: number): void | +| MessageParcel | writeNoException(): void | MessageSequence | writeNoException(): void | +| MessageParcel | readException(): void | MessageSequence | readException(): void | +| MessageParcel | writeByte(val: number): boolean | MessageSequence | writeByte(val: number): void | +| MessageParcel | writeShort(val: number): boolean | MessageSequence | writeShort(val: number): void | +| MessageParcel | writeInt(val: number): boolean | MessageSequence | writeInt(val: number): void | +| MessageParcel | writeLong(val: number): boolean | MessageSequence | writeLong(val: number): void | +| MessageParcel | writeFloat(val: number): boolean | MessageSequence | writeFloat(val: number): void | +| MessageParcel | writeDouble(val: number): boolean | MessageSequence | writeDouble(val: number): void | +| MessageParcel | writeBoolean(val: boolean): boolean | MessageSequence | writeBoolean(val: boolean): void | +| MessageParcel | writeChar(val: number): boolean | MessageSequence | writeChar(val: number): void | +| MessageParcel | writeString(val: string): boolean | MessageSequence | writeString(val: string): void | +| MessageParcel | writeSequenceable(val: Sequenceable): boolean | MessageSequence | writeParcelable(val: Parcelable): void | +| MessageParcel | writeByteArray(byteArray: number[]): boolean | MessageSequence | writeByteArray(byteArray: number[]): void | +| MessageParcel | writeShortArray(shortArray: number[]): boolean | MessageSequence | writeShortArray(shortArray: number[]): void | +| MessageParcel | writeIntArray(intArray: number[]): boolean | MessageSequence | writeIntArray(intArray: number[]): void | +| MessageParcel | writeLongArray(longArray: number[]): boolean | MessageSequence | writeLongArray(longArray: number[]): void | +| MessageParcel | writeFloatArray(floatArray: number[]): boolean | MessageSequence | writeFloatArray(floatArray: number[]): void | +| MessageParcel | writeDoubleArray(doubleArray: number[]): boolean | MessageSequence | writeDoubleArray(doubleArray: number[]): void | +| MessageParcel | writeBooleanArray(booleanArray: boolean[]): boolean | MessageSequence | writeBooleanArray(booleanArray: boolean[]): void | +| MessageParcel | writeCharArray(charArray: number[]): boolean | MessageSequence | writeCharArray(charArray: number[]): void | +| MessageParcel | writeStringArray(stringArray: string[]): boolean | MessageSequence | writeStringArray(stringArray: string[]): void | +| MessageParcel | writeSequenceableArray(sequenceableArray: Sequenceable[]): boolean | MessageSequence | writeParcelableArray(sequenceableArray: Parcelable[]): void | +| MessageParcel | writeRemoteObjectArray(objectArray: IRemoteObject[]): boolean | MessageSequence | writeRemoteObjectArray(objectArray: IRemoteObject[]): void | +| MessageParcel | readByte(): number | MessageSequence | readByte(): number | +| MessageParcel | readShort(): number | MessageSequence | readShort(): number | +| MessageParcel | readLong(): number | MessageSequence | readLong(): number | +| MessageParcel | readFloat(): number | MessageSequence | readFloat(): number | +| MessageParcel | readDouble(): number | MessageSequence | readDouble(): number | +| MessageParcel | readBoolean(): boolean | MessageSequence | readBoolean(): boolean | +| MessageParcel | readChar(): number | MessageSequence | readChar(): number | +| MessageParcel | readString(): string | MessageSequence | readString(): string | +| MessageParcel | readSequenceable(dataIn: Sequenceable) : boolean | MessageSequence | readSequenceable(dataIn: Parcelable) : void | +| MessageParcel | readByteArray(dataIn: number[]) : void | MessageSequence | readByteArray(dataIn: number[]) : void | +| MessageParcel | readByteArray(): number[] | MessageSequence | readByteArray(): number[] | +| MessageParcel | readShortArray(dataIn: number[]) : void | MessageSequence | readShortArray(dataIn: number[]) : void | +| MessageParcel | readShortArray(): number[] | MessageSequence | readShortArray(): number[] | +| MessageParcel | readIntArray(dataIn: number[]) : void | MessageSequence | readIntArray(dataIn: number[]) : void | +| MessageParcel | readIntArray() : number[] | MessageSequence | readIntArray() : number[] | +| MessageParcel | readLongArray(dataIn: number[]) : void | MessageSequence | readLongArray(dataIn: number[]) : void | +| MessageParcel | readLongArray(): number[] | MessageSequence | readLongArray(): number[] | +| MessageParcel | readFloatArray(dataIn: number[]) : void | MessageSequence | readFloatArray(dataIn: number[]) : void | +| MessageParcel | readFloatArray(): number[] | MessageSequence | readFloatArray(): number[] | +| MessageParcel | readDoubleArray(dataIn: number[]) : void | MessageSequence | readDoubleArray(dataIn: number[]) : void | +| MessageParcel | readDoubleArray(): number[] | MessageSequence | readDoubleArray(): number[] | +| MessageParcel | readBooleanArray(dataIn: boolean[]) : void | MessageSequence | readBooleanArray(dataIn: boolean[]) : void | +| MessageParcel | readBooleanArray(): boolean[] | MessageSequence | readBooleanArray(): boolean[] | +| MessageParcel | readCharArray(dataIn: number[]) : void | MessageSequence | readCharArray(dataIn: number[]) : void | +| MessageParcel | readCharArray(): number[] | MessageSequence | readCharArray(): number[] | +| MessageParcel | readStringArray(dataIn: string[]) : void | MessageSequence | readStringArray(dataIn: string[]) : void | +| MessageParcel | readStringArray(): string[] | MessageSequence | readStringArray(): string[] | +| MessageParcel | readSequenceableArray(sequenceableArray: Sequenceable[]): void | MessageSequence | readSequenceableArray(sequenceableArray: Parcelable[]): void | +| MessageParcel | readRemoteObjectArray(objects: IRemoteObject[]): void | MessageSequence | readRemoteObjectArray(objects: IRemoteObject[]): void | +| MessageParcel | readRemoteObjectArray(): IRemoteObject[] | MessageSequence | readRemoteObjectArray(): IRemoteObject[] | +| MessageParcel | static closeFileDescriptor(fd: number): void | MessageSequence | static closeFileDescriptor(fd: number): void | +| MessageParcel | static dupFileDescriptor(fd: number) :number | MessageSequence | static dupFileDescriptor(fd: number) :number | +| MessageParcel | containFileDescriptors(): boolean | MessageSequence | containFileDescriptors(): boolean | +| MessageParcel | writeFileDescriptor(fd: number): boolean | MessageSequence | writeFileDescriptor(fd: number): void | +| MessageParcel | readFileDescriptor(): number | MessageSequence | readFileDescriptor(): number | +| MessageParcel | writeAshmem(ashmem: Ashmem): boolean | MessageSequence | writeAshmem(ashmem: Ashmem): void | +| MessageParcel | readAshmem(): Ashmem | MessageSequence | readAshmem(): Ashmem | +| MessageParcel | writeRawData(rawData: number[], size: number): boolean | MessageSequence | writeRawData(rawData: number[], size: number): void | +| MessageParcel | readRawData(size: number): number[] | MessageSequence | readRawData(size: number): number[] | +| Sequenceable | marshalling(dataOut: MessageParcel): boolean | Parcelable | marshalling(dataOut: MessageSequence): boolean | +| Sequenceable | unmarshalling(dataIn: MessageParcel) : boolean | Parcelable | unmarshalling(dataIn: MessageSequence) : boolean | +| SendRequestResult | errCode: number | RequestResult | errCode: number | +| SendRequestResult | code: number | RequestResult | code: number | +| SendRequestResult | data: MessageParcel | RequestResult | data: MessageSequence | +| SendRequestResult | reply: MessageParcel | RequestResult | reply: MessageSequence | +| IRemoteObject | queryLocalInterface(descriptor: string): IRemoteBroker | NA | getLocalInterface(descriptor: string): IRemoteBroker | +| IRemoteObject | getInterfaceDescriptor(): string | NA | getDescriptor(): string | +| IRemoteObject | addDeathRecipient(recipient: DeathRecipient, flags: number): boolean | NA | registerDeathRecipient(recipient: DeathRecipient, flags: number): void | +| IRemoteObject | removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean | NA | unregisterDeathRecipient(recipient: DeathRecipient, flags: number): void | +| IRemoteObject | NA | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption): Promise | +| IRemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback): void | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption,callback: AsyncCallback): void | +| MessageOption | NA | NA | isAsync(): boolean | +| MessageOption | NA | NA | setAsync(async: boolean): void | +| MessageOption | NA | NA | constructor(async?: boolean) | +| RemoteObject | queryLocalInterface(descriptor: string): IRemoteBroker | NA | getLocalInterface(descriptor: string): IRemoteBroker | +| RemoteObject | attachLocalInterface(localInterface: IRemoteBroker, descriptor: string): void | NA | modifyLocalInterface(localInterface: IRemoteBroker, descriptor: string): void | +| RemoteObject | getInterfaceDescriptor(): string | NA | getDescriptor(): string | +| RemoteObject | onRemoteRequestEx(code : number, data : MessageParcel, reply: MessageParcel, options : MessageOption): boolean \| Promise | NA | onRemoteMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption): boolean \| Promise | +| RemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption): Promise | +| RemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback): void | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption, callback: AsyncCallback): void | +| RemoteProxy | queryLocalInterface(interface: string): IRemoteBroker | NA | getLocalInterface(descriptor: string): IRemoteBroker | +| RemoteProxy | getInterfaceDescriptor(): string | NA | getDescriptor(): string | +| RemoteProxy | addDeathRecipient(recipient: DeathRecipient, flags: number): boolean | NA | registerDeathRecipient(recipient: DeathRecipient, flags: number): void | +| RemoteProxy | removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean | NA | unregisterDeathRecipient(recipient: DeathRecipient, flags: number): void | +| RemoteProxy | NA | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption): Promise | +| RemoteProxy | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback): void | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption, callback: AsyncCallback): void | +| IPCSkeleton | static flushCommands(object: IRemoteObject): number | NA | static flushCmdBuffer(object: IRemoteObject): void | +| IPCSkeleton | static setCallingIdentity(identity: string): boolean | NA | static restoreCallingIdentity(identity: string): void | +| Ashmem | static createAshmem(name: string, size: number): Ashmem | NA | static create(name: string, size: number): Ashmem | +| Ashmem | static createAshmemFromExisting(ashmem: Ashmem): Ashmem | NA | static create(ashmem: Ashmem): Ashmem | +| Ashmem | mapAshmem(mapType: number): boolean | NA | mapTypedAshmem(mapType: number): void | +| Ashmem | mapReadAndWriteAshmem(): boolean | NA | mapReadWriteAshmem(): void | +| Ashmem | mapReadOnlyAshmem(): boolean | NA | mapReadonlyAshmem(): void | +| Ashmem | setProtection(protectionType: number): boolean | NA | setProtectionType(protectionType: number): void | +| Ashmem | writeToAshmem(buf: number[], size: number, offset: number): boolean | NA | writeAshmem(buf: number[], size: number, offset: number): void | +| Ashmem | readFromAshmem(size: number, offset: number): number[] | NA | readAshmem(size: number, offset: number): number[] | + +#### Adaptation Guide + +The newly added APIs return error codes and corresponding error information by throwing exceptions. Take the **create** API in **MessageParcel** as an example. The sample code is as follows: +```js +import rpc from '@ohos.rpc' + +try { + var data = rpc.MessageParcel.create(); + data.reclaim(); +} catch (error) { + console.info("create meassageParcel failed, errorCode = " + error.errCode); + console.info("create meassageParcel failed, errorMessage = " + error.errorMessage); +} +``` +For details about sample code of more APIs, see [RPC API reference](../../../application-dev/reference/apis/js-apis-rpc.md). diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-filemanagement.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-filemanagement.md new file mode 100644 index 0000000000000000000000000000000000000000..d50844ea44b5a523ab4c8cbd4d57ece6d6840abd --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-filemanagement.md @@ -0,0 +1,90 @@ +# File Management Subsystem ChangeLog + +## cl.filemanagement.1 File I/O API Changes + +The return value of file I/O APIs of **file_api** does not contain the error code. The original APIs are deprecated, and new APIs are added. + +**Change Impacts** + +For applications developed based on earlier versions, pay attention to the iterative update of discarded APIs. The specifications of the new APIs are slightly adjusted. Pay attention to the usage of the new APIs. + +**Key API/Component Changes** + +For the adaptation to the unified API exception handling mode, related file I/O APIs are deprecated, and corresponding new APIs are added. Original APIs are stored in **@ohos.fileio**, and the new ones are stored in **@ohos.file.fs**. The newly added APIs support unified error code handling specifications and function the same as the original APIs. The parameters are slightly adjusted. + +| Module | Method/Attribute/Enumeration/Constant | Change Type| +| ------------- | ------------------------------------------------------------ | -------- | +| @ohos.fileio | **function** open(path: string, flags?: number, mode?: number, callback?: AsyncCallback): void \| Promise; | Deprecated | +| @ohos.fileio | **function** openSync(path: string, flags?: number, mode?: number): number; | Deprecated | +| @ohos.file.fs | **function** open(path: string, mode?: number, callback?: AsyncCallback): void \| Promise; | Added | +| @ohos.file.fs | **function** openSync(path: string, mode?: number): File; | Added | +| @ohos.fileio | **function** read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }, callback?: AsyncCallback): void \| Promise; | Deprecated | +| @ohos.fileio | **function** readSync(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }): number; | Deprecated | +| @ohos.file.fs | **function** read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }, callback?: AsyncCallback): void \| Promise; | Added | +| @ohos.file.fs | **function** readSync(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }): number; | Added | +| @ohos.fileio | **function** stat(path: string, callback?: AsyncCallback): void \| Promise; | Deprecated | +| @ohos.fileio | **function** statSync(path: string): Stat; | Deprecated | +| @ohos.fileio | **function** fstat(fd: number, callback?: AsyncCallback): void \| Promise; | Deprecated | +| @ohos.fileio | **function** fstatSync(fd: number): Stat; | Deprecated | +| @ohos.file.fs | **function** stat(file: string \| number, callback?: AsyncCallback): void \| Promise; | Added | +| @ohos.file.fs | **function** statSync(file: string \| number): Stat; | Added | +| @ohos.fileio | **function** truncate(path: string, len?: number, callback?: AsyncCallback): void \| Promise; | Deprecated | +| @ohos.fileio | **function** truncateSync(path: string, len?: number): void; | Deprecated | +| @ohos.fileio | **function** ftruncate(fd: number, len?: number, callback?: AsyncCallback): void \| Promise; | Deprecated | +| @ohos.fileio | **function** ftruncateSync(fd: number, len?: number): void; | Deprecated | +| @ohos.file.fs | **function** truncate(file: string \| number, len?: number, callback?: AsyncCallback): void \| Promise; | Added | +| @ohos.file.fs | **function** truncateSync(file: string \| number, len?: number): void; | Added | +| @ohos.fileio | **function** write(fd: number, buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }, callback?: AsyncCallback): void \| Promise; | Deprecated | +| @ohos.fileio | **function** writeSync(fd: number, buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): number; | Deprecated | +| @ohos.file.fs | **function** write(fd: number, buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback): void \| Promise; | Added | +| @ohos.file.fs | **function** writeSync(fd: number, buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; encoding?: string; }): number; | Added | + +**Adaptation Guide** + +The original APIs use **@ohos.fileio**, which is imported as follows: + +```js +import fileio from '@ohos.fileio'; +``` + +The new APIs use **@ohos.file.fs**, which is imported as follows: + +```js +import fs from '@ohos.file.fs'; +``` + +In addition, exception handling needs to be adapted. Sample code for synchronous API exception handling is as follows: +```js +import fs from '@ohos.file.fs' + +try { + let file = fs.openSync(path, fs.OpenMode.READ_ONLY); +} catch (err) { + console.error("openSync errCode:" + err.code + ", errMessage:" + err.message); +} +``` +Sample code for handling exceptions of the **promise** method of an asynchronous API: +```js +import fs from '@ohos.file.fs' + +try { + let file = await fs.open(path, fs.OpenMode.READ_ONLY); +} catch (err) { + console.error("open promise errCode:" + err.code + ", errMessage:" + err.message); +} +``` + +Sample code for handling exceptions of the **callback** method of an asynchronous API: +```js +import fs from '@ohos.file.fs' + +try { + fs.open(path, fs.OpenMode.READ_ONLY, function(e, file){ // Asynchronous thread (such as system call) errors are obtained from the callback. + if (e) { + console.error("open in async errCode:" + e.code + ", errMessage:" + e.message); + } + }); +} catch (err) {// Errors (such as invalid parameters) of the main thread are obtained through try catch. + console.error("open callback errCode:" + err.code + ", errMessage:" + err.message); +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-global.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-global.md new file mode 100644 index 0000000000000000000000000000000000000000..3ea6d2e61ae7d061f0631b217bdba75d0a27319c --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-global.md @@ -0,0 +1,57 @@ +# Globalization Subsystem ChangeLog + +## cl.global.1 Support of Error Codes for the Internalization Module + +APIs provided by the internationalization component of the globalization subsystem are changed to support error codes in the following scenarios. The following changes are made in API version 9 and later: + - Obtaining the local expression of a country or language + - Obtaining the list of languages supported by the system and the list of areas supported by a language + - Checking whether a language matches an area + - Obtaining and setting the system language, country or region, and area + - Obtaining and setting the 24-hour format of the system + - Obtaining, adding, and removing the preferred language + - Obtaining and setting localized numbers + +You need to adapt your applications based on the following information: + +**Change Impacts** + +The preceding APIs are changed to the static methods of the **System** class. When such an API is called, add the class name to the end of the module name. +The return value data type of the setting APIs (for example, **setSystemLanguage**) is changed from boolean to void. +When a call to an API fails, an error code is returned according to the failure cause. For example, when permissions are not correctly configured for an application, **201** is returned. + +**Key API/Component Changes** + +Involved APIs: +- getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): string; +- getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): string; +- getSystemLanguages(): Array; +- getSystemCountries(language: string): Array; +- isSuggested(language: string, region?: string): boolean; +- getSystemLanguage(): string; +- setSystemLanguage(language: string): void; +- getSystemRegion(): string; +- setSystemRegion(region: string): void; +- getSystemLocale(): string; +- setSystemLocale(locale: string): void; +- is24HourClock(): boolean; +- set24HourClock(option: boolean): void; +- addPreferredLanguage(language: string, index?: number): void; +- removePreferredLanguage(index: number): void; +- getPreferredLanguageList(): Array; +- getFirstPreferredLanguage(): string; +- getAppPreferredLanguage(): string; +- setUsingLocalDigit(flag: boolean): void; +- getUsingLocalDigit(): boolean; + +**Adaptation Guide** + +Use the **try-catch** block to capture errors returned by an API. +``` +import I18n from '@ohos.i18n' + +try { + I18n.System.setSystemLanguage('zh'); +} catch(error) { + console.error(`call System.setSystemLanguage failed, error code: ${error.code}, message: ${error.message}.`) +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-inputmethod-framworks.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-inputmethod-framworks.md new file mode 100644 index 0000000000000000000000000000000000000000..10b882debbe61ecbb41c7ef43f96f1d563ea22ca --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-inputmethod-framworks.md @@ -0,0 +1,198 @@ +# Input Method Framework ChangeLog + +## cl.inputmethod_frameworks.1 API Error Information Return Method Change + +The internal APIs of the following modules used service logic return values to indicate error information, which did not comply with the error code specifications of OpenHarmony. Therefore, they are modified in API version 9 and later. + + - Input method framework module: system API, @ohos.inputmethod.d.ts + + - Input method service module: system API, @ohos.inputmethodengine.d.ts + + - Input method ExtentionAbility module: system API, @ohos.inputmethodextensionability.d.ts + + - Input method ExtentionContext module: system API, @ohos.inputmethodextensioncontext.d.ts + + - Input method subtype module: system API, @ohos.inputMethodSubtype.d.ts + +Asynchronous API: An error message is returned via **AsyncCallback** or the **error** object of **Promise**. + +Synchronous API: An error message is returned via an exception. + +**Change Impacts** + +The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +Error code processing is added for the following APIs: + - getSetting(): InputMethodSetting; + - getController(): InputMethodController; + - switchInputMethod(target: InputMethodProperty, callback: AsyncCallback): void; + - switchInputMethod(target: InputMethodProperty): Promise; + - switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback): void; + - switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise; + - switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype, callback: AsyncCallback): void; + - switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype): Promise; + - listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: AsyncCallback>): void; + - listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise>; + - listCurrentInputMethodSubtype(callback: AsyncCallback>): void; + - listCurrentInputMethodSubtype(): Promise>; + - getInputMethods(enable: boolean, callback: AsyncCallback>): void; + - getInputMethods(enable: boolean): Promise>; + - showOptionalInputMethods(callback: AsyncCallback): void; + - showOptionalInputMethods(): Promise; + - stopInputSession(callback: AsyncCallback): void; + - stopInputSession(): Promise; + - showSoftKeyboard(callback: AsyncCallback): void; + - showSoftKeyboard():Promise; + - hideSoftKeyboard(callback: AsyncCallback): void; + - hideSoftKeyboard():Promise; + - hide(callback: AsyncCallback): void; + - hide(): Promise; + - onCreate(want: Want): void; + - onDestroy(): void; + In **InputClient**: + - sendKeyFunction(action: number, callback: AsyncCallback): void; + - sendKeyFunction(action: number): Promise; + - deleteForward(length: number, callback: AsyncCallback): void; + - deleteForward(length: number): Promise; + - deleteBackward(length: number, callback: AsyncCallback): void; + - deleteBackward(length: number): Promise; + - insertText(text: string, callback: AsyncCallback): void; + - insertText(text: string): Promise; + - getForward(length: number, callback: AsyncCallback): void; + - getForward(length: number): Promise; + - getBackward(length: number, callback: AsyncCallback): void; + - getBackward(length: number): Promise; + - getEditorAttribute(callback: AsyncCallback): void; + - getEditorAttribute(): Promise; + - moveCursor(direction: number, callback: AsyncCallback): void; + - moveCursor(direction: number): Promise; + In **InputMethodExtensionAbility**: + - onCreate(want: Want): void; + - onDestroy(): void; + +**Adaptation Guide** + +The following uses **showOptionalInputMethods** as an example for asynchronous APIs: + +Callback mode: + +```js +import inputMethod from '@ohos.inputmethod'; +let inputMethodSetting = inputMethod.getSetting(); +try { + inputMethodSetting.showOptionalInputMethods((err, data) => { + if (err !== undefined) { + console.error('Failed to showOptionalInputMethods: ' + JSON.stringify(err)); + return; + } + console.info('Succeeded in showing optionalInputMethods.'); + }); +} catch (err) { + console.error('Failed to showOptionalInputMethods: ' + JSON.stringify(err)); +} +``` + +Promise mode: + +```js +import inputMethod from '@ohos.inputmethod'; +let inputMethodSetting = inputMethod.getSetting(); +inputMethodSetting.showOptionalInputMethods().then((data) => { + console.info('Succeeded in showing optionalInputMethods.'); +}).catch((err) => { + console.error('Failed to showOptionalInputMethods: ' + JSON.stringify(err)); +}) +``` + +## cl.inputmethod_frameworks.2 Deprecation of Some APIs + +Deprecated APIs: + - getInputMethodSetting(): InputMethodSetting; + - getInputMethodController(): InputMethodController; + - listInputMethod(callback: AsyncCallback>): void; + - listInputMethod(): Promise>; + - displayOptionalInputMethod(callback: AsyncCallback): void; + - displayOptionalInputMethod(): Promise; + - stopInput(callback: AsyncCallback): void; + - stopInput(): Promise; + interface InputMethodProperty: + - readonly packageName: string; + - readonly methodId: string; + - getInputMethodEngine(): InputMethodEngine; + - createKeyboardDelegate(): KeyboardDelegate; + - hideKeyboard(callback: AsyncCallback): void; + - hideKeyboard(): Promise; + +Substitute APIs: + - getSetting(): InputMethodSetting; + - getController(): InputMethodController; + - getInputMethods(enable: boolean, callback: AsyncCallback>): void; + - getInputMethods(enable: boolean): Promise>; + - showOptionalInputMethods(callback: AsyncCallback): void; + - showOptionalInputMethods(): Promise; + - stopInputSession(callback: AsyncCallback): void; + - stopInputSession(): Promise; + interface InputMethodProperty: + - readonly name: string; + - readonly id: string; + - getInputMethodAbility(): InputMethodAbility; + - getKeyboardDelegate(): KeyboardDelegate; + - hide(callback: AsyncCallback): void; + - hide(): Promise; + +**NOTE** + +- Use the **getInputMethodAbility()** API to obtain an **InputMethodAbility** object, and do not use **getInputMethodEngine()** to obtain an **InputMethodEngine** object. +- Use methods in **InputMethodAbility**, and do not use methods in **InputMethodEngine**. +- Use the **on('inputStart')** method in **InputMethodAbility** to obtain a **KeyboardController** instance and an **InputClient** instance, and do not use the **on('inputStart')** method in **InputMethodEngine** to obtain a **TextInputClient** instance. + +Before: + +```js +inputMethodEngine.getInputMethodEngine().on('inputStart', (kbController, textClient) => { + let keyboardController = kbController; + let textInputClient = textClient; // Obtain a TextInputClient instance. +}); +``` + +After: +```js +inputMethodEngine.getInputMethodAbility().on('inputStart', (kbController, client) => { + let keyboardController = kbController; + let inputClient = client; // // Obtain an InputClient instance. +}); +``` + +## cl.inputmethod_frameworks.3 Change of Some APIs + +Before change: + - listInputMethod(enable: boolean, callback: AsyncCallback>): void; + - listInputMethod(enable: boolean): Promise>; + - terminateSelf(callback: AsyncCallback): void; + - terminateSelf(): Promise; + +After change: + - getInputMethods(enable: boolean, callback: AsyncCallback>): void; + - getInputMethods(enable: boolean): Promise>; + - destroy(callback: AsyncCallback): void; + - destroy(): Promise; + +Deleted APIs in API version 9: + - startAbility(want: Want, callback: AsyncCallback): void; + - startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; + - startAbility(want: Want, options?: StartOptions): Promise; + +Added APIs: + - on(type: 'imeChange', callback: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void): void; + - off(type: 'imeChange', callback?: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void): void; + - interface InputMethodProperty: + - readonly label?: string; + - readonly icon?: string; + - readonly iconId?: number; + - extra: object; + + - interface InputMethodAbility: + - on(type: 'setSubtype', callback: (inputMethodSubtype: InputMethodSubtype) => void): void; + - off(type: 'setSubtype', callback?: (inputMethodSubtype: InputMethodSubtype) => void): void; diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-multimodalinput.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-multimodalinput.md new file mode 100644 index 0000000000000000000000000000000000000000..c9514a515412e1d6b765558272650f2c20cac5af --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-multimodalinput.md @@ -0,0 +1,103 @@ +# Multimodal Input ChangeLog + +## cl.multimodalinput.1 Error Information Return Method Change of APIs + +The internal APIs of the following modules used service logic return values to indicate error information, which did not comply with the error code specifications of OpenHarmony. Therefore, they are modified in API version 9 and later. + - Input device management module (**@ohos.multimodalInput.inputDevice.d.ts**): third-party APIs + + - Input consumer module (**@ohos.multimodalInput.inputConsumer.d.ts**): system APIs + + - Screen hopping module (**@ohos.multimodalInput.inputDeviceCooperate.d.ts**): system APIs + + - Key injection module (**@ohos.multimodalInput.inputEventClient.d.ts**): system APIs + + - Input listening module (**@ohos.multimodalInput.inputMonitor.d.ts**): system APIs + + - Mouse pointer module (**@ohos.multimodalInput.pointer.d.ts**): system APIs and third-party APIs + +Asynchronous APIs in the preceding modules have the following changes: A parameter check error is returned synchronously; a service logic error is returned via **AsyncCallback** or the **error** object of **Promise**. No change is made to synchronous APIs. + +**Change Impacts** + +The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + + - supportKeys(deviceId: number, keys: Array<KeyCode>, callback: AsyncCallback<Array<boolean>>): void; + - supportKeys(deviceId: number, keys: Array<KeyCode>): Promise<Array<boolean>>; + - getKeyboardType(deviceId: number, callback: AsyncCallback<KeyboardType>): void; > + - getKeyboardType(deviceId: number): Promise<KeyboardType>; + - setPointerSpeed(speed: number, callback: AsyncCallback<void>): void; + - setPointerSpeed(speed: number): Promise<void>; + - getPointerSpeed(callback: AsyncCallback<number>): void; + - getPointerSpeed(): Promise<number>; + - setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCallback<void>): void; + - setPointerStyle(windowId: number, pointerStyle: PointerStyle): Promise<void>; + - getPointerStyle(windowId: number, callback: AsyncCallback<PointerStyle>): void; + - getPointerStyle(windowId: number): Promise<PointerStyle>; + - setPointerVisible(visible: boolean, callback: AsyncCallback<void>): void; + - setPointerVisible(visible: boolean): Promise<void>; + - isPointerVisible(callback: AsyncCallback<boolean>): void; + - isPointerVisible(): Promise<boolean>; + - on(type:"touch", receiver:TouchEventReceiver):void; + - on(type:"mouse", receiver:Callback<MouseEvent>):void; + - off(type:"touch", receiver?:TouchEventReceiver):void; + - off(type:"mouse", receiver?:Callback<MouseEvent>):void; + - injectEvent({KeyEvent: KeyEvent}): void; + - enable(enable: boolean, callback: AsyncCallback<void>): void; + - enable(enable: boolean): Promise<void>; + - start(sinkDeviceDescriptor: string, srcInputDeviceId: number, callback: AsyncCallback<void>): void; + - start(sinkDeviceDescriptor: string, srcInputDeviceId: number): Promise<void>; + - stop(callback: AsyncCallback<void>): void; + - stop(): Promise<void>; + - getState(deviceDescriptor: string, callback: AsyncCallback<{ state: boolean }>): void; + - getState(deviceDescriptor: string): Promise<{ state: boolean }>; + - on(type: 'cooperation', callback: AsyncCallback<{ deviceDescriptor: string, eventMsg: EventMsg }>): void; + - off(type: 'cooperation', callback?: AsyncCallback<void>): void; + - on(type: "key", keyOptions: KeyOptions, callback: Callback<KeyOptions>): void; + - off(type: "key", keyOptions: KeyOptions, callback?: Callback<KeyOptions>): void; + +Deprecated APIs: + - getDeviceIds(callback: AsyncCallback<Array<number>>): void; + - getDeviceIds(): Promise<Array<number>>; + - getDevice(deviceId: number, callback: AsyncCallback<InputDeviceData>): void; + - getDevice(deviceId: number): Promise<InputDeviceData>; + +Substitute APIs: + - getDeviceList(callback: AsyncCallback<Array<number>>): void; + - getDeviceList(): Promise<Array<number>>; + - getDeviceInfo(deviceId: number, callback: AsyncCallback<InputDeviceData>): void; + - getDeviceInfo(deviceId: number): Promise<InputDeviceData>; + +Changed APIs: + +Before change: + - supportKeys(deviceId: number, keys: Array<KeyCode>, callback: Callback<Array<boolean>>): void; + - getKeyboardType(deviceId: number, callback: Callback<KeyboardType>): void; + +After change: + - supportKeys(deviceId: number, keys: Array<KeyCode>, callback: AsyncCallback<Array<boolean>>): void; + - getKeyboardType(deviceId: number, callback: AsyncCallback<KeyboardType>): void; + +**Adaptation Guide** + +The following uses **setPointerVisible** as an example: + +```ts +import pointer from '@ohos.multimodalInput.pointer'; +pointer.setPointerVisible(true, (error) => { + console.log(`Set pointer visible success`); + }); + +try { + pointer.setPointerVisible(true, (error) => { + if (error) { + console.log(`Set pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`); + return; + } + console.log(`Set pointer visible success`); + }); +} catch (error) { + console.log(`Set pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-power.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-power.md new file mode 100644 index 0000000000000000000000000000000000000000..116bff7f084ebed42c0c8842f4c8e2936bca3e75 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-power.md @@ -0,0 +1,68 @@ +# Power Subsystem ChangeLog + +## cl.powermgr.1 Error Information Return Method Change of APIs + +The following APIs used service logic return values to indicate error information, which did not comply with the error code specifications of OpenHarmony. Therefore, they are modified in API version 9 and later. + +- Power consumption statistics: [@ohos.batteryStatistics](../../../application-dev/reference/apis/js-apis-batteryStatistics.md) + - Brightness: [@ohos.brightness](../../../application-dev/reference/apis/js-apis-brightness.md) + - Power manager: [@ohos.power](../../../application-dev/reference/apis/js-apis-power.md) + - RunningLock: [@ohos.runningLock](../../../application-dev/reference/apis/js-apis-runninglock.md) + - Thermal manager: [@ohos.thermal](../../../application-dev/reference/apis/js-apis-thermal.md) + +Asynchronous API: An error message is returned via **AsyncCallback** or the **error** object of **Promise**. + +Synchronous API: An error message is returned via an exception. + +#### Change Impacts + +The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected. + +#### Key API/Component Changes + +Error code processing is added for the following APIs: + - getBatteryStats(callback: AsyncCallback): void + - getAppPowerValue(uid: number): number + - getAppPowerPercent(uid: number): number + - getHardwareUnitPowerValue(type: ConsumptionType): number + - getHardwareUnitPowerPercent(type: ConsumptionType): number + - setValue(value: number): void + - shutdown(reason: string): void; + - isActive(): boolean + - wakeup(detail: string): void + - suspend(): void + - getPowerMode(): DevicePowerMode + - setPowerMode(mode: DevicePowerMode, callback: AsyncCallback<void>): void + - setPowerMode(mode: DevicePowerMode): Promise<void> + - hold(timeout: number): void + - isHolding(): boolean + - unhold(): void + - isSupported(type: RunningLockType): boolean + - isSupported(type: RunningLockType): boolean + - create(name: string, type: RunningLockType, callback: AsyncCallback<RunningLock>): void + - create(name: string, type: RunningLockType): Promise<RunningLock> + - registerThermalLevelCallback(callback: Callback<ThermalLevel>): void + - unregisterThermalLevelCallback(callback?: Callback<void>): void + - getLevel(): ThermalLevel + +#### Adaptation Guide + +For details, see the API reference document of each API. +## cl.powermgr.2 System API Change + +#### Change Impacts + +The application developed based on earlier versions needs to adapt to new API names and the new method for returning API error information. Otherwise, the original service logic will be affected. + +#### Key API/Component Changes + +| Bundle Name | Original API | New API | +| ----------- | ------------------------------------ | ------------------------------ | +| @ohos.power | shutdownDevice(reason: string): void | shutdown(reason: string): void | +| @ohos.power | rebootDevice(reason: string): void | reboot(reason: string): void | +| @ohos.power | wakeupDevice(detail: string): void | wakeup(detail: string): void | +| @ohos.power | suspendDevice(): void | suspend(): void | + +#### Adaptation Guide + +For details, see [@ohos.power](../../../application-dev/reference/apis/js-apis-power.md). diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-request.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-request.md new file mode 100644 index 0000000000000000000000000000000000000000..fcdddaf40cfed2818c196e98da66ecae758b2e16 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-request.md @@ -0,0 +1,108 @@ +# Upload and Download Subsystem ChangeLog + +Compared with OpenHarmony 3.2 Beta3, OpenHarmony 3.2.8.1 has the following changes in its upload and download subsystem: + +## cl.request.1 Changes of Error Code Definitions and Some API Names + +- The processing of the [upload and download error codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-request.md) is added to the upload and download APIs. +- An error message is returned via **AsyncCallback** or the **error** object of **Promise**. An error message related to the parameter type or quantity is returned via an exception. +- Some APIs need to be replaced with new APIs, and the parameters remain unchanged. + +**Change Impacts** + +The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| +| -------------- | -------------------------- | ------------------------------------------------------------ | -------- | +| ohos.request | request | EXCEPTION_PERMISSION | Added | +| ohos.request | request | EXCEPTION_PARAMCHECK | Added | +| ohos.request | request | EXCEPTION_UNSUPPORTED | Added | +| ohos.request | request | EXCEPTION_FILEIO | Added | +| ohos.request | request | EXCEPTION_FILEPATH | Added | +| ohos.request | request | EXCEPTION_SERVICE | Added | +| ohos.request | request | EXCEPTION_OTHERS | Added | +| ohos.request | request | ERROR_OFFLINE | Added | +| ohos.request | request | ERROR_UNSUPPORTED_NETWORK_TYPE | Added | +| ohos.request | request | function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void; | Added | +| ohos.request | request | function downloadFile(context: BaseContext, config: DownloadConfig): Promise; | Added | +| ohos.request | request | function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; | Added | +| ohos.request | request | function uploadFile(context: BaseContext, config: UploadConfig): Promise; | Added | +| ohos.request | DownloadTask | delete(callback: AsyncCallback): void; | Added | +| ohos.request | DownloadTask | delete(): Promise; | Added | +| ohos.request | DownloadTask | suspend(callback: AsyncCallback): void; | Added | +| ohos.request | DownloadTask | suspend(): Promise; | Added | +| ohos.request | DownloadTask | restore(callback: AsyncCallback): void; | Added | +| ohos.request | DownloadTask | restore(): Promise; | Added | +| ohos.request | DownloadTask | getTaskInfo(callback: AsyncCallback): void; | Added | +| ohos.request | DownloadTask | getTaskInfo(): Promise; | Added | +| ohos.request | DownloadTask | getTaskMimeType(callback: AsyncCallback): void; | Added | +| ohos.request | DownloadTask | getTaskMimeType(): Promise; | Added | +| ohos.request | UploadTask | delete(callback: AsyncCallback): void; | Added | +| ohos.request | UploadTask | delete(): Promise; | Added | +| ohos.request | request | function download(config: DownloadConfig, callback: AsyncCallback): void;
Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void;| Deprecated | +| ohos.request | request | function download(config: DownloadConfig): Promise;
Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig): Promise; | Deprecated | +| ohos.request | request | function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void;
Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void; | Deprecated | +| ohos.request | request | function download(context: BaseContext, config: DownloadConfig): Promise;
Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig): Promise; | Deprecated | +| ohos.request | request | function upload(config: UploadConfig, callback: AsyncCallback): void;
Substitute API: function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; | Deprecated | +| ohos.request | request | function upload(config: UploadConfig): Promise;
Substitute API: function uploadFile(context: BaseContext, config: UploadConfig): Promise; | Deprecated | +| ohos.request | request | function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void;
Substitute API: function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; | Deprecated | +| ohos.request | request | function upload(context: BaseContext, config: UploadConfig): Promise;
Substitute API: function uploadFile(context: BaseContext, config: UploadConfig): Promise; | Deprecated | +| ohos.request | DownloadTask | remove(callback: AsyncCallback): void;
Substitute API: delete(callback: AsyncCallback): void | Deprecated | +| ohos.request | DownloadTask | remove(): Promise;
Substitute API: delete(): Promise; | Deprecated | +| ohos.request | DownloadTask | pause(callback: AsyncCallback): void;
Substitute API: suspend(callback: AsyncCallback): void; | Deprecated | +| ohos.request | DownloadTask | pause(): Promise;
Substitute API: suspend(): Promise; | Deprecated | +| ohos.request | DownloadTask | resume(callback: AsyncCallback): void;
Substitute API: restore(callback: AsyncCallback): void; | Deprecated | +| ohos.request | DownloadTask | resume(): Promise;
Substitute API: restore(): Promise; | Deprecated | +| ohos.request | DownloadTask | query(callback: AsyncCallback): void;
Substitute API: getTaskInfo(callback: AsyncCallback): void; | Deprecated | +| ohos.request | DownloadTask | query(): Promise;
Substitute API: getTaskInfo(): Promise; | Deprecated | +| ohos.request | DownloadTask | queryMimeType(callback: AsyncCallback): void;
Substitute API: getTaskMimeType(callback: AsyncCallback): void; | Deprecated | +| ohos.request | DownloadTask | queryMimeType(): Promise;
Substitute API: getTaskMimeType(): Promise; | Deprecated | +| ohos.request | UploadTask | remove(callback: AsyncCallback): void;
Substitute API: delete(callback: AsyncCallback): void; | Deprecated | +| ohos.request | UploadTask | remove(): Promise;
Substitute API: delete(): Promise; | Deprecated | +| system.request | UploadResponse | code | Deprecated | +| system.request | UploadResponse | data | Deprecated | +| system.request | UploadResponse | headers | Deprecated | +| system.request | DownloadResponse | token | Deprecated | +| system.request | OnDownloadCompleteResponse | uri | Deprecated | +| system.request | RequestFile | filename | Deprecated | +| system.request | RequestFile | name | Deprecated | +| system.request | RequestFile | uri | Deprecated | +| system.request | RequestFile | type | Deprecated | +| system.request | RequestData | name | Deprecated | +| system.request | RequestData | value | Deprecated | +| system.request | UploadRequestOptions | url | Deprecated | +| system.request | UploadRequestOptions | data | Deprecated | +| system.request | UploadRequestOptions | files | Deprecated | +| system.request | UploadRequestOptions | header | Deprecated | +| system.request | UploadRequestOptions | description | Deprecated | +| system.request | UploadRequestOptions | success | Deprecated | +| system.request | UploadRequestOptions | fail | Deprecated | +| system.request | UploadRequestOptions | complete | Deprecated | +| system.request | OnDownloadCompleteOptions | token | Deprecated | +| system.request | OnDownloadCompleteOptions | success | Deprecated | +| system.request | OnDownloadCompleteOptions | fail | Deprecated | +| system.request | OnDownloadCompleteOptions | complete | Deprecated | +| system.request | Request | static upload(options: UploadRequestOptions): void; | Deprecated | +| system.request | Request | static download(options: DownloadRequestOptions): void; | Deprecated | +| system.request | Request | static onDownloadComplete(options: OnDownloadCompleteOptions): void; | Deprecated | + + +**Adaptation Guide** + +The following uses **downloadFile** as an example to show how it is called in the new version: + +```ts +try { + request.downloadFile(globalThis.abilityContext, { url: 'https://xxxx/xxxxx.hap', + filePath: 'xxx/xxxxx.hap'}, (err, data) => { + if (err) { + console.error('Failed to request the download. Cause: ' + JSON.stringify(err)); + return; + } + }); +} catch (err) { + console.log("downloadFile callback fail." + "errCode:" + err.code + ",errMessage:" + err.message); +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-resource-manager.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-resource-manager.md new file mode 100644 index 0000000000000000000000000000000000000000..b5c769a395a5bc9efc9239fde9b4284f85f74c3c --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-resource-manager.md @@ -0,0 +1,66 @@ +# 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 and later: + +Some multi-project APIs of the resource manager need to be replaced with new APIs, and the parameters remain unchanged. + +**Change Impacts** + +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 sample code 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}.`) +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-theme.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-theme.md new file mode 100644 index 0000000000000000000000000000000000000000..17621fd618bab7919fc62a78ac5cf2fb21e44246 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-theme.md @@ -0,0 +1,148 @@ +# Theme Framework ChangeLog + +## cl.theme.1 Support of Exception Handling for APIs in API Version 9 + +The internal APIs of the following modules used service logic return values to indicate error information, which did not comply with the error code specifications of OpenHarmony. Therefore, they are modified in API version 9 and later. + - Wallpaper management service: **@ohos.wallpaper.d.ts** + + - Lock screen management service: **@ohos.screenLock.d.ts** + +APIs in the preceding modules are changed as follows: +Synchronous API: An error message is returned via an exception. +Asynchronous API: A parameter check error is returned synchronously. A service logic error is returned via **AsyncCallback** or the **error** object of **Promise**. + +**Change Impacts** + +The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +Deprecated APIs of the wallpaper management service: + - getColors(wallpaperType: WallpaperType, callback: AsyncCallback>): void; + - getColors(wallpaperType: WallpaperType): Promise>; + - getId(wallpaperType: WallpaperType, callback: AsyncCallback): void; + - getId(wallpaperType: WallpaperType): Promise; + - getMinHeight(callback: AsyncCallback): void; + - getMinHeight(): Promise; + - getMinWidth(callback: AsyncCallback): void; + - getMinWidth(): Promise; + - isChangePermitted(callback: AsyncCallback): void; + - isChangePermitted(): Promise; + - isOperationAllowed(callback: AsyncCallback): void; + - isOperationAllowed(): Promise; + - reset(wallpaperType: WallpaperType, callback: AsyncCallback): void; + - reset(wallpaperType: WallpaperType): Promise; + - setWallpaper(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; + - setWallpaper(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; + - getFile(wallpaperType: WallpaperType, callback: AsyncCallback): void; + - getFile(wallpaperType: WallpaperType): Promise; + - getPixelMap(wallpaperType: WallpaperType, callback: AsyncCallback): void; + - getPixelMap(wallpaperType: WallpaperType): Promise; + +Substitute APIs of the wallpaper management service: + - getColorsSync(wallpaperType: WallpaperType): Array; + - getIdSync(wallpaperType: WallpaperType): number; + - getMinHeightSync(): number; + - getMinWidthSync(): number; + - isChangeAllowed(): boolean; + - isUserChangeAllowed(): boolean; + - restore(wallpaperType: WallpaperType, callback: AsyncCallback): void; + - restore(wallpaperType: WallpaperType): Promise; + - setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; + - setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; + - getFileSync(wallpaperType: WallpaperType): number; + - getImage(wallpaperType: WallpaperType, callback: AsyncCallback): void; + - getImage(wallpaperType: WallpaperType): Promise; + +Changed APIs of the wallpaper management service: + - on(type: 'colorChange', callback: (colors: Array, wallpaperType: WallpaperType) => void): void + - off(type: 'colorChange', callback?: (colors: Array, wallpaperType: WallpaperType) => void): void + +Deprecated APIs of the lock screen management service: + - isScreenLocked(callback: AsyncCallback): void; + - isScreenLocked(): Promise; + - isSecureMode(callback: AsyncCallback): void; + - isSecureMode(): Promise; + - unlockScreen(callback: AsyncCallback): void; + - unlockScreen(): Promise; + +Substitute APIs of the lock screen management service: + - isLocked(): boolean; + - isSecure(): boolean; + - unlock(callback: AsyncCallback): void; + - unlock():Promise; + +Deleted APIs of the lock screen management service: + - lockScreen(callback: AsyncCallback): void; + - lockScreen(): Promise; + +The following APIs are added for the lock screen management service: + - lock(callback: AsyncCallback): void; + - lock():Promise; + +Changed APIs of the lock screen management service: + - onSystemEvent(callback: Callback): boolean; + - sendScreenLockEvent(event: String, parameter: number, callback: AsyncCallback): void; + - sendScreenLockEvent(event: String, parameter: number): Promise; + +**Adaption Guide for the Wallpaper Management Service** + +The following uses **getImage** as an example for asynchronous APIs: + +```ts +import pointer from '@ohos.wallpaper'; +try { + wallpaper.getImage(wallpaper.WallpaperType.WALLPAPER_SYSTEM).then((data) => { + console.log(`success to getImage: ${JSON.stringify(data)}`); + }).catch((error) => { + console.error(`failed to getImage because: ${JSON.stringify(error)}`); + }); +} catch (err) { + console.error(`failed to getImage because: ${JSON.stringify(err)}`); +} + +``` + +The following uses **getFileSync** as an example for synchronous APIs: + +```ts +import pointer from '@ohos.wallpaper'; +try { + let file = wallpaper.getFileSync(wallpaper.WallpaperType.WALLPAPER_SYSTEM); +} catch (err) { + console.error(`failed to getFileSync because: ${err.message}`); +} +``` + +**Adaption Guide for the Lock Screen Management Service** + +The following uses **lock** as an example for asynchronous APIs: + +```ts +import screenLock from '@ohos.screenlock'; +try { + screenLock.lock((err, data) => { + if (err) { + console.error(`Failed to lock the screen, because: ${err.message}`); + return; + } + console.info(`lock the screen successfully. result: ${data}`); + }); +} catch (err) { + console.error(`Failed to lock the screen, because: ${err.message}`); +} + +``` + +The following uses **onSystemEvent** as an example for synchronous APIs: + +```ts +import screenLock from '@ohos.screenlock'; +try { + let isSuccess = screenLock.onSystemEvent((event) => { + console.log(`Register the system event which related to screenlock successfully. eventType: ${event.eventType}`) + }); +} catch (err) { + console.error(`Failed to register the system event which related to screenlock, because: ${err.message}`) +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-bundlemanager.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-bundlemanager.md new file mode 100644 index 0000000000000000000000000000000000000000..8643663fa245f33dcf5866a767327ff83b2ffb92 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-bundlemanager.md @@ -0,0 +1,761 @@ +# Bundle Manager Subsystem ChangeLog + +## cl.bundlemanager.1 Bundle Manager API Changes +The bundle manager APIs use service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. APIs in API version 8 and earlier are deprecated. Replace them with APIs in API version 9 instead. + +**Change Impacts** + +The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs (version 9) and their method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +The new APIs are classified by module. The original **d.ts** file is divided into multiple ones. You can import the **d.ts** files as required. The newly added APIs support unified error code handling specifications and function the same as the original APIs. APIs whose functions are changed or added are listed separately. + +For adaptation to the unified API exception handling mode, bundle manager APIs (version 8 and earlier) are deprecated (original APIs in the following table) and corresponding new APIs (version 9) in the following table are added. + +| Original API (Deprecated) | New API (Added) | +| ------------------------------------ | ------------------------------------------------------------ | +| @ohos.bundle.d.ts | [@ohos.bundle.bundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) | +| @ohos.bundle.d.ts | [@ohos.bundle.freeInstall.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.freeInstall.d.ts) | +| @ohos.bundle.d.ts | [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts) | +| @ohos.bundle.innerBundleManager.d.ts | [@ohos.bundle.launcherBundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.launcherBundleManager.d.ts) | +| @ohos.bundle.innerBundleManager.d.ts | [@ohos.bundle.bundleMonitor.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleMonitor.d.ts) | +| @ohos.bundle.defaultAppManager.d.ts | [@ohos.bundle.defaultAppManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.defaultAppManager.d.ts) | +| @ohos.distributedBundle.d.ts | [@ohos.bundle.distributedBundle.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.distributedBundle.d.ts) | +| N/A | [@ohos.bundle.appControl.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.appControl.d.ts) | +| @system.package.d.ts | N/A | + +**Adaptation Guide** +1. Call the bundle manager query API. +``` +import bundle form '@ohos.bundle.bundleManager' +``` +2. Call the bundle manager installation and uninstallation API. +``` +import installer form '@ohos.bundle.installer' +``` +3. Call the bundle manager installation-free API. +``` +import freeInstall form '@ohos.bundle.freeInstall' +``` +4. Call the bundle manager launcher APIs. +``` +import launcherBundleManager form '@ohos.bundle.launcherBundleManager' +import bundleMonitor form '@ohos.bundle.bundleMonitor' +``` +6. Call the bundle manager API for the default application. +``` +import defaultAppManager form '@ohos.bundle.defaultAppManager' +``` +7. Call the distributed bundle manager API. +``` +import distributedBundle form '@ohos.bundle.distributedBundle' +``` +In addition, exception handling is needed. For details, see the API reference for the new APIs. + +## cl.bundlemanager.1 Bundle Manager API Structure Changes +The bundle manager APIs use service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. The structures of APIs in API version 8 and earlier are deprecated. Use the structures of APIs in API version 9 instead. + +**Change Impacts** + +The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt new structures. Otherwise, the original service logic will be affected. The export function of original level-2 modules will also be deprecated. Instead, the level-2 modules' export function of new APIs will be used, and new level-1 d.ts modules are imported. + +**Key API/Component Changes** + +The structures of APIs in API version 8 and earlier are sorted out and deprecated, and those of new APIs in API version 9 are added. The following table lists the comparison before and after the change. Some structures are combined. For example, replace **moduleInfo.d.ts** with **hapModuleInfo.d.ts** and **customizeData.d.ts** with **metadata.d.ts**. The structures' functions are the same as those of the original ones. Structures whose attributes are changed or added are listed separately. +| Original Structure (Deprecated) | New Structure (Added) | +| -------------------------------- | ------------------------------------------------------------ | +| bundle/abilityInfo.d.ts | [bundleManager/abilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/abilityInfo.d.ts) | +| bundle/applicationInfo.d.ts | [bundleManager/applicationInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/applicationInfo.d.ts) | +| bundle/bundleInfo.d.ts | [bundleManager/bundleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/bundleInfo.d.ts) | +| bundle/bundleInstaller.d.ts | [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts) | +| bundle/bundleStatusCallback.d.ts | [@ohos.bundle.bundleMonitor.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleMonitor.d.ts) | +| bundle/customizeData.d.ts | [bundleManager/metadata.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/metadata.d.ts) | +| bundle/dispatchInfo.d.ts | [bundleManager/dispatchInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/dispatchInfo.d.ts) | +| bundle/elementName.d.ts | [bundleManager/elementName.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/elementName.d.ts) | +| bundle/extensionAbilityInfo.d.ts | [bundleManager/extensionAbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/extensionAbilityInfo.d.ts) | +| bundle/hapModuleInfo.d.ts | [bundleManager/hapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/hapModuleInfo.d.ts) | +| bundle/launcherAbilityInfo.d.ts | [bundleManager/launcherAbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/launcherAbilityInfo.d.ts) | +| bundle/metadata.d.ts | [bundleManager/metadata.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/metadata.d.ts) | +| bundle/moduleInfo.d.ts | [bundleManager/hapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/hapModuleInfo.d.ts) | +| bundle/packInfo.d.ts | [bundleManager/packInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/packInfo.d.ts) | +| bundle/PermissionDef.d.ts | [bundleManager/permissionDef.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/permissionDef.d.ts) | +| bundle/remoteAbilityInfo.d.ts | [bundleManager/remoteAbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/remoteAbilityInfo.d.ts) | +| bundle/shortcutInfo.d.ts | [bundleManager/shortcutInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/shortcutInfo.d.ts) | + +**Adaptation Guide** +1. Replace the code of original structures with the code of new ones. +2. Deprecate the export function of original level-2 modules. Instead, use the level-2 modules' export function of new APIs, and import new level-1 d.ts modules. + +## cl.bundlemanager.3 Bundle Manager Query API Changes + +Bundle manager query APIs are changed as follows: APIs of version 8 and earlier in **@ohos.bundle** are deprecated, and APIs of version 9 in **@ohos.bundle** are changed to **@ohos.bundle.bundleManager**, **@ohos.bundle.freeInstall**, and **@ohos.bundle.installer**. Most deprecated APIs are added to **@ohos.bundle.bundleManager** and changed to system APIs, and the exception handling capability is added. + +API call mode: APIs are now used by the **@ohos.bundle.bundleManager**, **@ohos.bundle.freeInstall**, and **@ohos.bundle.installer** modules, instead of the **@ohos.bundle** module. + +The system capability of the **@ohos.bundle.bundleManager** and **@ohos.bundle.installer** modules is **SystemCapability.BundleManager.BundleFramework.Core**, and that of **@ohos.bundle.freeInstall** is **SystemCapability.BundleManager.BundleFramework.FreeInstall**. + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs. APIs of version 9 in **@ohos.bundle** are moved to the new **@ohos.bundle.bundleManager.d.ts**, **@ohos.bundle.freeInstall**, and **@ohos.bundle.installer** files. + +**Key API/Component Changes** + +The following table lists the deprecated and changed APIs involved in **@ohos.bundle.d.ts**. The APIs not listed in the table have no change in API names and input parameters, and they have new exception handling and import modules. The APIs can be directly used after being imported to **@ohos.bundle.bundleManager.d.ts**, **@ohos.bundle.freeInstall**, and **@ohos.bundle.installer**. The APIs listed in the table are changed in API version 9, and those marked with "N/A" are deprecated in API version 9. + +| Original API (Deprecated) | New API (Changed or Added) | System API| New File Name | +| ---------------------------- | ---------------------------- | --------- | ------------------------------- | +| BundleFlag | BundleFlag | No | @ohos.bundle.bundleManager.d.ts | +| N/A | ApplicationFlag | Yes | @ohos.bundle.bundleManager.d.ts | +| N/A | AbilityFlag | Yes | @ohos.bundle.bundleManager.d.ts | +| ExtensionFlag | ExtensionAbilityFlag | Yes | @ohos.bundle.bundleManager.d.ts | +| ColorMode | N/A | No | N/A | +| GrantStatus | PermissionGrantState | No | @ohos.bundle.bundleManager.d.ts | +| AbilityType | AbilityType | No | @ohos.bundle.bundleManager.d.ts | +| AbilitySubType | N/A | No | N/A | +| DisplayOrientation | DisplayOrientation | No | @ohos.bundle.bundleManager.d.ts | +| LaunchMode | LaunchType | No | @ohos.bundle.bundleManager.d.ts | +| ExtensionAbilityType | ExtensionAbilityType | Yes | @ohos.bundle.bundleManager.d.ts | +| BundleOptions | N/A | No | N/A | +| InstallErrorCode | N/A | No | N/A | +| UpgradeFlag | UpgradeFlag | Yes | @ohos.bundle.freeInstall.d.ts | +| SupportWindowMode | SupportWindowMode | No | @ohos.bundle.bundleManager.d.ts | +| getBundleInfo | getBundleInfo | Yes | @ohos.bundle.bundleManager.d.ts | +| getBundleInstaller | getBundleInstaller | Yes | @ohos.bundle.installer.d.ts | +| getAbilityInfo | queryAbilityInfo | Yes | @ohos.bundle.bundleManager.d.ts | +| getApplicationInfo | getApplicationInfo | Yes | @ohos.bundle.bundleManager.d.ts | +| queryAbilityByWant | queryAbilityInfo | Yes | @ohos.bundle.bundleManager.d.ts | +| getAllBundleInfo | getAllBundleInfo | Yes | @ohos.bundle.bundleManager.d.ts | +| getAllApplicationInfo | getAllApplicationInfo | Yes | @ohos.bundle.bundleManager.d.ts | +| getNameForUid | getBundleNameByUid | Yes | @ohos.bundle.bundleManager.d.ts | +| getBundleArchiveInfo | getBundleArchiveInfo | Yes | @ohos.bundle.bundleManager.d.ts | +| getLaunchWantForBundle | getLaunchWantForBundle | Yes | @ohos.bundle.bundleManager.d.ts | +| cleanBundleCacheFiles | cleanBundleCacheFiles | Yes | @ohos.bundle.bundleManager.d.ts | +| setApplicationEnabled | setApplicationEnabled | Yes | @ohos.bundle.bundleManager.d.ts | +| setAbilityEnabled | setAbilityEnabled | Yes | @ohos.bundle.bundleManager.d.ts | +| queryExtensionAbilityInfos | queryExtensionAbilityInfo | Yes | @ohos.bundle.bundleManager.d.ts | +| getPermissionDef | getPermissionDef | Yes | @ohos.bundle.bundleManager.d.ts | +| getAbilityLabel | getAbilityLabel | Yes | @ohos.bundle.bundleManager.d.ts | +| getAbilityIcon | getAbilityIcon | Yes | @ohos.bundle.bundleManager.d.ts | +| isAbilityEnabled | isAbilityEnabled | Yes | @ohos.bundle.bundleManager.d.ts | +| isApplicationEnabled | isApplicationEnabled | Yes | @ohos.bundle.bundleManager.d.ts | +| setModuleUpgradeFlag | setHapModuleUpgradeFlag | Yes | @ohos.bundle.freeInstall.d.ts | +| isModuleRemovable | isHapModuleRemovable | Yes | @ohos.bundle.freeInstall.d.ts | +| getBundlePackInfo | getBundlePackInfo | Yes | @ohos.bundle.freeInstall.d.ts | +| getDispatcherVersion | getDispatchInfo | Yes | @ohos.bundle.freeInstall.d.ts | +| getProfileByAbility | getProfileByAbility | No | @ohos.bundle.bundleManager.d.ts | +| getProfileByExtensionAbility | getProfileByExtensionAbility | No | @ohos.bundle.bundleManager.d.ts | +| setDisposedStatus | setDisposedStatus | Yes | @ohos.bundle.appControl.d.ts | +| getDisposedStatus | getDisposedStatus | Yes | @ohos.bundle.appControl.d.ts | +| N/A | deleteDisposedStatus | Yes | @ohos.bundle.appControl.d.ts | +| getBundleInfoSync | getBundleInfoSync | Yes | @ohos.bundle.bundleManager.d.ts | +| getApplicationInfoSync | getApplicationInfoSync | Yes | @ohos.bundle.bundleManager.d.ts | +| N/A | getBundleInfoForSelf | No | @ohos.bundle.bundleManager.d.ts | + +**Adaptation Guide** + +Replace the original APIs with new ones of version 9 and import related modules. + +Old import module: +``` +import bundle form '@ohos.bundle' +``` +New import module: +``` +import bundle form '@ohos.bundle.bundleManager' +import freeInstall form '@ohos.bundle.freeInstall' +import installer form '@ohos.bundle.installer' +import appControl form '@ohos.bundle.appControl' +``` + +## cl.bundlemanager.4 BundleInfo Structure Changes + +All **bundle/bundleInfo.d.ts** fields in the bundle manager are deprecated. [bundle/bundleInfo.d.ts]((https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundle/bundleInfo.d.ts)) is changed to [bundleManager/bundleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/bundleInfo.d.ts), involving field type changes. + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs. When a level-2 module is used to export **BundleInfo**, the **@ohos.bundle.bundleManager** module needs to be imported. + +**Key API/Component Changes** + +The following table describes the changed fields in the **BundleInfo** structure. After other fields are deprecated in **bundle/bundleInfo.d.ts**, they have corresponding values in the new **[bundleManager/bundleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/bundleInfo.d.ts)**. If corresponding fields do not exist, the fields have been deprecated in API version 9. + +| Deprecated | Added or Changed in API Version 9 | Type | +| --------------------- | --------------------- | ------------------------------------------ | +| type | N/A | string | +| appId | N/A | string | +| N/A | signatureInfo | SignatureInfo | +| uid | N/A | number | +| abilityInfos | N/A | Array\ | +| reqPermissions | N/A | Array | +| compatibleVersion | N/A | number | +| isCompressNativeLibs | N/A | boolean | +| entryModuleName | N/A | string | +| cpuAbi | N/A | string | +| isSilentInstallation | N/A | string | +| entryInstallationFree | N/A | boolean | +| reqPermissionStates | permissionGrantStates | Array\ | +| extensionAbilityInfo | N/A | Array\ | +| hapModuleInfos | hapModulesInfo | Array\ | + +The **SignatureInfo** structure is added to API version 9 as follows. + +| Field | Type | +| ----------- | ------ | +| appId | string | +| fingerprint | string | + +**Adaptation Guide** + +Use the **BundleInfo** structure of API version 9 for modules imported for bundle manager query. The following module needs to be imported when a level-2 module is used for export. + +``` +import bundle form '@ohos.bundle.bundleManager' +``` + +## cl.bundlemanager.5 ApplicationInfo Structure Changes +The **ApplicationInfo** structure is changed. The original **bundle/applicationInfo.d.ts** fields in the bundle manager are deprecated, and the file is changed from **bundle/applicationInfo.d.ts** to **bundleManager/applicationInfo.d.ts**, involving field type changes. + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs. When a level-2 module is used to export **ApplicationInfo**, the **@ohos.bundle.bundleManager** module needs to be imported. + +**Key API/Component Changes** + +The following table describes the changed fields in the **ApplicationInfo** structure. After other fields are deprecated in **bundle/applicationInfo.d.ts**, they have corresponding values in the new [bundleManager/applicationInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/applicationInfo.d.ts). If corresponding fields do not exist, the fields have been deprecated in API version 9. + +| Deprecated | Added or Changed in API Version 9| Type | +| ---------------- | -------------- | ---------------------------------- | +| systemApp | N/A | boolean | +| labelId | N/A | string | +| labelIndex | labelId | number | +| iconId | N/A | string | +| iconIndex | iconId | number | +| supportedModes | N/A | number | +| moduleSourceDirs | N/A | Array\ | +| moduleInfos | N/A | Array\ | +| metaData | N/A | Map\> | +| entityType | N/A | string | +| fingerprint | N/A | string | + +**Adaptation Guide** + +Use the **ApplicationInfo** structure of API version 9 for modules imported for bundle manager query. + + +## cl.bundlemanager.6 HapModuleInfo Structure Changes + +The **HapModuleInfo** structure is changed. The original **bundle/hapModuleInfo.d.ts** and **moduleInfo.d.ts** fields in the bundle manager are deprecated, and the files are changed to [bundleManager/hapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/hapModuleInfo.d.ts), involving field type changes. + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs. When a level-2 module is used to export **HapModuleInfo**, the **@ohos.bundle.bundleManager** module needs to be imported. + +**Key API/Component Changes** + +The following table describes the changed fields in the **HapModuleInfo** structure. After other fields are deprecated in **bundle/hapModuleInfo.d.ts**, they have corresponding values in the new **bundleManager/hapModuleInfo.d.ts** file. + +| Deprecated | Added or Changed in API Version 9 | Type | +| -------------------- | ---------------------- | ---------------------------- | +| abilityInfo | abilitiesInfo | Array | +| N/A | moduleSourceDir | string | +| backgroundImg | N/A | string | +| supportedModes | N/A | string | +| reqCapabilities | N/A | Array\ | +| moduleName | N/A | string | +| mainAbilityName | N/A | string | +| extensionAbilityInfo | extensionAbilitiesInfo | Array\ | + +**Adaptation Guide** + +Use the **HapModuleInfo** structure of API version 9 for modules imported for bundle manager query. + +## cl.bundlemanager.7 ModuleInfo Structure Changes + +The original **bundle/hapModuleInfo.d.ts** and **moduleInfo.d.ts** fields in the bundle manager are deprecated, and the files are changed to [bundleManager/hapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/hapModuleInfo.d.ts), involving field changes. +The **ModuleInfo** structure is deprecated and replaced by **HapModuleInfo** in [bundleManager/hapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/hapModuleInfo.d.ts). + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs. The **ModuleInfo** structure is deprecated and replaced by **HapModuleInfo**. + +**Key API/Component Changes** + +The **ModuleInfo** structure is deprecated and replaced by **HapModuleInfo**. + +**Adaptation Guide** + +Use the **HapModuleInfo** structure of API version 9. + +## cl.bundlemanager.8 AbilityInfo Structure Changes + +The **AbilityInfo** structure is changed. The original **bundle/abilityInfo.d.ts** file is deprecated and changed to **bundleManager/abilityInfo.d.ts**, involving field type changes. + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs. + +**Key API/Component Changes** + +The following table lists the field changes in the **AbilityInfo** structure for the bundle manager. Fields that are not listed in the table exist in the new **AbilityInfo** structure after being deprecated. Fields marked with "N/A" have been deprecated in API version 9 and do not exist in the new **AbilityInfo** structure. + +| Deprecated | Added or Changed in API Version 9 | Type | +| ------------------ | ------------------ | --------------------- | +| launchMode | launchType | number | +| supportWindowMode | supportWindowModes | Array\ | +| targetAbility | N/A | string | +| backgroundModes | N/A | number | +| formEnabled | N/A | boolean | +| subType | N/A | AbilitySubType | +| deviceCapabilities | N/A | Array\ | +| metaData | N/A | Array\ | +| maxWindowRatio | N/A | number | +| minWindowRatio | N/A | number | +| maxWindowWidth | N/A | number | +| minWindowWidth | N/A | number | +| maxWindowHeight | N/A | number | +| minWindowHeight | N/A | number | +| N/A | windowSize | WindowSize | + +The fields of the new structure **WindowSize** of API version 9 are as follows. + +| Field | Type | +| :-------------: | :----: | +| maxWindowRatio | number | +| minWindowRatio | number | +| maxWindowWidth | number | +| minWindowWidth | number | +| maxWindowHeight | number | +| minWindowHeight | number | + +**Adaptation Guide** + +Use the **AbilityInfo** structure of API version 9. + +## cl.bundlemanager.9 BundleFlag Changes + +**BundleFlag** is changed to **BundleFlag**, **ApplicationFlag**, and **AbilityFlag** in **@ohos.bundle.bundleManager**. Different types of flags are passed based on the input parameters of new APIs. + +**Change Impacts** + +**BundleFlag** is changed to **BundleFlag**, **ApplicationFlag**, and **AbilityFlag** in **@ohos.bundle.bundleManager**. Different types of flags are passed based on the input parameters of new APIs. If **BundleFlag** of a version earlier than API version 9 is directly used, the query may fail. + +**Key API/Component Changes** + +**BundleFlag** in the original **@ohos.bundle** is deprecated and replaced by **BundleFlag**, **ApplicationFlag**, and **AbilityFlag** in the new **@ohos.bundle.bundleManager**. + +The following table describes **BundleFlag** of API version 9. + +| BundleFlag | Value | Description | +| ----------------------------------------- | ---------- | ------------------------------------------------------------ | +| GET_BUNDLE_INFO_DEFAULT | 0x00000000 | Obtains the default **BundleInfo**. The obtained **BundleInfo** does not contain **signatureInfo**, **hapModuleInfo**, **appInfo**, **reqPermissionDetails**, or **permissionGrantStates**.| +| GET_BUNDLE_INFO_WITH_APPLICATION | 0x00000001 | Obtains **appInfos** with the default **BundleInfo**. | +| GET_BUNDLE_INFO_WITH_HAP_MODULE | 0x00000002 | Obtains **hapModulesInfo** with the default **BundleInfo**. | +| GET_BUNDLE_INFO_WITH_ABILITY | 0x00000004 | Indicates whether **abilitiesInfo** is obtained with **hapModulesInfo**. This flag must be used together with **GET_BUNDLE_INFO_WITH_HAP_MODULE** and cannot be used independently.| +| GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY | 0x00000008 | Indicates whether **extensionAbilitiesInfo** is obtained with **hapModulesInfo**. This flag must be used together with **GET_BUNDLE_INFO_WITH_HAP_MODULE** and cannot be used independently.| +| GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION | 0x00000010 | Obtains **reqPermissionDetails** and **permissionGrantStates** with the default **BundleInfo**. | +| GET_BUNDLE_INFO_WITH_METADATA | 0x00000020 | Indicates whether the returned **ApplicationInfo**, **AbilityInfo**, and **ExtensionAbilityInfo** contain metadata. This flag cannot be used independently.| +| GET_BUNDLE_INFO_WITH_DISABLE | 0x00000040 | Obtains **BundleInfo** of a disabled application and disabled ability information in **abilitiesInfo**.| +| GET_BUNDLE_INFO_WITH_SIGNATURE_INFO | 0x00000080 | Obtains **signatureInfo** with the default **BundleInfo**. | + +The following table describes **ApplicationFlag** of API version 9. + +| ApplicationFlag | Value | Description | +| ------------------------------------ | ---------- | ------------------------------------------------------------ | +| GET_APPLICATION_INFO_DEFAULT | 0x00000000 | Obtains the default **ApplicationInfo**. The obtained **ApplicationInfo** does not contain permission or metadata information.| +| GET_APPLICATION_INFO_WITH_PERMISSION | 0x00000001 | Obtains **permissions** with the default **ApplicationInfo**. | +| GET_APPLICATION_INFO_WITH_METADATA | 0x00000002 | Obtains **metadata** with the default **ApplicationInfo**. | +| GET_APPLICATION_INFO_WITH_DISABLE | 0x00000004 | Obtains disabled application information. | + + +The following table describes **AbilityFlag** of API version 9. +| AbilityFlag | Value | Description | +| --------------------------------- | ---------- | ------------------------------------------------------------ | +| GET_ABILITY_INFO_DEFAULT | 0x00000000 | Obtains the default **AbilityInfo**. The obtained **AbilityInfo** does not contain permission, metadata, or disabled ability information.| +| GET_ABILITY_INFO_WITH_PERMISSION | 0x00000001 | Obtains **AbilityInfo** with permission information. | +| GET_ABILITY_INFO_WITH_APPLICATION | 0x00000002 | Obtains **AbilityInfo** with the **ApplicationInfo** structure. | +| GET_ABILITY_INFO_WITH_METADATA | 0x00000004 | Obtains **AbilityInfo** with metadata information. | +| GET_ABILITY_INFO_WITH_DISABLE | 0x00000008 | Obtains all **AbilityInfo**, including disabled abilities. | +| GET_ABILITY_INFO_ONLY_SYSTEM_APP | 0x00000010 | Obtains **AbilityInfo** for system applications. | + +**Adaptation Guide** + +Use various flags according to the called API in **@ohos.bundle.bundleManager.d.ts**. + +## cl.bundlemanager.10 ApplicationType Enumerated Value Changes in the Default Application Module +For the **@ohos.bundle.defaultApp** module, both API functions and usage remain unchanged, but only the enumerated values of **ApplicationType** are changed. + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new enumerated values. + +**Key API/Component Changes** + +The enumerated values of **ApplicationType** are changed as follows. + +| ApplicationType| Added or Changed in API Version 9 | API Version 8 and Earlier| +| :-------------: | :-------------: | :--------: | +| BROWSER | "Web Browser" | "BROWSER" | +| IMAGE | "Image Gallery" | "IMAGE" | +| AUDIO | "Audio Player" | "AUDIO" | +| VIDEO | "Video Player" | "VIDEO" | +| PDF | "PDF Viewer" | "PDF" | +| WORD | "Word Viewer" | "WORD" | +| EXCEL | "Excel Viewer" | "EXCEL" | +| PPT | "PPT Viewer" | "PPT" | + +**Adaptation Guide** + +Import the default application module and call related APIs. + +``` +import defaultApp form '@ohos.bundle.defaultAppManager' +``` + +## cl.bundlemanager.11 Distributed Bundle Manager Changes +API exception handling is rectified. The distributed bundle manager module is changed. The original **@ohos.distributedBundle.d.ts** APIs are deprecated, and the **@ohos.distributedBundle.d.ts** file is changed to [@ohos.bundle.distributedBundle.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.distributedBundle.d.ts). The **getRemoteAbilityInfos** API is changed to **getRemoteAbilityInfo**. The export function of a level-2 module in the **RemoteAbilityInfo** structure can be used only after a new module is imported. + +**Change Impacts** + +Applications using APIs earlier than version 9 are not affected. The names of the distributed module and the **getRemoteAbilityInfos** API are changed. As a result, applications using APIs of version 9 may fail to be compiled using the new SDK. + +**Key API/Component Changes** + +All APIs in **@ohos.distributedBundle.d.ts** are deprecated. The **@ohos.bundle.distributedBundle.d.ts** file is added. The functions of some APIs are the same as those of the original ones. New APIs support exception handling. The API changes are as follows. + +| Deprecated | Added or Changed in API Version 9 | System API| +| --------------------- | -------------------- | --------- | +| getRemoteAbilityInfos | getRemoteAbilityInfo | Yes | + +**Adaptation Guide** + +Import a new distributed module. + +``` +import distributedBundle form '@ohos.bundle.distributedBundle' +``` + +## cl.bundlemanager.12 Installation-Free Module and API Changes +APIs support exception handling rectification. The installation-free module is moved from **@ohos.bundle.d.ts** to **@ohos.bundle.freeInstall.d.ts**, involving module and API changes. The system capability is **SystemCapability.BundleManager.BundleFramework.FreeInstall**. +1. The imported **@ohos.bundle** module needs to be changed to **@ohos.bundle.freeInstall**. +2. The **setModuleUpgradeFlag** API is changed to **setHapModuleUpgradeFlag**. +3. The **isModuleRemovable** API is changed to **isHapModuleRemovable**. +4. The **getDispatcher** API is changed to **getDispatchInfo**. + +**Change Impacts** + +Applications using APIs earlier than version 9 are not affected. Applications using APIs of version 9 will fail to be compiled. + +**Key API/Component Changes** + +The following table lists the installation-free API changes. For APIs not listed in the table, their names and usage are unchanged, but the module name is changed. + +| Deprecated | Added or Changed in API Version 9 | System API| +| -------------------- | ----------------------- | --------- | +| setModuleUpgradeFlag | setHapModuleUpgradeFlag | Yes | +| isModuleRemovable | isHapModuleRemovable | Yes | +| getDispatcher | getDispatchInfo | Yes | + +**Adaptation Guide** + +To use installation-free APIs, import a new module and modify the APIs according to their mappings. + +``` +import freeInstall from '@ohos.bundle.freeInstall' +``` + +## cl.bundlemanager.13 Installation-Free Structure Field Changes +The fields of the **DisPatchInfo**, **AbilityFormInfo**, **ModuleDistroInfo**, and **ModuleConfigInfo** structures are changed as follows: +1. The name of the **dispatchAPI** field in **DispatchInfo** is changed to [dispatchAPIVersion](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/dispatchInfo.d.ts), and the type is string, which is unchanged. The field indicates the version of the installation-free API. The meaning remains unchanged. +2. The type of the **supportDimensions** field in the **AbilityFormInfo** structure is changed from **Array\** to **Array\**. +3. The type of the **defaultDimension** field in the **AbilityFormInfo** structure is changed from **number** to **string**. +4. The **mainAbility** field is deprecated in the **ModuleDistroInfo** structure and moved to the **ModuleConfigInfo** structure. +5. The **mainAbility** field is added to the **ModuleConfigInfo** structure. + +**Change Impacts** + +Applications using APIs earlier than version 9 are not affected. The value type of certain fields in the structures is changed. As a result, applications using APIs of version 9 may fail to be compiled using the new SDK. + +**Key API/Component Changes** + +1. DispatchInfo + +| Deprecated | Added or Changed in API Version 9 | Type | +| ----------- | ------------------ | ------ | +| dispatchAPI | dispatchAPIVersion | string | + +2. AbilityFormInfo + +| Field | Type in API Version 9 | Original Type | +| ----------------- | -------------- | -------------- | +| supportDimensions | Array\ | Array\ | +| defaultDimension | string | number | + +3. ModuleDistroInfo + +| Field | Added or Changed in API Version 9| Type | +| ----------- | -------------- | ------ | +| mainAbility | N/A | string | + +4. MooduleConfigInfo + +| Field| Added or Changed in API Version 9| Type | +| ---- | -------------- | ------ | +| N/A | mainAbility | string | + +**Adaptation Guide** + +To use installation-free APIs, import a new module and modify the structures according to their mappings. + +``` +import freeInstall from '@ohos.bundle.freeInstall' +``` + +## cl.bundlemanager.14 Structure Changes +The structure **GrantStatus** is changed to **PermissionGrantState**. The enumeration type and values remain unchanged. + +**Change Impacts** + +Applications using APIs earlier than version 9 are not affected. The structure name is changed. As a result, applications using APIs of version 9 may fail to be compiled using the new SDK. + +**Key API/Component Changes** + +The **GrantStatus** structure indicating the authorization status is changed to **PermissionGrantState** in **@ohos.bundle.bundleManager.d.ts**. + +| Name | Value| +| ------------------ | ------ | +| PERMISSION_DENIED | -1 | +| PERMISSION_GRANTED | 0 | + +**Adaptation Guide** + +Import a new module and change the structure name to **PermissionGrantState**. + +``` +import bundle form '@ohos.bundle.bundleManager' +``` +## cl.bundlemanager.15 Bundle Manager ShortcutInfo Structure Field Changes +Fields in the **ShortcutInfo** structure of the bundle manager are changed. The **bundle/shortcutInfo.d.ts** fields are deprecated, and the file is changed to [bundleManager/shortcutInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/shortcutInfo.d.ts). The **ShortcutInfo** and **ShortWant** structures are changed to system APIs. + +**Change Impacts** + +Applications using APIs earlier than version 9 are not affected. The value type of certain fields in the structures is changed. As a result, applications using APIs of version 9 may fail to be compiled using the new SDK. + +**Key API/Component Changes** + +The **ShortcutInfo** and **ShortcutWant** structures are involved. To use the level-2 module export function, import the new module **@ohos.bundle.launcherBundleManager**. +The following table lists the field changes of the **ShortcutInfo** structure. Fields that are not listed in the table still exist in API version 9. + +| Deprecated | Added or Changed in API Version 9| Type | +| -------------- | -------------- | ------- | +| disableMessage | N/A | string | +| isStatic | N/A | boolean | +| isHomeShortcut | N/A | boolean | +| isEnabled | N/A | boolean | +| disableMessage | N/A | boolean | + +The following table lists the field changes of the **ShortcutWant** structure. Fields that are not listed in the table still exist in API version 9. +| Deprecated | Added or Changed in API Version 9| Type | +| ----------- | -------------- | ------ | +| targetClass | targetAbility | string | + +**Adaptation Guide** + +To use installation-free APIs, import a new module and modify the structures according to their mappings. + +``` +import launcherBundleManager form '@ohos.bundle.launcherBundleManager' +``` + +## cl.bundlemanager.16 getBundleInstaller API Changes +The **getBundleInstaller** API of the bundle manager is moved from **@ohos.bundle.d.ts** to [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts). +The system capability is **SystemCapability.BundleManager.BundleFramework.Core**. + +**Change Impacts** + +Applications using APIs earlier than version 9 are not affected. Applications that use APIs of version 9 need to adapt the new module and APIs. + +**Key API/Component Changes** +1. For **getBundleInstaller**, the import module is changed from **@ohos.bundle** to **@ohos.bundle.installer**. + +**Adaptation Guide** + +Import the new bundle manager installation module and call **getBundleInstaller**. + +``` +import installer form '@ohos.bundle.installer' +``` + +## cl.bundlemanager.17 Bundle Manager Installation API Changes +The bundle manager installation API is moved from **bundle/bundleInstaller.d.ts** to [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts). The system capability is **SystemCapability.BundleManager.BundleFramework.Core**. + +**Change Impacts** + +Applications using APIs earlier than version 9 are not affected. Applications that use APIs of version 9 need to adapt the new module and APIs. + +**Key API/Component Changes** + +1. The exception handling capability is added to the **install**, **uninstall**, and **recover** APIs. The API names and input parameters remain unchanged, and only the module name is changed. +2. Fields are added to the **HashParam** structure as follows. + +| Added in API Version 9 | Type | +| ---------- | ------ | +| moduleName | string | +| hashValue | string | + +3. Fields are added to the **InstallParam** structure as follows. + +| Added in API Version 9 | Type | +| ----------------- | ----------------- | +| userId | number | +| installFlag | number | +| isKeepData | boolean | +| hashParams | Array\ | +| crowdtestDeadline | number | + +4. The **InstallStatus** structure is deprecated. + +**Adaptation Guide** + +Import the new bundle manager installation module and call **getBundleInstaller**. + +``` +import installer form '@ohos.bundle.installer' +``` + +## cl.bundlemanager.18 Bundle Manager Installation Function Changes +The installation specifications of the bundle manager module are changed, in which whether the application **deviceType** setting matches the device type is verified. If they do not match, the installation fails. + +**Change Impacts** + +Applications developed in earlier versions are affected. Applications can be successfully installed in the image of the new version only after adaptation. + +**Key API/Component Changes** + +N/A + +**Adaptation Guide** + +Configure device types in the application configuration file **config.json** or **module.json**. + +``` +{ + "module": { + "name": "entry", + "type": "entry", + // ... + "deviceTypes":[ + // In this example, default and tablet are configured. In this case, the application can be installed on default and tablet. + "default", + "tablet" + ], + // ... + } +``` +## cl.bundlemanager.19 innerBundleManger Module API Changes +**innerBundleManager** API functions are unchanged, but API usage is changed. The [@ohos.bundle.launcherBundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.launcherBundleManager.d.ts) module needs to be imported to use **innerBundleManager** APIs. The system capability is **SystemCapability.BundleManager.BundleFramework.Core**. + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. Applications that use the **innerBundleManager** API capabilities need to adapt the new module and APIs. + +**Key API/Component Changes** + +The functions and input parameters of the following APIs remain unchanged, and API exception handling is added. When a level-2 module is used to export **ShortcutInfo** and **ShortcutWant**, the **@ohos.bundle.launcherBundleManager** module needs to be imported. The **on** and **off** APIs are deprecated from **@ohos.bundle.innerBundleManger.d.ts** and moved to **@ohos.bundle.bundleMonitor.d.ts**. + +1. getLauncherAbilityInfos
+2. getAllLauncherAbilityInfos
+3. getShortcutInfos + +**Adaptation Guide** + +Import the new module **@ohos.bundle.launcherBundleManage**. + +``` +import launcherBundleManager form '@ohos.bundle.launcherBundleManage' +``` + +## cl.bundlemanager.20 innerBundleManagr Module Changes +**innerBundleManager** API functions are unchanged, but API usage is changed. The [@ohos.bundle.bundleMonitor.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleMonitor.d.ts) module needs to be imported to use **innerBundleManager** APIs, which are system APIs. The system capability is **SystemCapability.BundleManager.BundleFramework.Core**. + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. Applications that use the **innerBundleManager** API capabilities need to adapt the new module and APIs. + +**Key API/Component Changes** + +The **on** and **off** APIs are changed to **@ohos.bundle.bundleMonitor.d.ts**. The input parameters are different from those of the original APIs. The function prototype of the APIs of version 9 is as follows: + +``` +function on(type: BundleChangedEvent, callback: Callback): void; +function off(type: BundleChangedEvent, callback?: Callback): void; +``` +**BundleChangedEvent**: + +``` +type BundleChangedEvent = 'add' | 'update' | 'remove'; +``` +Callback function of **BundleChangedInfo**: +``` + interface BundleChangedInfo { + readonly bundleName: string; + readonly userId: number; + } +``` +After obtaining **BundleChangedInfo**, perform related operations (that is, the **add**, **update**, and **remove** functions in **BundleStatusCallback** of the original API). + +**Adaptation Guide** + +Import the **bundleMonitor** module and call related APIs. + +``` +import bundleMonitor form '@ohos.bundle.bundleMonitor' +``` + +## cl.bundlemanager.21 bundleStatusCallback.d.ts API Changes +The **bundleStatusCallback.d.ts** APIs of the bundle manager are deprecated and moved to [@ohos.bundle.bundleMonitor.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleMonitor.d.ts). The **add**, **update**, and **remove** functions in **BundleStatusCallback** are deprecated and changed to **BundleChangedEvent**, which is a system API. The system capability is **SystemCapability.BundleManager.BundleFramework.Core**. + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. Applications that use the **BundleStatusCallback** API capabilities need to adapt the new module and APIs. + +**Key API/Component Changes** + +All the following functions are deprecated. The **BundleChangedEvent** API is added to **@ohos.bundle.bundleMonitor.d.ts**. + +1. add +2. update +3. remove + +**Adaptation Guide** + +Import the **bundleMonitor** module and call related APIs. Different from the previous **BundleStatusCallback**, **BundleStatusCallback** passes the **add**, **update**, and **remove** functions to the **on** and **off** APIs. The **BundleMonitor** uses the **on** or **off** API of version 9 to return **BundleChangedInfo** to the caller through the callback. + +``` +import bundleMonitor form '@ohos.bundle.bundleMonitor' +``` + +## cl.bundlemanager.22 Zlib Module API Changes +The **Zlib** module APIs of the bundle manager are changed. Certain APIs in [@ohos.zlib.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.zlib.d.ts) are deprecated and changed. The system capability is **SystemCapability.BundleManager.Zlib**. + +**Change Impacts** + +There is no impact on applications that use the APIs of versions earlier than 9. Applications that use APIs of version 9 need to adapt the new module and APIs. + +**Key API/Component Changes** + +The following table lists the changed APIs in **@ohos.zlib.d.ts**. The usage of the new APIs of version 9 is the same, and API exception handling is supported. + +| Deprecated | Added or Changed in API Version 9| System API| +| --------- | -------------- | --------- | +| zipFile | compressFile | Yes | +| unzipFile | decompressFile | Yes | +| ErrorCode | N/A | Yes | + +**Adaptation Guide** + +The import module does not change. The new API is directly used to adapt exception handling. + +``` +import zlib form '@ohos.zlib' +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-dmsfwk.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-dmsfwk.md new file mode 100644 index 0000000000000000000000000000000000000000..5eda23bba4e9832210d6f57de819bfe341ba75d4 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-dmsfwk.md @@ -0,0 +1,103 @@ +# Distributed Scheduler Subsystem ChangeLog + +## cl.DistributedManagerService.1 continuationManager API Changes + +- Event names passed to the **continuationManager** API do not comply with the OpenHarmony API specifications. +- The **continuationManager.on** API does not have a unified return value for various events, which does not comply with the OpenHarmony API specifications. + +The following changes have been made: + +- The device selection event name of **continuationManager.on** and **continuationManager.off** is changed from **deviceConnect** to **deviceSelected**, and the device deselection event name is changed from **deviceDisconnect** to **deviceUnselected**. +- The **continuationManager.on** API returns **Callback<Array<ContinuationResult>>** for all events. + +**Change Impacts** + +The application developed based on earlier versions needs to adapt the new APIs. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +- Involved APIs: + + continuationManager.on; + continuationManager.off; + +- Before change: + +```js + function on(type: "deviceConnect", token: number, callback: Callback>): void; + function off(type: "deviceConnect", token: number): void; + function on(type: "deviceDisconnect", token: number, callback: Callback>): void; + function off(type: "deviceDisconnect", token: number): void; +``` + +- After change: + +```js + function on(type: "deviceSelected", token: number, callback: Callback>): void; + function off(type: "deviceSelected", token: number): void; + function on(type: "deviceUnselected", token: number, callback: Callback>): void; + function off(type: "deviceUnselected", token: number): void; +``` + +**Adaptation Guide** + +Change the event names. The sample code is as follows: + +Device selection event of **continuationManager.on**: + +```ts + let token = 1; + try { + continuationManager.on("deviceSelected", token, (data) => { + console.info('onDeviceSelected len: ' + data.length); + for (let i = 0; i < data.length; i++) { + console.info('onDeviceSelected deviceId: ' + JSON.stringify(data[i].id)); + console.info('onDeviceSelected deviceType: ' + JSON.stringify(data[i].type)); + console.info('onDeviceSelected deviceName: ' + JSON.stringify(data[i].name)); + } + }); + } catch (err) { + console.error('on failed, cause: ' + JSON.stringify(err)); + } +``` + +Device selection event of **continuationManager.off**: + +```ts + let token = 1; + try { + continuationManager.off("deviceSelected", token); + } catch (err) { + console.error('off failed, cause: ' + JSON.stringify(err)); + } +``` + +Device deselection event of **continuationManager.on**: + +```ts + let token = 1; + try { + continuationManager.on("deviceUnselected", token, (data) => { + console.info('onDeviceUnselected len: ' + data.length); + for (let i = 0; i < data.length; i++) { + console.info('onDeviceUnselected deviceId: ' + JSON.stringify(data[i].id)); + console.info('onDeviceUnselected deviceType: ' + JSON.stringify(data[i].type)); + console.info('onDeviceUnselected deviceName: ' + JSON.stringify(data[i].name)); + } + console.info('onDeviceUnselected finished.'); + }); + } catch (err) { + console.error('on failed, cause: ' + JSON.stringify(err)); + } +``` + +Device deselection event of **continuationManager.off**: + +```ts + let token = 1; + try { + continuationManager.off("deviceUnselected", token); + } catch (err) { + console.error('off failed, cause: ' + JSON.stringify(err)); + } +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-wifi.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-wifi.md new file mode 100644 index 0000000000000000000000000000000000000000..7fd3843f2cedaf7f4d8d56d05c99ff7068a9bf16 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-wifi.md @@ -0,0 +1,115 @@ +# Wi-Fi Subsystem ChangeLog + + +## cl.wifi.1 Migration of System APIs and APIs in API Version 9 to the New @ohos.wifiManager.d.ts +**@ohos.wifi.d.ts** does not allow for throwing error codes, which is required by API version 9 and the system APIs. Therefore, all system APIs and APIs in API version 9 of **@ohos.wifi.d.ts** are migrated to the newly added **@ohos.wifiManager.d.ts**, and error code description is also added. + +Import **@ohos.wifiManager.d.ts**, so that system APIs and APIs in API version 9 of the Wi-Fi subsystem can be used. + +import wifiManager from '@ohos.wifiManager'; + + +**Change Impacts** + +System APIs and APIs in API version 9 are affected. Import **@ohos.wifiManager** to make sure that system APIs and APIs in API version 9 of the Wi-Fi subsystem can be used. + +import wifiManager from '@ohos.wifiManager'; + +Other APIs are not affected. + + +**Key API/Component Changes** + +| Class| Type | Declaration | Change Type | +| ---- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| wifi | namespace | declare namespace wifi | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | method | function enableWifi(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value type to void. | +| wifi | method | function disableWifi(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value type to void. | +| wifi | method | function scan(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value type to void. | +| wifi | method | function getScanResults(): Promise<Array<WifiScanInfo>> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed **getScanInfos** to **getScanResults**.| +| wifi | method | function getScanResults(callback: AsyncCallback<Array<WifiScanInfo>>): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed **getScanInfos** to **getScanResults**.| +| wifi | method | function getScanResultsSync():  Array<[WifiScanInfo]> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | method | function addCandidateConfig(config: WifiDeviceConfig): Promise<number> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | method | function addCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback<number>): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | method | function removeCandidateConfig(networkId: number): Promise<void> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | method | function removeCandidateConfig(networkId: number, callback: AsyncCallback<void>): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | method | function addUntrustedConfig(config: WifiDeviceConfig): Promise<boolean> | Deleted this API in API version 9. | +| wifi | method | function addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback<boolean>): void | Deleted this API in API version 9. | +| wifi | method | function removeUntrustedConfig(config: WifiDeviceConfig): Promise<boolean> | Deleted this API in API version 9. | +| wifi | method | function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback<boolean>): void | Deleted this API in API version 9. | +| wifi | method | function getCandidateConfigs():  Array<[WifiDeviceConfig]> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | method | function connectToCandidateConfig(networkId: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | method | function connectToNetwork(networkId: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function connectToDevice(config: WifiDeviceConfig): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function disconnect(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function reassociate(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function reconnect(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function disableNetwork(netId: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function removeAllNetwork(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function removeDevice(id: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function enableHotspot(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function disableHotspot(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function setHotspotConfig(config: HotspotConfig): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function getP2pLocalDevice(): Promise<WifiP2pDevice> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | method | function getP2pLocalDevice(callback: AsyncCallback<WifiP2pDevice>): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | method | function getP2pGroups(): Promise<Array<WifiP2pGroupInfo>> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | method | function getP2pGroups(callback: AsyncCallback<Array<WifiP2pGroupInfo>>): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | method | function createGroup(config: WifiP2PConfig): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function removeGroup(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function p2pConnect(config: WifiP2PConfig): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function p2pCancelConnect(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function startDiscoverDevices(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function stopDiscoverDevices(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function deletePersistentGroup(netId: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | method | function setDeviceName(devName: string): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| +| wifi | interface | export interface WifiEapConfig | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | enum | export enum EapMethod | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | enum | export enum Phase2Method | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | interface | export interface WifiDeviceConfig | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added the **eapConfig** parameter.| +| wifi | interface | export interface IpConfig | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added the **prefixLength** parameter.| +| wifi | interface | export interface WifiInfoElem | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | enum | export enum WifiChannelWidth | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | +| wifi | interface | export interface WifiScanInfo | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added the following three parameters: **centerFrequency0**, **centerFrequency1**, and **infoElems**.| +| wifi | enum | export enum WifiSecurityType | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added four encryption types. | +| wifi | interface | export interface WifiLinkedInfo | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added the **MacType** parameter. | + + +**(Optional) Adaptation Guide** + +The following uses **getLinkedInfo** as an example to show how it is called in the new version: + +``` +import wifiManager from '@ohos.wifiManager' + +wifiManager.getLinkedInfo((err, data) => { + if (err) { + console.error("get linked info error"); + return; + } + console.info("get linked info: " + JSON.stringify(data)); +}); + +wifiManager.getLinkedInfo().then(data => { + console.info("get linked info: " + JSON.stringify(data)); +}).catch(error => { + console.info("get linked info error"); +}); + +``` + +## cl.wifiext.1 Migration of System APIs and APIs in API Version 9 to the New @ohos.wifiManagerExt.d.ts + +**@ohos.wifiext.d.ts** does not allow for throwing error codes, which is required by API version 9 and the system API. Therefore, all system APIs and APIs in API version 9 of **@ohos.wifiext.d.ts** are migrated to the newly added **@ohos.wifiManagerExt.d.ts**, and error code description is also added. + +Import **@ohos.wifiManagerExt.d.ts**, so that system APIs and APIs in API version 9 of the Wi-Fi subsystem can be used. + +import wifiManagerExt from '@ohos.wifiManagerExt'; + + +**Change Impacts** + +System APIs and APIs in API version 9 are affected. Import **@ohos.wifiManagerExt**, so that system APIs and APIs in API version 9 of the Wi-Fi subsystem can be used together with the Wi-Fi manager. + +import wifiManagerExt from '@ohos.wifiManagerExt'; + +Other APIs are not affected. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-ability.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-ability.md new file mode 100644 index 0000000000000000000000000000000000000000..ae3d6a17cce9d488dff3f84765ca9f2cfc2260fe --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-ability.md @@ -0,0 +1,373 @@ +# Ability Subsystem ChangeLog + +## cl.ability.1 Application Component Startup Rule Change + +The rules for starting application components of the ability subsystem are changed in the following scenarios: + + - Start application components when the application is in the background. + - Start invisible application components across applications. + - Start **serviceAbility** and **dataAbility** of the FA model across applications. + - Use the **startAbilityByCall** API. + +You need to adapt your application based on the following information. + +**Change Impacts** + +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: + - **Start application components when the application is in the background.** + - OpenHarmony 3.2 Beta3 rules: + + - Starting application components when the application is in the background is not restricted. + - OpenHarmony 3.2 Beta4 rules: + - When the application is in the background, starting application components requires authentication. The following permission needs to be applied for: + ```json + { + "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false + } + ``` + > **NOTE** + > + > 1. Starting components of the same application is also restricted by this rule. + > 2. For SDKs of API version 8 or earlier, starting **serviceAbility** and **dataAbility** is not restricted by this rule. + + - **Start invisible application components across applications.** + - OpenHarmony 3.2 Beta3 rules: + + - For applications whose APL is normal, invisible application components cannot be started across applications. + - OpenHarmony 3.2 Beta4 rules: + - For all applications, starting invisible application components across applications requires authentication. The following permission needs to be applied for: + ```json + { + "name": "ohos.permission.START_INVISIBLE_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_core", + "provisionEnable": true, + "distributedSceneEnable": false + } + ``` + + - **Start serviceAbility and dataAbility of the FA model across applications.** + + - OpenHarmony 3.2 Beta3 rules: + - Starting **serviceAbility** and **dataAbility** across applications is not restricted. + - OpenHarmony 3.2 Beta4 rules: + - Associated startup needs to be configured for the provider of **serviceAbility** and **dataAbility**. Otherwise, **serviceAbility** and **dataAbility** cannot be started across applications. (Associated startup cannot be configured for common applications.) + + + - **Use the startAbilityByCall API.** + - OpenHarmony 3.2 Beta3 rules: + + - The API call is not restricted. + - OpenHarmony 3.2 Beta4 rules: + + - The **startAbilityByCall** API cannot be called by the same application. + - Calling the **startAbilityByCall** API across applications requires authentication. The following permission needs to be applied for: + + ```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 of the ability subsystem are changed in the following scenarios: + + - Start application components when the application is in the background. + - Start invisible application components across applications. + - Start **serviceAbility** of the FA model across applications. + +You need to adapt your application based on the following information. + + +**Change Impacts** + +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: + - **Start application components when the application is in the background.** + - OpenHarmony 3.2 Beta3 rules: + + - Starting application components when the application is in the background is not restricted. + - OpenHarmony 3.2 Beta4 rules: + - When the application is in the background, starting application components requires authentication. The following permission needs to be applied for: + ```json + { + "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false + } + ``` + > **NOTE** + > + > 1. Starting components of the same application is also restricted by this rule. + > 2. For SDKs of API version 8 or earlier, starting **serviceAbility** is not restricted by this rule. + + - **Start invisible application components across applications.** + - OpenHarmony 3.2 Beta3 rules: + + - Invisible application components cannot be started across applications. + - OpenHarmony 3.2 Beta4 rules: + - Starting invisible application components across applications requires authentication. The following permission needs to be applied for: + ```json + { + "name": "ohos.permission.START_INVISIBLE_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_core", + "provisionEnable": true, + "distributedSceneEnable": false + } + ``` + + - **Start serviceAbility of the FA model across applications.** + + - OpenHarmony 3.2 Beta3 rules: + + - Starting **serviceAbility** across applications is not restricted. + - OpenHarmony 3.2 Beta4 rules: + - Associated startup needs to be configured for the **serviceAbility** provider application. Otherwise, **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 Impacts** + +The application developed based on earlier versions needs to adapt the new APIs and their method for returning API error information. Otherwise, the original service logic will be affected. + +**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 migrated 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 some ability subsystem APIs are changed. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enumeration/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/OpenHarmony_3.2.8.3/changelogs-account_os_account.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-account_os_account.md new file mode 100644 index 0000000000000000000000000000000000000000..df7cbf93cd13a7cc4dfc04fb9aec4b112633035a --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-account_os_account.md @@ -0,0 +1,124 @@ +# Account Subsystem ChangeLog + +## cl.account_os_account.1 Change in Error Information Return Method of Account System APIs + +Certain system APIs of the account subsystem use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. The following changes are made in API version 9 and later: + +Asynchronous API: An error message is returned via **AsyncCallback** or the **error** object of **Promise**. + +Synchronous API: An error message is returned via an exception. + +**Change Impacts** + +The application developed based on earlier versions needs to adapt the new APIs and their method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +Before change: + - class UserAuth + - setProperty(request: SetPropertyRequest, callback: AsyncCallback<number>): void; + - setProperty(request: SetPropertyRequest): Promise<number>; + - cancelAuth(contextID: Uint8Array): number; + - class PINAuth + - registerInputer(inputer: Inputer): boolean; + - UserIdentityManager + - cancel(challenge: Uint8Array): number; + +After change: + - class UserAuth + - setProperty(request: SetPropertyRequest, callback: AsyncCallback<void>): void; + - setProperty(request: SetPropertyRequest): Promise<void>; + - cancelAuth(contextID: Uint8Array): void; + - class PINAuth + - registerInputer(inputer: Inputer): void; + - UserIdentityManager + - cancel(challenge: Uint8Array): void; + +**Adaptation Guide** + +The following uses **setProperty** as an example for asynchronous APIs: + +``` +import account_osAccount from "@ohos.account.osAccount" +userAuth.setProperty({ + authType: account_osAccount.AuthType.PIN, + key: account_osAccount.SetPropertyType.INIT_ALGORITHM, + setInfo: new Uint8Array([0]) +}, (err) => { + if (err) { + console.log("setProperty failed, error: " + JSON.stringify(err)); + } else { + console.log("setProperty successfully"); + } +}); + +userAuth.setProperty({ + authType: account_osAccount.AuthType.PIN, + key: account_osAccount.SetPropertyType.INIT_ALGORITHM, + setInfo: new Uint8Array([0]) +}).catch((err) => { + if (err) { + console.log("setProperty failed, error: " + JSON.stringify(err)); + } else { + console.log("setProperty successfully"); + } +}); +``` + +The following uses **registerInputer** as an example for synchronous APIs: + +``` +import account_osAccount from "@ohos.account.osAccount" +let pinAuth = new account_osAccount.PINAuth() +let inputer = { + onGetData: (authType, passwordRecipient) => { + let password = new Uint8Array([0]); + passwordRecipient.onSetData(authType, password); + } +} +try { + pinAuth.registerInputer(inputer); +} catch (err) { + console.log("registerInputer failed, error: " + JSON.stringify(err)); +} +``` + +## cl.account_os_account.2 ACTION Definition Change for the Application Account Authentication Service + +**Change Impacts** + +For the application developed based on an earlier version, you need to modify **ACTION** in the application configuration file (**config.json** for the FA model and **module.json5** for the Stage model) to normally provide the application authentication service. + +**Key API/Component Changes** + +Involved constant: + +@ohos.ability.wantConstant.ACTION_APP_ACCOUNT_AUTH + +Before change: + +ACTION_APP_ACCOUNT_AUTH = "account.appAccount.action.auth" + +After change: + +ACTION_APP_ACCOUNT_AUTH = "ohos.appAccount.action.auth" + +**Adaptation Guide** + +For a third-party application providing the account authentication service, adapt the changed application account authentication **ACTION** in the **ServiceAbility** configuration file (**config.json** for the FA module or **module.json5** for the Stage module). +``` +"abilities": [ + { + "name": "ServiceAbility", + "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", + ... + "visible": true, + "skills": { + { + "actions": [ + "ohos.appAccount.action.auth" + ] + } + } + }] +} diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-enterprise_device_management.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-enterprise_device_management.md new file mode 100644 index 0000000000000000000000000000000000000000..5a3f51481a6ce67f75c16deded929f64c1b29432 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-enterprise_device_management.md @@ -0,0 +1,159 @@ +# Customization Subsystem ChangeLog + +Compared with OpenHarmony 3.2.8.1, OpenHarmony 3.2.8.3 has the following API changes in the customization subsystem: + +## cl.Customization.1 Change of the Enterprise Device Management Module Name + +Beginning from OpenHarmony 3.2.8.3, **@ohos.enterpriseDeviceManager.d.ts** is changed to **@ohos.enterprise.adminManager.d.ts**. You need to adapt your applications according to the following information. + +**Change Impacts** + +The application developed based on OpenHarmony earlier than 3.2.8.3 must be adapted so that it can be properly compiled in the SDK environment of the new version. + +**Key API/Component Changes** + +| Original API | New API | +| --------------------------------- | ---------------------------------- | +| @ohos.enterpriseDeviceManager.d.ts | @ohos.enterprise.adminManager.d.ts | + +**Adaptation Guide** + +The original APIs are only migrated to the new namespace. Therefore, you can modify **import** to solve the adaptation problem. + +If the original API uses **@ohos.enterpriseDeviceManager**: + +```js +import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager'; +``` + +You can directly modify **import** to switch to the new namespace: + +```js +import enterpriseDeviceManager from '@ohos.enterprise.adminManager'; +``` + +## cl.Customization.2 enterpriseDeviceManager/DeviceSettingsManager.d.ts Module Change + +Beginning from OpenHarmony 3.2.8.3, **enterpriseDeviceManager/DeviceSettingsManager.d.ts** is changed to **ohos.enterprise.dateTimeManager.d.ts**. + +**Change Impacts** + +The application developed based on OpenHarmony earlier than 3.2.8.3 must be adapted so that it can be properly compiled in the SDK environment of the new version. + +**Key API/Component Changes** + +| Original API | Original API Type | New API | New API Type | +| --------------------------------- | --------- | ---------------------------------- | ----- | +| enterpriseDeviceManager/DeviceSettingsManager.d.ts | interface | @ohos.enterprise.dateTimeManager.d.ts | namespace | + +**Adaptation Guide** + +If the **setDateTime** API of **enterpriseDeviceManager/DeviceSettingsManager.d.ts** is used: + +```js +import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager' + +let wantTemp = { + bundleName: "bundleName", + abilityName: "abilityName", +}; +enterpriseDeviceManager.getDeviceSettingsManager((error, mgr) => { + if (error) { + console.log("error code:" + error.code + " error message:" + error.message); + return; + } + mgr.setDateTime(wantTemp, 1526003846000, (error) => { + if (error) { + console.log("error code:" + error.code + " error message:" + error.message); + } + }); +}); +``` + +You need to import the new namespace for adaptation: + +```js +import dateTimeManager from '@ohos.enterprise.dateTimeManager' + +let wantTemp = { + bundleName: "bundleName", + abilityName: "abilityName", +}; +dateTimeManager.setDateTime(wantTemp, 1526003846000, (error) => { + if (error) { + console.log("error code:" + error.code + " error message:" + error.message); + } +}) +``` + +## cl.Customization.3 System API Change + +Beginning from OpenHarmony 3.2.8.3, all enterprise device management APIs are changed to system APIs. + +**Change Impacts** + +All APIs can be called only by system applications. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<**void**>): void; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<**void**>): void; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise<**void**>; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, callback: AsyncCallback<**void**>): void; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId: number, callback: AsyncCallback<**void**>): void; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId?: number): Promise<**void**>; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String, callback: AsyncCallback<**void**>): void; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String): Promise<**void**>; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, callback: AsyncCallback<**boolean**>): void; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback<**boolean**>): void; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, userId?: number): Promise<**boolean**>; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** getEnterpriseInfo(admin: Want, callback: AsyncCallback<**EnterpriseInfo**>): void; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** getEnterpriseInfo(admin: Want): Promise<**EnterpriseInfo**>; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback<**void**>): void; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<**void**>; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** isSuperAdmin(bundleName: String, callback: AsyncCallback<**boolean**>): void; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** isSuperAdmin(bundleName: String): Promise<**boolean**>; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **interface** EnterpriseInfo | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **enum** AdminType | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **enum** ManagedEvent | Changed to a system API | +| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number, callback: AsyncCallback<**void**>): void; | Changed to a system API | +| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number): Promise<**void**>; | Changed to a system API | + +## cl.Customization.4 API Permission Change + +Beginning from OpenHarmony 3.2.8.3, permission verification is required for some APIs. + +**Change Impacts** + +The application developed based on OpenHarmony earlier than 3.2.8.3 must have the corresponding permission so that it can properly call these APIs. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enumeration/Constant | New Permission| +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise<**void**>; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId: number, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId?: number): Promise<**void**>; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String): Promise<**void**>; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback<**void**>): void; | ohos.permission.SET_ENTERPRISE_INFO | +| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<**void**>; | ohos.permission.SET_ENTERPRISE_INFO | +| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT | +| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT | +| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT | +| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT | +| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number, callback: AsyncCallback<**void**>): void; | ohos.permission.ENTERPRISE_SET_DATETIME | +| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number): Promise<**void**>; | ohos.permission.ENTERPRISE_SET_DATETIME | + +**Adaptation Guide** + +Apply for the corresponding permission to call these APIs properly. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-geolocation.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-geolocation.md new file mode 100644 index 0000000000000000000000000000000000000000..5597e65039b4f5ded8e3f6dd0b39681ec44f564e --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-geolocation.md @@ -0,0 +1,116 @@ +# Location Subsystem ChangeLog + +## cl.location.1 Migration of System APIs and APIs in API Version 9 to the New @ohos.geoLocationManager.d.ts + +APIs in **@ohos.geolocation.d.ts** do not support throwing error codes. However, APIs in API version 9 and system APIs all need to support throwing error codes. To support this function, all system APIs and APIs in API version 9 in **@ohos.geolocation.d.ts** are migrated to the newly added **@ohos.geoLocationManager.d.ts** file, and corresponding error code description is added. + +To use system APIs and APIs in API version 9 of the location subsystem, you need to import **@ohos.geoLocationManager**. + +import geoLocationManager from '@ohos.geoLocationManager'; + + +**Change Impacts** + +System APIs and APIs in API version 9 are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**. + +import geoLocationManager from '@ohos.geoLocationManager'; + +Other APIs are not affected. + +**Key API/Component Changes** + +| Class| API Type| API Declaration| Change Type| +| -- | -- | -- | -- | +|geolocation| namespace | declare namespacegeolocation| Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation | interface | export interface ReverseGeocodingMockInfo | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation | interface | export interface LocationMockConfig | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation | interface | export interface CountryCode | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation | enum | export enum CountryCodeType | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation.GeoAddress | field | isFromMock?: Boolean; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation.Location | field | isFromMock?: Boolean; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation.GeoLocationErrorCode | field | NOT_SUPPORTED = 100 | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation.GeoLocationErrorCode | field | QUERY_COUNTRY_CODE_ERROR | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation| method | function on(type: 'countryCodeChange', callback: Callback<CountryCode>): void; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation| method | function off(type: 'countryCodeChange', callback?: Callback<CountryCode>): void; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation| method | function getCountryCode(callback: AsyncCallback<CountryCode>): void; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation| method | function getCountryCode(): Promise<CountryCode>; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation| method | function enableLocationMock(scenario: LocationRequestScenario, callback: AsyncCallback<void>): void; | Deleted this API in API version 9.| +|geolocation| method | function enableLocationMock(callback: AsyncCallback<void>): void; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation| method | function enableLocationMock(scenario: LocationRequestScenario): Promise<void>; | Deleted this API in API version 9.| +|geolocation| method | function enableLocationMock(): Promise<void>; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| +|geolocation| method | function disableLocationMock(scenario: LocationRequestScenario, callback: AsyncCallback<void>): void; | Deleted this API in API version 9.| +|geolocation| method | function disableLocationMock(callback: AsyncCallback<void>): void; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**. | +|geolocation| method | function disableLocationMock(scenario: LocationRequestScenario): Promise<void>; | Deleted this API in API version 9.| +|geolocation| method | function disableLocationMock(): Promise<void>; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**. | +|geolocation| method | function setMockedLocations(config: LocationMockConfig, callback: AsyncCallback<void>): void; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**. | +|geolocation| method | function setMockedLocations(config: LocationMockConfig): Promise<void>; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**. | +|geolocation| method | function enableReverseGeocodingMock(callback: AsyncCallback<void>): void; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**. | +|geolocation| method | function enableReverseGeocodingMock(): Promise<void>; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**. | +|geolocation| method | function disableReverseGeocodingMock(callback: AsyncCallback<void>): void; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**. | +|geolocation| method | function disableReverseGeocodingMock(): Promise<void>; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**. | +|geolocation| method | function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>, callback: AsyncCallback<void>): void; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**. | +|geolocation| method | function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>): Promise<void>; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**. | +|geolocation| method | function isLocationPrivacyConfirmed(type: LocationPrivacyType, callback: AsyncCallback<boolean>): void; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**. | +|geolocation| method | function isLocationPrivacyConfirmed(type: LocationPrivacyType): Promise<boolean>; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**. | +|geolocation| method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean, callback: AsyncCallback<boolean>): void; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts** and changed the callback return value to **void**. | +|geolocation| method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): Promise<boolean>; | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts** and changed the promise return value to **void**. | + +**(Optional) Adaptation Guide** + +The following uses **enableLocation** as an example to show how it is called in the new version: + + ```ts + import geoLocationManager from '@ohos.geoLocationManager'; + try { + geoLocationManager.enableLocation((err, data) => { + if (err) { + console.log('enableLocation: err=' + JSON.stringify(err)); + } + }); + } catch (err) { + console.error("errCode:" + err.code + ",errMessage:" + err.message); + } + ``` + +## cl.location.2 Location Service Permission Change + +From API version 9, the **ohos.permission.APPROXIMATELY_LOCATION** permission is added for obtaining the approximate location. + +If you use API version 9 or later, you need to apply for both the **ohos.permission.LOCATION** and **ohos.permission.APPROXIMATELY_LOCATION** permissions. Applying for only the **ohos.permission.LOCATION** permission will fail. + +**Change Impacts** + +Applications using API versions earlier than 9 are not affected. For an application using API version 9 or later, the method for applying for the location permission is changed. The details are as follows: + +Before using basic location capabilities, check whether your application has been granted the permission to access the device location information. If not, your application needs to obtain the permission from the user as described below. + +The system provides the following location permissions: + +- ohos.permission.LOCATION + +- ohos.permission.APPROXIMATELY_LOCATION + +- ohos.permission.LOCATION_IN_BACKGROUND + +If your application needs to access the device location information, it must first apply for required permissions. Specifically speaking: + +API versions earlier than 9: Apply for **ohos.permission.LOCATION**. + +API version 9 and later: Apply for **ohos.permission.APPROXIMATELY_LOCATION**, or apply for **ohos.permission.APPROXIMATELY_LOCATION** and **ohos.permission.LOCATION**. Note that **ohos.permission.LOCATION** cannot be applied for separately. + +| API Version| Location Permission| Permission Application Result| Location Accuracy| +| -------- | -------- | -------- | -------- | +| Earlier than 9| ohos.permission.LOCATION | Success| Location accurate to meters| +| 9 and later| ohos.permission.LOCATION | Failure| No location obtained| +| 9 and later| ohos.permission.APPROXIMATELY_LOCATION | Success| Location accurate to 5 kilometers| +| 9 and later| ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.LOCATION| Success| Location accurate to meters| + +If your application needs to access the device location information when running in the background, it must be configured to be able to run in the background and be granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information after your application moves to the background. + +You can declare the required permission in your application's configuration file. For details, see the [permission application guide](../../../application-dev/security/accesstoken-guidelines.md). + +**Key API/Component Changes** + +Applications using API versions earlier than 9 are not affected. + +If your application uses API version 9 or later and needs to call APIs requiring the **ohos.permission.LOCATION** permission in **@ohos.geolocation** and **@ohos.geoLocationManager**, you need to apply for the corresponding permission as described previously. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-multimedia.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-multimedia.md new file mode 100644 index 0000000000000000000000000000000000000000..a2edb4e0b1bb14cf4d8185549b09069dc5da7cf1 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-multimedia.md @@ -0,0 +1,319 @@ +# Multimedia Subsystem ChangeLog + +## cl.multimedia.audio.001 Call Mode Change of getRoutingManager() + +**getRoutingManager()** is changed from asynchronous to synchronous. + +**Change Impacts** + +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 Impacts** + +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 Impacts** + +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 Impacts** + +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 Impacts** + +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 Impacts** + +If the new name 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 Impacts** + +If the new name 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 Impacts** + +If the **VideoRecorder** caller is not a system user, the call will fail. + +Involved APIs and enumerations: + +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 Impacts** + +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 Impacts** + +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: +[Media](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-media.md) +[Media Error Codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-media.md) diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-notification.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-notification.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a670a8a4de3f8674194bd2dcc0cdc13e2e2d17 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-notification.md @@ -0,0 +1,64 @@ +# Common Event and Notification Subsystem ChangeLog + +## cl.notification.1 API Exception Handling Method Changes + +Certain event notification APIs use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. + +**Change Impacts** + +The application developed based on earlier versions needs to adapt the new APIs and their method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +For adaptation to the unified API exception handling mode, certain event notification APIs are deprecated (original APIs in the following table) and corresponding new APIs in the following table are added. The newly added APIs support unified error code handling specifications and function the same as the original APIs. + +| Original API | New API | +| ----------------------- | -------------------------------- | +| @ohos.commonEvent.d.ts | @ohos.commonEventManager.d.ts | +| @ohos.notification.d.ts | @ohos.notificationManager.d.ts | +| @ohos.notification.d.ts | @ohos.notificationSubscribe.d.ts | + +**Adaptation Guide** + +The original APIs are only migrated to the new namespace. Therefore, you can modify **import** to solve the adaptation problem. + +If the original API uses **@ohos.commonEvent**: + +```js +import commonEvent from '@ohos.commonEvent'; +``` + +You can directly modify **import** to switch to the new namespace: + +```js +import commonEvent from '@ohos.commonEventManager'; +``` + +**@ohos.notification** is split into two namespaces. You need to select a new namespace for adaptation. + +In addition, exception handling is needed. For details, see the API reference for the new APIs. + +## cl.notification.2 API Changes + +The names of some event notification APIs are changed. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.notification | notification | **function** enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.notification | notification | **function** enableNotification(bundle: BundleOption, enable: boolean): Promise<**void**>; | Deprecated | +| @ohos.notificationManager | notificationManager | **function** setNotificationEnable(bundle: BundleOption, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Added | +| @ohos.notificationManager | notificationManager | **function** setNotificationEnable(bundle: BundleOption, enable: boolean): Promise<**void**>; | Added | +| @ohos.notification | notification | **function** enableNotificationSlot(bundle: BundleOption, **type**: SlotType, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.notification | notification | **function** enableNotificationSlot(bundle: BundleOption, **type**: SlotType, enable: boolean): Promise<**void**>; | Deprecated | +| @ohos.notificationManager | notificationManager | **function** setNotificationEnableSlot(bundle: BundleOption, **type**: SlotType, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Added | +| @ohos.notificationManager | notificationManager | **function** setNotificationEnableSlot(bundle: BundleOption, **type**: SlotType, enable: boolean): Promise<**void**>; | Added | +| @ohos.notification | notification | **function** enableDistributed(enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.notification | notification | **function** enableDistributed(enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.notificationManager | notificationManager | **function** setDistributedEnable(enable: boolean, callback: AsyncCallback<**void**>): **void**; | Added | +| @ohos.notificationManager | notificationManager | **function** setDistributedEnable(enable: boolean): Promise<**void**>; | Added | +| @ohos.notification | notification | **function** enableDistributedByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.notification | notification | **function** enableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise<**void**>; | Deprecated | +| @ohos.notificationManager | notificationManager | **function** setDistributedEnableByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Added | +| @ohos.notificationManager | notificationManager | **function** setDistributedEnableByBundle(bundle: BundleOption, enable: boolean): Promise<**void**>; | Added | diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-useriam.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-useriam.md new file mode 100644 index 0000000000000000000000000000000000000000..a9a1a8dd9d3b33f6a36b741d60e4859e61e00bee --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-useriam.md @@ -0,0 +1,74 @@ +# User IAM Subsystem ChangeLog + +## cl.useriam.1 API Exception Handling Method Change + +Certain APIs of user IAM use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. The following changes are made in API version 9 and later: + +An error message is returned via an exception. + +**Change Impacts** + +Applications developed based on earlier versions are not affected. If your application uses API version 9 or later, you need to adapt the change in the way for APIs to return the error information. Otherwise, service logic will be affected. + +**Key API/Component Changes** + +For adaptation to the unified API exception handling mode, certain APIs of user IAM are deprecated (original APIs in the following table) and corresponding new APIs in the following table are added. The newly added APIs support unified error code handling specifications and function the same as the original APIs. + +| Module | Class | Method/Attribute/Enumeration/Constant | Change Type | +| ---------------------- | ------------------- | ------------------------- | ------------------------ | +| ohos.userIAM.userAuth | UserAuth | constructor() | Deprecated| +| ohos.userIAM.userAuth | UserAuth | getVersion() : number | Deprecated| +| ohos.userIAM.userAuth | UserAuth | getAvailableStatus(authType : UserAuthType, authTrustLevel : AuthTrustLevel) : number | Deprecated| +| ohos.userIAM.userAuth | UserAuth | auth(challenge: Uint8Array, authType: UserAuthType, authTrustLevel: AuthTrustLevel, callback: IUserAuthCallback): Uint8Array | Deprecated| +| ohos.userIAM.userAuth | UserAuth | cancelAuth(contextID : Uint8Array) : number | Deprecated| +| ohos.userIAM.userAuth | IUserAuthCallback | onResult: (result : number, extraInfo : AuthResult) => void | Deprecated| +| ohos.userIAM.userAuth | IUserAuthCallback | onAcquireInfo ?: (module : number, acquire : number, extraInfo : any) => void | Deprecated| +| ohos.userIAM.userAuth | AuthResult | AuthResult {
token ?: Uint8Array;
remainTimes ?: number;
freezingTime ?: number;} | Deprecated| +| ohos.userIAM.userAuth | Enumeration| ResultCode {
SUCCESS = 0,
FAIL = 1,
GENERAL_ERROR = 2,
CANCELED = 3,
TIMEOUT = 4,
TYPE_NOT_SUPPORT = 5,
TRUST_LEVEL_NOT_SUPPORT = 6,
BUSY = 7,
INVALID_PARAMETERS = 8,
LOCKED = 9,
NOT_ENROLLED = 10,} | Deprecated| +| ohos.userIAM.userAuth | type | AuthEventKey = "result" | Added| +| ohos.userIAM.userAuth | type | EventInfo = AuthResultInfo | Added| +| ohos.userIAM.userAuth | AuthResultInfo | AuthResultInfo {
result : number;
token ?: Uint8Array;
remainAttempts ?: number;
lockoutDuration ?: number;} | Added| +| ohos.userIAM.userAuth | TipInfo | TipInfo {
module : number;
tip : number;} | Added| +| ohos.userIAM.userAuth | AuthInstance | AuthInstance {
on: (name: AuthEventKey, callback: AuthEvent) => void;
off: (name: AuthEventKey) => void;
start: () => void;
cancel: () => void;} | Added| +| ohos.userIAM.userAuth | Enumeration| ResultCodeV9 {
SUCCESS = 12500000,
FAIL = 12500001,
GENERAL_ERROR = 12500002,
CANCELED = 12500003,
TIMEOUT = 12500004,
TYPE_NOT_SUPPORT = 12500005,
TRUST_LEVEL_NOT_SUPPORT = 12500006,
BUSY = 12500007,
LOCKED = 12500009,
NOT_ENROLLED = 12500010,} | Added| +| ohos.userIAM.userAuth | function | getAuthInstance(challenge : Uint8Array, authType : UserAuthType, authTrustLevel : AuthTrustLevel) : AuthInstance | Added| +| ohos.userIAM.userAuth | function | getVersion() : number | Added| +| ohos.userIAM.userAuth | function | getAvailableStatus(authType : UserAuthType, authTrustLevel : AuthTrustLevel) : void | Added| +| ohos.userIAM.faceAuth | FaceAuthManager | setSurfaceId(surfaceId : string) : ResultCode | Deleted| +| ohos.userIAM.faceAuth | Enumeration| ResultCode {
SUCCESS = 0,
FAIL = 1,} | Deleted| +| ohos.userIAM.faceAuth | FaceAuthManager | setSurfaceId(surfaceId: string) : void | Added| + +**Adaptation Guide** + +The following uses **getVersion** as an example: + +```js +import userIAM_userAuth from '@ohos.userIAM.userAuth'; + +try { + let version = userIAM_userAuth.getVersion(); + console.info("auth version = " + version); +} catch (error) { + console.info("get version failed, error = " + error); +} +``` + +For sample code of more APIs, see the [user authentication API reference](../../../application-dev/reference/apis/js-apis-useriam-userauth.md) and [face authentication API reference](../../../application-dev/reference/apis/js-apis-useriam-faceauth.md). + +## cl.useriam.2 API Call Permission Change + +Some APIs of user IAM can only be called by system applications, and system application runtime authentication is required. The following changes are made in API version 9 and later: + +The service logic for checking whether an application is a system application is added for the **setSurfaceId** API of the face authentication module. Non-system applications cannot call this API. + +**Change Impacts** + +Applications developed based on earlier versions are not affected. If your application uses API version 9 or later and wants to call this API, your application must be a system application. + +**Key API/Component Changes** + +The service logic for checking whether an application is a system application is added for the **setSurfaceId** API. Error code **202** will be returned if the API is called by a non-system application. + +**Adaptation Guide** + +Modify the **UnsgnedReleasedProfileTemplate.json** file related to [app signing](https://gitee.com/openharmony/developtools_hapsigner/tree/master/dist) to change the **app-feature** field to **hos_system_app**, so that the signed application is a system application. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-dmsfwk.md b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-dmsfwk.md new file mode 100644 index 0000000000000000000000000000000000000000..311b1a90b716a22e151625ab990e73dbf3249f02 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-dmsfwk.md @@ -0,0 +1,21 @@ +# Distributed Scheduler Subsystem ChangeLog + +## cl.DistributedManagerService.1 Adding DATASYNC Permission Verification on the continuationManager API + +In earlier versions, the **continuationManager** API does not verify the caller, which does not comply with the OpenHarmony API specifications. +Now, before using **continuationManager**, the caller must apply for the **ohos.permission.DISTRIBUTED_DATASYNC** permission. + +**Change Impacts** + +The application developed based on earlier versions needs to apply for the **ohos.permission.DISTRIBUTED_DATASYNC** permission in advance. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +Involved APIs: + + - continuationManager.registerContinuation; + - continuationManager.on; + - continuationManager.off; + - continuationManager.unregisterContinuation; + - continuationManager.updateContinuationState; + - continuationManager.startContinuationDeviceManager; diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-web.md b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-web.md new file mode 100644 index 0000000000000000000000000000000000000000..c9bccbb9f588c2ed237f73516a27d10effeded39 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-web.md @@ -0,0 +1,128 @@ +# Web Subsystem ChangeLog + +This document describes the web API changes in OpenHarmony 3.2.9.1 SP8 when compared with OpenHarmony 3.2.8.1. + +## cl.web.1 Deletion of Unnecessary Error Codes + +APIs in the webviewController component of the web subsystem are changed: + + - Deleted **@throws { BusinessError } 17100007 - Invalid back or forward operation** from the **forward**, **backward**, and **backOrForward** APIs. + - Deleted **@throws { BusinessError } 17100009 - Cannot zoom in or zoom out** from the **zoom**, **zoomIn**, and **zoomOut** APIs. + +You need to adapt your application based on the following information. + +**Change Impacts** + +Released JS APIs are affected. The application can be properly compiled in the SDK environment of the new version, without any adaptation. + +**Key API/Component Changes** + +Involved APIs: **forward**, **backward**, **backOrForward**, **zoom**, **zoomIn**, and **zoomOut** +Involved component: web + +**Adaptation Guide** + +No adaptation is required. +## cl.web.2 setWebController Input Parameter Changes + +Some released web controllers are migrated to the webviewController, and the original webController is deprecated. The following changes are made in API version 9 and later: +The input parameter of **setWebController** is replaced by the new **webviewController**. + +**Change Impacts** + +Input parameters of JS APIs need to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected. + +**Key API/Component Changes** + +- Involved API: + + setWebController(controller: WebviewController): void; + +- Before change: + +```js +setWebController(controller: WebController): void; +``` + +- After change: + +```js +setWebController(controller: WebviewController): void; +``` + +**Adaptation Guide** + +The sample code is as follows: + +Before change: + +```js +// xxx.ets +@Entry +@Component +struct WebComponent { + controller:WebController = new WebController() + build() { + Column() { + Web({ src:'www.example.com', controller: this.controller }) + .multiWindowAccess(true) + .onWindowNew((event) => { + console.log("onWindowNew...") + var popController: WebController = new WebController() + event.handler.setWebController(popController) + }) + } + } +} +``` + +After change: +```js +// xxx.ets +@Entry +@Component +struct WebComponent { + controller: web_webview.WebviewController = new web_webview.WebviewController() + build() { + Column() { + Web({ src:'www.example.com', controller: this.controller }) + .multiWindowAccess(true) + .onWindowNew((event) => { + console.log("onWindowNew...") + var popController: web_webview.WebviewController = new web_webview.WebviewController() + event.handler.setWebController(popController) + }) + } + } +} +``` + +## cl.web.3 getUnfilterendLinkUrl API Name Change + +The **getUnfilterendLinkUrl** API is misspelled and should be changed to **getUnfilteredLinkUrl**. + +**Change Impacts** + +The JS API name needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected. + +**Key API/Component Changes** + +- Involved API: + + getUnfilteredLinkUrl(): string; + +- Before change: + +```js +getUnfilterendLinkUrl(): string; +``` + +- After change: + +```js +getUnfilteredLinkUrl(): string; +``` + +**Adaptation Guide** + +The JS API name needs to be adapted for applications developed based on earlier versions. The new API name is used to replace the original one. Otherwise, relevant functions will be affected. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-x-x.md b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-x-x.md new file mode 100644 index 0000000000000000000000000000000000000000..3ac3e83268d2ac247676cd313d5b5e45d195ea2b --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-x-x.md @@ -0,0 +1,33 @@ +# *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 Impacts** + +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 (Optional)** + +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/OpenHarmony_3.2.9.1/changelogs-arkui.md b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-arkui.md new file mode 100644 index 0000000000000000000000000000000000000000..80e5645eba71f86ec75134e366d436164a961802 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-arkui.md @@ -0,0 +1,126 @@ +# ArkUI Subsystem ChangeLog + +## cl.arkui.1 xcomponent API Change + +The following APIs of the **xcomponent** component of the ArkUI subsystem are changed: + + - **getXComponentSurfaceId** and **setXComponentSurfaceSize**: The **@systemapi** tag is removed. + - **getXComponentSurfaceId**, **getXComponentContext**, and **setXComponentSurfaceSize**: The return value types are specified. + +You need to adapt your applications based on the following information. + + +**Change Impacts** + +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** + + - **getXComponentSurfaceId**: is changed to a public API, with its return value type specified as string. + - **setXComponentSurfaceSize**: is changed to a public API, with its return value type specified as void. + - **getXComponentContext**: has its return value type specified as object. + +**Adaptation Guide** + +Startup rules for different scenarios are as follows: + +Adaptions to be made: + + - **getXComponentSurfaceId** + - OpenHarmony 3.2 Beta3 rules: + - System API + - No specified return value + - OpenHarmony 3.2 Beta4 rules: + - Public API + - Return value type specified as string + - You need to process the return value as a string. + - **setXComponentSurfaceSize** + - OpenHarmony 3.2 Beta3 rules: + - System API + - No specified return value + - OpenHarmony 3.2 Beta4 rules: + - Public API + - Return value type specified as void + - You need to process the return value as a void. + - **getXComponentContext** + - OpenHarmony 3.2 Beta3 rules: + - No specified return value + - OpenHarmony 3.2 Beta4 rules: + - Return value type specified as object + - You need to process the return value as an object. + +## cl.arkui.2 Change of Styles of Popup Component and APIs + +The styles of the **alertDialog**, **actionSheet**, and **customDialog** components, as well as the **prompt** and **promptAction** APIs were changed. Specifically speaking: + +The popup background blurring effect is added to **promptAction.showDialog**, **promptAction.showActionMenu**, **alertDialog**, **actionSheet**, and **customDialog**. + +**Change Impacts** + +The popup background blurring effect is set by default. + +**Key API/Component Changes** + +APIs: **promptAction.showDialog** and **promptAction.showActionMenu;** +Components: **alertDialog**, **actionSheet**, and **customDialog** + +**Adaptation Guide** + +No adaptation is required. + +## cl.arkui.3 Supplementation of the Initialization Mode and Restriction Verification Scenarios of Custom Components' Member Variables + +For details, see [Restrictions and Extensions](../../../application-dev/quick-start/arkts-restrictions-and-extensions.md). + +**Change Impacts** + +If custom components' member variables are initialized or assigned with values not according to the document specifications, an error will be reported during compilation. + +**Key API/Component Changes** + +N/A + +**Adaptation Guide** + +Make modification according to specifications in the above document. + +## cl.arkui.4 Supplementation of Verification Scenarios of Value Assignment Restrictions on Member Variables of Custom Parent Components and Child Components + +For details, see [Restrictions and Extensions](../../../application-dev/quick-start/arkts-restrictions-and-extensions.md). + + +**Change Impacts** + +If member variables of the parent component or child component are initialized not according to the document specifications, an error will be reported during compilation. + +**Key API/Component Changes** + +N/A + +**Adaptation Guide** + +Make modification according to specifications in the above document, using other decorators or normal member variables for value assignment. + +## cl.arkui.5 Supplementation of Verification for a Single Subcomponent + +Verification for a single subcomponent is enabled for the following components: **Button**, **FlowItem**, **GridItem**, **GridCol**, **ListItem**, **Navigator**, **Refresh**, **RichText**, **ScrollBar**, **StepperItem**, and **TabContent**. + + +**Change Impacts** + +If one of the preceding components contains more than one subcomponent, an error will be reported during compilation. + +**Key API/Component Changes** + +```js +RichText('RichText') { + Text('Text1') + Text('Text2') +} +/* ArkTS:ERROR File: /root/newOH/developtools/ace-ets2bundle/compiler/sample/pages/home.ets:25:7 + The component 'RichText' can only have a single child component. */ +``` + +**Adaptation Guide** + +Make modification based on the error message. Make sure that the specified component contains only one subcomponent. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-telephony.md b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-telephony.md new file mode 100644 index 0000000000000000000000000000000000000000..a2a022040a775eeae466e34cc61d26924073b395 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-telephony.md @@ -0,0 +1,59 @@ +# Telephony Subsystem ChangeLog + + + +## cl.telephony.1 Input Parameter Change of System APIs of the SMS Module + +Input parameters are changed for some released system APIs of the SMS module of the telephony subsystem, which do not comply with the API specifications of OpenHarmony. The following changes are made in API version 9 and later: + +The **slotId** parameter is added to the **isImsSmsSupported** API, indicating the slot ID. + +**Change Impacts** + +Input parameters of JavaScript APIs need to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected. + +**Key API/Component Changes** + +- Involved APIs + + isImsSmsSupported(callback: AsyncCallback): void; + isImsSmsSupported(): Promise; + +- Before change: + +```js +function isImsSmsSupported(callback: AsyncCallback): void; +function isImsSmsSupported(): Promise; +``` + +- After change: + +```js +function isImsSmsSupported(slotId: number, callback: AsyncCallback): void; +function isImsSmsSupported(slotId: number): Promise; +``` + +**Adaptation Guide** + +Add an input parameter. The sample code is as follows: + +Callback mode + +```js +let slotId = 0; +sms.isImsSmsSupported(slotId, (err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + +Promise mode + +```js +let slotId = 0; +let promise = sms.isImsSmsSupported(slotId); +promise.then(data => { + console.log(`isImsSmsSupported success, promise: data->${JSON.stringify(data)}`); +}).catch(err => { + console.error(`isImsSmsSupported failed, promise: err->${JSON.stringify(err)}`); +}); +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-wantAgent.md b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-wantAgent.md new file mode 100644 index 0000000000000000000000000000000000000000..869ff66b05c240d76e5382b493942c712e04579a --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-wantAgent.md @@ -0,0 +1,90 @@ +# ChangeLog of JS API Changes in the WantAgent + +This document describes the WantAgent API changes in OpenHarmony 3.2.9.1 SP8 when compared with OpenHarmony 3.2.8.1. + +## 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 Impacts** + +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/OpenHarmony_3.2.9.2/changelog-x-x.md b/en/release-notes/changelogs/OpenHarmony_3.2.9.2/changelog-x-x.md new file mode 100644 index 0000000000000000000000000000000000000000..3ac3e83268d2ac247676cd313d5b5e45d195ea2b --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.9.2/changelog-x-x.md @@ -0,0 +1,33 @@ +# *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 Impacts** + +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 (Optional)** + +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/OpenHarmony_3.2.9.3/changelog-x-x.md b/en/release-notes/changelogs/OpenHarmony_3.2.9.3/changelog-x-x.md new file mode 100644 index 0000000000000000000000000000000000000000..3ac3e83268d2ac247676cd313d5b5e45d195ea2b --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.9.3/changelog-x-x.md @@ -0,0 +1,33 @@ +# *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 Impacts** + +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 (Optional)** + +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/OpenHarmony_4.0.1.1/changelogs-account_os_account.md b/en/release-notes/changelogs/OpenHarmony_4.0.1.1/changelogs-account_os_account.md new file mode 100644 index 0000000000000000000000000000000000000000..22a1dad1ce6387f0a05697738e9dc688cc8c869c --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_4.0.1.1/changelogs-account_os_account.md @@ -0,0 +1,19 @@ +# Account Subsystem ChangeLog + +## cl.account_os_account.1 Expansion of Distributed Account Nickname and Profile Picture Specifications + +The existing distributed account nickname and profile picture specifications cannot meet requirements in scenarios where the nickname is long and profile picture is large. + +Therefore, the distributed account nickname and profile picture specifications are expanded. + +**Change Impacts** + +The API change is forward compatible. Applications developed based on earlier versions can use the APIs in accordance with the new specifications, without affecting the original logic. + +**Key API/Component Changes** + +Before change: + - The nickname cannot exceed 20 characters, and the profile picture size cannot exceed 3 MB. + +After change: + - The nickname cannot exceed 1024 characters, and the profile picture size cannot exceed 10 MB. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.1.1/changelogs-window.md b/en/release-notes/changelogs/OpenHarmony_4.0.1.1/changelogs-window.md new file mode 100644 index 0000000000000000000000000000000000000000..4c26515ed4be4c3d5b7ff568886d174ed65591a4 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_4.0.1.1/changelogs-window.md @@ -0,0 +1,63 @@ +# Window Subsystem ChangeLog + +## cl.window.1 Change of Window Stage Lifecycle Listener Types + +Changed the enumerated listener types of the window stage lifecycle in version 4.0.1.1 and later. + +**Change Impacts** + +Application lifecycle listeners developed using **FOREGROUND** and **BACKGROUND** in versions earlier than 4.0.1.1 will be invalidated in version 4.0.1.1 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)); + }; + } +}; +```