diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-account_os_account.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-account_os_account.md index 6d5ce737601297172bcf6fedf268705102e1053d..e4b1955ff7fdcd16e8fe9946dc899c16657ffdc8 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-account_os_account.md +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-account_os_account.md @@ -1,11 +1,11 @@ -# Account Subsystem ChangeLog +# Account Subsystem Changelog ## cl.account_os_account.1 createOsAccountForDomain Error Code Change -Changed the error code returned when the **createOsAccountForDomain** API is used to create a domain account that already exists from **12300001** to **12300004**. -The error information is changed from a common system error to an error indicating that the account already exists. +Changed the error code returned when the domain account created by **createOsAccountForDomain()** already exists from **12300001** to **12300004**. +Changed the error information from "common system error" to "The account already exists". -**Change Impacts** +**Change Impact** The application developed based on earlier versions needs to adapt the new error code. Otherwise, the original service logic will be affected. @@ -16,11 +16,10 @@ The application developed based on earlier versions needs to adapt the new error **Adaptation Guide** -The sample code for returning an error when a domain account is repeatedly created is as follows: +The sample code is as follows: ```ts import account_osAccount from "@ohos.account.osAccount" -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' let accountMgr = account_osAccount.getAccountManager(); let domainInfo = { @@ -31,6 +30,67 @@ try { await accountMgr.createOsAccountForDomain(account_osAccount.OsAccountType.NORMAL, domainInfo); await accountMgr.createOsAccountForDomain(account_osAccount.OsAccountType.NORMAL, domainInfo); } catch (err) { - expect(err.code).assertEqual(12300004); + console.log("activateOsAccount err: " + JSON.stringify(err)); // error.code = 12300004; } ``` + +## cl.account_os_account.2 Application Account getAllAccounts() Permission Change + +Removed the **ohos.permission.GET_ALL_APP_ACCOUNTS** permission that is originally required for an application to call **getAllAccounts()** to obtain accessible accounts. + +**Change Impact** + +From this version, applications do not need the **ohos.permission.GET_ALL_APP_ACCOUNTS** permission when calling **getAllAccounts()**. + +**Key API/Component Changes** +- AccountManager + - getAllAccounts(callback: AsyncCallback<Array<AppAccountInfo>>): void; + - getAllAccounts(): Promise<Array<AppAccountInfo>>; + +**Adaptation Guide** + +The following is the sample code for an application to obtain the accessible accounts without the **ohos.permission.GET_ALL_APP_ACCOUNTS** permission: + +```ts +import account_appAccount from "@ohos.account.appAccount" + +let accountMgr = account_appAccount.createAppAccountManager(); +try { + await accountMgr.addAccount("accessibleAccount_promise_nopermission"); + var data = await accountMgr.getAllAccounts(); + if (data[0].name == "accessibleAccount_promise_nopermission") { + console.log("getAllAccounts successfully"); + } +} catch (err) { + console.log("getAllAccounts err: " + JSON.stringify(err)); +} +``` + +## cl.account_os_account.3 Application Account getAccountsByOwner() Permission Change + +Removed the **ohos.permission.GET_ALL_APP_ACCOUNTS** permission that is originally required for an application to call **getAccountsByOwner()** to obtain the accessible accounts based on the account owner . + +**Change Impact** + +From this version, applications do not need the **ohos.permission.GET_ALL_APP_ACCOUNTS** permission when calling **getAccountsByOwner()**. + +**Key API/Component Changes** +- AccountManager + - getAccountsByOwner(owner: string, callback: AsyncCallback<Array<AppAccountInfo>>): void; + - getAccountsByOwner(owner: string): Promise<Array<AppAccountInfo>>; + +**Adaptation Guide** + +The following is the sample code for an application to obtain the accessible accounts based on the account owner without the **ohos.permission.GET_ALL_APP_ACCOUNTS** permission: + +```ts +import account_appAccount from "@ohos.account.appAccount" + +let accountMgr = account_appAccount.createAppAccountManager(); +try { + var ownerName = "com.example.owner"; + var data = await accountMgr.getAllAccounts(ownerName); +} catch (err) { + console.log("getAllAccounts err: " + JSON.stringify(err)); +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelog-accesstoken.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelog-accesstoken.md new file mode 100644 index 0000000000000000000000000000000000000000..832acd65c2ad41b5b824d9f29a046130e9217c89 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelog-accesstoken.md @@ -0,0 +1,33 @@ +# App Access Control Subsystem ChangeLog + +OpenHarmony 4.0.3.2 has the following changes in the APIs of the app access control subsystem: + +## cl.access_token.1 getPermissionUsedRecords Name Change + +Changed **getPermissionUsedRecords** to **getPermissionUsedRecord**. + +**Change Impact** + +The **getPermissionUsedRecords()** API cannot be used in OpenHarmony 4.0.3.3 and later versions. + +**Key API/Component Changes** + +- Involved APIs: + + function getPermissionUsedRecords + +- Before change: + + ```ts + function getPermissionUsedRecords + ``` + +- After change: + + ```ts + function getPermissionUsedRecord + ``` + +**Adaptation Guide** + +Use **getPermissionUsedRecord()**. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-filemanagement.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-filemanagement.md new file mode 100644 index 0000000000000000000000000000000000000000..41cb99ecf701967d1ebe28a7e35de35896455fa6 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-filemanagement.md @@ -0,0 +1,25 @@ +# File Management Subsystem Changelog + +## cl.filemanagement.1 Filter Module Change + +Moved **Filter** from **@ohos.fileio** to **@ohos.file.fs**. The attributes of **Filter** remain unchanged. + +**Change Impact** + +If your application is developed using the APIs of earlier versions, note that the position of **Filter** in the **d.ts** file and the module name are changed. The **Filter** type is moved to **@ohos.file.fs**. + +**Key API/Component Changes** + +Before the change, **Filter** is in the **@ohos.fileio** module and imported as follows: + +```js +import Filter from '@ohos.fileio'; +``` + +**Adaptation Guide** + +Now, **Filter** is in the **@ohos.file.fs** module and imported as follows: + +```js +import Filter from '@ohos.file.fs'; +``` diff --git a/en/release-notes/changelogs/v3.1-Release/changelogs-account_os_account.md b/en/release-notes/changelogs/v3.1-Release/changelogs-account_os_account.md index 1eb84215498004fe05d46715ac02236ee28d5e58..6fcb4b8e86b81e914187162404581ff35f3b0f7f 100644 --- a/en/release-notes/changelogs/v3.1-Release/changelogs-account_os_account.md +++ b/en/release-notes/changelogs/v3.1-Release/changelogs-account_os_account.md @@ -1,10 +1,10 @@ -# Account Subsystem ChangeLog +# Account Subsystem Changelog ## cl.account_os_account.1 OsAccountInfo.type Value Type Change -Changed the value type of **OsAccountInfo.type** from **Object** to **OsAccountType** enumeration. +Changed the value type of **OsAccountInfo.type** from object to **OsAccountType** enum. -**Change Impacts** +**Change Impact** The mode for reading the **OsAccountInfo.type** value needs to be changed for the application developed based on earlier versions. Otherwise, the original service logic will be affected. @@ -33,25 +33,25 @@ The following APIs are involved: **Adaptation Guide** ```ts import account_osAccount from "@ohos.account.osAccount" -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' let accountMgr = account_osAccount.getAccountManager(); -accountMgr.createOsAccount('account_test', account_osAccount.OsAccountType.GUEST).then((accountInfo) => { - expect(accountInfo.type).assertEqual(account_osAccount.OsAccountType.GUEST); +accountMgr.createOsAccount("account_test", account_osAccount.OsAccountType.GUEST).then((accountInfo) => { + if (accountInfo.type == account_osAccount.OsAccountType.GUEST) { + console.log("createOsAccount successfully"); + } accountMgr.activateOsAccount(accountInfo.localId).then(() => { - console.log('activateOsAccount successfully'); + console.log("activateOsAccount successfully"); accountMgr.getOsAccountTypeFromProcess().then((accountType) => { - expect(accountType).assertEqual(account_osAccount.OsAccountType.GUEST); + if (accountType == account_osAccount.OsAccountType.GUEST) { + console.log("getOsAccountTypeFromProcess successfully"); + } }).catch((err) => { - console.log('activateOsAccount err: ' + JSON.stringify(err)); - expect().assertFail(); + console.log("activateOsAccount err: " + JSON.stringify(err)); }); }).catch((err) => { - console.log('activateOsAccount err: ' + JSON.stringify(err)); - expect().assertFail(); + console.log("activateOsAccount err: " + JSON.stringify(err)); }); }).catch((err) => { - console.log('createOsAccount err: ' + JSON.stringify(err)); - expect().assertFail(); + console.log("createOsAccount err: " + JSON.stringify(err)); }); ```