提交 901e909b 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 0228ed86
# User IAM Subsystem Changelog
## cl.useriam.1 Deletion of API9 GetVesion
Deleted the **GetVersion()** API.
**Change Impact**
The **GetVersion()** API cannot be used from this version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enum/Constant | Change Type |
| ---------------------- | ------------------- | ------------------------- | ------------------------ |
| ohos.userIAM.userAuth | function | getVersion() : number | Deleted|
**Adaptation Guide**
Delete the use of **GetVersion()**.
## cl.useriam.2 Change of the API8 GetVesion() Return Value
Changed the return value of **GetVersion()** (in API version 8) from **0** to **1**.
**Change Impact**
If the application verifies the return value of **GetVersion()** (API version 8), the verification fails.
**Key API/Component Changes**
The return value of **GetVersion()** (in API version 8) is changed from **0** to **1**.
**Adaptation Guide**
Delete the use of **GetVersion()** (API version 8) because this API has been deprecated.
# Account Subsystem Changelog
OpenHarmony 4.0.3.2 has the following changes in account module APIs:
## cl.account_os_account.1 App Account API isAccountRemovable Renamed
Changed **isAccountRemovable** in the **Authenticator** class to **checkAccountRemovable**.
**Change Impact**
The **isAccountRemovable** API in the **Authenticator** class cannot be used from 4.0.3.2. Use **checkAccountRemovable** instead.
**Key API/Component Changes**
- Involved APIs:
```ts
class Authenticator {
...
isAccountRemovable
...
}
```
- Before change:
```ts
class Authenticator {
...
/**
* Checks whether the specified account can be removed.
* @param name Indicates the account name.
* @param callback Indicates the authenticator callback.
* @returns void.
* @since 9
*/
isAccountRemovable(name: string, callback: AuthCallback): void;
...
}
```
- After change:
```ts
class Authenticator {
...
/**
* Checks whether the specified account can be removed.
* @param name Indicates the account name.
* @param callback Indicates the authenticator callback.
* @returns void.
* @since 9
*/
checkAccountRemovable(name: string, callback: AuthCallback): void;
...
}
```
## cl.account_os_account.2 OS Account API checkConstraintEnabled Renamed
Changed **checkConstraintEnabled** to **checkOsAccountConstraintEnabled**.
**Change Impact**
The **checkConstraintEnabled** API cannot be used from 4.0.3.2. Use **checkOsAccountConstraintEnabled** instead.
**Key API/Component Changes**
- Involved APIs:
```
interface AccountManager {
...
checkConstraintEnabled
...
}
```
- Before change:
```ts
checkConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback<boolean>): void;
checkConstraintEnabled(localId: number, constraint: string): Promise<boolean>;
```
- After change:
```ts
checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback<boolean>): void;
checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise<boolean>;
```
## cl.account_os_account.3 OS Account API **checkOsAccountConstraintEnabled** Permission Scenario Change
Added an optional permission **ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS** to the **checkOsAccountConstraintEnabled** API.
**Change Impact**
In 4.0.3.2 and later versions, an app with the **ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS** permission can also call **checkOsAccountConstraintEnabled**.
The use of **ohos.permission.MANAGE_LOCAL_ACCOUNTS** is not affected.
**Key API/Component Changes**
- Involved APIs:
```
interface AccountManager {
...
checkOsAccountConstraintEnabled
...
}
```
- Before change:
```ts
...
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
...
checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback<boolean>): void;
checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise<boolean>;
```
- After change:
```ts
...
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
...
checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback<boolean>): void;
checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise<boolean>;
```
## cl.account_os_account.4 OS Account API queryOsAccountLocalIdFromProcessd Renamed
Changed **queryOsAccountLocalIdFromProcess** to **getOsAccountLocalId**.
**Change Impact**
The **queryOsAccountLocalIdFromProcess** API cannot be used from 4.0.3.2. Use **getOsAccountLocalId** instead.
**Key API/Component Changes**
- Involved APIs:
```
interface AccountManager {
...
queryOsAccountLocalIdFromProcess
...
}
```
- Before change:
```ts
queryOsAccountLocalIdFromProcess(callback: AsyncCallback<number>): void;
queryOsAccountLocalIdFromProcess(): Promise<number>;
```
- After change:
```ts
getOsAccountLocalId(callback: AsyncCallback<number>): void;
getOsAccountLocalId(): Promise<number>;
```
## cl.account_os_account.5 OS Account API queryOsAccountLocalIdFromUid Renamed
Changed **queryOsAccountLocalIdFromUid** to **getOsAccountLocalIdForUid**.
**Change Impact**
The **queryOsAccountLocalIdFromUid** API cannot be used from 4.0.3.2. Use **getOsAccountLocalIdForUid** instead.
**Key API/Component Changes**
- Involved APIs:
```
interface AccountManager {
...
queryOsAccountLocalIdFromUid
...
}
```
- Before change:
```ts
queryOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback<number>): void;
queryOsAccountLocalIdFromUid(uid: number): Promise<number>;
```
- After change:
```ts
getOsAccountLocalIdForUid(uid: number, callback: AsyncCallback<number>): void;
getOsAccountLocalIdForUid(uid: number): Promise<number>;
```
## cl.account_os_account.6 OS Account API queryOsAccountLocalIdFromDomain Renamed
Changed **queryOsAccountLocalIdFromDomain** to **getOsAccountLocalIdForDomain**.
**Change Impact**
The **queryOsAccountLocalIdFromDomain** API cannot be used from 4.0.3.2. Use **getOsAccountLocalIdForDomain** instead.
**Key API/Component Changes**
- Involved APIs:
```
interface AccountManager {
...
queryOsAccountLocalIdFromDomain
...
}
```
- Before change:
```ts
queryOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback<number>): void;
queryOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise<number>;
```
- After change:
```ts
getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback<number>): void;
getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo): Promise<number>;
```
## cl.account_os_account.7 OS Account API getActivatedOsAccountIds Renamed
Changed **getActivatedOsAccountIds** to **getActivatedOsAccountLocalIds**.
**Change Impact**
The **getActivatedOsAccountIds** API cannot be used from 4.0.3.2. Use **getActivatedOsAccountLocalIds** instead.
**Key API/Component Changes**
- Involved APIs:
```
interface AccountManager {
...
getActivatedOsAccountIds
...
}
```
- Before change:
```ts
getActivatedOsAccountIds(callback: AsyncCallback<Array<number>>): void;
getActivatedOsAccountIds(): Promise<Array<number>>;
```
- After change:
```ts
getActivatedOsAccountLocalIds(callback: AsyncCallback<Array<number>>): void;
getActivatedOsAccountLocalIds(): Promise<Array<number>>;
```
## cl.account_os_account.8 OS Account API queryOsAccountLocalIdBySerialNumber Renamed
Changed **queryOsAccountLocalIdBySerialNumber** to **getOsAccountLocalIdForSerialNumber**.
**Change Impact**
The **queryOsAccountLocalIdBySerialNumber** API cannot be used from 4.0.3.2. Use **getOsAccountLocalIdForSerialNumber** instead.
**Key API/Component Changes**
- Involved APIs:
```
interface AccountManager {
...
queryOsAccountLocalIdBySerialNumber
...
}
```
- Before change:
```ts
queryOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback<number>): void;
queryOsAccountLocalIdBySerialNumber(serialNumber: number): Promise<number>;
```
- After change:
```ts
getOsAccountLocalIdForSerialNumber(serialNumber: number, callback: AsyncCallback<number>): void;
getOsAccountLocalIdForSerialNumber(serialNumber: number): Promise<number>;
```
## cl.account_os_account.9 OS Account API querySerialNumberByOsAccountLocalId Renamed
Changed **querySerialNumberByOsAccountLocalId** to **getSerialNumberForOsAccountLocalId**.
**Change Impact**
The **querySerialNumberByOsAccountLocalId** API cannot be used from 4.0.3.2. Use **getSerialNumberForOsAccountLocalId** instead.
**Key API/Component Changes**
- Involved APIs:
```
interface AccountManager {
...
querySerialNumberByOsAccountLocalId
...
}
```
- Before change:
```ts
querySerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback<number>): void;
querySerialNumberByOsAccountLocalId(localId: number): Promise<number>;
```
- After change:
```ts
getSerialNumberForOsAccountLocalId(localId: number, callback: AsyncCallback<number>): void;
getSerialNumberForOsAccountLocalId(localId: number): Promise<number>;
```
## cl.account_os_account.10 OS Account API getBundleIdFromUid Renamed
Changed **getBundleIdFromUid** to **getBundleIdForUid**.
**Change Impact**
The **getBundleIdFromUid** API cannot be used from 4.0.3.2. Use **getBundleIdForUid** instead.
**Key API/Component Changes**
- Involved APIs:
```
interface AccountManager {
...
getBundleIdFromUid
...
}
```
- Before change:
```ts
getBundleIdFromUid(uid: number, callback: AsyncCallback<number>): void;
getBundleIdFromUid(uid: number): Promise<number>;
```
- After change:
```ts
getBundleIdForUid(uid: number, callback: AsyncCallback<number>): void;
getBundleIdForUid(uid: number): Promise<number>;
```
## cl.account_os_account.11 OS Account API queryOsAccountConstraintSourceTypes Renamed
Changed **queryOsAccountConstraintSourceTypes** to **getOsAccountConstraintSourceTypes**.
**Change Impact**
The **queryOsAccountConstraintSourceTypes** API cannot be used from 4.0.3.2. Use **getOsAccountConstraintSourceTypes** instead.
**Key API/Component Changes**
- Involved APIs:
```
interface AccountManager {
...
queryOsAccountConstraintSourceTypes
...
}
```
- Before change:
```ts
queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback<Array<ConstraintSourceTypeInfo>>): void;
queryOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise<Array<ConstraintSourceTypeInfo>>;
```
- After change:
```ts
getOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback<Array<ConstraintSourceTypeInfo>>): void;
getOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise<Array<ConstraintSourceTypeInfo>>;
```
# Readme
- [Account](changelogs-account_os_account.md)
- [DSoftBus](changelogs-dsoftbus.md)
- [File Management](changelogs-filemanagement.md)
- [Test](changelogs-testfwk_arkxtest.md)
- [User IAM](changelogs-useriam.md)
- [Communication-WIFI](changelogs-wifi.md)
# Account Subsystem Changelog
## cl.account_os_account.1 Error Code Change
To ensure consistent error codes and normalized return of error codes in the account subsystem APIs, the following changes are made in API version 9:
- Added the following error codes:
- [Account Management Error Codes](../../../application-dev/reference/errorcodes/errorcode-account.md)
- Changed the error code return modes as follows:
- Asynchronous APIs: Return error information in the **error** object of **AsyncCallback** or **Promise**. Wherein, parameter type or quantity error information is returned by throwing an exception.
- Synchronous APIs: Throw an exception to return an error message.
**Change Impact**
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**
Involved APIs:
- class AccountManager
- activateOsAccount(localId: number, callback: AsyncCallback&lt;void&gt;): void;
- removeOsAccount(localId: number, callback: AsyncCallback&lt;void&gt;): void;
- setOsAccountConstraints(localId: number, constraints: Array&lt;string&gt;, enable: boolean, callback: AsyncCallback&lt;void&gt;): void;
- setOsAccountName(localId: number, localName: string, callback: AsyncCallback&lt;void&gt;): void;
- queryMaxOsAccountNumber(callback: AsyncCallback&lt;number&gt;): void;
- queryAllCreatedOsAccounts(callback: AsyncCallback&lt;Array&lt;OsAccountInfo&gt;&gt;): void;
- createOsAccount(localName: string, type: OsAccountType, callback: AsyncCallback&lt;OsAccountInfo&gt;): void;
- createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, callback: AsyncCallback&lt;OsAccountInfo&gt;): void;
- queryOsAccountById(localId: number, callback: AsyncCallback&lt;OsAccountInfo&gt;): void;
- getOsAccountProfilePhoto(localId: number, callback: AsyncCallback&lt;string&gt;): void;
- setOsAccountProfilePhoto(localId: number, photo: string, callback: AsyncCallback&lt;void&gt;): void;
- on(type: 'activate' | 'activating', name: string, callback: Callback&lt;number&gt;): void;
- off(type: 'activate' | 'activating', name: string, callback?: Callback&lt;number&gt;): void;
- isMainOsAccount(callback: AsyncCallback&lt;boolean&gt;): void;
- queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback&lt;Array&lt;ConstraintSourceTypeInfo&gt;&gt;): void;
- class UserAuth
- constructor();
- getVersion(): number;
- getAvailableStatus(authType: AuthType, authTrustLevel: AuthTrustLevel): number;
- getProperty(request: GetPropertyRequest, callback: AsyncCallback&lt;ExecutorProperty&gt;): void;
- setProperty(request: SetPropertyRequest, callback: AsyncCallback&lt;number&gt;): 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&lt;Uint8Array&gt;): 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&lt;Array&lt;EnrolledCredInfo&gt;&gt;): void;
- interface IInputData
- onSetData: (authSubType: AuthSubType, data: Uint8Array) =&gt; void;
**Adaptation Guide**
The following uses **activateOsAccount** as an example to describe 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 service error.
console.log("account_osAccount failed, error: " + JSON.stringify(err));
} else {
console.log("account_osAccount successfully");
}
}
try {
accountMgr.activateOsAccount("100", callbackFunc);
} catch (err) { // Handle the parameter type error.
console.log("account_osAccount failed for incorrect parameter type, error: " + JSON.stringify(err));
}
try {
accountMgr.activateOsAccount();
} catch (err) { // Handle the parameter number error.
console.log("account_osAccount failed for incorrect parameter number, error: " + JSON.stringify(err));
}
```
The following uses **registerInputer** as an example to describe 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) { // Handle the parameter type error.
console.log("account_osAccount failed for incorrect parameter type, error: " + JSON.stringify(err));
}
try {
pinAuth.registerInputer()
} catch (err) { // Handle the parameter number error.
console.log("account_osAccount failed for incorrect parameter number, error: " + JSON.stringify(err));
}
```
## cl.account_os_account.2 Change in Error Information Return of Account System APIs
Some 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:
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 Impact**
The application developed based on earlier versions needs to be adapted. Otherwise, the service logic will be affected.
**Key API/Component Changes**
Before change:
- class UserAuth
- setProperty(request: SetPropertyRequest, callback: AsyncCallback&lt;number&gt;): void;
- setProperty(request: SetPropertyRequest): Promise&lt;number&gt;;
- cancelAuth(contextID: Uint8Array): number;
- class PINAuth
- registerInputer(inputer: Inputer): boolean;
- UserIdentityManager
- cancel(challenge: Uint8Array): number;
After change:
- class UserAuth
- setProperty(request: SetPropertyRequest, callback: AsyncCallback&lt;void&gt;): void;
- setProperty(request: SetPropertyRequest): Promise&lt;void&gt;;
- 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.3 Change of ACTION for the App Account Authentication Service
**Change Impact**
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). Otherwise, the application authentication service will be affected.
**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, change **ACTION** in the **ServiceAbility** configuration file (**config.json** for the FA module or **module.json5** for the stage module).
```
"abilities": [
{
"name": "ServiceAbility",
"srcEnty": "./ets/ServiceAbility/ServiceAbility.ts",
...
"visible": true,
"skills": {
{
"actions": [
"ohos.appAccount.action.auth"
]
}
}
}]
}
```
# DSoftBus Subsystem Changelog
## Support for Exception Handling and Determining Synchronous or Asynchronous Message Sending by Passing in a Boolean or Numeric Value in IPC&RPC APIs
1. Some IPC&RPC APIs of DSoftBus use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony.
2. A Boolean value can be passed in to specify the message transfer mode, which can be asynchronous or synchronous.
#### Change Impact
This version is compatible with earlier versions and no adaptation is required. Newly added APIs can be called to support the following changes:
1. Implement exception handling and return of error codes.
2. Enable messages to be sent synchronously or asynchronously by using a Boolean value or a number of **0** or non-0.
#### **Key API/Component Changes**
To ease the adaptation, the related IPC&RPC APIs are deprecated and replaced by new APIs. 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<RequestResult> |
| IRemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback<SendRequestResult>): void | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption,callback: AsyncCallback<RequestResult>): 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&nbsp;\|&nbsp;Promise<boolean> | NA | onRemoteMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption): boolean&nbsp;\|&nbsp;Promise<boolean> |
| RemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise<SendRequestResult> | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption): Promise<RequestResult> |
| RemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback<SendRequestResult>): void | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption, callback: AsyncCallback<RequestResult>): 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<RequestResult> |
| RemoteProxy | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback<SendRequestResult>): void | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption, callback: AsyncCallback<RequestResult>): 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 new APIs return error codes and error information by throwing exceptions. The following uses the **create()** API of **MessageParcel** as an example.
```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 the APIs, see [RPC](../../../application-dev/reference/apis/js-apis-rpc.md).
# File Management Subsystem Changelog
## cl.filemanagement.1 fileio API Changes
Deprecated the **fileio** APIs, which do not return error codes; added APIs that return error codes.
**Change Impact**
For applications developed based on earlier versions, pay attention to the iterative update of deprecated APIs. The specifications of the new APIs are slightly adjusted. Pay attention to the usage of the new APIs.
**Key API/Component Changes**
The APIs of **@ohos.fileio** do not support error code handling and are deprecated. New APIs with minor changes in parameters are added in **@ohos.file.fs** to support unified error code handling. The functionalities of the APIs remain unchanged.
| Module | Method/Attribute/Enum/Constant | Change Type|
| ------------------------- | ------------------------------------------------------------ | -------- |
| @ohos.fileio | **function** open(path: string, flags?: number, mode?: number, callback?: AsyncCallback<number>): void \| Promise<number>; | Deprecated |
| @ohos.fileio | **function** openSync(path: string, flags?: number, mode?: number): number; | Deprecated |
| @ohos.file.fs | **function** open(path: string, mode?: number, callback?: AsyncCallback<File>): void \| Promise<File>; | 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<ReadOut>): void \| Promise<ReadOut>; | 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<number>): void \| Promise<number>; | 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<Stat>): void \| Promise<Stat>; | Deprecated |
| @ohos.fileio | **function** statSync(path: string): Stat; | Deprecated |
| @ohos.fileio | **function** fstat(fd: number, callback?: AsyncCallback<Stat>): void \| Promise<Stat>; | Deprecated |
| @ohos.fileio | **function** fstatSync(fd: number): Stat; | Deprecated |
| @ohos.file.fs | **function** stat(file: string \| number, callback?: AsyncCallback<Stat>): void \| Promise<Stat>; | Added |
| @ohos.file.fs | **function** statSync(file: string \| number): Stat; | Added |
| @ohos.fileio | **function** truncate(path: string, len?: number, callback?: AsyncCallback<void>): void \| Promise<void>; | Deprecated |
| @ohos.fileio | **function** truncateSync(path: string, len?: number): void; | Deprecated |
| @ohos.fileio | **function** ftruncate(fd: number, len?: number, callback?: AsyncCallback<void>): void \| Promise<void>; | Deprecated |
| @ohos.fileio | **function** ftruncateSync(fd: number, len?: number): void; | Deprecated |
| @ohos.file.fs | **function** truncate(file: string \| number, len?: number, callback?: AsyncCallback<void>): void \| Promise<void>; | 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<number>): void \| Promise<void>; | 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<number>): void \| Promise<void>; | Added |
| @ohos.file.fs | **function** writeSync(fd: number, buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; encoding?: string; }): number; | Added |
**Adaptation Guide**
1. Change the module to import.
Change **import fileio from '@ohos.fileio'** to **import fs from '@ohos.file.fs'**.
2. Change the exception handling method.
Sample code for exception handling in a synchronous API:
```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 exception handling in an asynchronous API (promise):
```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 exception handling in an asynchronous API (callback):
```js
import fs from '@ohos.file.fs'
try {
fs.open(path, fs.OpenMode.READ_ONLY, function(e, file){ // Asynchronous thread errors (such as a syscall error) are obtained via a callback.
if (e) {
console.error("open in async errCode:" + e.code + ", errMessage:" + e.message);
}
});
} catch (err) {// Main thread errors (such as invalid parameters) are obtained by try catch.
console.error("open callback errCode:" + err.code + ", errMessage:" + err.message);
}
```
\ No newline at end of file
# Test Subsystem ChangeLog
## cl.testfwk_arkxtest.1 On, Driver, and Component APIs Support Exception Handling
The APIs of API version 8 are deprecated and replaced by new APIs in API version 9 to capture exceptions using **try catch**.
## Change Impact
The api9-JS APIs provided by @ohos.uitest are affected. If you have used the APIs of **@ohos.uitest-api9** during test case development, adaptation is required so that the compilation can be successful in the SDK environment of the new version.
## Key API/Component Changes
- Deprecated the **By** class of API version 8 and replaced it with the **On** class in API version 9. The APIs of the **On** class support exception handling. The API names in the class remain unchanged, except that **By#key** is replaced with **On.id**.
- Deprecated the **BY** object of API version 8 and replaced it with the **ON** object in API version 9.
- Deprecated the **UiDriver** class of API version 8 and replaced it with the **Driver** class in API version 9. The APIs of the **Driver** class support exception handling, and the API names in the class remain unchanged.
- Deprecated the **UiComponent** class of API version 8 and replaced it with the **Component** class in API version 9. The APIs of the **Component** class support exception handling, and the API names in the class remain unchanged.
## Adaptation Guide
1. Replace the class names as follows:
- `By-->On`
- `BY-->ON`
- `UiDriver-->Driver`
- `UiComponent-->Component`
2. Capture the exception thrown.
Use **try-catch** to capture exceptions thrown.<br>Example:
```typescript
import {Driver,ON,Component} from '@ohos.uitest'
try {
let driver = Driver.create();
} catch (error) {
// error handle; error.code indicates the error code.
}
```
# User IAM Subsystem ChangeLog
## cl.useriam.1 API Exception Handling Change
Certain user IAM APIs 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:
An error message is returned by throwing an exception.
**Change Impact**
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 error information. Otherwise, service logic will be affected.
**Key API/Component Changes**
To implement unified exception handling, certain IAM APIs are deprecated and replaced by new APIs. The newly added APIs support unified error code handling specifications and function the same as the original APIs.
| Module | Class | Method/Attribute/Enum/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 {<br>token ?: Uint8Array; <br>remainTimes ?: number; <br>freezingTime ?: number;} | Deprecated|
| ohos.userIAM.userAuth | Enum| ResultCode {<br>SUCCESS = 0, <br>FAIL = 1, <br>GENERAL_ERROR = 2, <br>CANCELED = 3, <br>TIMEOUT = 4, <br>TYPE_NOT_SUPPORT = 5, <br>TRUST_LEVEL_NOT_SUPPORT = 6, <br>BUSY = 7, <br>INVALID_PARAMETERS = 8, <br>LOCKED = 9, <br>NOT_ENROLLED = 10,} | Deprecated|
| ohos.userIAM.userAuth | type | AuthEventKey = "result" | Added|
| ohos.userIAM.userAuth | type | EventInfo = AuthResultInfo | Added|
| ohos.userIAM.userAuth | AuthResultInfo | AuthResultInfo {<br>result : number; <br>token ?: Uint8Array; <br>remainAttempts ?: number; <br>lockoutDuration ?: number;} | Added|
| ohos.userIAM.userAuth | TipInfo | TipInfo {<br>module : number; <br>tip : number;} | Added|
| ohos.userIAM.userAuth | AuthInstance | AuthInstance {<br>on: (name: AuthEventKey, callback: AuthEvent) => void; <br>off: (name: AuthEventKey) => void; <br>start: () => void; <br>cancel: () => void;} | Added|
| ohos.userIAM.userAuth | Enum| ResultCodeV9 {<br>SUCCESS = 12500000, <br>FAIL = 12500001, <br>GENERAL_ERROR = 12500002, <br>CANCELED = 12500003, <br>TIMEOUT = 12500004, <br>TYPE_NOT_SUPPORT = 12500005, <br>TRUST_LEVEL_NOT_SUPPORT = 12500006, <br>BUSY = 12500007, <br>LOCKED = 12500009, <br>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 | Enum| ResultCode {<br>SUCCESS = 0, <br>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 more information about the APIs, see [User Authentication](../../../application-dev/reference/apis/js-apis-useriam-userauth.md) and [Facial Authentication](../../../application-dev/reference/apis/js-apis-useriam-faceauth.md).
## cl.useriam.2 API Invoking Permission Change
Some user IAM APIs can only be called by system applications, and system application runtime authentication is required. The following changes are made in API version 9:
Added the service logic for checking whether an application is a system application to the **setSurfaceId** API of the facial authentication module. Non-system applications cannot call this API.
**Change Impact**
Applications developed based on earlier versions are not affected.
**Key API/Component Changes**
The service logic for checking whether an application is a system application is added to **setSurfaceId()** . Error code **202** will be returned if the API is called by a non-system application.
**Adaptation Guide**
Change the **app-feature** field to **hos_system_app** in the **UnsgnedReleasedProfileTemplate.json** file in [developtools_hapsigner](https://gitee.com/openharmony/developtools_hapsigner/tree/master/dist). Then, the signed application is a system application.
# Wi-Fi Subsystem Changelog
## cl.wifi.1 Moving System APIs and APIs of Version 9 to @ohos.wifiManager.d.ts
Moved all system APIs and APIs of version 9 from **@ohos.wifi.d.ts** to the newly added **@ohos.wifiManager.d.ts**, and added error code descriptions. The **@ohos.wifi.d.ts** APIs do not support error code handling.
To use these APIs, import the **@ohos.wifiManager.d.ts** module as follows:
import wifiManager from '@ohos.wifiManager';
**Change Impact**
System APIs and APIs of version 9 are affected. To use these APIs, import **@ohos.wifiManager** as follows:
import wifiManager from '@ohos.wifiManager';
Other APIs are not affected.
**Key API/Component Changes**
| Class| API Type| Declaration| Change Type|
| -- | -- | -- | -- |
| wifi | namespace | declare namespace wifi | Moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function enableWifi(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function disableWifi(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function scan(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function getScanResults(): Promise&lt;Array&lt;WifiScanInfo&gt;&gt; | Changed from **getScanInfos** to **getScanResults** and moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function getScanResults(callback: AsyncCallback&lt;Array&lt;WifiScanInfo&gt;&gt;): void | Changed from **getScanInfos** to **getScanResults** and moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function getScanResultsSync(): &nbsp;Array&lt;[WifiScanInfo]&gt; | Moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function addCandidateConfig(config: WifiDeviceConfig): Promise&lt;number&gt; | Moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function addCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback&lt;number&gt;): void | Moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function removeCandidateConfig(networkId: number): Promise&lt;void&gt; | Moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function removeCandidateConfig(networkId: number, callback: AsyncCallback&lt;void&gt;): void | Moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function addUntrustedConfig(config: WifiDeviceConfig): Promise&lt;boolean&gt; | Deleted this API in API version 9.|
| wifi | method | function addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback&lt;boolean&gt;): void | Deleted|
| wifi | method | function removeUntrustedConfig(config: WifiDeviceConfig): Promise&lt;boolean&gt; | Deleted|
| wifi | method | function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback&lt;boolean&gt;): void | Deleted|
| wifi | method | function getCandidateConfigs(): &nbsp;Array&lt;[WifiDeviceConfig]&gt; | Moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function connectToCandidateConfig(networkId: number): void | Moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function connectToNetwork(networkId: number): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function connectToDevice(config: WifiDeviceConfig): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function disconnect(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function reassociate(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function reconnect(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function disableNetwork(netId: number): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function removeAllNetwork(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function removeDevice(id: number): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function enableHotspot(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function disableHotspot(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function setHotspotConfig(config: HotspotConfig): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function getP2pLocalDevice(): Promise&lt;WifiP2pDevice&gt; | Moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function getP2pLocalDevice(callback: AsyncCallback&lt;WifiP2pDevice&gt;): void | Moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function getP2pGroups(): Promise&lt;Array&lt;WifiP2pGroupInfo&gt;&gt; | Moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function getP2pGroups(callback: AsyncCallback&lt;Array&lt;WifiP2pGroupInfo&gt;&gt;): void | Moved to **@ohos.wifiManager.d.ts**|
| wifi | method | function createGroup(config: WifiP2PConfig): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function removeGroup(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function p2pConnect(config: WifiP2PConfig): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function p2pCancelConnect(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function startDiscoverDevices(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function stopDiscoverDevices(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function deletePersistentGroup(netId: number): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | method | function setDeviceName(devName: string): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**|
| wifi | interface | export interface WifiEapConfig | Moved to **@ohos.wifiManager.d.ts**|
| wifi | enum | export enum EapMethod | Moved to **@ohos.wifiManager.d.ts**|
| wifi | enum | export enum Phase2Method | Moved to **@ohos.wifiManager.d.ts**|
| wifi | interface | export interface WifiDeviceConfig | Added with the **eapConfig** parameter and moved to **@ohos.wifiManager.d.ts**|
| wifi | interface | export interface IpConfig | Added with the **prefixLength** parameter and moved to **@ohos.wifiManager.d.ts**|
| wifi | interface | export interface WifiInfoElem | Moved to **@ohos.wifiManager.d.ts**|
| wifi | enum | export enum WifiChannelWidth | Moved to **@ohos.wifiManager.d.ts**|
| wifi | interface | export interface WifiScanInfo | Added with the **centerFrequency0**, **centerFrequency1**, and **infoElems** parameters and moved to **@ohos.wifiManager.d.ts**|
| wifi | enum | export enum WifiSecurityType | Added with four encryption types and moved to **@ohos.wifiManager.d.ts**|
| wifi | interface | export interface WifiLinkedInfo | Added with the **MacType** parameter and moved to **@ohos.wifiManager.d.ts**|
**(Optional) Adaptation Guide**
The following uses **getLinkedInfo** as an example:
```
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 Change of System APIs and APIs of Version 9
Moved all system APIs and APIs of version 9 from **@ohos.wifiext.d.ts** to the newly added **@ohos.wifiManagerExt.d.ts**, and added error code descriptions.
To use these APIs, import the **@ohos.wifiManagerExt.d.ts** module as follows:
import wifiManagerExt from '@ohos.wifiManagerExt';
**Change Impact**
System APIs and APIs of version 9 are affected. Import **@ohos.wifiManagerExt** and use it together with **wifiManager**.
import wifiManagerExt from '@ohos.wifiManagerExt';
Other APIs are not affected.
# Readme
- [Account](changelogs-account_os_account.md)
- [Distributed Data Management](changelogs-distributeddatamgr.md)
- [File Management](changelogs-filemanagement.md)
- [Communication-NFC](changelogs-nfc.md)
- [Security](changelogs-security.md)
- [User IAM](changelogs-useriam.md)
# Account Subsystem Changelog
## cl.account_os_account.1 createOsAccountForDomain Error Code Change
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 Impact**
The application developed based on earlier versions needs to adapt the new error code. Otherwise, the original service logic will be affected.
**Key API/Component Changes**
- AccountManager
- createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, callback: AsyncCallback&lt;OsAccountInfo&gt;);
- createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo): Promise&lt;OsAccountInfo&gt;;
**Adaptation Guide**
The sample code is as follows:
```ts
import account_osAccount from "@ohos.account.osAccount"
let accountMgr = account_osAccount.getAccountManager();
let domainInfo = {
accountName: "zhangsan",
domain: "china.example.com"
};
try {
await accountMgr.createOsAccountForDomain(account_osAccount.OsAccountType.NORMAL, domainInfo);
await accountMgr.createOsAccountForDomain(account_osAccount.OsAccountType.NORMAL, domainInfo);
} catch (err) {
console.log("activateOsAccount err: " + JSON.stringify(err)); // error.code = 12300004;
}
```
## cl.account_os_account.2 App 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&lt;Array&lt;AppAccountInfo&gt;&gt;): void;
- getAllAccounts(): Promise&lt;Array&lt;AppAccountInfo&gt;&gt;;
**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 App 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&lt;Array&lt;AppAccountInfo&gt;&gt;): void;
- getAccountsByOwner(owner: string): Promise&lt;Array&lt;AppAccountInfo&gt;&gt;;
**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));
}
```
# Distributed Data Management Subsystem Changelog
## cl.distributeddatamgr.1 API Change
Changed the APIs in **kv_store** of the distributed data management subsystem:
Changed **createKVManager()** from an asynchronous API to a synchronous API, because the execution duration is fixed and short.<br>Before change:<br>**createKVManager(config: KVManagerConfig): Promise\<KVManager\>;**<br>**createKVManager(config: KVManagerConfig, callback: AsyncCallback<KVManager>): void;**<br>After change:<br>**createKVManager(config: KVManagerConfig): KVManager;**
You need to adapt your application based on the following information.
**Change Impact**
JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enumeration/Constant | Change Type|
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): Promise\<KVManager\>; | Deleted |
| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): KVManager; | Changed |
**Adaptation Guide**
The following sample code shows 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 Moved function getRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impact**
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**
Moved the following APIs from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**:
Before change:
```ts
function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number, callback: AsyncCallback<RdbStoreV9>): void;
function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number): Promise<RdbStoreV9>;
```
After change:
```
function getRdbStore(context: Context, config: StoreConfig, callback: AsyncCallback<RdbStore>): void;
function getRdbStore(context: Context, config: StoreConfig): Promise<RdbStore>;
```
**Adaptation Guide**
* Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**.
* Change the names of related APIs accordingly.
## cl.distributeddatamgr.3 Moved function deleteRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impact**
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>): void;
function deleteRdbStoreV9(context: Context, name: string): Promise<void>;
```
The APIs are moved from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**.
```
function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback<void>): void;
function deleteRdbStoreV9(context: Context, name: string): Promise<void>;
```
**Adaptation Guide**
* Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**.
* Change the names of related APIs accordingly.
## cl.distributeddatamgr.4 Moved interface StoreConfigV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impact**
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**
Moved **StoreConfigV9** from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and renamed it **StoreConfig**.
**Adaptation Guide**
* Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**.
* Change the names of related APIs accordingly.
## cl.distributeddatamgr.5 Moved enum SecurityLevel from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impact**
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**
Moved enum **SecurityLevel** from **ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**.
**Adaptation Guide**
* Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**.
* Change the names of related APIs accordingly.
## cl.distributeddatamgr.6 Moved interface RdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impact**
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**
Moved **RdbStoreV9** from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and renamed it **RdbStore**.
**Adaptation Guide**
* Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**.
* Change the names of related APIs accordingly.
## cl.distributeddatamgr.7 Moved class RdbPredicatesV9 from ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impact**
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**
Moved the class **RdbPredicatesV9** from **ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and renamed it **RdbPredicates**.
**Adaptation Guide**
* Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**.
* Change the names of related APIs accordingly.
## cl.distributeddatamgr.8 Moved interface ResultSetV9 from api/@ohos.data.relationalStore.d.ts to @ohos.data.relationalStore.d.ts
**Change Impact**
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**
Moved **ResultSetV9** from **api/data/rdb/resultSet.d.ts** to **@ohos.data.relationalStore.d.ts** and renamed it **ResultSet**.
**Adaptation Guide**
* Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**.
* Obtain the **ResultSetV9** instance only by using **getRdbStoreV9**. After modifications are made according to cl.distributeddatamgr.2, the code can automatically adapt to **ResultSet**.
# File Management Subsystem Changelog
## cl.filemanagement.1 environment Module Change
The file management subsystem **d.ts** file has been archived and moved to the **file** directory. The **environment** module supports error code handling.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **environment** module supports error code handling. See [Adaptation Guide](../v3.2-beta4/changelogs-filemanagement.md).
**Key API/Component Changes**
Before the change, **environment** is imported from **@ohos.environment**:
```js
import environment from '@ohos.environment';
```
Now, **environment** is imported from **@ohos.file.environment**:
```js
import environment from '@ohos.file.environment';
```
## cl.filemanagement.2 securityLabel Change
Moved the file management subsystem **d.ts** file to the **file** directory. The **securityLabel** module supports error code handling.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **securityLabel** module supports error code handling. See [Adaptation Guide](../v3.2-beta4/changelogs-filemanagement.md).
**Key API/Component Changes**
Before the change, **securityLabel** is imported from **@ohos.securityLabel**:
```js
import securityLabel from '@ohos.securityLabel';
```
Now, **securityLabel** is imported from **@ohos.file.securityLabel**:
```js
import securityLabel from '@ohos.file.securityLabel';
```
## cl.filemanagement.3 fs Change
Changed the **ino** attribute type of **Stat** under **fs**.
**Change Impact**
The **ino** attribute type is changed from number to BigInt, to adapt to the **inode** range of all types of files in the file system.
**Key API/Component Changes**
The type of the **ino** attribute of **Stat** is changed from number to BigInt.
## cl.filemanagement.4 fileAccess Change
Moved the file management subsystem **d.ts** file to the **file** directory. The **fileAccess** module supports error code handling.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **fileAccess** module supports error code handling. See [Adaptation Guide](../v3.2-beta4/changelogs-filemanagement.md).
**Key API/Component Changes**
Before the change, **fileAccess** is imported from **@ohos.data.fileAccess**:
```js
import fileAccess from '@ohos.data.fileAccess';
```
Now, **fileAccess** is imported from **@ohos.file.fileAccess**:
```js
import fileAccess from '@ohos.file.fileAccess';
```
## cl.filemanagement.5 fileExtensionInfo Change
Moved the file management subsystem **d.ts** file to the **file** directory. The **fileExtensionInfo** module supports error code handling.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **fileExtensionInfo** module supports error code handling. See [Adaptation Guide](../v3.2-beta4/changelogs-filemanagement.md).
**Key API/Component Changes**
Before the change, **fileExtensionInfo** is imported from **@ohos.fileExtensionInfo**:
```js
import fileExtensionInfo from '@ohos.fileExtensionInfo';
```
Now, **fileExtensionInfo** is imported from **@ohos.file.fileExtensionInfo**:
```js
import fileExtensionInfo from '@ohos.file.fileExtensionInfo';
```
## cl.filemanagement.6 storageStatistics Change
Moved the file management subsystem **d.ts** file to the **file** directory. The **fileExtensionInfo** module supports error code handling.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **storageStatistics** module supports error code handling. See [Adaptation Guide](../v3.2-beta4/changelogs-filemanagement.md).
**Key API/Component Changes**
Before the change, **storageStatistics** was imported from **@ohos.storageStatistics**:
```js
import storageStatistics from '@ohos.storageStatistics';
```
Now, **storageStatistics** is imported from **@ohos.file.storageStatistics**:
```js
import storageStatistics from '@ohos.file.storageStatistics';
```
## cl.filemanagement.7 volumeManager Change
Moved the file management subsystem **d.ts** file to the **file** directory. The **fileExtensionInfo** module supports error code handling.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **volumeManager** module supports error code handling. See [Adaptation Guide](../v3.2-beta4/changelogs-filemanagement.md).
**Key API/Component Changes**
Before the change, **volumeManager** was imported from **@ohos.volumeManager**:
```js
import volumeManager from '@ohos.volumeManager';
```
Now, **volumeManager** is imported from **@ohos.file.volumeManager**:
```js
import volumeManager from '@ohos.file.volumeManager';
```
## cl.filemanagement.8 fileio API Changes
Deprecated the **fileio** APIs, which do not return error codes; added APIs that return error codes.
**Change Impact**
For applications developed based on earlier versions, pay attention to the iterative update of deprecated APIs. The specifications of the new APIs are slightly adjusted. Pay attention to the usage of the new APIs.
**Key API/Component Changes**
The APIs of **@ohos.fileio** do not support error code handling and are deprecated. New APIs with minor changes in parameters are added in **@ohos.file.fs** to support unified error code handling specifications. The new APIs function the same as the original APIs. The following table lists the API changes.
The API names remain unchanged.
| Module | Method/Attribute/Enum/Constant | Change Type|
| ------------------------- | ------------------------------------------------------------ | -------- |
| @ohos.fileio | **function** access(path: string, mode?: number, callback?: AsyncCallback\<void>): void \| Promise\<void> | Deprecated |
| @ohos.fileio | **function** accessSync(path: string, mode?: number): void | Deprecated |
| @ohos.file.fs | **function** access(path: string, callback?: AsyncCallback\<boolean>): void \| Promise\<boolean> | Added |
| @ohos.file.fs | **function** accessSync(path: string): boolean | Added |
| @ohos.fileio | **function** close(fd: number, callback?: AsyncCallback\<void>): void \| Promise\<void> | Deprecated |
| @ohos.fileio | **function** closeSync(fd: number): void | Deprecated |
| @ohos.file.fs | **function** close(file: File \| number, callback?: AsyncCallback\<void>): void \| Promise\<void> | Added |
| @ohos.file.fs | **function** closeSync(file: File \| number): void | Added |
| @ohos.fileio | **function** mkdir(path: string, mode?: number, callback?: AsyncCallback\<void>): void \| Promise\<void> | Deprecated |
| @ohos.fileio | **function** mkdirSync(path: string, mode?: number): void | Deprecated |
| @ohos.file.fs | **function** mkdir(path: string, callback?: AsyncCallback\<void>): void \| Promise\<void> | Added |
| @ohos.file.fs | **function** mkdirSync(path: string): void | Added |
| @ohos.fileio | **function** readText(filePath: string, options?: { position?: number; length?: number; encoding?: string; }, callback?: AsyncCallback\<string>): void \| Promise\<string> | Deprecated |
| @ohos.fileio | **function** readTextSync(filePath: string, options?: { position?: number; length?: number; encoding?: string; }): string | Deprecated |
| @ohos.file.fs | **function** readText(filePath: string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback\<string>): void \| Promise\<string> | Added |
| @ohos.file.fs | **function** readTextSync(filePath: string, options?: { offset?: number; length?: number; encoding?: string; }): string | Added |
| @ohos.fileio | **function** Stream.read(buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }, callback?: AsyncCallback\<ReadOut>): void \| Promise\<ReadOut> | Deprecated |
| @ohos.fileio | **function** Stream.readSync(buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }): number | Deprecated |
| @ohos.file.fs | **function** Stream.read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }, callback?: AsyncCallback\<number>): void \| Promise\<number> | Added |
| @ohos.file.fs | **function** Stream.readSync(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }): number | Added |
| @ohos.fileio | **function** Stream.write(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }, callback?: AsyncCallback\<number>): void \| Promise\<void> | Deprecated |
| @ohos.fileio | **function** Stream.writeSync(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): number | Deprecated |
| @ohos.file.fs | **function** Stream.write(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback\<number>): void \| Promise\<void> | Added |
| @ohos.file.fs | **function** Stream.writeSync(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; encoding?: string; }): number | Added |
**Adaptation Guide**
The APIs of @ohos.file.fs support unified exception handling. For details, see [File Management](../../../application-dev/reference/apis/js-apis-file-fs.md).
# Changelog of NFC JS APIs in the Communication Subsystem
Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.2(Mr) has the following changes in NFC APIs:
## cl.nfc.1 API Change
Deprecated some NFC JS APIs in API versions 6 to 8 because the APIs cannot throw error codes, and added new APIs in API version 9 instead.
Deprecated some NFC JS APIs in API versions 6 to 8 because the APIs cannot throw exceptions, and replaced them with new APIs in API version 9.
You need to adapt your application.
You need to adapt your application based on the following information.
**Change Impact**
......@@ -13,7 +11,7 @@ The deprecated JS APIs in API versions 6 to 8 are affected. Your application nee
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enum/Constant | Change Type|
| Module | Class | Method/Attribute/Enumeration/Constant | Change Type|
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | FeatureType | Deprecated |
| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | isSupported | Deprecated |
......@@ -58,4 +56,3 @@ See the following:
[tagSession (Standard NFC Tag Session)](../../../application-dev/reference/apis/js-apis-tagSession.md)
# Security Subsystem Changelog
## cl.security.1 Change of setSeed() from Asynchronous to Synchronous
**Change Impact**
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**
Before change:<br>
setSeed(seed : DataBlob, callback : AsyncCallback\<void>) : void;<br>
setSeed(seed : DataBlob) : Promise\<void>;
After change:<br>
setSeed(seed : DataBlob) : void;
**Adaptation Guide**
See **setSeed()** in [Crypto Framework](../../../application-dev/reference/apis/js-apis-cryptoFramework.md).
## cl.security.2 Moved DataArray from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impact**
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**
Moved **DataArray** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide**
1. Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert';
2. See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.3 Moved EncodingFormat from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impact**
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**
Moved **EncodingFormat** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide**
1. Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert';
2. See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.4 Moved EncodingBlob from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impact**
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**
Moved **EncodingBlob** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide**
1. Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert';
2. See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.5 Moved CertChainData from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impact**
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**
Moved **interface CertChainData** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide**
1. Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert';
2. See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.6 Moved X509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impact**
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**
Moved **X509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide**
1. Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert';
2. See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.7 Moved createX509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impact**
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**
Moved **createX509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide**
1. Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert';
2. See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.8 Moved X509CrlEntry from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts.
**Change Impact**
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**
Moved **X509CrlEntry** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide**
1. Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert';
2. See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.9 Moved X509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impact**
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**
Moved **X509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide**
1. Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert';
2. See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.10 Moved createX509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impact**
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**
Moved **createX509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide**
1. Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert';
2. See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.11 Moved CertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impact**
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**
Moved **CertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide**
1. Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert';
2. See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.12 Moved createCertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impact**
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**
Moved **createCertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide**
1. Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert';
2. See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.13 Change of getPublicKey() of X509Cert from Asynchronous to Synchronous
**Change Impact**
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**
Before change:
getPublicKey(callback : AsyncCallback\<PubKey>) : void;
getPublicKey() : Promise\<PubKey>;
After change:
getPublicKey() : cryptoFramework.PubKey;
**Adaptation Guide**
See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.14 Change of checkValidityWithDate of X509Cert from Asynchronous to Synchronous
**Change Impact**
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**
Before change:<br>
checkValidityWithDate(date: string, callback : AsyncCallback\<void>) : void;<br>
checkValidityWithDate(date: string) : Promise\<void>;
After change:<br>
checkValidityWithDate(date: string) : void;
**Adaptation Guide**
See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.15 Change of getCertIssuer of X509CrlEntry from Asynchronous to Synchronous
**Change Impact**
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**
Before change:<br>
getCertIssuer(callback : AsyncCallback\<DataBlob>) : void;<br>
getCertIssuer() : Promise\<DataBlob>;
After change:<br>
getCertIssuer() : DataBlob;
**Adaptation Guide**
See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.16 Change of getRevocationDate of X509CrlEntry from Asynchronous to Synchronous
**Change Impact**
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**
Before change:<br>
getRevocationDate(callback : AsyncCallback\<string>) : void;<br>
getRevocationDate() : Promise\<string>;
After change:<br>
getRevocationDate() : string;
**Adaptation Guide**
See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.17 Change of isRevoked of X509Crl from Asynchronous to Synchronous
**Change Impact**
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**
Before change:<br>
isRevoked(cert : X509Cert, callback : AsyncCallback\<boolean>) : void;<br>
isRevoked(cert : X509Cert) : Promise\<boolean>;
After change:<br>
isRevoked(cert : X509Cert) : boolean;
**Adaptation Guide**
See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.18 Change of getRevokedCert of X509Crl from Asynchronous to Synchronous
**Change Impact**
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**
Before change:<br>
getRevokedCert(serialNumber : number, callback : AsyncCallback\<X509CrlEntry>) : void;<br>
getRevokedCert(serialNumber : number) : Promise\<X509CrlEntry>;
After change:<br>
getRevokedCert(serialNumber : number) : X509CrlEntry;
**Adaptation Guide**
See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.19 Change of getRevokedCertWithCert of X509Crl from Asynchronous to Synchronous
**Change Impact**
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**
Before change:<br>
getRevokedCertWithCert(cert : X509Cert, callback : AsyncCallback\<X509CrlEntry>) : void;<br>
getRevokedCertWithCert(cert : X509Cert) : Promise\<X509CrlEntry>;
After change:<br>
getRevokedCertWithCert(cert : X509Cert) : X509CrlEntry;
**Adaptation Guide**
See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.20 Change of getTbsInfo of X509Crl from Asynchronous to Synchronous
**Change Impact**
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**
Before change:<br>
getTbsInfo(callback : AsyncCallback\<DataBlob>) : void;<br>
getTbsInfo() : Promise\<DataBlob>;
After change:<br>
getTbsInfo() : DataBlob;
**Adaptation Guide**
See [Certificate](../../../application-dev/reference/apis/js-apis-cert.md).
## cl.security.21 Support of No-Hash Signing Mode for HUKS
Before the change, the application passes **huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE** and HUKS uses **huks.HuksKeyDigest.HUKS_DIGEST_SHA256** for processing by default.
After the change, the application passes **huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE** and HUKS does not generate a digest by default. Instead, the service performs a hash operation on the original data and then passes a hashed digest to HUKS for signing or signature verification.
**Change Impact**
Behavior of released JavaScript APIs will be changed.
The application needs to adapt these APIs so that the signing or signature verification result can be passed before and after the change.
**Key API/Component Changes**
Released JavaScript APIs remain unchanged, but parameter sets passed to the APIs are changed.
The service uses the No-Hash signing mode, and hashes the original data and then passes a hashed digest to the signing or signature verification API of HUKS. In addition, the **huks.HuksTag.HUKS_TAG_DIGEST** parameter is set to **huks.HuksKeyDigest.HUKS_DIGEST_NONE**.
**Adaptation Guide**
The following uses signing as an example.
```js
import huks from '@ohos.security.huks';
let keyAlias = 'rsa_Key';
/* Digest value after SHA-256 encryption */
let inDataAfterSha256 = new Uint8Array(
0x4B, 0x1E, 0x22, 0x64, 0xA9, 0x89, 0x60, 0x1D, 0xEC, 0x78, 0xC0, 0x5D, 0xBE, 0x46, 0xAD, 0xCF,
0x1C, 0x35, 0x16, 0x11, 0x34, 0x01, 0x4E, 0x9B, 0x7C, 0x00, 0x66, 0x0E, 0xCA, 0x09, 0xC0, 0xF3,
);
/* Signing parameters */
let signProperties = new Array();
signProperties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_RSA,
}
signProperties[1] = {
tag: huks.HuksTag.HUKS_TAG_PURPOSE,
value:
huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_SIGN
}
signProperties[2] = {
tag: huks.HuksTag.HUKS_TAG_KEY_SIZE,
value: huks.HuksKeySize.HUKS_RSA_KEY_SIZE_2048,
}
signProperties[3] = {
tag: huks.HuksTag.HUKS_TAG_DIGEST,
value: huks.HuksKeyDigest.HUKS_DIGEST_NONE, // Set digest-none.
}
let signOptions = {
properties: signProperties,
inData: inDataAfterSha256 // Set the value after hashing.
}
huks.initSession(keyAlias, signOptions);
```
For more information, see [HUKS Development](../../../application-dev/security/huks-guidelines.md) and [HUKS](../../../application-dev/reference/apis/js-apis-huks.md).
## cl.security.22 Support for Key Calculation Parameter Specifications During Key Usage
Before the change, all parameters for key calculation must be specified when the application generates a key. After the change, only mandatory parameters need to be specified when the application generates a key, and other parameters can be passed in when the key is used. The application can specify key calculation parameters more flexibly.
**Change Impact**
Behavior of released JavaScript APIs will be changed.
The application can specify only mandatory parameters when creating a key and specify other optional parameters when using the key.
**Key API/Component Changes**
Released JavaScript APIs remain unchanged, but parameter sets passed to the APIs are changed and parameters are classified into mandatory parameters and optional parameters. For details, see [HUKS Development](../../../application-dev/security/huks-guidelines.md).
huks.generateKeyItem
huks.importKeyItem
huks.importWrappedKeyItem
huks.initSession
huks.updateSession
huks.finishSession
**Adaptation Guide**
The following uses the key generation process as an example.
```js
let keyAlias = 'keyAlias';
let properties = new Array();
// Mandatory parameter.
properties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_RSA
};
// Mandatory parameter.
properties[1] = {
tag: huks.HuksTag.HUKS_TAG_KEY_SIZE,
value: huks.HuksKeySize.HUKS_RSA_KEY_SIZE_2048
};
// Mandatory parameter.
properties[2] = {
tag: huks.HuksTag.HUKS_TAG_PURPOSE,
value:
huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_SIGN |
huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_VERIFY
};
// Optional parameter. If this parameter is not specified when a key is generated, it must be specified when the key is used.
properties[3] = {
tag: huks.HuksTag.HUKS_TAG_DIGEST,
value: huks.HuksKeyDigest.HUKS_DIGEST_SHA256
};
let options = {
properties: properties
};
try {
huks.generateKeyItem(keyAlias, options, function (error, data) {
if (error) {
console.error(`callback: generateKeyItem failed, code: ${error.code}, msg: ${error.message}`);
} else {
console.info(`callback: generateKeyItem key success`);
}
});
} catch (error) {
console.error(`callback: generateKeyItem input arg invalid, code: ${error.code}, msg: ${error.message}`);
}
```
For more information, see [HUKS Development](../../../application-dev/security/huks-guidelines.md) and [HUKS](../../../application-dev/reference/apis/js-apis-huks.md).
# User IAM Subsystem ChangeLog
## cl.useriam.1 API9 Return Value Change
Changed the return value **ResultCodeV9** to **UserAuthResultCode** for API9.
**Change Impact**
Applications developed based on earlier versions are not affected. For the applications developed from this version, the class name of the error code needs to be adapted. Otherwise, the service logic is affected.
**Key API/Component Changes**
N/A
**Adaptation Guide**
Change the class name for invoking the authentication result code from **ResultCode** to **UserAuthResultCode**.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册