提交 1b7e44b5 编写于 作者: G Gloria

updated changelogs folder

Signed-off-by: NGloria <wusongqing@huawei.com>
上级 5dd16eab
...@@ -164,7 +164,7 @@ To use the full SDK that contains system APIs, you must download the full code, ...@@ -164,7 +164,7 @@ To use the full SDK that contains system APIs, you must download the full code,
For details about the API changes, see [API Differences](api-diff/v3.2-beta5/Readme-EN.md). For details about the API changes, see [API Differences](api-diff/v3.2-beta5/Readme-EN.md).
For details about the API changes of each subsystem, see [Changelogs](changelogs/v3.2-beta5/Readme-EN.md).
### Chip and Development Board Adaptation ### Chip and Development Board Adaptation
......
# ArkUI Subsystem LocalStorage Class ChangeLog
## cl.LocalStorage.1 Return Type Change of the get API
Changed the return type from **get\<T>(propName: string): T** to **get\<T>(propName: string): T | undefined**.
**Change Impact**
None
## cl.LocalStorage.2 Mandatory/Optional Change of the newValue Parameter in setOrCreate
**Change Impact**
API declaration before change:
```js
setOrCreate<T>(propName: string, newValue?: T): boolean
```
API declaration after change:
```js
setOrCreate<T>(propName: string, newValue: T): boolean
```
The **newValue** parameter becomes mandatory.
If it is not specified when an application calls the API, the build will fail after the SDK is replaced.
**Adaptation Guide**
```js
let storage = new LocalStorage();
storage.setOrCreate('propA', 'hello');
```
## cl.LocalStorage.3 link Parameter and Return Type Changes
**Change Impact**
API declaration before change:
```js
link<T>(propName: string, linkUser?: T, subscribersName?: string): T
```
API declaration after change:
```js
link<T>(propName: string): SubscribedAbstractProperty<T>
```
1. The second and third parameters of the **link** API are reserved for internal use by the framework. Therefore, the API is changed to contain only one parameter.
2. The return type **T** is changed to **SubscribedAbstractProperty**.
**Adaptation Guide**
```js
let storage = new LocalStorage({"PropA": "47"});
let linA = storage.link("PropA");
linA.set(50);
```
## cl.LocalStorage.4 setAndLink Parameter and Return Type Changes
**Change Impact**
API declaration before change:
```js
setAndLink<T>(propName: string, defaultValue: T, linkUser?: T, subscribersName?: string): T
```
API declaration after change:
```js
setAndLink<T>(propName: string, defaultValue: T): SubscribedAbstractProperty<T>
```
1. The third and fourth parameters of the **setAndLink** API are reserved for internal use by the framework. Therefore, the API is changed to contain two parameters.
2. The return type **T** is changed to **SubscribedAbstractProperty**.
**Adaptation Guide**
```js
let storage = new LocalStorage({"PropA": "47"});
let linA = storage.setAndLink("PropA", "48")
linA.set(50);
```
## cl.LocalStorage.5 prop Parameter and Return Type Changes
**Change Impact**
API declaration before change:
```js
prop<T>(propName: string, propUser?: T, subscribersName?: string): T
```
API declaration after change:
```js
prop<S>(propName: string): SubscribedAbstractProperty<S>
```
1. The second and third parameters of the **prop** API are reserved for internal use by the framework. Therefore, the API is changed to contain only one parameter.
2. The return type **T** is changed to **SubscribedAbstractProperty**.
**Adaptation Guide**
```js
let storage = new LocalStorage({"PropA": "47"});
let propA = storage.prop("PropA");
propA.set(51); // one-way sync
```
## cl.LocalStorage.6 setAndProp Parameter and Return Type Changes
**Change Impact**
API declaration before change:
```js
setAndProp<T>(propName: string, defaultValue: T, propUser?: T, subscribersName?: string): T
```
API declaration after change:
```js
setAndProp<S>(propName: string, defaultValue: S): SubscribedAbstractProperty<S>
```
1. The third and fourth parameters of the **setAndProp** API are reserved for internal use by the framework. Therefore, the API is changed to contain two parameters.
2. The return type **T** is changed to **SubscribedAbstractProperty**.
**Adaptation Guide**
```js
let storage = new LocalStorage({"PropA": "47"});
let propA = storage.setAndProp("PropA", "48");
propA.set(51); // one-way sync
```
# ChangeLog of JS API Changes of the Distributed Data Management Subsystem
Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(Mr) has the following API changes in the distributed data management subsystem:
## cl.distributeddatamgr.1 API Change
APIs in the **kv_store** component of the distributed data management subsystem are changed:
**createKVManager** is changed from asynchronous to synchronous, because the execution duration is fixed and short and there is no need to asynchronously wait for the execution result. Therefore, the original APIs **function createKVManager(config: KVManagerConfig): Promise\<KVManager\>;** and **function createKVManager(config: KVManagerConfig, callback: AsyncCallback<KVManager>): void;** are changed to **function createKVManager(config: KVManagerConfig): KVManager;**.
You need to adapt your applications based on the following information:
**Change Impacts**
JS APIs in API version 9 are affected. The application needs to adapt these APIs so that it can properly implement functions in the SDK environment of the new version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enumeration/Constant | Change Type|
| ------------------------ | ------------------ | ------------------------------------------------------------ | -------- |
| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): Promise\<KVManager\>; | Deleted |
| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): KVManager; | Changed |
**Adaptation Guide**
The following illustrates how to call **createKVManager** to create a **KVManager** object.
Stage model:
```ts
import AbilityStage from '@ohos.application.Ability'
let kvManager;
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("MyAbilityStage onCreate")
let context = this.context
const kvManagerConfig = {
context: context,
bundleName: 'com.example.datamanagertest',
}
try {
kvManager = distributedKVStore.createKVManager(kvManagerConfig);
} catch (e) {
console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`);
}
}
}
```
FA model:
```ts
import featureAbility from '@ohos.ability.featureAbility'
let kvManager;
let context = featureAbility.getContext()
const kvManagerConfig = {
context: context,
bundleName: 'com.example.datamanagertest',
}
try {
kvManager = distributedKVStore.createKVManager(kvManagerConfig);
} catch (e) {
console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`);
}
```
## cl.distributeddatamgr.2 Migration of function getRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts.
**Change Impacts**
The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
**Key API/Component Changes**
APIs:
```ts
function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number, callback: AsyncCallback<RdbStoreV9>): void;
function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number): Promise<RdbStoreV9>;
```
The APIs are migrated from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**.
```
function getRdbStore(context: Context, config: StoreConfig, callback: AsyncCallback<RdbStore>): void;
function getRdbStore(context: Context, config: StoreConfig): Promise<RdbStore>;
```
**Adaptation Guide**
* `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
* The names of relevant methods should be changed according to the preceding changes.
## cl.distributeddatamgr.3 Migration of function deleteRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impacts**
The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
**Key API/Component Changes**
APIs:
```ts
function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback<void>): void;
function deleteRdbStoreV9(context: Context, name: string): Promise<void>;
```
The APIs are migrated from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**.
```
function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback<void>): void;
function deleteRdbStoreV9(context: Context, name: string): Promise<void>;
```
**Adaptation Guide**
* `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
* The names of relevant methods should be changed according to the preceding changes.
## cl.distributeddatamgr.4 Migration of interface StoreConfigV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impacts**
The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
**Key API/Component Changes**
**interface StoreConfigV9** is migrated from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and is renamed as **interface StoreConfig**.
**Adaptation Guide**
* `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
* The names of relevant APIs should be changed according to the preceding changes.
## cl.distributeddatamgr.5 Migration of enum SecurityLevel from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impacts**
The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
**Key API/Component Changes**
**enum SecurityLevel** is migrated from **ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**.
**Adaptation Guide**
* `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
* The names of relevant APIs should be changed according to the preceding changes.
## cl.distributeddatamgr.6 Migration of interface RdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impacts**
The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
**Key API/Component Changes**
**interface RdbStoreV9** is migrated from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and is renamed as **interface RdbStore**.
**Adaptation Guide**
* `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
* The names of relevant APIs should be changed according to the preceding changes.
## cl.distributeddatamgr.7 Migration of class RdbPredicatesV9 from ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impacts**
The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
**Key API/Component Changes**
**class RdbPredicatesV9** is migrated from **ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and is renamed as **interface RdbPredicates**.
**Adaptation Guide**
* `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
* The names of relevant APIs should be changed according to the preceding changes.
## cl.distributeddatamgr.8 Migration of interface ResultSetV9 from api/@ohos.data.relationalStore.d.ts to @ohos.data.relationalStore.d.ts
**Change Impacts**
The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
**Key API/Component Changes**
**interface ResultSetV9** is migrated from **api/data/rdb/resultSet.d.ts** to **@ohos.data.relationalStore.d.ts** and is renamed as **interface ResultSet**.
**Adaptation Guide**
* `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
* The **ResultSetV9** instance is obtained only via **getRdbStoreV9**. After modifications are made according to cl.distributeddatamgr.2, the code can automatically adapt to **ResultSet**.
# Bundle Manager Subsystem Changelog
## cl.bundlemanager.1 Deleted the atomicService Tag from the app.json File
The **atomicService** tag is deleted from the **app.json** file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete the **atomicService** tag from your code.
## cl.bundlemanager.2 Added the bundleType Tag to the app.json File
The **bundleType** tag is added to the **app.json** file.
**Change Impact**<br>
For an existing ability with [installationFree](../../../application-dev/quick-start/module-configuration-file.md) set to **true**, **bundleType** must be set to **atomicService** in the **app.json** file. Otherwise, the packaging fails.
**Adaptation Guide**<br>
Add the [bundleType](../../../application-dev/quick-start/app-configuration-file.md) tag. This tag can be left blank. The default value is **app**. The setting of this tag and the [installationFree](../../../application-dev/quick-start/module-configuration-file.md) field in the **module.json** file must meet the following rules:
- If **bundleType** is **app**, **installationFree** must be set to **false**.
- If **bundleType** is **atomicService**, **installationFree** must be set to **true**.
## cl.bundlemanager.3 Deleted the split Field from the ApplicationInfo Struct
The **split** field is deleted from the [ApplicationInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) struct.
**Change Impact**<br>
If the **split** field is used in your code, the compilation fails.
**Key API/Component Changes**<br>
The **split** field is deleted from the [ApplicationInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) struct.
**Adaptation Guide**<br>
Delete the **split** field from the **ApplicationInfo** struct of your code. The stage model always forcibly splits bundles.
## cl.bundlemanager.4 Deleted the atomicServiceModuleType Field from the HapModuleInfo Struct
The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
**Change Impact**<br>
If the **atomicServiceModuleType** field is used in your code, the compilation fails.
**Key API/Component Changes**<br>
The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
**Adaptation Guide**<br>
Record the setting of the **atomicServiceModuleType** field, delete it from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct, and set the **moduleType** field in the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct to the recorded value.
## cl.bundlemanager.5 Deleted the AtomicServiceModuleType Enumerated Value
The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
**Change Impact**<br>
If the **atomicServiceModuleType** field is used in your code, the compilation fails.
**Key API/Component Changes**<br>
The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
**Adaptation Guide**<br>
Record the setting of the **atomicServiceModuleType** field, delete it from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct, and set the **moduleType** field in the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct to the recorded value.
# Input Method Framework Subsystem – Input Method Framework Service Changelog
## @ohos.InputMethodSubtype Change of name, label, and id
Changed the **name**, **label**, and **id** attributes since API version 9.
**Change Impact**
Applications must be adapted to the following changes.
| Name| Before Change| After Change|
| -------- | -------- | -------- |
| label | (1) Value: ID of the input method subtype.| (1) Value: Label of the input method subtype.|
| name | (1) Description: Name of the input method subtype. (2) Value: Label of the input method subtype.| (1) Description: Bundle name of the input method; (2) Value: Bundle name of the input method.|
| id | (1) Value: Bundle name of the input method.| (1) Value: ID of the input method subtype.|
**Adaptation Guide**
Update the code to adapt to the preceding changes.
# Theme Framework Subsystem – Screenlock Management Service Changelog
## cl.screenlock.1 Permission Change of isLocked and unlock
Changed the **isLocked** and **unlock** APIs to system APIs since API version 9.
You need to adapt your application based on the following information.
**Change Impact**
The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
- Involved APIs:
```js
function isLocked(): boolean;
function unlock(callback: AsyncCallback<boolean>): void;
function unlock():Promise<boolean>;
```
- Before change:
```js
* Checks whether the screen is currently locked.
*
* @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise.
* @syscap SystemCapability.MiscServices.ScreenLock
* @since 9
*/
function isLocked(): boolean;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @systemapi Hide this for inner system use.
* @since 9
*/
function unlock(callback: AsyncCallback<boolean>): void;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @systemapi Hide this for inner system use.
* @since 9
*/
function unlock():Promise<boolean>;
```
- After change:
```js
* Checks whether the screen is currently locked.
*
* @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.ScreenLock
* @systemapi Hide this for inner system use.
* @since 9
*/
function isLocked(): boolean;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @since 9
*/
function unlock(callback: AsyncCallback<boolean>): void;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @since 9
*/
function unlock():Promise<boolean>;
```
**Adaptation Guide**
Make sure the APIs are only invoked by system applications.
The code snippet is as follows:
```js
try {
let ret = screenLock.isLocked();
console.error(`Obtain whether the screen is locked successfully , ret is: ${ret}`);
} catch (error) {
console.error(`Failed to obtain whether the screen is locked, error is : ${error.code}, ${error.message}`);
}
```
```js
screenlock.unlock((err, data) => {
if (err) {
console.error(`Failed to unlock the screen, because: ${err.message}`);
return;
}
console.info(`unlock the screen successfully. result: ${data}`);
});
```
```js
screenlock.unlock().then((data) => {
console.info(`unlock the screen successfully. result: ${data}`);
}).catch((err) => {
console.error(`Failed to unlock the screen, because: ${err.message}`);
});
```
## cl.screenlock.2 Deprecation of isSecure
Deprecated the **isSecure** API since API version 9.
You need to adapt your application based on the following information.
**Change Impact**
The API can no longer be used after being deleted.
- Involved APIs:
```js
function isSecure(): boolean;
```
- Before change:
```js
function isSecure(): boolean;
```
- After change:
The API is deleted.
**Adaptation Guide**
Update the code so that the deprecated API is not used.
# Theme Framework Subsystem – Wallpaper Management Service Changelog
## cl.wallpaper.1 Permission Change of getColorsSync, getMinHeightSync, getMinWidthSync, restore, and setImage
Changed the **getColorsSync**, **getMinHeightSync**, **getMinWidthSync**, restore, and **setImage** APIs to system APIs since API version 9.
You need to adapt your application based on the following information.
**Change Impact**
The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
- Involved APIs:
```js
function getColorsSync(wallpaperType: WallpaperType): Array<RgbaColor>;
function getMinHeightSync(): number;
function getMinWidthSync(): number;
function restore(wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
function restore(wallpaperType: WallpaperType): Promise<void>;
function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise<void>;
```
- Before change:
```js
/**
* Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function.
* @param wallpaperType Indicates the wallpaper type.
* @returns { Array<RgbaColor> } the Array<RgbaColor> returned by the function.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function getColorsSync(wallpaperType: WallpaperType): Array<RgbaColor>;
/**
* Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function getMinHeightSync(): number;
/**
* Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function getMinWidthSync(): number;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function restore(wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function restore(wallpaperType: WallpaperType): Promise<void>;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise<void>;
```
- After change:
```js
/**
* Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function.
* @param wallpaperType Indicates the wallpaper type.
* @returns { Array<RgbaColor> } the Array<RgbaColor> returned by the function.
* @throws {BusinessError} 401 - parameter error.
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function getColorsSync(wallpaperType: WallpaperType): Array<RgbaColor>;
/**
* Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function getMinHeightSync(): number;
/**
* Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function getMinWidthSync(): number;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function restore(wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function restore(wallpaperType: WallpaperType): Promise<void>;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise<void>;
```
**Adaptation Guide**
Make sure the APIs are only invoked by system applications.
The code snippet is as follows:
```js
try {
let colors = wallpaper.getColorsSync(wallpaper.WallpaperType.WALLPAPER_SYSTEM);
console.log(`success to getColorsSync: ${JSON.stringify(colors)}`);
} catch (error) {
console.error(`failed to getColorsSync because: ${JSON.stringify(error)}`);
}
```
```js
let minHeight = wallpaper.getMinHeightSync();
```
```js
let minWidth = wallpaper.getMinWidthSync();
```
```js
wallpaper.restore(wallpaper.WallpaperType.WALLPAPER_SYSTEM, (error) => {
if (error) {
console.error(`failed to restore because: ${JSON.stringify(error)}`);
return;
}
console.log(`success to restore.`);
});
```
```js
wallpaper.restore(wallpaper.WallpaperType.WALLPAPER_SYSTEM).then(() => {
console.log(`success to restore.`);
}).catch((error) => {
console.error(`failed to restore because: ${JSON.stringify(error)}`);
});
```
```js
// The source type is string.
let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg";
wallpaper.setImage(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM, (error) => {
if (error) {
console.error(`failed to setImage because: ${JSON.stringify(error)}`);
return;
}
console.log(`success to setImage.`);
});
```
```js
// The source type is string.
let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg";
wallpaper.setImage(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM).then(() => {
console.log(`success to setImage.`);
}).catch((error) => {
console.error(`failed to setImage because: ${JSON.stringify(error)}`);
});
```
## cl.wallpaper.2 Deprecation of getIdSync, getFileSync, isChangeAllowed, isUserChangeAllowed, on, off, and RgbaColor
Deprecated the **getIdSync**, **getFileSync**, **isChangeAllowed**, **isUserChangeAllowed**, **on**, **off**, and **RgbaColor** APIs since API version 9.
You need to adapt your application based on the following information.
**Change Impact**
The APIs can no longer be used after being deleted.
- Involved APIs:
```js
function getIdSync(wallpaperType: WallpaperType): number;
function getFileSync(wallpaperType: WallpaperType): number;
function isChangeAllowed(): boolean;
function isUserChangeAllowed(): boolean;
function on(type: 'colorChange', callback: (colors: Array<RgbaColor>, wallpaperType: WallpaperType) => void): void;
function off(type: 'colorChange', callback?: (colors: Array<RgbaColor>, wallpaperType: WallpaperType) => void): void;
interface RgbaColor {
red: number;
green: number;
blue: number;
alpha: number;
}
```
- Before change:
```js
function getIdSync(wallpaperType: WallpaperType): number;
function getFileSync(wallpaperType: WallpaperType): number;
function isChangeAllowed(): boolean;
function isUserChangeAllowed(): boolean;
function on(type: 'colorChange', callback: (colors: Array<RgbaColor>, wallpaperType: WallpaperType) => void): void;
function off(type: 'colorChange', callback?: (colors: Array<RgbaColor>, wallpaperType: WallpaperType) => void): void;
interface RgbaColor {
red: number;
green: number;
blue: number;
alpha: number;
}
```
- After change:
The APIs are deleted.
**Adaptation Guide**
Update the code so that the deprecated APIs are not used.
# Bundle Manager Subsystem Changelog
## cl.bundlemanager.1 Field Change of the ApplicationInfo Struct in API Version 9
The **ApplicationInfo** struct [bundleManager/applicationInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) in API version 9 has field changes, with the **systemApp** field being added and the **entryDir** field being deleted.
**Change Impact**<br>
There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs.
**Key API/Component Changes**<br>
The following table describes the changed fields in the **ApplicationInfo** struct.
| Deleted Field| Added or Changed Field in API Version 9| Type|
| --- | --- | --- |
| N/A| systemApp | boolean |
| entryDir | N/A | string |
**Adaptation Guide**<br>
Import the bundle manager query module and use the **systemApp** field in the **ApplicationInfo** struct of API version 9. If the **entryDir** field is used, change the field because it is redundant in features where HAP decompression is not required.
## cl.bundlemanager.2 Field Change of the HapModuleInfo Struct in API Version 9
The **moduleSourceDir** field is deleted from the **HapModuleInfo** struct [bundleManager/hapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) in API version 9.
**Change Impact**<br>
There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs.
**Key API/Component Changes**<br>
The following table describes the changed fields in the **HapModuleInfo** struct.
| Deleted Field| Added or Changed Field in API Version 9| Type|
| --- | --- | --- |
| moduleSourceDir | N/A | string |
**Adaptation Guide**<br>
Import the bundle manager query module and do not use the **moduleSourceDir** field in the **HapModuleInfo** struct of API version 9. If the **moduleSourceDir** field is used, change the field because it is redundant in features where HAP decompression is not required.
# Bundle Manager Subsystem ChangeLog
## cl.bundlemanager.1 Name Change of the Bundle Manager Distributed Query Module
The name of the bundle manager distributed query module in API version 9 is changed from **ohos.bundle.distributedBundle** to **[ohos.bundle.distributedBundleManager](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.distributedBundleManager.d.ts)**. The APIs remain unchanged.
**Change Impacts**
There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt the new module.
**Key API/Component Changes**
The name of the bundle manager distributed query module is changed from **ohos.bundle.distributedBundle** to **ohos.bundle.distributedBundleManager**. The APIs remain unchanged.
**Adaptation Guide**
Change the module to import from **@ohos.bundle.distributedBundle** to **@ohos.bundle.distributedBundleManager**.
```ts
import distributedBundle form '@ohos.bundle.distributedBundleManager';
```
# ChangeLog of NFC JS API Changes in the Communication Subsystem
Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.2(Mr) has the following API changes in the distributed data management subsystem.
## cl.nfc.1 API Change
Some NFC JS APIs in API versions 6 to 8 cannot throw error codes and need to be deprecated and deleted, and then APIs in API version 9 are used instead.
You need to adapt your application based on the following information.
**Change Impacts**
Some JS APIs in API versions 6 to 8 are affected. Your application needs to adapt new APIs so that it can properly implement functions in the SDK environment of the new version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enumeration/Constant| Change Type|
| -------------------------------- | ------------- | ------------------- | -------- |
| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | FeatureType | Deprecated |
| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | isSupported | Deprecated |
| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | hasHceCapability | Added |
| api/@ohos.nfc.controller.d.ts | nfcController | isNfcAvailable | Deprecated |
| api/@ohos.nfc.controller.d.ts | nfcController | openNfc | Deprecated |
| api/@ohos.nfc.controller.d.ts | nfcController | closeNfc | Deprecated |
| api/@ohos.nfc.controller.d.ts | nfcController | enableNfc | Added |
| api/@ohos.nfc.controller.d.ts | nfcController | disableNfc | Added |
| api/@ohos.nfc.tag.d.ts | tag | getNfcATag | Deprecated |
| api/@ohos.nfc.tag.d.ts | tag | getNfcBTag | Deprecated |
| api/@ohos.nfc.tag.d.ts | tag | getNfcFTag | Deprecated |
| api/@ohos.nfc.tag.d.ts | tag | getNfcVTag | Deprecated |
| api/@ohos.nfc.tag.d.ts | tag | getNfcA | Added |
| api/@ohos.nfc.tag.d.ts | tag | getNfcB | Added |
| api/@ohos.nfc.tag.d.ts | tag | getNfcF | Added |
| api/@ohos.nfc.tag.d.ts | tag | getNfcV | Added |
| api/tag/tagSession.d.ts | TagSession | getTagInfo | Deprecated |
| api/tag/tagSession.d.ts | TagSession | connectTag | Deprecated |
| api/tag/tagSession.d.ts | TagSession | reset | Deprecated |
| api/tag/tagSession.d.ts | TagSession | isTagConnected | Deprecated |
| api/tag/tagSession.d.ts | TagSession | setSendDataTimeout | Deprecated |
| api/tag/tagSession.d.ts | TagSession | getSendDataTimeout | Deprecated |
| api/tag/tagSession.d.ts | TagSession | sendData | Deprecated |
| api/tag/tagSession.d.ts | TagSession | getMaxSendLength | Deprecated |
| api/tag/tagSession.d.ts | TagSession | connect | Added |
| api/tag/tagSession.d.ts | TagSession | resetConnection | Added |
| api/tag/tagSession.d.ts | TagSession | isConnected | Added |
| api/tag/tagSession.d.ts | TagSession | setTimeout | Added |
| api/tag/tagSession.d.ts | TagSession | getTimeout | Added |
| api/tag/tagSession.d.ts | TagSession | transmit | Added |
| api/tag/tagSession.d.ts | TagSession | getMaxTransmitSize | Added |
**Adaptation Guide**
View the following API references:
[@ohos.nfc.cardEmulation (Standard NFC Card Emulation)](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cardEmulation.md)
[@ohos.nfc.controller (Standard NFC)](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-nfcController.md)
[@ohos.nfc.tag (Standard NFC Tags)](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-nfcTag.md)
[tagSession (Standard NFC Tag Session)](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-tagSession.md)
```
```
# Bundle Manager Subsystem ChangeLog
## cl.bundlemanager.1 Changed Underlying Capability by Adding Verification to bundle-name in the Signing Certification During Application Installation
During application installation, the **bundle-name** field in the [signing certificate profile](../../../application-dev/security/app-provision-structure.md) is verified against the bundle name of the application.
If the value of **bundle-name** is different from the value of **bundleName** in the application configuration file, the installation fails and the following error information is displayed:
```
error: verify signature failed.
```
**Change Impact**
For applications using system images of 3.2.10.5 or later, if the **bundle-name** field in the signing certificate profile is different from the bundle name of the application, application installation fails. This change has no impact on applications using system images earlier than 3.2.10.5.
**Key API/Component Changes**
No API or component change is involved.
**Adaptation Guide**
If "error: verify signature failed" is displayed, change **bundle-name** in the signing certificate profile to the bundle name of the application, generate a new signing certificate (with the file name extension .p7b), and sign the application again.
For details about how to use the signing tool and generate a signing certificate, see [hapsigner Guide](../../../application-dev/security/hapsigntool-guidelines.md).
## cl.bundlemanager.2 Changed Underlying Capability by Adding Control over Applications Without Entry Icons
If no entry icon is configured for an application that has not requested the **AllowHideDesktopIcon** privilege, a default icon is displayed on the home screen. Any click on the icon redirects to the application details page. An application is determined to have no entry icon in either of the following scenarios:
1. The **abilities** field is not configured for the application.
2. The **abilities** field is configured for the application, but the **skills** field under the ability of any page type does not contain both **ohos.want.action.home** and **entity.system.home**, as follows:
```json
"skills": [
{
"actions": [
"ohos.want.action.home"
],
"entities": [
"entity.system.home"
]
}
]
```
If the application installation mode is **hdc_std install** or **bm install**, a default icon is displayed for the application on the home screen.
If your application does not need an icon to be displayed on the home screen, request the **AllowHideDesktopIcon** privilege and configure it in the signing certificate or trustlist (**install_list_capability.json**). For details, see [Application Privilege Configuration Guide](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md).
If your application needs an icon to be displayed on the home screen, select an ability from **abilities** and configure its **skills** field to contain both **ohos.want.action.home** and **entity.system.home**.
**Change Impact**
For applications using system images of 3.2.10.5 and later versions, if no entry icon is configured for an application, the default icon is displayed on the home screen when the application is installed using the CLI. This change has no impact on applications using system images earlier than 3.2.10.5.
**Key API/Component Changes**
No API or component change is involved.
**Adaptation Guide**
If your application does not need an icon to be displayed on the home screen, request the **AllowHideDesktopIcon** privilege and configure it in the signing certificate or trustlist (**install_list_capability.json**). For details, see [Application Privilege Configuration Guide](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md).
If your application needs an icon to be displayed on the home screen, select an ability from **abilities** and configure its **skills** field to contain both **ohos.want.action.home** and **entity.system.home**.
## cl.bundlemanager.3 Changed Underlying Capability by Restricting AllowAppUsePrivilegeExtension, AllowAppMultiProcess, and AllowFormVisibleNotify from Being Configured in the Signing Certificate
The **AllowAppUsePrivilegeExtension**, **AllowAppMultiProcess**, and **AllowFormVisibleNotify** privileges can no longer be configured in the signing certificate. They can be requested only through the trustlist (**install_list_capability.json**). If your application requests these privileges in the signing certificate, the installation may fail or the privileges may be invalid.
If the following error information is displayed, adapt to the new privilege configuration method. For details, see [Application Privilege Configuration Guide](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md).
```
error: install parse profile prop check error.
```
For the XTS or local debugging demo, if the **install_list_capability.json** file on the development board cannot be modified, you can change the bundle name of the application to start with **com.acts.** and request the privileges in the signing certificate.
The **AllowAppUsePrivilegeExtension** privilege is requested by configuring it under the **extensionAbilities** field, with the **type** attribute set to **dataShare** or **service**, in the application configuration file. If this privilege is not configured, the installation fails.
**Change Impact**
For applications using system images of 3.2.10.5 or later, if the required privileges are not requested using the trustlist (**install_list_capability.json**), application installation may fail. This change has no impact on applications using system images earlier than 3.2.10.5.
**Key API/Component Changes**
No API or component change is involved.
**Adaptation Guide**
If the following error information is displayed, adapt to the new privilege configuration method. For details, see [Application Privilege Configuration Guide](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md).
```
error: install parse profile prop check error.
```
For the XTS or local debugging demo, if the **install_list_capability.json** file on the development board cannot be modified, you can change the bundle name of the application to start with **com.acts.** and request the privileges in the signing certificate.
## cl.bundlemanager.4 Changed Underlying Capability by Not Decompressing the HAP During HAP Installation
The HAP will no longer be decompressed during installation. After the installation is complete, only the HAP file exists in the installation directory. As a result, the application must use the standard resource management interface, rather than a combined path, to access a resource file.
**Change Impact**
If the application uses a combined path to access a resource file, the access fails. It must use the resource management interface.
**Key API/Component Changes**
No API or component change is involved.
**Adaptation Guide**
The resource management subsystem provides the JS interface for accessing resource files. Reference: [Accessing Resource Files](../../../application-dev/reference/apis/js-apis-resource-manager.md#getrawfilecontent9)
\ No newline at end of file
# Location Subsystem ChangeLog
## cl.location.1 API Migration from @ohos.geolocation.d.ts to @ohos.geoLocationManager.d.ts
APIs in **@ohos.geolocation.d.ts** do not support throwing error codes. To support this function, all APIs in **@ohos.geolocation.d.ts** are migrated to the newly added **@ohos.geoLocationManager.d.ts** file, and corresponding error code description is added.
To use APIs of the location subsystem, you need to import **@ohos.geoLocationManager**.
import geoLocationManager from '@ohos.geoLocationManager';
**Change Impacts**
All APIs of the location subsystem are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**.
import geoLocationManager from '@ohos.geoLocationManager';
**Key API/Component Changes**
| Class | API Type | Declaration | Change Type |
| ----------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| geolocation | method | function on(type: 'locationChange', request: LocationRequest, callback: Callback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function off(type: 'locationChange', callback?: Callback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function on(type: 'locationServiceState', callback: Callback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'locationServiceState'** to **type: 'locationEnabledChange'**.|
| geolocation | method | function off(type: 'locationServiceState', callback?: Callback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'locationServiceState'** to **type: 'locationEnabledChange'**.|
| geolocation | method | function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback<Array<Location>>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'cachedGnssLocationsReporting'** to **type: 'cachedGnssLocationsChange'**.|
| geolocation | method | function off(type: 'cachedGnssLocationsReporting', callback?: Callback<Array<Location>>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'cachedGnssLocationsReporting'** to **type: 'cachedGnssLocationsChange'**.|
| geolocation | method | function on(type: 'gnssStatusChange', callback: Callback<SatelliteStatusInfo>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'gnssStatusChange'** to **type: 'satelliteStatusChange'**.|
| geolocation | method | function off(type: 'gnssStatusChange', callback?: Callback<SatelliteStatusInfo>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'gnssStatusChange'** to **type: 'satelliteStatusChange'**.|
| geolocation | method | function on(type: 'nmeaMessageChange', callback: Callback<string>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'nmeaMessageChange'** to **type: 'nmeaMessage'**.|
| geolocation | method | function off(type: 'nmeaMessageChange', callback?: Callback<string>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'nmeaMessageChange'** to **type: 'nmeaMessage'**.|
| geolocation | method | function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'fenceStatusChange'** to **type: 'gnssFenceStatusChange'**.|
| geolocation | method | function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'fenceStatusChange'** to **type: 'gnssFenceStatusChange'**.|
| geolocation | method | function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getCurrentLocation(callback: AsyncCallback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getCurrentLocation(request?: CurrentLocationRequest): Promise<Location>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getLastLocation(callback: AsyncCallback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function getLastLocation(): Location**.|
| geolocation | method | function getLastLocation(): Promise<Location>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function getLastLocation(): Location**.|
| geolocation | method | function isLocationEnabled(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isLocationEnabled(): boolean**.|
| geolocation | method | function isLocationEnabled(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isLocationEnabled(): boolean**.|
| geolocation | method | function requestEnableLocation(callback: AsyncCallback<boolean>): void; | Deleted. |
| geolocation | method | function requestEnableLocation(): Promise<boolean>; | Deleted. |
| geolocation | method | function enableLocation(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function enableLocation(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function disableLocation(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableLocation(): void**.|
| geolocation | method | function disableLocation(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableLocation(): void**.|
| geolocation | method | function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise<Array<GeoAddress>>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getAddressesFromLocationName(request: GeoCodeRequest): Promise<Array<GeoAddress>>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function isGeoServiceAvailable(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isGeocoderAvailable(): boolean**.|
| geolocation | method | function isGeoServiceAvailable(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isGeocoderAvailable(): boolean**.|
| geolocation | method | function getCachedGnssLocationsSize(callback: AsyncCallback<number>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getCachedGnssLocationsSize(): Promise<number>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function flushCachedGnssLocations(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function flushCachedGnssLocations(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function sendCommand(command: LocationCommand, callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function sendCommand(command: LocationCommand): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function enableLocationMock(callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function enableLocationMock(): void**.|
| geolocation | method | function enableLocationMock(): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function enableLocationMock(): void**.|
| geolocation | method | function disableLocationMock(callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableLocationMock(): void**.|
| geolocation | method | function disableLocationMock(): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableLocationMock(): void**.|
| geolocation | method | function setMockedLocations(config: LocationMockConfig, callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setMockedLocations(config: LocationMockConfig): void**.|
| geolocation | method | function setMockedLocations(config: LocationMockConfig): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setMockedLocations(config: LocationMockConfig): void**.|
| geolocation | method | function enableReverseGeocodingMock(callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function enableReverseGeocodingMock(): void**.|
| geolocation | method | function enableReverseGeocodingMock(): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function enableReverseGeocodingMock(): void**.|
| geolocation | method | function disableReverseGeocodingMock(callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableReverseGeocodingMock(): void**.|
| geolocation | method | function disableReverseGeocodingMock(): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableReverseGeocodingMock(): void**.|
| geolocation | method | function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>, callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>): void**.|
| geolocation | method | function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>): void**.|
| geolocation | method | function isLocationPrivacyConfirmed(type: LocationPrivacyType, callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean**.|
| geolocation | method | function isLocationPrivacyConfirmed(type: LocationPrivacyType,): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean**.|
| geolocation | method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean, callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void**.|
| geolocation | method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void**.|
| geolocation | interface | SatelliteStatusInfo | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | CachedGnssLocationsRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | GeofenceRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | Geofence | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | ReverseGeoCodeRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | GeoCodeRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | GeoAddress | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | LocationRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | CurrentLocationRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | Location | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | enum | LocationRequestPriority | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | enum | LocationRequestScenario | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | enum | GeoLocationErrorCode | Deprecated. |
| geolocation | enum | LocationPrivacyType | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | enum | LocationCommand | Migrated to **@ohos.geoLocationManager.d.ts**. |
**(Optional) Adaptation Guide**
The following sample code shows how to call **enableLocation** in the new version:
```ts
import geoLocationManager from '@ohos.geoLocationManager';
try {
geoLocationManager.enableLocation((err, data) => {
if (err) {
console.log('enableLocation: err=' + JSON.stringify(err));
}
});
} catch (err) {
console.error("errCode:" + err.code + ",errMessage:" + err.message);
}
```
# Location Subsystem ChangeLog
## cl.location.1 API Migration from @ohos.geolocation.d.ts to @ohos.geoLocationManager.d.ts
APIs in **@ohos.geolocation.d.ts** do not support throwing error codes. To support this function, all APIs in **@ohos.geolocation.d.ts** are migrated to the newly added **@ohos.geoLocationManager.d.ts** file, and corresponding error code description is added.
To use APIs of the location subsystem, you need to import **@ohos.geoLocationManager**.
import geoLocationManager from '@ohos.geoLocationManager';
**Change Impacts**
All APIs of the location subsystem are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**.
import geoLocationManager from '@ohos.geoLocationManager';
**Key API/Component Changes**
| Class | API Type | Declaration | Change Type |
| ----------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| geolocation | namespace | declare namespace geolocation | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **namespace geoLocationManager**.|
| geolocation | method | function on(type: 'locationChange', request: LocationRequest, callback: Callback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function off(type: 'locationChange', callback?: Callback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function on(type: 'locationServiceState', callback: Callback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function off(type: 'locationServiceState', callback?: Callback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback<Array<Location>>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function off(type: 'cachedGnssLocationsReporting', callback?: Callback<Array<Location>>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function on(type: 'gnssStatusChange', callback: Callback<SatelliteStatusInfo>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function off(type: 'gnssStatusChange', callback?: Callback<SatelliteStatusInfo>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function on(type: 'nmeaMessageChange', callback: Callback<string>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function off(type: 'nmeaMessageChange', callback?: Callback<string>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getCurrentLocation(callback: AsyncCallback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getCurrentLocation(request?: CurrentLocationRequest): Promise<Location>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getLastLocation(callback: AsyncCallback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getLastLocation(): Promise<Location>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function isLocationEnabled(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function isLocationEnabled(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function requestEnableLocation(callback: AsyncCallback<boolean>): void; | Deleted. |
| geolocation | method | function requestEnableLocation(): Promise<boolean>; | Deleted. |
| geolocation | method | function enableLocation(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function enableLocation(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function disableLocation(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function disableLocation(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise<Array<GeoAddress>>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getAddressesFromLocationName(request: GeoCodeRequest): Promise<Array<GeoAddress>>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function isGeoServiceAvailable(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function isGeoServiceAvailable(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getCachedGnssLocationsSize(callback: AsyncCallback<number>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function getCachedGnssLocationsSize(): Promise<number>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function flushCachedGnssLocations(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function flushCachedGnssLocations(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function sendCommand(command: LocationCommand, callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | method | function sendCommand(command: LocationCommand): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | SatelliteStatusInfo | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | CachedGnssLocationsRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | GeofenceRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | Geofence | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | ReverseGeoCodeRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | GeoCodeRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | GeoAddress | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | LocationRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | CurrentLocationRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | interface | Location | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | enum | LocationRequestPriority | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | enum | LocationRequestScenario | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | enum | GeoLocationErrorCode | Deprecated. |
| geolocation | enum | LocationPrivacyType | Migrated to **@ohos.geoLocationManager.d.ts**. |
| geolocation | enum | LocationCommand | Migrated to **@ohos.geoLocationManager.d.ts**. |
**(Optional) Adaptation Guide**
The following sample code shows how to call **enableLocation** in the new version:
```ts
import geoLocationManager from '@ohos.geoLocationManager';
try {
geoLocationManager.enableLocation((err, data) => {
if (err) {
console.log('enableLocation: err=' + JSON.stringify(err));
}
});
} catch (err) {
console.error("errCode:" + err.code + ",errMessage:" + err.message);
}
```
# Ability Subsystem Changelog
## cl.ability.1 RestartFlag Attribute Names Changed and Unsupported Attribute Deleted in appRecovery
In the **appRecovery** API, the enum names of **RestartFlag** are changed from **NO_RESTART** upon a specific fault to **RESTART** upon a specific fault.
The **CPP_CRASH_NO_RESTART** enum is deleted.
**Change Impact**
If your application uses the **CPP_CRASH_NO_RESTART**, **JS_CRASH_NO_RESTART**, or **APP_FREEZE_NO_RESTART** attribute in versions earlier than 3.2.10.6, its behavior will change after an upgrade to 3.2.10.6.
**Key API/Component Changes**
**RestartFlag** <sup>9+</sup>
Before change:
| Name | Value | Description |
| ----------------------------- | ---- | ------------------------------------------------------------ |
| ALWAYS_RESTART | 0 | The application is restarted in all cases.|
| CPP_CRASH_NO_RESTART | 0x0001 | The application is **not restarted** in the case of CPP_CRASH.|
| JS_CRASH_NO_RESTART | 0x0002 | The application is **not restarted** in the case of JS_CRASH.|
| APP_FREEZE_NO_RESTART | 0x0004 | The application is **not restarted** in the case of APP_FREEZE.|
| NO_RESTART | 0xFFFF | The application is not restarted in any case.|
After change:
| Name | Value | Description |
| ---------- | ---- | ---------- |
| ALWAYS_RESTART | 0 | The application is restarted in all cases.|
| CPP_CRASH_NO_RESTART | NA | **Deleted.** The restart in this scenario is not supported.|
| RESTART_WHEN_JS_CRASH | 0x0001 | The application is **restarted** in the case of JS_CRASH.|
| RESTART_WHEN_APP_FREEZE | 0x0002 | The application is **restarted** in the case of APP_FREEZE.|
| NO_RESTART | 0xFFFF | The application is not restarted in any case.|
**Adaptation Guide**
Perform adaptation based on the new semantics.
# Web Subsystem Changelog
Compared with earlier versions, OpenHarmony 3.2.10.7 has the following API changes in its web subsystem:
## cl.web.1 HitTestTypeV9 Name Change
Renamed the enum class **HitTestTypeV9** **WebHitTestType** to meet the naming conventions.
**Change Impact**
The enum class **HitTestTypeV9** and APIs that use **HitTestTypeV9** as a parameter or return value cannot be used in OpenHarmony 3.2.10.7 and later versions.
**Key API/Component Changes**
- Involved APIs:
enum HitTestTypeV9
- Before change:
```ts
enum HitTestTypeV9
```
- After change:
```ts
enum WebHitTestType
```
**Adaptation Guide**
Replace **HitTestTypeV9** with **WebHitTestType**.
## cl.web.2 HeaderV9 Name Change
Renamed the struct **HeaderV9** **WebHeader** to meet the naming conventions.
**Change Impact**
The struct **HeaderV9** and APIs that use **HeaderV9** as a parameter or return value cannot be used in OpenHarmony 3.2.10.7 and later versions.
**Key API/Component Changes**
- Involved APIs:
interface HeaderV9
- Before change:
```ts
interface HeaderV9
```
- After change:
```ts
interface WebHeader
```
**Adaptation Guide**
Replace **HeaderV9** with **WebHeader**.
## cl.web.3 Member Change of HitTestValue
Rename the member variable **HitTestTypeV9** in the **HitTestValue** struct **WebHitTestType** to meet the naming conventions.
**Change Impact**
The struct **HitTestValue** and APIs that use **HitTestValue** as a parameter or return value cannot be used in OpenHarmony 3.2.10.7 and later versions.
**Key API/Component Changes**
- Involved APIs:
interface HitTestValue
- Before change:
```ts
interface HitTestValue {
/**
* Get the hit test type.
*
* @since 9
*/
type: HitTestTypeV9;
/**
* Get the hit test extra data.
*
* @since 9
*/
extra: string;
}
```
- After change:
```ts
interface HitTestValue {
/**
* Get the hit test type.
*
* @since 9
*/
type: WebHitTestType;
/**
* Get the hit test extra data.
*
* @since 9
*/
extra: string;
}
```
**Adaptation Guide**
Replace **HitTestTypeV9** with **WebHitTestType**.
## cl.web.4 Parameter Type Change of loadUrl
Changed the type of the **headers** parameter in **loadUrl** to **WebHeader** to meet the naming conventions.
**Change Impact**
The **loadUrl** API that uses the **headers** parameter cannot be used in OpenHarmony 3.2.10.7 and later versions.
**Key API/Component Changes**
- Involved APIs:
loadUrl(url: string | Resource, headers?: Array\<HeaderV9>): void
- Before change:
```ts
loadUrl(url: string | Resource, headers?: Array<HeaderV9>): void
```
- After change:
```ts
loadUrl(url: string | Resource, headers?: Array<WebHeader>): void
```
**Adaptation Guide**
Change the type of the **headers** parameter in **loadUrl** from **HeaderV9** to **WebHeader**.
## cl.web.5 Return Value Type Change of getHitTest
Changed the return value type of the **getHitTest** API to **WebHitTest** to meet the naming conventions.
**Change Impact**
The **getHitTest** API cannot be used in OpenHarmony 3.2.10.7 and later versions.
**Key API/Component Changes**
- Involved APIs:
getHitTest(): HitTestTypeV9
- Before change:
```ts
getHitTest(): HitTestTypeV9
```
- After change:
```ts
getHitTest(): WebHitTestType
```
**Adaptation Guide**
Change the return value type of the **getHitTest** API from **HitTestTypeV9** to **WebHitTestType**.
## cl.web.6 Moving of the WebMessagePort Class
Moved the **WebMessagePort** class to **@ohos.web.webview.d.ts** and added error throwing.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. In addition, be mindful of the error codes now that the APIs in the class support error code processing.
**Key API/Component Changes**
- Involved APIs:
postMessageEvent(message: WebMessageEvent): void;
onMessageEvent(callback: (result: string) => void): void;
- Before change:
```ts
postMessageEvent(message: WebMessageEvent): void;
onMessageEvent(callback: (result: string) => void): void;
```
- After change:
```ts
postMessageEvent(message: WebMessage): void;
onMessageEvent(callback: (result: WebMessage) => void): void;
```
**Adaptation Guide**
Instead of importing APIs from the original **WebMessagePort** class, import APIs from **@ohos.web.webview** as follows:
```ts
import web_webview from '@ohos.web.webview';
```
## cl.web.7 Moving of the HitTestValue Class
Moved the **HitTestValue** class to **@ohos.web.webview.d.ts**; changed **HitTestValue** from a class to an API; changed the **getType** and **getExtra** from APIs to attributes.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed.
**Key API/Component Changes**
- Involved APIs:
getType(): HitTestType;
getExtra(): string;
- Before change:
```ts
getType(): HitTestType;
getExtra(): string;
```
- After change:
```ts
type: WebHitTestType;
extra: string;
```
**Adaptation Guide**
Instead of importing APIs from the original **HitTestValue** class, import APIs from **@ohos.web.webview** as follows:
```ts
import web_webview from '@ohos.web.webview';
```
## cl.web.8 Moving of API Version 9 APIs Under WebCookie
Moved APIs of API version 9 in the **WebCookie** class to **web.webview.webview.WebCookieManager**
and added error throwing.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. In addition, be mindful of the error codes now that the APIs in the class support error code processing.
The APIs in the class are static.
**Key API/Component Changes**
- Involved APIs:
isCookieAllowed(): boolean;
isThirdPartyCookieAllowed(): boolean;
putAcceptCookieEnabled(accept: boolean): void;
putAcceptThirdPartyCookieEnabled(accept: boolean): void;
setCookie(url: string, value: string): boolean;
saveCookieSync(): boolean;
getCookie(url: string): string;
existCookie(): boolean;
deleteEntireCookie(): void;
deleteSessionCookie(): void;
- Before change:
```ts
isCookieAllowed(): boolean;
isThirdPartyCookieAllowed(): boolean;
putAcceptCookieEnabled(accept: boolean): void;
putAcceptThirdPartyCookieEnabled(accept: boolean): void;
setCookie(url: string, value: string): boolean;
saveCookieSync(): boolean;
getCookie(url: string): string;
existCookie(): boolean;
deleteEntireCookie(): void;
deleteSessionCookie(): void;
```
- After change:
```ts
static isCookieAllowed(): boolean;
static isThirdPartyCookieAllowed(): boolean;
static putAcceptCookieEnabled(accept: boolean): void;
static putAcceptThirdPartyCookieEnabled(accept: boolean): void;
static setCookie(url: string, value: string): void;
static saveCookieAsync(): Promise<void>;
static saveCookieAsync(callback: AsyncCallback<void>): void;
static getCookie(url: string): string;
static existCookie(): boolean;
static deleteEntireCookie(): void;
static deleteSessionCookie(): void;
```
**Adaptation Guide**
Instead of importing APIs from the original **WebCookie** class, import APIs from **@ohos.web.webview** as follows:
```ts
import web_webview from '@ohos.web.webview';
```
## cl.web.9 Moving of API Version 9 APIs Under WebController
Moved APIs of API version 9 in the **WebController** class to **web.webview.webview.WebviewController** and added error throwing.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. In addition, be mindful of the error codes now that the APIs in the class support error code processing.
The **getDefaultUserAgent** API is renamed **getUserAgent**.
**Key API/Component Changes**
- Involved APIs:
zoomIn(): boolean;
zoomOut(): boolean;
createWebMessagePorts(): Array\<WebMessagePort>;
postMessage(options: { message: WebMessageEvent, uri: string}): void;
getHitTestValue(): HitTestValue;
getWebId(): number;
getDefaultUserAgent(): string;
getTitle(): string;
getPageHeight(): number;
backOrForward(step: number): void;
searchAllAsync(searchString: string): void;
clearMatches(): void;
searchNext(forward: boolean): void;
clearSslCache(): void;
clearClientAuthenticationCache(): void;
getUrl(): string;
- Before change:
```ts
zoomIn(): boolean;
zoomOut(): boolean;
createWebMessagePorts(): Array<WebMessagePort>;
postMessage(options: { message: WebMessageEvent, uri: string}): void;
getHitTestValue(): HitTestValue;
getWebId(): number;
getDefaultUserAgent(): string;
getTitle(): string;
getPageHeight(): number;
backOrForward(step: number): void;
searchAllAsync(searchString: string): void;
clearMatches(): void;
searchNext(forward: boolean): void;
clearSslCache(): void;
clearClientAuthenticationCache(): void;
getUrl(): string;
```
- After change:
```ts
zoomIn(): void;
zoomOut(): void;
createWebMessagePorts(): Array<WebMessagePort>;
postMessage(name: string, ports: Array<WebMessagePort>, uri: string): void;
getHitTestValue(): HitTestValue;
getWebId(): number;
getUserAgent(): string;
getTitle(): string;
getPageHeight(): number;
backOrForward(step: number): void;
searchAllAsync(searchString: string): void;
clearMatches(): void;
searchNext(forward: boolean): void;
clearSslCache(): void;
clearClientAuthenticationCache(): void;
getUrl(): string;
```
**Adaptation Guide**
Instead of importing APIs from the original **WebController** class, import APIs from **@ohos.web.webview** as follows:
```ts
import web_webview from '@ohos.web.webview';
```
## cl.web.10 Moving of the WebAsyncController Class
Moved the APIs in the **WebAsyncController** class to the **web.webview.webview.WebviewController** class and added error throwing.
**Change Impact**
If your application is developed based on earlier versions, pay attention to error code processing.
**Key API/Component Changes**
- Involved APIs:
storeWebArchive(baseName: string, autoName: boolean): Promise\<string>;
storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback\<string>): void;
- Before change:
```ts
storeWebArchive(baseName: string, autoName: boolean): Promise<string>;
storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback<string>): void;
```
- After change:
```ts
storeWebArchive(baseName: string, autoName: boolean): Promise<string>;
storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback<string>): void;
```
**Adaptation Guide**
Example:
```ts
// xxx.ets
import web_webview from '@ohos.web.webview'
@Entry
@Component
struct WebComponent {
controller: web_webview.WebviewController = new web_webview.WebviewController();
build() {
Column() {
Button('saveWebArchive')
.onClick(() => {
try {
this.controller.storeWebArchive("/data/storage/el2/base/", true, (error, filename) => {
if (error) {
console.info(`save web archive error: ` + JSON.stringify(error))
return;
}
if (filename != null) {
console.info(`save web archive success: ${filename}`)
}
});
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
})
Web({ src: 'www.example.com', controller: this.controller })
}
}
}
```
## cl.web.11 Removal of webDebuggingAccess
The definition of the **webDebuggingAccess** API is inappropriate. This API should take effect for all **Web** instances. In light of this, it is removed and replaced by the new API **setWebDebuggingAccess**.
**Change Impacts**
This API must be deprecated and replaced with the **setWebDebuggingAccess** API.
**Key API/Component Changes**
| Class| API Type| Declaration| Change Type|
| -- | -- | -- | -- |
|WebAttribute | method | webDebugggingAccess(webDebugggingAccess: boolean): WebAttribute| Deleted|
**Adaptation Guide**
Use the new API **setWebDebuggingAccess**.
## cl.web.12 Adding of setWebDebuggingAccess
Added the static API **setWebDebuggingAccess** to **WebviewController**. It sets whether to enable web debugging works for all **Web** instances.
**Change Impacts**
The original **webDebugggingAccess** API must be replaced with the new API in the application.
**Key API/Component Changes**
| Class| API Type| Declaration| Change Type|
| -- | -- | -- | -- |
|webview.WebviewController | method | static setWebDebugggingAccess(webDebugggingAccess: boolean): void| Added|
**Adaptation Guide**
The following exemplifies how to enable web debugging:
```ts
// xxx.ets
import web_webview from '@ohos.web.webview';
@Entry
@Component
struct WebComponent {
controller: web_webview.WebviewController = new web_webview.WebviewController();
aboutToAppear():void {
try {
web_webview.WebviewController.setWebDebuggingAccess(true);
} catch(error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
}
build() {
Column() {
Web({ src: 'www.example.com', controller: this.controller })
}
}
}
```
# ArkUI Subsystem Changelog
## cl.arkui.1 Return Value Type Change of getInspectorTree
**Change Impact**
The code that uses the **getInspectorTree** API in versions earlier than OpenHarmony 3.2.10.7 must be adapted.
**Key API/Component Changes**
The return value of the **getInspectorTree** API is changed from the string type to the Object type.
**Adaptation Guide**
Adapt the code that takes the return value of **getInspectorTree** as a string.The sample code is as follows:
- Before change:
```typescript
console.info(getInspectorTree())
```
- After change:
```typescript
console.info(JSON.stringify(getInspectorTree()))
```
## cl.arkui.2 Deprecation the forceRebuild Attribute of \<GridItem>
**Change Impact**
None. The attribute has no effect.
**Key API/Component Changes**
Deprecate the **forceRebuild** attribute of the **\<GridItem>** component.
**Adaptation Guide**
Delete the code that uses the **forceRebuild** attribute. This will not affect the functionality of the **\<GridItem>** component.
## cl.arkui.3 Plugin Module API Changes
### 1. API Change in the **PluginComponentTemplate** Module
Renamed the **ability** parameter **bundleName** to more clearly indicate the intended meaning.
You need to adapt your application.
**Change Impact**
The application developed based on earlier versions must be adapted to the change. Otherwise, build errors will occur.
**Key API/Component Changes**
- Involved APIs:
interface PluginComponentTemplate {
source: string;
bundleName: string;
}
interface PluginComponentInterface {
(value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute;
}
- Before change:
```js
interface PluginComponentTemplate { source: string; ability: string; }
interface PluginComponentInterface {
(value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute;
}
```
- After change:
```js
interface PluginComponentTemplate { source: string; bundleName: string; }
interface PluginComponentInterface {
(value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute;
}
```
**Adaptation Guide**
Use the new API. The sample code is as follows:
- Before change:
```js
PluginComponent({
template: { source: 'plugincomponent1', ability: 'com.example.plugin' },
data: { 'countDownStartValue': 'new countDownStartValue' }
}).size({ width: 500, height: 100 })
```
- After change:
```js
PluginComponent({
template: { source: 'plugincomponent1', bundleName: 'com.example.plugin' },
data: { 'countDownStartValue': 'new countDownStartValue' }
}).size({ width: 500, height: 100 })
```
### 2. API Change in the **pluginComponentManager** Module
Renamed the **want** parameter **target** to more clearly indicate the intended meaning.
You need to adapt your application.
**Change Impact**
The application developed based on earlier versions must be adapted to the change. Otherwise, alarms will arise. Though the build may be successful, the API will not work as intended.
**Key API/Component Changes**
- Involved APIs:
interface PushParameterForStage {
owner: Want;
target: Want;
name: string;
data: KVObject;
extraData: KVObject;
jsonPath?: string;
}
function push(param: PushParameterForStage, callback: AsyncCallback\<void>): void;
interface RequestParameterForStage {
owner: Want;
target: Want;
name: string;
data: KVObject;
jsonPath?: string;
}
function request(param: RequestParameterForStage, callback: AsyncCallback\<RequestCallbackParameters>): void;
- Before change:
```js
interface PushParameterForStage {
owner: Want;
want: Want;
name: string;
data: KVObject;
extraData: KVObject;
jsonPath?: string;
}
function push(param: PushParameterForStage, callback: AsyncCallback<void>): void;
interface RequestParameterForStage {
owner: Want;
want: Want;
name: string;
data: KVObject;
jsonPath?: string;
}
function request(param: RequestParameterForStage, callback: AsyncCallback<RequestCallbackParameters>): void;
```
- After change:
```js
interface PushParameterForStage {
owner: Want;
target: Want;
name: string;
data: KVObject;
extraData: KVObject;
jsonPath?: string;
}
function push(param: PushParameterForStage, callback: AsyncCallback<void>): void;
interface RequestParameterForStage {
owner: Want;
target: Want;
name: string;
data: KVObject;
jsonPath?: string;
}
function request(param: RequestParameterForStage, callback: AsyncCallback<RequestCallbackParameters>): void;
```
**Adaptation Guide**
Use the new API. The sample code is as follows:
- Before change:
```js
import pluginComponentManager from '@ohos.pluginComponent'
pluginComponentManager.push({
owner:{
bundleName:"com.example.provider",
abilityName:"com.example.provider.MainAbility"
},
want: {
bundleName: "com.example.provider",
abilityName: "com.example.provider.MainAbility",
},
name: "ets/pages/plugin2.js",
data: {
"js": "ets/pages/plugin.js",
"key_1": 1111,
},
extraData: {
"extra_str": "this is push event"
},
jsonPath: "",
},
(err, data) => {
console.log("push_callback:err: " ,JSON.stringify(err));
console.log("push_callback:data: " , JSON.stringify(data));
console.log("push_callback: push ok!");
}
)
pluginComponentManager.request({
owner:{
bundleName:"com.example.provider",
abilityName:"com.example.provider.MainAbility"
},
want: {
bundleName: "com.example.provider",
abilityName: "ets/pages/plugin2.js",
},
name: "plugintemplate",
data: {
"key_1": " myapplication plugin component test",
"key_2": 123456
},
jsonPath: "",
},
(err, data) => {
console.log("request_callback: componentTemplate.ability=" + data.componentTemplate.ability)
console.log("request_callback: componentTemplate.source=" + data.componentTemplate.source)
}
)
```
- After change:
```js
import pluginComponentManager from '@ohos.pluginComponent'
pluginComponentManager.push({
owner:{
bundleName:"com.example.provider",
abilityName:"com.example.provider.MainAbility"
},
target: {
bundleName: "com.example.provider",
abilityName: "com.example.provider.MainAbility",
},
name: "ets/pages/plugin2.js",
data: {
"js": "ets/pages/plugin.js",
"key_1": 1111,
},
extraData: {
"extra_str": "this is push event"
},
jsonPath: "",
},
(err, data) => {
console.log("push_callback:err: " ,JSON.stringify(err));
console.log("push_callback:data: " , JSON.stringify(data));
console.log("push_callback: push ok!");
}
)
pluginComponentManager.request({
owner:{
bundleName:"com.example.provider",
abilityName:"com.example.provider.MainAbility"
},
target: {
bundleName: "com.example.provider",
abilityName: "ets/pages/plugin2.js",
},
name: "plugintemplate",
data: {
"key_1": " myapplication plugin component test",
"key_2": 123456
},
jsonPath: "",
},
(err, data) => {
console.log("request_callback: componentTemplate.ability=" + data.componentTemplate.ability)
console.log("request_callback: componentTemplate.source=" + data.componentTemplate.source)
}
)
```
# Ability Framework Changelog
Compared with OpenHarmony 3.2 Release, OpenHarmony 3.2.12.2 provides more detailed error code information for the APIs of the ability framework.
## cl.ability.1 Added and Optimized API Error Code Description
The error code description and all error codes that may be returned by the APIs are commented out. This helps developers control the error process more accurately.
**Change Impact**
The external declaration of the JS APIs of API version 9 is affected, but the API functionalities are not affected. You can determine whether to adapt to the JS APIs.
**Key API/Component Changes**
The comments of the following modules are updated. For details, see the corresponding external API declaration and API development guide.
| Module | Description of Major Changes |
| ----------------------------------- | ------------------------------------------------------------ |
| @ohos.app.ability.UIAbility | Added the description of error codes 16200001, 16200002, 16200004, 16200005, 16000050.|
| @ohos.app.ability.abilityManager | Added the description of error codes 201, 202, and 16000050, and adjusted the description of error code 401.|
| @ohos.app.ability.appManager | Added the description of error codes 201, 202, and 16000050, and adjusted the description of error code 401.|
| @ohos.app.ability.dataUriUtils | Added the description of error code 401. |
| @ohos.app.ability.errorManager | Added the description of error code 16000003. |
| @ohos.app.ability.missionManager | Added the description of error codes 201, 202, 16300001, 16300002, and 16000009, and adjusted the description of error code 401.|
| @ohos.app.ability.quickFixManager | Added the description of error codes 201, 202, 18500001, 18500002, and 18500008. |
| @ohos.app.ability.wantAgent | Added the description of error codes 16000007, 16000015, and 16000151. |
| application/AbilityDelegator | Added the description of error codes 16000001, 16000002, 16000004, 16000005, 16000006, 16000008, 16000009, 16000010, 16000011, 16000050, 16000053, 16000055, 16200001, and 16000100.|
| application/ApplicationContext | Added the description of error codes 16000011 and 16000050. |
| application/Context | Added the description of error codes 201, 202, and 401. |
| application/ServiceExtensionContext | Added the description of error codes 201, 202, 16000001, 16000002, 16000004, 16000005, 16000006, 16000008, 16000009, 16000010, 16000011, 16000050, 16000053, 16000055, and 16200001.|
| application/UIAbilityContext | Added the description of error codes 201, 16000001, 16000002, 16000004, 16000005, 16000006, 16000008, 16000009, 16000010, 16000011, 16000050, 16000053, 16000055, 16200001, and 16000100.|
| @ohos.app.form.formHost | Added the description of error codes 201, 202, 16500050, 16500060, 16501000, 16501001, and 16501003, and adjusted the description of error code 401.|
| @ohos.app.form.formProvider | Added the error codes 202, 16500050, 16500060, 16500100, 16501000, 16501001, 16501002, and 16501003, and adjusted the description of error code 401.|
| application/FormExtensionContext | Added the description of error codes 202, 401, 16500050, 16500100, 16500101, and 16501000.|
# Notification Subsystem Changelog
Compared with OpenHarmony 3.2 Release, OpenHarmony 3.2.12.2 provides more detailed error code information for the APIs of the notification subsystem.
## cl.notification.1 Added and Optimized API Error Code Description
The error code description and all error codes that may be returned by the APIs are commented out. This helps developers control the error process more accurately.
**Change Impact**
The external declaration of the JS APIs of API version 9 is affected, but the API functionalities are not affected. You can determine whether to adapt to the JS APIs.
**Key API/Component Changes**
The comments of the following modules are updated. For details, see the corresponding external API declaration and API development guide.
| Module | Major Change |
| --------------------------- | ------------------------------------------------------------ |
| @ohos.commonEventManager | Added the description of error codes 801, 1500007, and 1500008. |
| @ohos.notificationManager | Added the description of error codes 201, 202, 1600001, 1600002, 1600003, 1600004, 1600005, 1600007, 1600008, 1600009, 1600010, and 17700001, and adjusted the description of error code 401.|
| @ohos.notificationSubscribe | Added the description of error codes 201, 202, 1600001, 1600002, 1600003, 1600007, 1600008, and 17700001, and adjusted the description of error code 401.|
# File Management Subsystem ChangeLog
## cl.filemanagement.1 File I/O API Changes
The return value of file I/O APIs of **file_api** does not contain the error code. The original APIs are deprecated, and new APIs are added.
**Change Impacts**
For applications developed based on earlier versions, pay attention to the iterative update of discarded APIs. The specifications of the new APIs are slightly adjusted. Pay attention to the usage of the new APIs.
**Key API/Component Changes**
For the adaptation to the unified API exception handling mode, related file I/O APIs are deprecated, and corresponding new APIs are added. Original APIs are stored in **@ohos.fileio**, and the new ones are stored in **@ohos.file.fs**. The newly added APIs support unified error code handling specifications and function the same as the original APIs. The parameters are slightly adjusted.
| Module | Method/Attribute/Enumeration/Constant | Change Type|
| ------------- | ------------------------------------------------------------ | -------- |
| @ohos.fileio | **function** open(path: string, flags?: number, mode?: number, callback?: AsyncCallback<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**
The original APIs use **@ohos.fileio**, which is imported as follows:
```js
import fileio from '@ohos.fileio';
```
The new APIs use **@ohos.file.fs**, which is imported as follows:
```js
import fs from '@ohos.file.fs';
```
In addition, exception handling needs to be adapted. Sample code for synchronous API exception handling is as follows:
```js
import fs from '@ohos.file.fs'
try {
let file = fs.openSync(path, fs.OpenMode.READ_ONLY);
} catch (err) {
console.error("openSync errCode:" + err.code + ", errMessage:" + err.message);
}
```
Sample code for handling exceptions of the **promise** method of an asynchronous API:
```js
import fs from '@ohos.file.fs'
try {
let file = await fs.open(path, fs.OpenMode.READ_ONLY);
} catch (err) {
console.error("open promise errCode:" + err.code + ", errMessage:" + err.message);
}
```
Sample code for handling exceptions of the **callback** method of an asynchronous API:
```js
import fs from '@ohos.file.fs'
try {
fs.open(path, fs.OpenMode.READ_ONLY, function(e, file){ // Asynchronous thread (such as system call) errors are obtained from the callback.
if (e) {
console.error("open in async errCode:" + e.code + ", errMessage:" + e.message);
}
});
} catch (err) {// Errors (such as invalid parameters) of the main thread are obtained through try catch.
console.error("open callback errCode:" + err.code + ", errMessage:" + err.message);
}
```
# Upload and Download Subsystem ChangeLog
Compared with OpenHarmony 3.2 Beta3, OpenHarmony 3.2.8.1 has the following changes in its upload and download subsystem:
## cl.request.1 Changes of Error Code Definitions and Some API Names
- The processing of the [upload and download error codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-request.md) is added to the upload and download APIs.
- An error message is returned via **AsyncCallback** or the **error** object of **Promise**. An error message related to the parameter type or quantity is returned via an exception.
- Some APIs need to be replaced with new APIs, and the parameters remain unchanged.
**Change Impacts**
The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enumeration/Constant | Change Type|
| -------------- | -------------------------- | ------------------------------------------------------------ | -------- |
| ohos.request | request | EXCEPTION_PERMISSION | Added |
| ohos.request | request | EXCEPTION_PARAMCHECK | Added |
| ohos.request | request | EXCEPTION_UNSUPPORTED | Added |
| ohos.request | request | EXCEPTION_FILEIO | Added |
| ohos.request | request | EXCEPTION_FILEPATH | Added |
| ohos.request | request | EXCEPTION_SERVICE | Added |
| ohos.request | request | EXCEPTION_OTHERS | Added |
| ohos.request | request | ERROR_OFFLINE | Added |
| ohos.request | request | ERROR_UNSUPPORTED_NETWORK_TYPE | Added |
| ohos.request | request | function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void; | Added |
| ohos.request | request | function downloadFile(context: BaseContext, config: DownloadConfig): Promise<DownloadTask>; | Added |
| ohos.request | request | function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback<UploadTask>): void; | Added |
| ohos.request | request | function uploadFile(context: BaseContext, config: UploadConfig): Promise<UploadTask>; | Added |
| ohos.request | DownloadTask | delete(callback: AsyncCallback<boolean>): void; | Added |
| ohos.request | DownloadTask | delete(): Promise<boolean>; | Added |
| ohos.request | DownloadTask | suspend(callback: AsyncCallback<boolean>): void; | Added |
| ohos.request | DownloadTask | suspend(): Promise<boolean>; | Added |
| ohos.request | DownloadTask | restore(callback: AsyncCallback<boolean>): void; | Added |
| ohos.request | DownloadTask | restore(): Promise<boolean>; | Added |
| ohos.request | DownloadTask | getTaskInfo(callback: AsyncCallback<DownloadInfo>): void; | Added |
| ohos.request | DownloadTask | getTaskInfo(): Promise<DownloadInfo>; | Added |
| ohos.request | DownloadTask | getTaskMimeType(callback: AsyncCallback<string>): void; | Added |
| ohos.request | DownloadTask | getTaskMimeType(): Promise<string>; | Added |
| ohos.request | UploadTask | delete(callback: AsyncCallback<boolean>): void; | Added |
| ohos.request | UploadTask | delete(): Promise<boolean>; | Added |
| ohos.request | request | function download(config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void;<br>Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void;| Deprecated |
| ohos.request | request | function download(config: DownloadConfig): Promise<DownloadTask>;<br>Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig): Promise<DownloadTask>; | Deprecated |
| ohos.request | request | function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void;<br>Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void; | Deprecated |
| ohos.request | request | function download(context: BaseContext, config: DownloadConfig): Promise<DownloadTask>;<br>Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig): Promise<DownloadTask>; | Deprecated |
| ohos.request | request | function upload(config: UploadConfig, callback: AsyncCallback<UploadTask>): void;<br>Substitute API: function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback<UploadTask>): void; | Deprecated |
| ohos.request | request | function upload(config: UploadConfig): Promise<UploadTask>;<br>Substitute API: function uploadFile(context: BaseContext, config: UploadConfig): Promise<UploadTask>; | Deprecated |
| ohos.request | request | function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback<UploadTask>): void;<br>Substitute API: function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback<UploadTask>): void; | Deprecated |
| ohos.request | request | function upload(context: BaseContext, config: UploadConfig): Promise<UploadTask>;<br>Substitute API: function uploadFile(context: BaseContext, config: UploadConfig): Promise<UploadTask>; | Deprecated |
| ohos.request | DownloadTask | remove(callback: AsyncCallback<boolean>): void;<br>Substitute API: delete(callback: AsyncCallback<boolean>): void | Deprecated |
| ohos.request | DownloadTask | remove(): Promise<boolean>;<br>Substitute API: delete(): Promise<boolean>; | Deprecated |
| ohos.request | DownloadTask | pause(callback: AsyncCallback<boolean>): void;<br>Substitute API: suspend(callback: AsyncCallback<boolean>): void; | Deprecated |
| ohos.request | DownloadTask | pause(): Promise<boolean>;<br>Substitute API: suspend(): Promise<boolean>; | Deprecated |
| ohos.request | DownloadTask | resume(callback: AsyncCallback<boolean>): void;<br>Substitute API: restore(callback: AsyncCallback<boolean>): void; | Deprecated |
| ohos.request | DownloadTask | resume(): Promise<boolean>;<br>Substitute API: restore(): Promise<boolean>; | Deprecated |
| ohos.request | DownloadTask | query(callback: AsyncCallback<DownloadInfo>): void;<br>Substitute API: getTaskInfo(callback: AsyncCallback<DownloadInfo>): void; | Deprecated |
| ohos.request | DownloadTask | query(): Promise<DownloadInfo>;<br>Substitute API: getTaskInfo(): Promise<DownloadInfo>; | Deprecated |
| ohos.request | DownloadTask | queryMimeType(callback: AsyncCallback<string>): void;<br>Substitute API: getTaskMimeType(callback: AsyncCallback<string>): void; | Deprecated |
| ohos.request | DownloadTask | queryMimeType(): Promise<string>;<br>Substitute API: getTaskMimeType(): Promise<string>; | Deprecated |
| ohos.request | UploadTask | remove(callback: AsyncCallback<boolean>): void;<br>Substitute API: delete(callback: AsyncCallback<boolean>): void; | Deprecated |
| ohos.request | UploadTask | remove(): Promise<boolean>;<br>Substitute API: delete(): Promise<boolean>; | Deprecated |
| system.request | UploadResponse | code | Deprecated |
| system.request | UploadResponse | data | Deprecated |
| system.request | UploadResponse | headers | Deprecated |
| system.request | DownloadResponse | token | Deprecated |
| system.request | OnDownloadCompleteResponse | uri | Deprecated |
| system.request | RequestFile | filename | Deprecated |
| system.request | RequestFile | name | Deprecated |
| system.request | RequestFile | uri | Deprecated |
| system.request | RequestFile | type | Deprecated |
| system.request | RequestData | name | Deprecated |
| system.request | RequestData | value | Deprecated |
| system.request | UploadRequestOptions | url | Deprecated |
| system.request | UploadRequestOptions | data | Deprecated |
| system.request | UploadRequestOptions | files | Deprecated |
| system.request | UploadRequestOptions | header | Deprecated |
| system.request | UploadRequestOptions | description | Deprecated |
| system.request | UploadRequestOptions | success | Deprecated |
| system.request | UploadRequestOptions | fail | Deprecated |
| system.request | UploadRequestOptions | complete | Deprecated |
| system.request | OnDownloadCompleteOptions | token | Deprecated |
| system.request | OnDownloadCompleteOptions | success | Deprecated |
| system.request | OnDownloadCompleteOptions | fail | Deprecated |
| system.request | OnDownloadCompleteOptions | complete | Deprecated |
| system.request | Request | static upload(options: UploadRequestOptions): void; | Deprecated |
| system.request | Request | static download(options: DownloadRequestOptions): void; | Deprecated |
| system.request | Request | static onDownloadComplete(options: OnDownloadCompleteOptions): void; | Deprecated |
**Adaptation Guide**
The following uses **downloadFile** as an example to show how it is called in the new version:
```ts
try {
request.downloadFile(globalThis.abilityContext, { url: 'https://xxxx/xxxxx.hap',
filePath: 'xxx/xxxxx.hap'}, (err, data) => {
if (err) {
console.error('Failed to request the download. Cause: ' + JSON.stringify(err));
return;
}
});
} catch (err) {
console.log("downloadFile callback fail." + "errCode:" + err.code + ",errMessage:" + err.message);
}
```
# Bundle Manager Subsystem ChangeLog
## cl.bundlemanager.1 Bundle Manager API Changes
The bundle manager APIs use service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. APIs in API version 8 and earlier are deprecated. Replace them with APIs in API version 9 instead.
**Change Impacts**
The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs (version 9) and their method for returning API error information. Otherwise, the original service logic will be affected.
**Key API/Component Changes**
The new APIs are classified by module. The original **d.ts** file is divided into multiple ones. You can import the **d.ts** files as required. The newly added APIs support unified error code handling specifications and function the same as the original APIs. APIs whose functions are changed or added are listed separately.
For adaptation to the unified API exception handling mode, bundle manager APIs (version 8 and earlier) are deprecated (original APIs in the following table) and corresponding new APIs (version 9) in the following table are added.
| Original API (Deprecated) | New API (Added) |
| ------------------------------------ | ------------------------------------------------------------ |
| @ohos.bundle.d.ts | [@ohos.bundle.bundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) |
| @ohos.bundle.d.ts | [@ohos.bundle.freeInstall.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.freeInstall.d.ts) |
| @ohos.bundle.d.ts | [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts) |
| @ohos.bundle.innerBundleManager.d.ts | [@ohos.bundle.launcherBundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.launcherBundleManager.d.ts) |
| @ohos.bundle.innerBundleManager.d.ts | [@ohos.bundle.bundleMonitor.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleMonitor.d.ts) |
| @ohos.bundle.defaultAppManager.d.ts | [@ohos.bundle.defaultAppManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.defaultAppManager.d.ts) |
| @ohos.distributedBundle.d.ts | [@ohos.bundle.distributedBundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.distributedBundleManager.d.ts) |
| N/A | [@ohos.bundle.appControl.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.appControl.d.ts) |
| @system.package.d.ts | N/A |
**Adaptation Guide**
1. Call the bundle manager query API.
```
import bundle form '@ohos.bundle.bundleManager'
```
2. Call the bundle manager installation and uninstallation API.
```
import installer form '@ohos.bundle.installer'
```
3. Call the bundle manager installation-free API.
```
import freeInstall form '@ohos.bundle.freeInstall'
```
4. Call the bundle manager launcher APIs.
```
import launcherBundleManager form '@ohos.bundle.launcherBundleManager'
import bundleMonitor form '@ohos.bundle.bundleMonitor'
```
6. Call the bundle manager API for the default application.
```
import defaultAppManager form '@ohos.bundle.defaultAppManager'
```
7. Call the distributed bundle manager API.
```
import distributedBundle form '@ohos.bundle.distributedBundle'
```
In addition, exception handling is needed. For details, see the API reference for the new APIs.
## cl.bundlemanager.1 Bundle Manager API Structure Changes
The bundle manager APIs use service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. The structures of APIs in API version 8 and earlier are deprecated. Use the structures of APIs in API version 9 instead.
**Change Impacts**
The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt new structures. Otherwise, the original service logic will be affected. The export function of original level-2 modules will also be deprecated. Instead, the level-2 modules' export function of new APIs will be used, and new level-1 d.ts modules are imported.
**Key API/Component Changes**
The structures of APIs in API version 8 and earlier are sorted out and deprecated, and those of new APIs in API version 9 are added. The following table lists the comparison before and after the change. Some structures are combined. For example, replace **moduleInfo.d.ts** with **hapModuleInfo.d.ts** and **customizeData.d.ts** with **metadata.d.ts**. The structures' functions are the same as those of the original ones. Structures whose attributes are changed or added are listed separately.
| Original Structure (Deprecated) | New Structure (Added) |
| -------------------------------- | ------------------------------------------------------------ |
| bundle/abilityInfo.d.ts | [bundleManager/AbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts) |
| bundle/applicationInfo.d.ts | [bundleManager/ApplicationInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) |
| bundle/bundleInfo.d.ts | [bundleManager/BundleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundleInfo.d.ts) |
| bundle/bundleInstaller.d.ts | [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts) |
| bundle/bundleStatusCallback.d.ts | [@ohos.bundle.bundleMonitor.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleMonitor.d.ts) |
| bundle/customizeData.d.ts | [bundleManager/Metadata.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/Metadata.d.ts) |
| bundle/dispatchInfo.d.ts | [bundleManager/DispatchInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/DispatchInfo.d.ts) |
| bundle/elementName.d.ts | [bundleManager/ElementName.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ElementName.d.ts) |
| bundle/extensionAbilityInfo.d.ts | [bundleManager/ExtensionAbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts) |
| bundle/hapModuleInfo.d.ts | [bundleManager/HapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) |
| bundle/launcherAbilityInfo.d.ts | [bundleManager/LauncherAbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/LauncherAbilityInfo.d.ts) |
| bundle/metadata.d.ts | [bundleManager/Metadata.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/Metadata.d.ts) |
| bundle/moduleInfo.d.ts | [bundleManager/HapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) |
| bundle/PermissionDef.d.ts | [bundleManager/PermissionDef.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/PermissionDef.d.ts) |
| bundle/remoteAbilityInfo.d.ts | [bundleManager/RemoteAbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/RemoteAbilityInfo.d.ts) |
| bundle/shortcutInfo.d.ts | [bundleManager/ShortcutInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ShortcutInfo.d.ts) |
**Adaptation Guide**
1. Replace the code of original structures with the code of new ones.
2. Deprecate the export function of original level-2 modules. Instead, use the level-2 modules' export function of new APIs, and import new level-1 d.ts modules.
## cl.bundlemanager.3 Bundle Manager Query API Changes
Bundle manager query APIs are changed as follows: APIs of version 8 and earlier in **@ohos.bundle** are deprecated, and APIs of version 9 in **@ohos.bundle** are changed to **@ohos.bundle.bundleManager**, **@ohos.bundle.freeInstall**, and **@ohos.bundle.installer**. Most deprecated APIs are added to **@ohos.bundle.bundleManager** and changed to system APIs, and the exception handling capability is added.
API call mode: APIs are now used by the **@ohos.bundle.bundleManager**, **@ohos.bundle.freeInstall**, and **@ohos.bundle.installer** modules, instead of the **@ohos.bundle** module.
The system capability of the **@ohos.bundle.bundleManager** and **@ohos.bundle.installer** modules is **SystemCapability.BundleManager.BundleFramework.Core**, and that of **@ohos.bundle.freeInstall** is **SystemCapability.BundleManager.BundleFramework.FreeInstall**.
**Change Impacts**
There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs. APIs of version 9 in **@ohos.bundle** are moved to the new **@ohos.bundle.bundleManager.d.ts**, **@ohos.bundle.freeInstall**, and **@ohos.bundle.installer** files.
**Key API/Component Changes**
The following table lists the deprecated and changed APIs involved in **@ohos.bundle.d.ts**. The APIs not listed in the table have no change in API names and input parameters, and they have new exception handling and import modules. The APIs can be directly used after being imported to **@ohos.bundle.bundleManager.d.ts**, **@ohos.bundle.freeInstall**, and **@ohos.bundle.installer**. The APIs listed in the table are changed in API version 9, and those marked with "N/A" are deprecated in API version 9.
| Original API (Deprecated) | New API (Changed or Added) | System API| New File Name |
| ---------------------------- | ---------------------------- | --------- | ------------------------------- |
| BundleFlag | BundleFlag | No | @ohos.bundle.bundleManager.d.ts |
| N/A | ApplicationFlag | Yes | @ohos.bundle.bundleManager.d.ts |
| N/A | AbilityFlag | Yes | @ohos.bundle.bundleManager.d.ts |
| ExtensionFlag | ExtensionAbilityFlag | Yes | @ohos.bundle.bundleManager.d.ts |
| ColorMode | N/A | No | N/A |
| GrantStatus | PermissionGrantState | No | @ohos.bundle.bundleManager.d.ts |
| AbilityType | AbilityType | No | @ohos.bundle.bundleManager.d.ts |
| AbilitySubType | N/A | No | N/A |
| DisplayOrientation | DisplayOrientation | No | @ohos.bundle.bundleManager.d.ts |
| LaunchMode | LaunchType | No | @ohos.bundle.bundleManager.d.ts |
| ExtensionAbilityType | ExtensionAbilityType | Yes | @ohos.bundle.bundleManager.d.ts |
| BundleOptions | N/A | No | N/A |
| InstallErrorCode | N/A | No | N/A |
| UpgradeFlag | UpgradeFlag | Yes | @ohos.bundle.freeInstall.d.ts |
| SupportWindowMode | SupportWindowMode | No | @ohos.bundle.bundleManager.d.ts |
| getBundleInfo | getBundleInfo | Yes | @ohos.bundle.bundleManager.d.ts |
| getBundleInstaller | getBundleInstaller | Yes | @ohos.bundle.installer.d.ts |
| getAbilityInfo | queryAbilityInfo | Yes | @ohos.bundle.bundleManager.d.ts |
| getApplicationInfo | getApplicationInfo | Yes | @ohos.bundle.bundleManager.d.ts |
| queryAbilityByWant | queryAbilityInfo | Yes | @ohos.bundle.bundleManager.d.ts |
| getAllBundleInfo | getAllBundleInfo | Yes | @ohos.bundle.bundleManager.d.ts |
| getAllApplicationInfo | getAllApplicationInfo | Yes | @ohos.bundle.bundleManager.d.ts |
| getNameForUid | getBundleNameByUid | Yes | @ohos.bundle.bundleManager.d.ts |
| getBundleArchiveInfo | getBundleArchiveInfo | Yes | @ohos.bundle.bundleManager.d.ts |
| getLaunchWantForBundle | getLaunchWantForBundle | Yes | @ohos.bundle.bundleManager.d.ts |
| cleanBundleCacheFiles | cleanBundleCacheFiles | Yes | @ohos.bundle.bundleManager.d.ts |
| setApplicationEnabled | setApplicationEnabled | Yes | @ohos.bundle.bundleManager.d.ts |
| setAbilityEnabled | setAbilityEnabled | Yes | @ohos.bundle.bundleManager.d.ts |
| queryExtensionAbilityInfos | queryExtensionAbilityInfo | Yes | @ohos.bundle.bundleManager.d.ts |
| getPermissionDef | getPermissionDef | Yes | @ohos.bundle.bundleManager.d.ts |
| getAbilityLabel | getAbilityLabel | Yes | @ohos.bundle.bundleManager.d.ts |
| getAbilityIcon | getAbilityIcon | Yes | @ohos.bundle.bundleManager.d.ts |
| isAbilityEnabled | isAbilityEnabled | Yes | @ohos.bundle.bundleManager.d.ts |
| isApplicationEnabled | isApplicationEnabled | Yes | @ohos.bundle.bundleManager.d.ts |
| setModuleUpgradeFlag | setHapModuleUpgradeFlag | Yes | @ohos.bundle.freeInstall.d.ts |
| isModuleRemovable | isHapModuleRemovable | Yes | @ohos.bundle.freeInstall.d.ts |
| getBundlePackInfo | getBundlePackInfo | Yes | @ohos.bundle.freeInstall.d.ts |
| getDispatcherVersion | getDispatchInfo | Yes | @ohos.bundle.freeInstall.d.ts |
| getProfileByAbility | getProfileByAbility | No | @ohos.bundle.bundleManager.d.ts |
| getProfileByExtensionAbility | getProfileByExtensionAbility | No | @ohos.bundle.bundleManager.d.ts |
| setDisposedStatus | setDisposedStatus | Yes | @ohos.bundle.appControl.d.ts |
| getDisposedStatus | getDisposedStatus | Yes | @ohos.bundle.appControl.d.ts |
| N/A | deleteDisposedStatus | Yes | @ohos.bundle.appControl.d.ts |
| getBundleInfoSync | getBundleInfoSync | Yes | @ohos.bundle.bundleManager.d.ts |
| getApplicationInfoSync | getApplicationInfoSync | Yes | @ohos.bundle.bundleManager.d.ts |
| N/A | getBundleInfoForSelf | No | @ohos.bundle.bundleManager.d.ts |
**Adaptation Guide**
Replace the original APIs with new ones of version 9 and import related modules.
Old import module:
```
import bundle form '@ohos.bundle'
```
New import module:
```
import bundle form '@ohos.bundle.bundleManager'
import freeInstall form '@ohos.bundle.freeInstall'
import installer form '@ohos.bundle.installer'
import appControl form '@ohos.bundle.appControl'
```
## cl.bundlemanager.4 BundleInfo Structure Changes
All **bundle/bundleInfo.d.ts** fields in the bundle manager are deprecated. [bundle/bundleInfo.d.ts]((https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundle/bundleInfo.d.ts)) is changed to [bundleManager/BundleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundleInfo.d.ts), involving field type changes.
**Change Impacts**
There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs. When a level-2 module is used to export **BundleInfo**, the **@ohos.bundle.bundleManager** module needs to be imported.
**Key API/Component Changes**
The following table describes the changed fields in the **BundleInfo** structure. After other fields are deprecated in **bundle/bundleInfo.d.ts**, they have corresponding values in the new **[bundleManager/BundleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundleInfo.d.ts)**. If corresponding fields do not exist, the fields have been deprecated in API version 9.
| Deprecated | Added or Changed in API Version 9 | Type |
| --------------------- | --------------------- | ------------------------------------------ |
| type | N/A | string |
| appId | N/A | string |
| N/A | signatureInfo | SignatureInfo |
| uid | N/A | number |
| abilityInfos | N/A | Array\<AbilityInfo> |
| reqPermissions | N/A | Array<string> |
| compatibleVersion | N/A | number |
| isCompressNativeLibs | N/A | boolean |
| entryModuleName | N/A | string |
| cpuAbi | N/A | string |
| isSilentInstallation | N/A | string |
| entryInstallationFree | N/A | boolean |
| reqPermissionStates | permissionGrantStates | Array\<bundleManager.PermissionGrantState> |
| extensionAbilityInfo | N/A | Array\<ExtensionAbilityInfo> |
| hapModuleInfos | hapModulesInfo | Array\<HapModuleInfo> |
The **SignatureInfo** structure is added to API version 9 as follows.
| Field | Type |
| ----------- | ------ |
| appId | string |
| fingerprint | string |
**Adaptation Guide**
Use the **BundleInfo** structure of API version 9 for modules imported for bundle manager query. The following module needs to be imported when a level-2 module is used for export.
```
import bundle form '@ohos.bundle.bundleManager'
```
## cl.bundlemanager.5 ApplicationInfo Structure Changes
The **ApplicationInfo** structure is changed. The original **bundle/applicationInfo.d.ts** fields in the bundle manager are deprecated, and the file is changed from **bundle/applicationInfo.d.ts** to **bundleManager/ApplicationInfo.d.ts**, involving field type changes.
**Change Impacts**
There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs. When a level-2 module is used to export **ApplicationInfo**, the **@ohos.bundle.bundleManager** module needs to be imported.
**Key API/Component Changes**
The following table describes the changed fields in the **ApplicationInfo** structure. After other fields are deprecated in **bundle/applicationInfo.d.ts**, they have corresponding values in the new [bundleManager/ApplicationInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts). If corresponding fields do not exist, the fields have been deprecated in API version 9.
| Deprecated | Added or Changed in API Version 9| Type |
| ---------------- | -------------- | ---------------------------------- |
| systemApp | N/A | boolean |
| labelId | N/A | string |
| labelIndex | labelId | number |
| iconId | N/A | string |
| iconIndex | iconId | number |
| supportedModes | N/A | number |
| moduleSourceDirs | N/A | Array\<string> |
| moduleInfos | N/A | Array\<ModuleInfo> |
| metaData | N/A | Map\<string,Array\<CustomizeData>> |
| entityType | N/A | string |
| fingerprint | N/A | string |
**Adaptation Guide**
Use the **ApplicationInfo** structure of API version 9 for modules imported for bundle manager query.
## cl.bundlemanager.6 HapModuleInfo Structure Changes
The **HapModuleInfo** structure is changed. The original **bundle/hapModuleInfo.d.ts** and **moduleInfo.d.ts** fields in the bundle manager are deprecated, and the files are changed to [bundleManager/HapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts), involving field type changes.
**Change Impacts**
There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs. When a level-2 module is used to export **HapModuleInfo**, the **@ohos.bundle.bundleManager** module needs to be imported.
**Key API/Component Changes**
The following table describes the changed fields in the **HapModuleInfo** structure. After other fields are deprecated in **bundle/hapModuleInfo.d.ts**, they have corresponding values in the new **bundleManager/HapModuleInfo.d.ts** file.
| Deprecated | Added or Changed in API Version 9 | Type |
| -------------------- | ---------------------- | ---------------------------- |
| abilityInfo | abilitiesInfo | Array<AbilityInfo> |
| N/A | moduleSourceDir | string |
| backgroundImg | N/A | string |
| supportedModes | N/A | string |
| reqCapabilities | N/A | Array\<string> |
| moduleName | N/A | string |
| mainAbilityName | N/A | string |
| extensionAbilityInfo | extensionAbilitiesInfo | Array\<ExtensionAbilityInfo> |
**Adaptation Guide**
Use the **HapModuleInfo** structure of API version 9 for modules imported for bundle manager query.
## cl.bundlemanager.7 ModuleInfo Structure Changes
The original **bundle/hapModuleInfo.d.ts** and **moduleInfo.d.ts** fields in the bundle manager are deprecated, and the files are changed to [bundleManager/HapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts), involving field changes.
The **ModuleInfo** structure is deprecated and replaced by **HapModuleInfo** in [bundleManager/HapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts).
**Change Impacts**
There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs. The **ModuleInfo** structure is deprecated and replaced by **HapModuleInfo**.
**Key API/Component Changes**
The **ModuleInfo** structure is deprecated and replaced by **HapModuleInfo**.
**Adaptation Guide**
Use the **HapModuleInfo** structure of API version 9.
## cl.bundlemanager.8 AbilityInfo Structure Changes
The **AbilityInfo** structure is changed. The original **bundle/abilityInfo.d.ts** file is deprecated and changed to **bundleManager/AbilityInfo.d.ts**, involving field type changes.
**Change Impacts**
There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs.
**Key API/Component Changes**
The following table lists the field changes in the **AbilityInfo** structure for the bundle manager. Fields that are not listed in the table exist in the new **AbilityInfo** structure after being deprecated. Fields marked with "N/A" have been deprecated in API version 9 and do not exist in the new **AbilityInfo** structure.
| Deprecated | Added or Changed in API Version 9 | Type |
| ------------------ | ------------------ | --------------------- |
| launchMode | launchType | number |
| supportWindowMode | supportWindowModes | Array\<number> |
| targetAbility | N/A | string |
| backgroundModes | N/A | number |
| formEnabled | N/A | boolean |
| subType | N/A | AbilitySubType |
| deviceCapabilities | N/A | Array\<string> |
| metaData | N/A | Array\<CustomizeData> |
| maxWindowRatio | N/A | number |
| minWindowRatio | N/A | number |
| maxWindowWidth | N/A | number |
| minWindowWidth | N/A | number |
| maxWindowHeight | N/A | number |
| minWindowHeight | N/A | number |
| N/A | windowSize | WindowSize |
The fields of the new structure **WindowSize** of API version 9 are as follows.
| Field | Type |
| :-------------: | :----: |
| maxWindowRatio | number |
| minWindowRatio | number |
| maxWindowWidth | number |
| minWindowWidth | number |
| maxWindowHeight | number |
| minWindowHeight | number |
**Adaptation Guide**
Use the **AbilityInfo** structure of API version 9.
## cl.bundlemanager.9 BundleFlag Changes
**BundleFlag** is changed to **BundleFlag**, **ApplicationFlag**, and **AbilityFlag** in **@ohos.bundle.bundleManager**. Different types of flags are passed based on the input parameters of new APIs.
**Change Impacts**
**BundleFlag** is changed to **BundleFlag**, **ApplicationFlag**, and **AbilityFlag** in **@ohos.bundle.bundleManager**. Different types of flags are passed based on the input parameters of new APIs. If **BundleFlag** of a version earlier than API version 9 is directly used, the query may fail.
**Key API/Component Changes**
**BundleFlag** in the original **@ohos.bundle** is deprecated and replaced by **BundleFlag**, **ApplicationFlag**, and **AbilityFlag** in the new **@ohos.bundle.bundleManager**.
The following table describes **BundleFlag** of API version 9.
| BundleFlag | Value | Description |
| ----------------------------------------- | ---------- | ------------------------------------------------------------ |
| GET_BUNDLE_INFO_DEFAULT | 0x00000000 | Obtains the default **BundleInfo**. The obtained **BundleInfo** does not contain **signatureInfo**, **hapModuleInfo**, **appInfo**, **reqPermissionDetails**, or **permissionGrantStates**.|
| GET_BUNDLE_INFO_WITH_APPLICATION | 0x00000001 | Obtains **appInfos** with the default **BundleInfo**. |
| GET_BUNDLE_INFO_WITH_HAP_MODULE | 0x00000002 | Obtains **hapModulesInfo** with the default **BundleInfo**. |
| GET_BUNDLE_INFO_WITH_ABILITY | 0x00000004 | Indicates whether **abilitiesInfo** is obtained with **hapModulesInfo**. This flag must be used together with **GET_BUNDLE_INFO_WITH_HAP_MODULE** and cannot be used independently.|
| GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY | 0x00000008 | Indicates whether **extensionAbilitiesInfo** is obtained with **hapModulesInfo**. This flag must be used together with **GET_BUNDLE_INFO_WITH_HAP_MODULE** and cannot be used independently.|
| GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION | 0x00000010 | Obtains **reqPermissionDetails** and **permissionGrantStates** with the default **BundleInfo**. |
| GET_BUNDLE_INFO_WITH_METADATA | 0x00000020 | Indicates whether the returned **ApplicationInfo**, **AbilityInfo**, and **ExtensionAbilityInfo** contain metadata. This flag cannot be used independently.|
| GET_BUNDLE_INFO_WITH_DISABLE | 0x00000040 | Obtains **BundleInfo** of a disabled application and disabled ability information in **abilitiesInfo**.|
| GET_BUNDLE_INFO_WITH_SIGNATURE_INFO | 0x00000080 | Obtains **signatureInfo** with the default **BundleInfo**. |
The following table describes **ApplicationFlag** of API version 9.
| ApplicationFlag | Value | Description |
| ------------------------------------ | ---------- | ------------------------------------------------------------ |
| GET_APPLICATION_INFO_DEFAULT | 0x00000000 | Obtains the default **ApplicationInfo**. The obtained **ApplicationInfo** does not contain permission or metadata information.|
| GET_APPLICATION_INFO_WITH_PERMISSION | 0x00000001 | Obtains **permissions** with the default **ApplicationInfo**. |
| GET_APPLICATION_INFO_WITH_METADATA | 0x00000002 | Obtains **metadata** with the default **ApplicationInfo**. |
| GET_APPLICATION_INFO_WITH_DISABLE | 0x00000004 | Obtains disabled application information. |
The following table describes **AbilityFlag** of API version 9.
| AbilityFlag | Value | Description |
| --------------------------------- | ---------- | ------------------------------------------------------------ |
| GET_ABILITY_INFO_DEFAULT | 0x00000000 | Obtains the default **AbilityInfo**. The obtained **AbilityInfo** does not contain permission, metadata, or disabled ability information.|
| GET_ABILITY_INFO_WITH_PERMISSION | 0x00000001 | Obtains **AbilityInfo** with permission information. |
| GET_ABILITY_INFO_WITH_APPLICATION | 0x00000002 | Obtains **AbilityInfo** with the **ApplicationInfo** structure. |
| GET_ABILITY_INFO_WITH_METADATA | 0x00000004 | Obtains **AbilityInfo** with metadata information. |
| GET_ABILITY_INFO_WITH_DISABLE | 0x00000008 | Obtains all **AbilityInfo**, including disabled abilities. |
| GET_ABILITY_INFO_ONLY_SYSTEM_APP | 0x00000010 | Obtains **AbilityInfo** for system applications. |
**Adaptation Guide**
Use various flags according to the called API in **@ohos.bundle.bundleManager.d.ts**.
## cl.bundlemanager.10 ApplicationType Enumerated Value Changes in the Default Application Module
For the **@ohos.bundle.defaultApp** module, both API functions and usage remain unchanged, but only the enumerated values of **ApplicationType** are changed.
**Change Impacts**
There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new enumerated values.
**Key API/Component Changes**
The enumerated values of **ApplicationType** are changed as follows.
| ApplicationType| Added or Changed in API Version 9 | API Version 8 and Earlier|
| :-------------: | :-------------: | :--------: |
| BROWSER | "Web Browser" | "BROWSER" |
| IMAGE | "Image Gallery" | "IMAGE" |
| AUDIO | "Audio Player" | "AUDIO" |
| VIDEO | "Video Player" | "VIDEO" |
| PDF | "PDF Viewer" | "PDF" |
| WORD | "Word Viewer" | "WORD" |
| EXCEL | "Excel Viewer" | "EXCEL" |
| PPT | "PPT Viewer" | "PPT" |
**Adaptation Guide**
Import the default application module and call related APIs.
```
import defaultApp form '@ohos.bundle.defaultAppManager'
```
## cl.bundlemanager.11 Distributed Bundle Manager Changes
API exception handling is rectified. The distributed bundle manager module is changed. The original **@ohos.distributedBundle.d.ts** APIs are deprecated, and the **@ohos.distributedBundle.d.ts** file is changed to [@ohos.bundle.distributedBundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.distributedBundleManager.d.ts). The **getRemoteAbilityInfos** API is changed to **getRemoteAbilityInfo**. The export function of a level-2 module in the **RemoteAbilityInfo** structure can be used only after a new module is imported.
**Change Impacts**
Applications using APIs earlier than version 9 are not affected. The names of the distributed module and the **getRemoteAbilityInfos** API are changed. As a result, applications using APIs of version 9 may fail to be compiled using the new SDK.
**Key API/Component Changes**
All APIs in **@ohos.distributedBundle.d.ts** are deprecated. The **@ohos.bundle.distributedBundleManager.d.ts** file is added. The functions of some APIs are the same as those of the original ones. New APIs support exception handling. The API changes are as follows.
| Deprecated | Added or Changed in API Version 9 | System API|
| --------------------- | -------------------- | --------- |
| getRemoteAbilityInfos | getRemoteAbilityInfo | Yes |
**Adaptation Guide**
Import a new distributed module.
```
import distributedBundle form '@ohos.bundle.distributedBundle'
```
## cl.bundlemanager.12 Installation-Free Module and API Changes
APIs support exception handling rectification. The installation-free module is moved from **@ohos.bundle.d.ts** to **@ohos.bundle.freeInstall.d.ts**, involving module and API changes. The system capability is **SystemCapability.BundleManager.BundleFramework.FreeInstall**.
1. The imported **@ohos.bundle** module needs to be changed to **@ohos.bundle.freeInstall**.
2. The **setModuleUpgradeFlag** API is changed to **setHapModuleUpgradeFlag**.
3. The **isModuleRemovable** API is changed to **isHapModuleRemovable**.
4. The **getDispatcher** API is changed to **getDispatchInfo**.
**Change Impacts**
Applications using APIs earlier than version 9 are not affected. Applications using APIs of version 9 will fail to be compiled.
**Key API/Component Changes**
The following table lists the installation-free API changes. For APIs not listed in the table, their names and usage are unchanged, but the module name is changed.
| Deprecated | Added or Changed in API Version 9 | System API|
| -------------------- | ----------------------- | --------- |
| setModuleUpgradeFlag | setHapModuleUpgradeFlag | Yes |
| isModuleRemovable | isHapModuleRemovable | Yes |
| getDispatcher | getDispatchInfo | Yes |
**Adaptation Guide**
To use installation-free APIs, import a new module and modify the APIs according to their mappings.
```
import freeInstall from '@ohos.bundle.freeInstall'
```
## cl.bundlemanager.13 Installation-Free Structure Field Changes
The fields of the **DisPatchInfo**, **AbilityFormInfo**, **ModuleDistroInfo**, and **ModuleConfigInfo** structures are changed as follows:
1. The name of the **dispatchAPI** field in **DispatchInfo** is changed to [dispatchAPIVersion](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/DispatchInfo.d.ts), and the type is string, which is unchanged. The field indicates the version of the installation-free API. The meaning remains unchanged.
2. The type of the **supportDimensions** field in the **AbilityFormInfo** structure is changed from **Array\<number>** to **Array\<string>**.
3. The type of the **defaultDimension** field in the **AbilityFormInfo** structure is changed from **number** to **string**.
4. The **mainAbility** field is deprecated in the **ModuleDistroInfo** structure and moved to the **ModuleConfigInfo** structure.
5. The **mainAbility** field is added to the **ModuleConfigInfo** structure.
**Change Impacts**
Applications using APIs earlier than version 9 are not affected. The value type of certain fields in the structures is changed. As a result, applications using APIs of version 9 may fail to be compiled using the new SDK.
**Key API/Component Changes**
1. DispatchInfo
| Deprecated | Added or Changed in API Version 9 | Type |
| ----------- | ------------------ | ------ |
| dispatchAPI | dispatchAPIVersion | string |
2. AbilityFormInfo
| Field | Type in API Version 9 | Original Type |
| ----------------- | -------------- | -------------- |
| supportDimensions | Array\<string> | Array\<number> |
| defaultDimension | string | number |
3. ModuleDistroInfo
| Field | Added or Changed in API Version 9| Type |
| ----------- | -------------- | ------ |
| mainAbility | N/A | string |
4. MooduleConfigInfo
| Field| Added or Changed in API Version 9| Type |
| ---- | -------------- | ------ |
| N/A | mainAbility | string |
**Adaptation Guide**
To use installation-free APIs, import a new module and modify the structures according to their mappings.
```
import freeInstall from '@ohos.bundle.freeInstall'
```
## cl.bundlemanager.14 Structure Changes
The structure **GrantStatus** is changed to **PermissionGrantState**. The enumeration type and values remain unchanged.
**Change Impacts**
Applications using APIs earlier than version 9 are not affected. The structure name is changed. As a result, applications using APIs of version 9 may fail to be compiled using the new SDK.
**Key API/Component Changes**
The **GrantStatus** structure indicating the authorization status is changed to **PermissionGrantState** in **@ohos.bundle.bundleManager.d.ts**.
| Name | Value|
| ------------------ | ------ |
| PERMISSION_DENIED | -1 |
| PERMISSION_GRANTED | 0 |
**Adaptation Guide**
Import a new module and change the structure name to **PermissionGrantState**.
```
import bundle form '@ohos.bundle.bundleManager'
```
## cl.bundlemanager.15 Bundle Manager ShortcutInfo Structure Field Changes
Fields in the **ShortcutInfo** structure of the bundle manager are changed. The **bundle/shortcutInfo.d.ts** fields are deprecated, and the file is changed to [bundleManager/ShortcutInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ShortcutInfo.d.ts). The **ShortcutInfo** and **ShortWant** structures are changed to system APIs.
**Change Impacts**
Applications using APIs earlier than version 9 are not affected. The value type of certain fields in the structures is changed. As a result, applications using APIs of version 9 may fail to be compiled using the new SDK.
**Key API/Component Changes**
The **ShortcutInfo** and **ShortcutWant** structures are involved. To use the level-2 module export function, import the new module **@ohos.bundle.launcherBundleManager**.
The following table lists the field changes of the **ShortcutInfo** structure. Fields that are not listed in the table still exist in API version 9.
| Deprecated | Added or Changed in API Version 9| Type |
| -------------- | -------------- | ------- |
| disableMessage | N/A | string |
| isStatic | N/A | boolean |
| isHomeShortcut | N/A | boolean |
| isEnabled | N/A | boolean |
| disableMessage | N/A | boolean |
The following table lists the field changes of the **ShortcutWant** structure. Fields that are not listed in the table still exist in API version 9.
| Deprecated | Added or Changed in API Version 9| Type |
| ----------- | -------------- | ------ |
| targetClass | targetAbility | string |
**Adaptation Guide**
To use installation-free APIs, import a new module and modify the structures according to their mappings.
```
import launcherBundleManager form '@ohos.bundle.launcherBundleManager'
```
## cl.bundlemanager.16 getBundleInstaller API Changes
The **getBundleInstaller** API of the bundle manager is moved from **@ohos.bundle.d.ts** to [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts).
The system capability is **SystemCapability.BundleManager.BundleFramework.Core**.
**Change Impacts**
Applications using APIs earlier than version 9 are not affected. Applications that use APIs of version 9 need to adapt the new module and APIs.
**Key API/Component Changes**
1. For **getBundleInstaller**, the import module is changed from **@ohos.bundle** to **@ohos.bundle.installer**.
**Adaptation Guide**
Import the new bundle manager installation module and call **getBundleInstaller**.
```
import installer form '@ohos.bundle.installer'
```
## cl.bundlemanager.17 Bundle Manager Installation API Changes
The bundle manager installation API is moved from **bundle/bundleInstaller.d.ts** to [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts). The system capability is **SystemCapability.BundleManager.BundleFramework.Core**.
**Change Impacts**
Applications using APIs earlier than version 9 are not affected. Applications that use APIs of version 9 need to adapt the new module and APIs.
**Key API/Component Changes**
1. The exception handling capability is added to the **install**, **uninstall**, and **recover** APIs. The API names and input parameters remain unchanged, and only the module name is changed.
2. Fields are added to the **HashParam** structure as follows.
| Added in API Version 9 | Type |
| ---------- | ------ |
| moduleName | string |
| hashValue | string |
3. Fields are added to the **InstallParam** structure as follows.
| Added in API Version 9 | Type |
| ----------------- | ----------------- |
| userId | number |
| installFlag | number |
| isKeepData | boolean |
| hashParams | Array\<HashParam> |
| crowdtestDeadline | number |
4. The **InstallStatus** structure is deprecated.
**Adaptation Guide**
Import the new bundle manager installation module and call **getBundleInstaller**.
```
import installer form '@ohos.bundle.installer'
```
## cl.bundlemanager.18 Bundle Manager Installation Function Changes
The installation specifications of the bundle manager module are changed, in which whether the application **deviceType** setting matches the device type is verified. If they do not match, the installation fails.
**Change Impacts**
Applications developed in earlier versions are affected. Applications can be successfully installed in the image of the new version only after adaptation.
**Key API/Component Changes**
N/A
**Adaptation Guide**
Configure device types in the application configuration file **config.json** or **module.json**.
```
{
"module": {
"name": "entry",
"type": "entry",
// ...
"deviceTypes":[
// In this example, default and tablet are configured. In this case, the application can be installed on default and tablet.
"default",
"tablet"
],
// ...
}
```
## cl.bundlemanager.19 innerBundleManger Module API Changes
**innerBundleManager** API functions are unchanged, but API usage is changed. The [@ohos.bundle.launcherBundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.launcherBundleManager.d.ts) module needs to be imported to use **innerBundleManager** APIs. The system capability is **SystemCapability.BundleManager.BundleFramework.Core**.
**Change Impacts**
There is no impact on applications that use the APIs of versions earlier than 9. Applications that use the **innerBundleManager** API capabilities need to adapt the new module and APIs.
**Key API/Component Changes**
The functions and input parameters of the following APIs remain unchanged, and API exception handling is added. When a level-2 module is used to export **ShortcutInfo** and **ShortcutWant**, the **@ohos.bundle.launcherBundleManager** module needs to be imported. The **on** and **off** APIs are deprecated from **@ohos.bundle.innerBundleManger.d.ts** and moved to **@ohos.bundle.bundleMonitor.d.ts**.
1. getLauncherAbilityInfos<br>
2. getAllLauncherAbilityInfos<br>
3. getShortcutInfos
**Adaptation Guide**
Import the new module **@ohos.bundle.launcherBundleManage**.
```
import launcherBundleManager form '@ohos.bundle.launcherBundleManage'
```
## cl.bundlemanager.20 innerBundleManagr Module Changes
**innerBundleManager** API functions are unchanged, but API usage is changed. The [@ohos.bundle.bundleMonitor.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleMonitor.d.ts) module needs to be imported to use **innerBundleManager** APIs, which are system APIs. The system capability is **SystemCapability.BundleManager.BundleFramework.Core**.
**Change Impacts**
There is no impact on applications that use the APIs of versions earlier than 9. Applications that use the **innerBundleManager** API capabilities need to adapt the new module and APIs.
**Key API/Component Changes**
The **on** and **off** APIs are changed to **@ohos.bundle.bundleMonitor.d.ts**. The input parameters are different from those of the original APIs. The function prototype of the APIs of version 9 is as follows:
```
function on(type: BundleChangedEvent, callback: Callback<BundleChangedInfo>): void;
function off(type: BundleChangedEvent, callback?: Callback<BundleChangedInfo>): void;
```
**BundleChangedEvent**:
```
type BundleChangedEvent = 'add' | 'update' | 'remove';
```
Callback function of **BundleChangedInfo**:
```
interface BundleChangedInfo {
readonly bundleName: string;
readonly userId: number;
}
```
After obtaining **BundleChangedInfo**, perform related operations (that is, the **add**, **update**, and **remove** functions in **BundleStatusCallback** of the original API).
**Adaptation Guide**
Import the **bundleMonitor** module and call related APIs.
```
import bundleMonitor form '@ohos.bundle.bundleMonitor'
```
## cl.bundlemanager.21 bundleStatusCallback.d.ts API Changes
The **bundleStatusCallback.d.ts** APIs of the bundle manager are deprecated and moved to [@ohos.bundle.bundleMonitor.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleMonitor.d.ts). The **add**, **update**, and **remove** functions in **BundleStatusCallback** are deprecated and changed to **BundleChangedEvent**, which is a system API. The system capability is **SystemCapability.BundleManager.BundleFramework.Core**.
**Change Impacts**
There is no impact on applications that use the APIs of versions earlier than 9. Applications that use the **BundleStatusCallback** API capabilities need to adapt the new module and APIs.
**Key API/Component Changes**
All the following functions are deprecated. The **BundleChangedEvent** API is added to **@ohos.bundle.bundleMonitor.d.ts**.
1. add
2. update
3. remove
**Adaptation Guide**
Import the **bundleMonitor** module and call related APIs. Different from the previous **BundleStatusCallback**, **BundleStatusCallback** passes the **add**, **update**, and **remove** functions to the **on** and **off** APIs. The **BundleMonitor** uses the **on** or **off** API of version 9 to return **BundleChangedInfo** to the caller through the callback.
```
import bundleMonitor form '@ohos.bundle.bundleMonitor'
```
## cl.bundlemanager.22 Zlib Module API Changes
The **Zlib** module APIs of the bundle manager are changed. Certain APIs in [@ohos.zlib.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.zlib.d.ts) are deprecated and changed. The system capability is **SystemCapability.BundleManager.Zlib**.
**Change Impacts**
There is no impact on applications that use the APIs of versions earlier than 9. Applications that use APIs of version 9 need to adapt the new module and APIs.
**Key API/Component Changes**
The following table lists the changed APIs in **@ohos.zlib.d.ts**. The usage of the new APIs of version 9 is the same, and API exception handling is supported.
| Deprecated | Added or Changed in API Version 9| System API|
| --------- | -------------- | --------- |
| zipFile | compressFile | Yes |
| unzipFile | decompressFile | Yes |
| ErrorCode | N/A | Yes |
**Adaptation Guide**
The import module does not change. The new API is directly used to adapt exception handling.
```
import zlib form '@ohos.zlib'
```
\ No newline at end of file
# Wi-Fi Subsystem ChangeLog
## cl.wifi.1 Migration of System APIs and APIs in API Version 9 to the New @ohos.wifiManager.d.ts
**@ohos.wifi.d.ts** does not allow for throwing error codes, which is required by API version 9 and the system APIs. Therefore, all system APIs and APIs in API version 9 of **@ohos.wifi.d.ts** are migrated to the newly added **@ohos.wifiManager.d.ts**, and error code description is also added.
Import **@ohos.wifiManager.d.ts**, so that system APIs and APIs in API version 9 of the Wi-Fi subsystem can be used.
import wifiManager from '@ohos.wifiManager';
**Change Impacts**
System APIs and APIs in API version 9 are affected. Import **@ohos.wifiManager** to make sure that system APIs and APIs in API version 9 of the Wi-Fi subsystem can be used.
import wifiManager from '@ohos.wifiManager';
Other APIs are not affected.
**Key API/Component Changes**
| Class| Type | Declaration | Change Type |
| ---- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| wifi | namespace | declare namespace wifi | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | method | function enableWifi(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value type to void. |
| wifi | method | function disableWifi(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value type to void. |
| wifi | method | function scan(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value type to void. |
| wifi | method | function getScanResults(): Promise&lt;Array&lt;WifiScanInfo&gt;&gt; | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed **getScanInfos** to **getScanResults**.|
| wifi | method | function getScanResults(callback: AsyncCallback&lt;Array&lt;WifiScanInfo&gt;&gt;): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed **getScanInfos** to **getScanResults**.|
| wifi | method | function getScanResultsSync(): &nbsp;Array&lt;[WifiScanInfo]&gt; | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | method | function addCandidateConfig(config: WifiDeviceConfig): Promise&lt;number&gt; | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | method | function addCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback&lt;number&gt;): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | method | function removeCandidateConfig(networkId: number): Promise&lt;void&gt; | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | method | function removeCandidateConfig(networkId: number, callback: AsyncCallback&lt;void&gt;): void | Migrated this API in API version 9 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 this API in API version 9. |
| wifi | method | function removeUntrustedConfig(config: WifiDeviceConfig): Promise&lt;boolean&gt; | Deleted this API in API version 9. |
| wifi | method | function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback&lt;boolean&gt;): void | Deleted this API in API version 9. |
| wifi | method | function getCandidateConfigs(): &nbsp;Array&lt;[WifiDeviceConfig]&gt; | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | method | function connectToCandidateConfig(networkId: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | method | function connectToNetwork(networkId: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function connectToDevice(config: WifiDeviceConfig): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function disconnect(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function reassociate(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function reconnect(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function disableNetwork(netId: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function removeAllNetwork(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function removeDevice(id: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function enableHotspot(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function disableHotspot(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function setHotspotConfig(config: HotspotConfig): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function getP2pLocalDevice(): Promise&lt;WifiP2pDevice&gt; | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | method | function getP2pLocalDevice(callback: AsyncCallback&lt;WifiP2pDevice&gt;): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | method | function getP2pGroups(): Promise&lt;Array&lt;WifiP2pGroupInfo&gt;&gt; | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | method | function getP2pGroups(callback: AsyncCallback&lt;Array&lt;WifiP2pGroupInfo&gt;&gt;): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | method | function createGroup(config: WifiP2PConfig): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function removeGroup(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function p2pConnect(config: WifiP2PConfig): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function p2pCancelConnect(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function startDiscoverDevices(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function stopDiscoverDevices(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function deletePersistentGroup(netId: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | method | function setDeviceName(devName: string): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.|
| wifi | interface | export interface WifiEapConfig | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | enum | export enum EapMethod | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | enum | export enum Phase2Method | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | interface | export interface WifiDeviceConfig | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added the **eapConfig** parameter.|
| wifi | interface | export interface IpConfig | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added the **prefixLength** parameter.|
| wifi | interface | export interface WifiInfoElem | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | enum | export enum WifiChannelWidth | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. |
| wifi | interface | export interface WifiScanInfo | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added the following three parameters: **centerFrequency0**, **centerFrequency1**, and **infoElems**.|
| wifi | enum | export enum WifiSecurityType | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added four encryption types. |
| wifi | interface | export interface WifiLinkedInfo | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added the **MacType** parameter. |
**(Optional) Adaptation Guide**
The following uses **getLinkedInfo** as an example to show how it is called in the new version:
```
import wifiManager from '@ohos.wifiManager'
wifiManager.getLinkedInfo((err, data) => {
if (err) {
console.error("get linked info error");
return;
}
console.info("get linked info: " + JSON.stringify(data));
});
wifiManager.getLinkedInfo().then(data => {
console.info("get linked info: " + JSON.stringify(data));
}).catch(error => {
console.info("get linked info error");
});
```
## cl.wifiext.1 Migration of System APIs and APIs in API Version 9 to the New @ohos.wifiManagerExt.d.ts
**@ohos.wifiext.d.ts** does not allow for throwing error codes, which is required by API version 9 and the system API. Therefore, all system APIs and APIs in API version 9 of **@ohos.wifiext.d.ts** are migrated to the newly added **@ohos.wifiManagerExt.d.ts**, and error code description is also added.
Import **@ohos.wifiManagerExt.d.ts**, so that system APIs and APIs in API version 9 of the Wi-Fi subsystem can be used.
import wifiManagerExt from '@ohos.wifiManagerExt';
**Change Impacts**
System APIs and APIs in API version 9 are affected. Import **@ohos.wifiManagerExt**, so that system APIs and APIs in API version 9 of the Wi-Fi subsystem can be used together with the Wi-Fi manager.
import wifiManagerExt from '@ohos.wifiManagerExt';
Other APIs are not affected.
# Account Subsystem ChangeLog
## cl.account_os_account.1 Change in Error Information Return Method of Account System APIs
Certain system APIs of the account subsystem use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. The following changes are made in API version 9 and later:
Asynchronous API: An error message is returned via **AsyncCallback** or the **error** object of **Promise**.
Synchronous API: An error message is returned via an exception.
**Change Impacts**
The application developed based on earlier versions needs to adapt the new APIs and their method for returning API error information. Otherwise, the original service logic will be affected.
**Key API/Component Changes**
Before change:
- class UserAuth
- setProperty(request: SetPropertyRequest, callback: AsyncCallback&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.2 ACTION Definition Change for the Application Account Authentication Service
**Change Impacts**
For the application developed based on an earlier version, you need to modify **ACTION** in the application configuration file (**config.json** for the FA model and **module.json5** for the Stage model) to normally provide the application authentication service.
**Key API/Component Changes**
Involved constant:
@ohos.ability.wantConstant.ACTION_APP_ACCOUNT_AUTH
Before change:
ACTION_APP_ACCOUNT_AUTH = "account.appAccount.action.auth"
After change:
ACTION_APP_ACCOUNT_AUTH = "ohos.appAccount.action.auth"
**Adaptation Guide**
For a third-party application providing the account authentication service, adapt the changed application account authentication **ACTION** in the **ServiceAbility** configuration file (**config.json** for the FA module or **module.json5** for the Stage module).
```
"abilities": [
{
"name": "ServiceAbility",
"srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts",
...
"visible": true,
"skills": {
{
"actions": [
"ohos.appAccount.action.auth"
]
}
}
}]
}
# Distributed Scheduler Subsystem ChangeLog
## cl.DistributedManagerService.1 Adding DATASYNC Permission Verification on the continuationManager API
In earlier versions, the **continuationManager** API does not verify the caller, which does not comply with the OpenHarmony API specifications.
Now, before using **continuationManager**, the caller must apply for the **ohos.permission.DISTRIBUTED_DATASYNC** permission.
**Change Impacts**
The application developed based on earlier versions needs to apply for the **ohos.permission.DISTRIBUTED_DATASYNC** permission in advance. Otherwise, the original service logic will be affected.
**Key API/Component Changes**
Involved APIs:
- continuationManager.registerContinuation;
- continuationManager.on;
- continuationManager.off;
- continuationManager.unregisterContinuation;
- continuationManager.updateContinuationState;
- continuationManager.startContinuationDeviceManager;
# *Example* Subsystem ChangeLog
Changes that affect contract compatibility of the last version should be described in the ChangeLog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions.
## cl.subsystemname.x xxx Function Change (Example: DeviceType Attribute Change or Camera Permission Change. Use a short description.)
Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of ChangeLog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order).
Describe the changes in terms of functions. Example: *n* and *m* of the *a* function are changed. Developers need to adapt their applications based on the change description.
If there is a requirement or design document corresponding to the change, attach the requirement number or design document number in the description.
**Change Impacts**
Describe whether released APIs (JS or native APIs) are affected or API behavior is changed.
Describe whether available applications are affected, that is, whether an adaptation is required for building the application code in the SDK environment of the new version.
**Key API/Component Changes**
List the API/component changes involved in the function change.
**Adaptation Guide (Optional)**
Provide guidance for developers on how to adapt their application to the changes to be compatible with the new version.
Example:
Change parameter *n* to *m* in the *a* file.
```
sample code
```
# 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
## cl.account_os_account.1 Expansion of Distributed Account Nickname and Profile Picture Specifications
The existing distributed account nickname and profile picture specifications cannot meet requirements in scenarios where the nickname is long and profile picture is large.
Therefore, the distributed account nickname and profile picture specifications are expanded.
**Change Impacts**
The API change is forward compatible. Applications developed based on earlier versions can use the APIs in accordance with the new specifications, without affecting the original logic.
**Key API/Component Changes**
Before change:
- The nickname cannot exceed 20 characters, and the profile picture size cannot exceed 3 MB.
After change:
- The nickname cannot exceed 1024 characters, and the profile picture size cannot exceed 10 MB.
# Location Subsystem ChangeLog
## cl.location.1 Deletion of the geoLocationManager.requestEnableLocation API in API Version 9
When the location function is disabled, your application can call the **geoLocationManager.requestEnableLocation** API to request the user to enable the location function. However, this API is seldom used because the user is not notified of the scenario in which your application uses the location information.
Therefore, your application shows a popup, asking the user to go to the settings page and enable the location function. In addition, the popup clearly states the scenarios in which the location information will be used, improving user experience.
**Change Impacts**
Your application cannot use the **geoLocationManager.requestEnableLocation** API in API version 9 to request the user to enable the location function. Instead, you need to implement a popup asking the user to enable the location function for your application.
**Key API/Component Changes**
| Class | API Type| Declaration | Change Type |
| ------------------ | -------- | ------------------------------------------------------------ | ------------------ |
| geoLocationManager | method | function requestEnableLocation(callback: AsyncCallback&lt;boolean&gt;): void; | Deleted from API version 9|
| geoLocationManager | method | function requestEnableLocation(): Promise&lt;boolean&gt;; | Deleted from API version 9|
# Wi-Fi Subsystem ChangeLog
## cl.location.1 Location Service Permission Change
From API version 9, the **ohos.permission.APPROXIMATELY_LOCATION** permission is added for obtaining the approximate location.
If you use API version 9 or later, you need to apply for both the **ohos.permission.LOCATION** and **ohos.permission.APPROXIMATELY_LOCATION** permissions. Applying for only the **ohos.permission.LOCATION** permission will fail.
**Change Impacts**
Applications using API versions earlier than 9 are not affected. For an application using API version 9 or later, the method for applying for the location permission is changed. The details are as follows:
Before using basic location capabilities, check whether your application has been granted the permission to access the device location information. If not, your application needs to obtain the permission from the user as described below.
The system provides the following location permissions:
- ohos.permission.LOCATION
- ohos.permission.APPROXIMATELY_LOCATION
- ohos.permission.LOCATION_IN_BACKGROUND
If your application needs to access the device location information, it must first apply for required permissions. Specifically speaking:
API versions earlier than 9: Apply for **ohos.permission.LOCATION**.
API version 9 and later: Apply for **ohos.permission.APPROXIMATELY_LOCATION**, or apply for **ohos.permission.APPROXIMATELY_LOCATION** and **ohos.permission.LOCATION**. Note that **ohos.permission.LOCATION** cannot be applied for separately.
| API Version| Location Permission | Permission Application Result| Location Accuracy |
| ------------- | ------------------------------------------------------------ | -------- | -------------------------------- |
| Earlier than 9 | ohos.permission.LOCATION | Success | Location accurate to meters|
| 9 and later | ohos.permission.LOCATION | Failure | No location obtained |
| 9 and later | ohos.permission.APPROXIMATELY_LOCATION | Success | Location accurate to 5 kilometers |
| 9 and later | ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.LOCATION| Success | Location accurate to meters|
If your application needs to access the device location information when running in the background, it must be configured to be able to run in the background and be granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information after your application moves to the background.
You can declare the required permissions in your application's configuration file. For details, see the [permission application guide](../../../application-dev/security/accesstoken-guidelines.md).
**Key API/Component Changes**
| Class | API Type| Declaration | Change Type |
| ----------- | -------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| wifiManager | method | function scan(): void; | The permission is changed to **ohos.permission.SET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function getScanResults(): Promise&lt;Array&lt;WifiScanInfo&gt;&gt;; | The permission is changed to **ohos.permission.GET_WIFI_INFO** and **ohos.permission.GET_WIFI_PEERS_MAC** or **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function getScanResults(callback: AsyncCallback&lt;Array&lt;WifiScanInfo&gt;&gt;): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO** and **ohos.permission.GET_WIFI_PEERS_MAC** or **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function getScanResultsSync(): Array&lt;WifiScanInfo&gt;; | The permission is changed to **ohos.permission.GET_WIFI_INFO** and **ohos.permission.GET_WIFI_PEERS_MAC** or **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function getCandidateConfigs(): Array&lt;WifiDeviceConfig&gt;; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function getDeviceConfigs(): Array&lt;WifiDeviceConfig&gt;; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, **ohos.permission.APPROXIMATELY_LOCATION**, and **ohos.permission.GET_WIFI_CONFIG**.|
| wifiManager | method | function getStations(): Array&lt;StationInfo&gt;; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, **ohos.permission.APPROXIMATELY_LOCATION**, and **ohos.permission.MANAGE_WIFI_HOTSPOT**.|
| wifiManager | method | function getCurrentGroup(): Promise&lt;WifiP2pGroupInfo&gt;; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function getCurrentGroup(callback: AsyncCallback&lt;WifiP2pGroupInfo&gt;): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function getP2pPeerDevices(): Promise&lt;WifiP2pDevice[]&gt;; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function getP2pPeerDevices(callback: AsyncCallback&lt;WifiP2pDevice[]&gt;): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function p2pConnect(config: WifiP2PConfig): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function startDiscoverDevices(): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function getP2pGroups(): Promise&lt;Array&lt;WifiP2pGroupInfo&gt;&gt;; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function getP2pGroups(callback: AsyncCallback&lt;Array&lt;WifiP2pGroupInfo&gt;&gt;): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function on(type: "p2pDeviceChange", callback: Callback&lt;WifiP2pDevice&gt;): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function off(type: "p2pDeviceChange", callback?: Callback&lt;WifiP2pDevice&gt;): void; | The permission is changed to **ohos.permission.LOCATION** and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function on(type: "p2pPeerDeviceChange", callback: Callback&lt;WifiP2pDevice[]&gt;): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.|
| wifiManager | method | function off(type: "p2pPeerDeviceChange", callback?: Callback&lt;WifiP2pDevice[]&gt;): void; | The permission is changed to **ohos.permission.LOCATION** and **ohos.permission.APPROXIMATELY_LOCATION**.|
# Web Subsystem ChangeLog
Compared with earlier versions, OpenHarmony 4.0.2.1 has the following API changes in its Web subsystem:
## cl.web.1 Parameter Type Change of postMessageEvent
The **postMessageEvent** API supported only the string type. In OpenHarmony 4.0.2.1 and later versions, it also supports the ArrayBuffer type.
**Change Impacts**
The API change is forward compatible. Applications developed based on earlier versions can still use the API, and the original functions are not affected.
**Key API/Component Changes**
- Involved APIs
postMessageEvent(message: string): void
- Before change
```ts
postMessageEvent(message: string): void
```
- After change
```ts
type WebMessage = ArrayBuffer | string
postMessageEvent(message: WebMessage): void
```
**Adaptation Guide**
The API change is forward compatible. Applications developed based on earlier versions can still use the API, and the original functions are not affected.
## cl.web.2 Parameter Type Change of onMessageEvent
The **onMessageEvent** API supported only the string type. In OpenHarmony 4.0.2.1 and later versions, it also supports the ArrayBuffer type.
**Change Impacts**
The API change is forward compatible. Applications developed based on earlier versions can still use the API. With the corresponding logic handling added, the original functions are not affected.
**Key API/Component Changes**
- Involved APIs
onMessageEvent(callback: (result: string) => void): void
- Before change
```ts
onMessageEvent(callback: (result: string) => void): void
```
- After change
```ts
type WebMessage = ArrayBuffer | string
onMessageEvent(callback: (result: WebMessage) => void): void
```
**Adaptation Guide**
The API change is forward compatible. Applications developed based on earlier versions can still use the API. With the corresponding logic handling added, the original functions are not affected.
# Ability Subsystem ChangeLog
## cl.ability.1 System API Usage Rule Change
System application verification is not performed for system APIs provided by the ability when they are called. The APIs can be used by a third-party application using the full SDK, which brings security risks. Therefore, application identity verification is added to OpenHarmony 4.0.2.1 and later versions.
**Change Impacts**
System APIs are available to only system applications. When a third-party application tries to use a system API, the **202** error will be returned via either an exception or asynchronous callback.
**Key API/Component Changes**
Below are the system APIs.
| Module | API | Error Code Return Mode|
| -------------------------------------- | ------------------------------------------------------------ | -------------- |
| @ohos.app.ability.abilityManager.d.ts | updateConfiguration(config: Configuration, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.abilityManager.d.ts | updateConfiguration(config: Configuration): Promise<void> | Asynchronous callback |
| @ohos.app.ability.abilityManager.d.ts | getAbilityRunningInfos(): Promise<Array<AbilityRunningInfo>> | Asynchronous callback |
| @ohos.app.ability.abilityManager.d.ts | getAbilityRunningInfos(callback: AsyncCallback<Array<AbilityRunningInfo>>): void | Asynchronous callback |
| @ohos.app.ability.abilityManager.d.ts | getExtensionRunningInfos(upperLimit: number): Promise<Array<ExtensionRunningInfo>> | Asynchronous callback |
| @ohos.app.ability.abilityManager.d.ts | getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback<Array<ExtensionRunningInfo>>): void | Asynchronous callback |
| @ohos.app.ability.abilityManager.d.ts | getTopAbility(): Promise<ElementName> | Exception |
| @ohos.app.ability.abilityManager.d.ts | getTopAbility(callback: AsyncCallback<ElementName>): void | Exception |
| @ohos.app.ability.appManager.d.ts | on(type: "applicationState", observer: ApplicationStateObserver): number | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | on(type: "applicationState", observer: ApplicationStateObserver, bundleNameList: Array<string>): number | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | off(type: "applicationState", observerId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | off(type: "applicationState", observerId: number): Promise<void> | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | getForegroundApplications(callback: AsyncCallback<Array<AppStateData>>): void | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | getForegroundApplications(): Promise<Array<AppStateData>> | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | killProcessWithAccount(bundleName: string, accountId: number): Promise<void> | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | killProcessesByBundleName(bundleName: string): Promise<void> | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | killProcessesByBundleName(bundleName: string, callback: AsyncCallback<void>) | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | clearUpApplicationData(bundleName: string): Promise<void> | Asynchronous callback |
| @ohos.app.ability.appManager.d.ts | clearUpApplicationData(bundleName: string, callback: AsyncCallback<void>) | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | on(type: "mission", listener: MissionListener): number | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | off(type: "mission", listenerId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | off(type: "mission", listenerId: number): Promise<void> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback<MissionInfo>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getMissionInfo(deviceId: string, missionId: number): Promise<MissionInfo> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback<Array<MissionInfo>>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getMissionInfos(deviceId: string, numMax: number): Promise<Array<MissionInfo>> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback<MissionSnapshot>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getMissionSnapShot(deviceId: string, missionId: number): Promise<MissionSnapshot> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback<MissionSnapshot>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise<MissionSnapshot> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | lockMission(missionId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | lockMission(missionId: number): Promise<void> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | unlockMission(missionId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | unlockMission(missionId: number): Promise<void> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | clearMission(missionId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | clearMission(missionId: number): Promise<void> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | clearAllMissions(callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | clearAllMissions(): Promise<void> | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, options?: StartOptions): Promise<void> | Asynchronous callback |
| @ohos.app.ability.quickFixManager.d.ts | applyQuickFix(hapModuleQuickFixFiles: Array<string>, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.ability.quickFixManager.d.ts | applyQuickFix(hapModuleQuickFixFiles: Array<string>): Promise<void> | Asynchronous callback |
| @ohos.app.ability.quickFixManager.d.ts | getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback<ApplicationQuickFixInfo>): void | Asynchronous callback |
| @ohos.app.ability.quickFixManager.d.ts | getApplicationQuickFixInfo(bundleName: string): Promise<ApplicationQuickFixInfo> | Asynchronous callback |
| @ohos.app.ability.wantAgent.d.ts | getWant(agent: WantAgent, callback: AsyncCallback<Want>): void | Asynchronous callback |
| @ohos.app.ability.wantAgent.d.ts | getWant(agent: WantAgent): Promise<Want> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | deleteForm(formId: string, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | deleteForm(formId: string): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, isReleaseCache: boolean, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, isReleaseCache?: boolean): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | requestForm(formId: string, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | requestForm(formId: string): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | castToNormalForm(formId: string, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | castToNormalForm(formId: string): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyVisibleForms(formIds: Array<string>, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyVisibleForms(formIds: Array<string>): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyInvisibleForms(formIds: Array<string>, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyInvisibleForms(formIds: Array<string>): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | enableFormsUpdate(formIds: Array<string>, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | enableFormsUpdate(formIds: Array<string>): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | disableFormsUpdate(formIds: Array<string>, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | disableFormsUpdate(formIds: Array<string>): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | isSystemReady(callback: AsyncCallback<void>): void | Exception |
| @ohos.app.form.formHost.d.ts | isSystemReady(): Promise<void> | Exception |
| @ohos.app.form.formHost.d.ts | getAllFormsInfo(callback: AsyncCallback<Array<formInfo.FormInfo>>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | getAllFormsInfo(): Promise<Array<formInfo.FormInfo>> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, callback: AsyncCallback<Array<formInfo.FormInfo>>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback<Array<formInfo.FormInfo>>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, moduleName?: string): Promise<Array<formInfo.FormInfo>> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | deleteInvalidForms(formIds: Array<string>, callback: AsyncCallback<number>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | deleteInvalidForms(formIds: Array<string>): Promise<number> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | acquireFormState(want: Want, callback: AsyncCallback<formInfo.FormStateInfo>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | acquireFormState(want: Want): Promise<formInfo.FormStateInfo> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | on(type: "formUninstall", callback: Callback<string>): void | Exception |
| @ohos.app.form.formHost.d.ts | off(type: "formUninstall", callback?: Callback<string>): void | Exception |
| @ohos.app.form.formHost.d.ts | notifyFormsVisible(formIds: Array<string>, isVisible: boolean, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyFormsVisible(formIds: Array<string>, isVisible: boolean): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyFormsEnableUpdate(formIds: Array<string>, isEnableUpdate: boolean, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyFormsEnableUpdate(formIds: Array<string>, isEnableUpdate: boolean): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | shareForm(formId: string, deviceId: string, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | shareForm(formId: string, deviceId: string): Promise<void> | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyFormsPrivacyProtected(formIds: Array<string>, isProtected: boolean, callback: AsyncCallback<void>): void | Asynchronous callback |
| @ohos.app.form.formHost.d.ts | notifyFormsPrivacyProtected(formIds: Array<string>, isProtected: boolean): Promise<void> | Asynchronous callback |
| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback<string>): void | Asynchronous callback |
| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, callback: AsyncCallback<string>): void | Asynchronous callback |
| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, formBindingData?: formBindingData.FormBindingData): Promise<string> | Asynchronous callback |
| @ohos.app.form.formProvider.d.ts | isRequestPublishFormSupported(callback: AsyncCallback<boolean>): void | Exception |
| @ohos.app.form.formProvider.d.ts | isRequestPublishFormSupported(): Promise<boolean> | Exception |
| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<void>): void | Asynchronous callback |
| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<void> | Asynchronous callback |
| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback<AbilityResult>): void | Exception |
| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<AbilityResult>): void | Exception |
| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<AbilityResult> | Exception |
| UIAbilityContext.d.ts | startServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void | Asynchronous callback |
| UIAbilityContext.d.ts | startServiceExtensionAbility(want: Want): Promise<void> | Asynchronous callback |
| UIAbilityContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| UIAbilityContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void> | Asynchronous callback |
| UIAbilityContext.d.ts | stopServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void | Asynchronous callback |
| UIAbilityContext.d.ts | stopServiceExtensionAbility(want: Want): Promise<void> | Asynchronous callback |
| UIAbilityContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| UIAbilityContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void> | Asynchronous callback |
| UIAbilityContext.d.ts | connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number | Asynchronous callback |
| UIAbilityContext.d.ts | setMissionIcon(icon: image.PixelMap, callback: AsyncCallback<void>): void | Asynchronous callback |
| UIAbilityContext.d.ts | setMissionIcon(icon: image.PixelMap): Promise<void> | Asynchronous callback |
| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<void>): void | Asynchronous callback |
| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<void> | Asynchronous callback |
| ServiceExtensionContext.d.ts | startServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void | Asynchronous callback |
| ServiceExtensionContext.d.ts | startServiceExtensionAbility(want: Want): Promise<void> | Asynchronous callback |
| ServiceExtensionContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| ServiceExtensionContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void> | Asynchronous callback |
| ServiceExtensionContext.d.ts | stopServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void | Asynchronous callback |
| ServiceExtensionContext.d.ts | stopServiceExtensionAbility(want: Want): Promise<void> | Asynchronous callback |
| ServiceExtensionContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void | Asynchronous callback |
| ServiceExtensionContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void> | Asynchronous callback |
| ServiceExtensionContext.d.ts | connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number | Asynchronous callback |
| Context.d.ts | createBundleContext(bundleName: string): Context | Exception |
| Context.d.ts | createModuleContext(bundleName: string, moduleName: string): Context | Exception |
| FormExtensionContext.d.ts | startAbility(want: Want, callback: AsyncCallback<void>): void | Asynchronous callback |
| FormExtensionContext.d.ts | startAbility(want: Want): Promise<void> | Asynchronous callback |
# Bluetooth Subsystem ChangeLog
## cl.bluetooth.1 API Migration to @ohos.bluetoothManager.d.ts
**@ohos.bluetooth.d.ts** does not allow for throwing error codes, which is required by API version 9 and system APIs. Therefore, all APIs of **@ohos.bluetooth.d.ts** are migrated to the newly added **@ohos.bluetoothManager.d.ts**, and error code description is also added.
To use Bluetooth APIs, import **@ohos.bluetoothManager**.
```ts
import bluetoothManager from '@ohos.bluetoothManager';
```
**Change Impacts**
System APIs and APIs in API version 9 are affected. Import **@ohos.bluetoothManager** to use APIs that can throw error codes.
```ts
import bluetoothManager from '@ohos.bluetoothManager';
```
**Key API/Component Changes**
| Class | Original API | New API | Change Type |
| ---------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| bluetooth | function getState(): BluetoothState | function getState(): BluetoothState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | method | function getBtConnectionState(): ProfileConnectionState; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function pairDevice(deviceId: string): boolean | function pairDevice(deviceId: string): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| bluetooth | function cancelPairedDevice(deviceId: string): boolean | function cancelPairedDevice(deviceId: string): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| bluetooth | function getRemoteDeviceName(deviceId: string): string | function getRemoteDeviceName(deviceId: string): string | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function getRemoteDeviceClass(deviceId: string): DeviceClass | function getRemoteDeviceClass(deviceId: string): DeviceClass | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function enableBluetooth(): boolean | function enableBluetooth(): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| bluetooth | function disableBluetooth(): boolean | function disableBluetooth(): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| bluetooth | function getLocalName(): string | function getLocalName(): string | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function getPairedDevices(): Array&lt;string&gt;; | function getPairedDevices(): Array&lt;string&gt;; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function getProfileConnState(profileId: ProfileId): ProfileConnectionState | function getProfileConnectionState(profileId: ProfileId): ProfileConnectionState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the API name to **getProfileConnectionState**.|
| bluetooth | function setDevicePairingConfirmation(device: string, accept: boolean): boolean | function setDevicePairingConfirmation(device: string, accept: boolean): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| bluetooth | function setLocalName(name: string): boolean; | function setLocalName(name: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| bluetooth | function setBluetoothScanMode(mode: ScanMode, duration: number): boolean | function setBluetoothScanMode(mode: ScanMode, duration: number): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| bluetooth | function getBluetoothScanMode(): ScanMod | function getBluetoothScanMode(): ScanMode | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function startBluetoothDiscovery(): boolean | function startBluetoothDiscovery(): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**, added the **ohos.permission.APPROXIMATELY_LOCATION** permission, and changed the return value to **void**.|
| bluetooth | function stopBluetoothDiscovery(): boolean; | function stopBluetoothDiscovery(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| bluetooth | function on(type: "bluetoothDeviceFind", callback: Callback&lt;Array&lt;string&gt;&gt;): void; | function on(type: "bluetoothDeviceFind", callback: Callback&lt;Array&lt;string&gt;&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function off(type: "bluetoothDeviceFind", callback?: Callback&lt;Array&lt;string&gt;&gt;): void; | function off(type: "bluetoothDeviceFind", callback?: Callback&lt;Array&lt;string&gt;&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function on(type: "bondStateChange", callback: Callback&lt;BondStateParam&gt;): void; | function on(type: "bondStateChange", callback: Callbackk&lt;BondStateParam&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function off(type: "bondStateChange", callback?: Callback&lt;BondStateParam&gt;): void; | function off(type: "bondStateChange", callback?: Callback&lt;BondStateParam&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function on(type: "pinRequired", callback: Callback&lt;PinRequiredParam&gt;): void; | function on(type: "pinRequired", callback: Callback&lt;PinRequiredParam&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function off(type: "pinRequired", callback?: Callback&lt;PinRequiredParam&gt;): void; | function off(type: "pinRequired", callback?: Callback&lt;PinRequiredParam&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function on(type: "stateChange", callback: Callback&lt;BluetoothState&gt;): void; | function on(type: "stateChange", callback: Callback&lt;BluetoothState&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function off(type: "stateChange", callback?: Callback&lt;BluetoothState&gt;): void; | function off(type: "stateChange", callback?: Callback&lt;BluetoothState&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function sppListen(name: string, option: SppOption, callback: AsyncCallback&lt;number&gt;): void; | function sppListen(name: string, option: SppOption, callback: AsyncCallback&lt;number&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function sppAccept(serverSocket: number, callback: AsyncCallback&lt;number&gt;): void; | function sppAccept(serverSocket: number, callback: AsyncCallback&lt;number&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function sppConnect(device: string, option: SppOption, callback: AsyncCallback&lt;number&gt;): void; | function sppConnect(device: string, option: SppOption, callback: AsyncCallback&lt;number&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function sppCloseServerSocket(socket: number): void; | function sppCloseServerSocket(socket: number): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function sppCloseClientSocket(socket: number): void; | function sppCloseClientSocket(socket: number): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function sppWrite(clientSocket: number, data: ArrayBuffer): boolean; | function sppWrite(clientSocket: number, data: ArrayBuffer): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| bluetooth | function on(type: "sppRead", clientSocket: number, callback: Callback&lt;ArrayBuffer&gt;): void; | function on(type: "sppRead", clientSocket: number, callback: Callback&lt;ArrayBuffer&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function off(type: "sppRead", clientSocket: number, callback?: Callback&lt;ArrayBuffer&gt;): void; | function off(type: "sppRead", clientSocket: number, callback?: Callback&lt;ArrayBuffer&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | function getProfile(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile; | function getProfileInstance(profileId: ProfileId): A2dpSourceProfile |
| bluetooth | function getProfileInst(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile | HidHostProfile |
| BaseProfile | getConnectionDevices(): Array&lt;string&gt;; | getConnectionDevices(): Array&lt;string&gt;; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| BaseProfile | getDeviceState(device: string): ProfileConnectionState; | getDeviceState(device: string): ProfileConnectionState; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| A2dpSourceProfile | connect(device: string): boolean; | connect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| A2dpSourceProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| A2dpSourceProfile | on(type: "connectionStateChange", callback: Callback&lt;StateChangeParam&gt;): void; | on(type: "connectionStateChange", callback: Callback&lt;StateChangeParam&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| A2dpSourceProfile | off(type: "connectionStateChange", callback?: Callback&lt;StateChangeParam&gt;): void; | off(type: "connectionStateChange", callback?: Callback&lt;StateChangeParam&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| A2dpSourceProfile | getPlayingState(device: string): PlayingState; | getPlayingState(device: string): PlayingState; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| HandsFreeAudioGatewayProfile | connect(device: string): boolean; | connect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| HandsFreeAudioGatewayProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| HandsFreeAudioGatewayProfile | on(type: "connectionStateChange", callback: Callback&lt;StateChangeParam&gt;): void; | on(type: "connectionStateChange", callback: Callback&lt;StateChangeParam&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| HandsFreeAudioGatewayProfile | off(type: "connectionStateChange", callback?: Callback&lt;StateChangeParam&gt;): void; | off(type: "connectionStateChange", callback?: Callback&lt;StateChangeParam&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| HidHostProfile | connect(device: string): boolean; | connect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| HidHostProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| HidHostProfile | on(type: "connectionStateChange", callback: Callback&lt;StateChangeParam&gt;): void; | on(type: "connectionStateChange", callback: Callback&lt;StateChangeParam&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| HidHostProfile | off(type: "connectionStateChange", callback?: Callback&lt;StateChangeParam&gt;): void; | off(type: "connectionStateChange", callback?: Callback&lt;StateChangeParam&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| PanProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| PanProfile | on(type: "connectionStateChange", callback: Callback&lt;StateChangeParam&gt;): void; | on(type: "connectionStateChange", callback: Callback&lt;StateChangeParam&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| PanProfile | off(type: "connectionStateChange", callback?: Callback&lt;StateChangeParam&gt;): void; | off(type: "connectionStateChange", callback?: Callback&lt;StateChangeParam&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| PanProfile | setTethering(enable: boolean): void; | setTethering(enable: boolean): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| PanProfile | isTetheringOn(): boolean; | isTetheringOn(): boolean; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| BLE | function createGattServer(): GattServer; | function createGattServer(): GattServer; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| BLE | function createGattClientDevice(deviceId: string): GattClientDevice; | function createGattClientDevice(deviceId: string): GattClientDevice; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| BLE | function getConnectedBLEDevices(): Array&lt;string&gt;; | function getConnectedBLEDevices(): Array&lt;string&gt;; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| BLE | function startBLEScan(filters: Array&lt;ScanFilter&gt;, options?: ScanOptions): void; | function startBLEScan(filters: Array&lt;ScanFilter&gt;, options?: ScanOptions): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and added the **ohos.permission.APPROXIMATELY_LOCATION** permission.|
| BLE | function stopBLEScan(): void; | function stopBLEScan(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| BLE | mefunction on(type: "BLEDeviceFind", callback: Callback&lt;Array&lt;ScanResult&gt;&gt;): void;thod | function on(type: "BLEDeviceFind", callback: Callback&lt;Array&lt;ScanResult&gt;&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| BLE | function off(type: "BLEDeviceFind", callback?: Callback&lt;Array&lt;ScanResult&gt;&gt;): void; | function off(type: "BLEDeviceFind", callback?: Callback&lt;Array&lt;ScanResult&gt;&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattServer | startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void; | startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattServer | stopAdvertising(): void; | stopAdvertising(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattServer | addService(service: GattService): boolean; | addService(service: GattService): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| GattServer | removeService(serviceUuid: string): boolean; | removeService(serviceUuid: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.|
| GattServer | close(): void; | close(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**.
| GattServer | notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): boolean; | notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. |
| GattServer | sendResponse(serverResponse: ServerResponse): boolean; | sendResponse(serverResponse: ServerResponse): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. |
| GattServer | on(type: "characteristicRead", callback: Callback&lt;CharacteristicReadReq&gt;): void; | on(type: "characteristicRead", callback: Callback&lt;CharacteristicReadRequest&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattServer | off(type: "characteristicRead", callback?: Callback&lt;CharacteristicReadReq&gt;): void; | off(type: "characteristicRead", callback?: Callback&lt;CharacteristicReadRequest&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattServer | on(type: "characteristicWrite", callback: Callback&lt;CharacteristicWriteReq&gt;): void; | on(type: "characteristicWrite", callback: Callback&lt;CharacteristicWriteRequest&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattServer | off(type: "characteristicWrite", callback?: Callback&lt;CharacteristicWriteReq&gt;): void; | off(type: "characteristicWrite", callback?: Callback&lt;CharacteristicWriteRequest&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattServer | on(type: "descriptorRead", callback: Callback&lt;DescriptorReadReq&gt;): void; | on(type: "descriptorRead", callback: Callback&lt;DescriptorReadRequest&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattServer | off(type: "descriptorRead", callback?: Callback&lt;DescriptorReadReq&gt;): void; | off(type: "descriptorRead", callback?: Callback&lt;DescriptorReadRequest&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattServer | on(type: "descriptorWrite", callback: Callback&lt;DescriptorWriteReq&gt;): void; | on(type: "descriptorWrite", callback: Callback&lt;DescriptorWriteRequest&gt;): void;| Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattServer | off(type: "descriptorWrite", callback?: Callback&lt;DescriptorWriteReq&gt;): void; | off(type: "descriptorWrite", callback?: Callback&lt;DescriptorWriteRequest&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattServer | on(type: "connectStateChange", callback: Callback&lt;BLEConnectChangedState&gt;): void; | on(type: "connectStateChange", callback: Callback&lt;BLEConnectChangedState&gt;): void;| Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattServer | off(type: "connectStateChange", callback?: Callback&lt;BLEConnectChangedState&gt;): void; | off(type: "connectStateChange", callback?: Callback&lt;BLEConnectChangedState&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | connect(): boolean; | connect(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. |
| GattClientDevice | disconnect(): boolean; | disconnect(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. |
| GattClientDevice | close(): boolean; | close(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. |
| GattClientDevice | getDeviceName(callback: AsyncCallback&lt;string&gt;): void; | getDeviceName(callback: AsyncCallback&lt;string&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | getDeviceName(): Promise&lt;string&gt;; | getDeviceName(): Promise&lt;string&gt;; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | getServices(callback: AsyncCallback&lt;Array&lt;GattService&gt;&gt;): void; | getServices(callback: AsyncCallback&lt;Array&lt;GattService&gt;&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | getServices(): Promise&lt;Array&lt;GattService&gt;&gt;; | getServices(): Promise&lt;Array&lt;GattService&gt;&gt;; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback&lt;BLECharacteristic&gt;): void; | readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback&lt;BLECharacteristic&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | readCharacteristicValue(characteristic: BLECharacteristic): Promise&lt;BLECharacteristic&gt;; | readCharacteristicValue(characteristic: BLECharacteristic): Promise&lt;BLECharacteristic&gt;; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback&lt;BLEDescriptor&gt;): void; | readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback&lt;BLEDescriptor&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | readDescriptorValue(descriptor: BLEDescriptor): Promise&lt;BLEDescriptor&gt;; | readDescriptorValue(descriptor: BLEDescriptor): Promise&lt;BLEDescriptor&gt;; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | writeCharacteristicValue(characteristic: BLECharacteristic): boolean; | writeCharacteristicValue(characteristic: BLECharacteristic): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. |
| GattClientDevice | writeDescriptorValue(descriptor: BLEDescriptor): boolean; | writeDescriptorValue(descriptor: BLEDescriptor): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. |
| GattClientDevice | getRssiValue(callback: AsyncCallback&lt;number&gt;): void; | getRssiValue(callback: AsyncCallback&lt;number&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | getRssiValue(): Promise&lt;number&gt;; | getRssiValue(): Promise&lt;number&gt;; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | setBLEMtuSize(mtu: number): boolean; | setBLEMtuSize(mtu: number): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. |
| GattClientDevice | setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): boolean; | setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. |
| GattClientDevice | on(type: "BLECharacteristicChange", callback: Callback&lt;BLECharacteristic&gt;): void; | on(type: "BLECharacteristicChange", callback: Callback&lt;BLECharacteristic&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | off(type: "BLECharacteristicChange", callback?: Callback&lt;BLECharacteristic&gt;): void; | off(type: "BLECharacteristicChange", callback?: Callback&lt;BLECharacteristic&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | on(type: "BLEConnectionStateChange", callback: Callback&lt;BLEConnectChangedState&gt;): void; | on(type: "BLEConnectionStateChange", callback: Callback&lt;BLEConnectChangedState&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| GattClientDevice | off(type: "BLEConnectionStateChange", callback?: Callback&lt;BLEConnectChangedState&gt;): void; | off(type: "BLEConnectionStateChange", callback?: Callback&lt;BLEConnectChangedState&gt;): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | GattService | GattService | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | BLECharacteristic | BLECharacteristic | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | BLEDescriptor | BLEDescriptor | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | NotifyCharacteristic | NotifyCharacteristic | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | CharacteristicReadReq | CharacteristicReadRequest | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | CharacteristicWriteReq | CharacteristicWriteRequest | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | DescriptorReadRe | DescriptorReadRequest | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | DescriptorWriteReq | DescriptorWriteRequest | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | ServerResponse | ServerResponse | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | BLEConnectChangedState | BLEConnectChangedState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | ScanResult | ScanResult | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | AdvertiseSetting | AdvertiseSetting | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | AdvertiseData | AdvertiseData | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | ManufactureData | ManufactureData | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | ServiceData | ServiceData | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | ScanFilter | ScanFilter | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | ScanOptions | ScanOptions | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | SppOption | SppOption | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | PinRequiredParam | PinRequiredParam | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | DeviceClass | DeviceClass | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | BondStateParam | BondStateParam | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | StateChangeParam | StateChangeParam | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | ScanDuty | ScanDuty | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | MatchMode | MatchMode | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | ProfileConnectionState | ProfileConnectionState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | BluetoothState | BluetoothState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | SppType | SppType | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | ScanMode | ScanMode | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | BondState | BondState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | MajorClass | MajorClass | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | MajorMinorClass | MajorMinorClass | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | PlayingState | PlayingState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
| bluetooth | ProfileId | ProfileId | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. |
**(Optional) Adaptation Guide**
The following uses **enableLocation** as an example to show how it is called in the new version:
```ts
import bluetoothManager from '@ohos.bluetoothManager';
try {
var state = bluetoothManager.getState();
} catch (err) {
console.error("errCode:" + err.code + ",errMessage:" + err.message);
}
```
# Distributed Data Management Subsystem JS API Changelog
## cl.distributeddatamgr.1 API Change
Changed the **relationalStore** APIs of the distributed data management (distributeddatamgr) subsystem.
Before change:
After **getRdbStore()** is called, the application determines whether the RDB store is newly created based on the **openStatus** attribute (openStatus == ON_CREATE) of the returned **rdbStore** object.
After change:
After **getRdbStore()** is called, the application determines whether the RDB store is newly created based on the **version** attribute (version == 0) of the returned **rdbStore** object.
You need to adapt your application.
**Change Impact**
The JS APIs of API version 10 are affected and need to be changed accordingly. Otherwise, certain functions cannot be properly implemented in the SDK of the new version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enum/Constant| Change Type|
| ------------------------------ | --------------- | ---------------- | ------- |
| @ohos.data.relationalStore | RdbStore | **openStatus: number;** is changed to **version: number;**.| Changed |
**Adaptation Guide**
Refer to the following code to set or obtain the RDB store version for an application:
```ts
const STORE_CONFIG = {
name: "rdbstore.db",
securityLevel: data_rdb.SecurityLevel.S1
}
data_rdb.getRdbStore(this.context, STORE_CONFIG, function (err, rdbStore) {
// Before:
// if (rdbStore.openStatus == ON_CREATE) {
// rdbStore.executeSql("CREATE TABLE IF NOT EXISTS student (id INTEGER PRIMARY KEY AUTOINCREMENT, score REAL);", null) // create table xxx
// }
// Now:
if (rdbStore.version == 0) {
rdbStore.executeSql("CREATE TABLE IF NOT EXISTS student (id INTEGER PRIMARY KEY AUTOINCREMENT, score REAL);", null) // create table xxx
// Set the RDB store version, which is a positive integer greater than 0.
rdbStore.version == 3
}
// Obtain the RDB store version.
console.info("Get RdbStore version is " + rdbStore.version)
})
```
# File Management Subsystem ChangeLog
## cl.filemanagement.1 Changed environment
The file management subsystem **d.ts** file has been archived and moved to the **file** directory. The **environment** module supports error code processing.
**Change Impacts**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. The **environment** module supports error code processing. See [adaptation instructions](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details.
**Key API/Component Changes**
Before the change, **environment** was imported using **@ohos.environment**:
```js
import environment from '@ohos.environment';
```
But now, **environment** is imported using **@ohos.file.environment**:
```js
import environment from '@ohos.file.environment';
```
## cl.filemanagement.2 Changed securityLabel
The file management subsystem **d.ts** file has been archived and moved to the **file** directory. The **securityLabel** module supports error code processing.
**Change Impacts**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. The **securityLabel** module supports error code processing. See [adaptation instructions](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details.
**Key API/Component Changes**
Before the change, **securityLabel** was imported using **@ohos.securityLabel**:
```js
import securityLabel from '@ohos.securityLabel';
```
But now, **securityLabel** is imported using **@ohos.file.securityLabel**:
```js
import securityLabel from '@ohos.file.securityLabel';
```
## cl.filemanagement.3 Changed fs
The **ino** attribute type of the **Stat** API under the **fs** module is changed.
**Change Impacts**
The **ino** attribute type is changed from number to BigInt, to adapt the inode range of all types of files in the file system.
**Key API/Component Changes**
The type of the **ino** attribute of the **Stat** API is changed from number to BigInt.
## cl.filemanagement.4 Changed fileAccess
The file management subsystem **d.ts** file has been archived and moved to the **file** directory. The **fileAccess** module supports error code processing.
**Change Impacts**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. The **fileAccess** module supports error code processing. See [adaptation instructions](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details.
**Key API/Component Changes**
Before the change, **fileAccess** was imported using **@ohos.data.fileAccess**:
```js
import fileAccess from '@ohos.data.fileAccess';
```
But now, **fileAccess** is imported using **@ohos.file.fileAccess**:
```js
import fileAccess from '@ohos.file.fileAccess';
```
## cl.filemanagement.5 Changed fileExtensionInfo
The file management subsystem **d.ts** file has been archived and moved to the **file** directory. The **fileExtensionInfo** module supports error code processing.
**Change Impacts**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. The **fileExtensionInfo** module supports error code processing. See [adaptation instructions](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details.
**Key API/Component Changes**
Before the change, **fileExtensionInfo** was imported using **@ohos.fileExtensionInfo**:
```js
import fileExtensionInfo from '@ohos.fileExtensionInfo';
```
But now, **fileExtensionInfo** is imported using **@ohos.file.fileExtensionInfo**:
```js
import fileExtensionInfo from '@ohos.file.fileExtensionInfo';
```
## cl.filemanagement.6 Changed storageStatistics
The file management subsystem **d.ts** file has been archived and moved to the **file** directory. The **fileExtensionInfo** module supports error code processing.
**Change Impacts**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. The **storageStatistics** module supports error code processing. See [adaptation instructions](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details.
**Key API/Component Changes**
Before the change, **storageStatistics** was imported using **@ohos.storageStatistics**:
```js
import storageStatistics from '@ohos.storageStatistics';
```
But now, **storageStatistics** is imported using **@ohos.file.storageStatistics**:
```js
import storageStatistics from '@ohos.file.storageStatistics';
```
## cl.filemanagement.7 Changed volumeManager
The file management subsystem **d.ts** file has been archived moved to the **file** directory. The **volumeManager** module supports error code processing.
**Change Impacts**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. The **volumeManager** module supports error code processing. See [adaptation instructions](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details.
**Key API/Component Changes**
Before the change, **volumeManager** was imported using **@ohos.volumeManager**:
```js
import volumeManager from '@ohos.volumeManager';
```
But now, **volumeManager** is imported using **@ohos.file.volumeManager**:
```js
import volumeManager from '@ohos.file.volumeManager';
```
# Globalization Subsystem ChangeLog
## cl.global.1 Runtime Authentication Added for System APIs
The internationalization component of the globalization subsystem adds runtime authentication for system APIs in certain scenarios. The following changes are made in API version 9 and later:
- Setting the system language, country or region, and area
- Setting the 24-hour format of the system
- Adding and removing the preferred language
- Setting localized numbers
You need to adapt your application based on the following information.
**Change Impacts**
APIs involved in the preceding scenarios can be properly called only by system applications that have the **UPDATE_CONFIGURATION** permission.
**Key API/Component Changes**
- Involved APIs:
- setSystemLanguage(language: string): void;
- setSystemRegion(region: string): void;
- setSystemLocale(locale: string): void;
- set24HourClock(option: boolean): void;
- addPreferredLanguage(language: string, index?: number): void;
- removePreferredLanguage(index: number): void;
- setUsingLocalDigit(flag: boolean): void;
**Adaptation Guide**
Make sure the application trying to call any of the above APIs is a system application. Non-system applications are not allowed to call the APIs.
An exception will be thrown upon lack of a necessary permission or a call request from a non-system application. The exception can be captured via **try-catch**.
```js
import I18n from '@ohos.i18n'
try {
I18n.System.setSystemLanguage('zh');
} catch(error) {
console.error(`call System.setSystemLanguage failed, error code: ${error.code}, message: ${error.message}.`)
}
```
# Media Subsystem ChangeLog
## cl.media.1 API Change of the Playback Function
Added the [AVPlayer](../../../application-dev/reference/apis/js-apis-media.md#avplayer9)<sup>9+</sup> API for audio and video playback, with the updated state machine and error codes, which is recommended. The following APIs for audio playback and video playback are no longer maintained: [AudioPlayer](../../../application-dev/reference/apis/js-apis-media.md#audioplayer)<sup>6+</sup> and [VideoPlayer](../../../application-dev/reference/apis/js-apis-media.md#videoplayer)<sup>8+</sup>.
**Change Impacts**
The original APIs can still be used but are no longer maintained. You are advised to use the new API instead.
**Key API/Component Changes**
Added APIs
| Class | Declaration |
| -------------- | ------------------------------------------------------------ |
| media | createAVPlayer(callback: AsyncCallback\<AVPlayer>): void |
| media | createAVPlayer() : Promise\<AVPlayer> |
| media.AVPlayer | interface AVPlayer |
| media.AVPlayer | videoScaleType ?: VideoScaleType |
| media.AVPlayer | url ?: string |
| media.AVPlayer | surfaceId ?: string |
| media.AVPlayer | stop(callback: AsyncCallback\<void>): void |
| media.AVPlayer | stop(): Promise\<void> |
| media.AVPlayer | setVolume(volume: number): void |
| media.AVPlayer | setSpeed(speed: PlaybackSpeed): void |
| media.AVPlayer | setBitrate(bitrate: number): void |
| media.AVPlayer | seek(timeMs: number, mode?:SeekMode): void |
| media.AVPlayer | reset(callback: AsyncCallback\<void>): void |
| media.AVPlayer | reset(): Promise\<void> |
| media.AVPlayer | release(callback: AsyncCallback\<void>): void |
| media.AVPlayer | release(): Promise\<void> |
| media.AVPlayer | readonly width: number |
| media.AVPlayer | readonly state: AVPlayerState |
| media.AVPlayer | readonly height: number |
| media.AVPlayer | readonly duration: number |
| media.AVPlayer | readonly currentTime: number |
| media.AVPlayer | prepare(callback: AsyncCallback\<void>): void |
| media.AVPlayer | prepare(): Promise\<void> |
| media.AVPlayer | play(callback: AsyncCallback\<void>): void |
| media.AVPlayer | play(): Promise\<void> |
| media.AVPlayer | pause(callback: AsyncCallback\<void>): void |
| media.AVPlayer | pause(): Promise\<void> |
| media.AVPlayer | on(type: 'volumeChange', callback: Callback\<number>): void |
| media.AVPlayer | on(type: 'videoSizeChange', callback: (width: number, height: number) => void): void |
| media.AVPlayer | on(type: 'timeUpdate', callback: Callback\<number>): void |
| media.AVPlayer | on(type: 'stateChange', callback: (state: AVPlayerState, reason: StateChangeReason) => void): void |
| media.AVPlayer | on(type: 'startRenderFrame', callback: Callback\<void>): void |
| media.AVPlayer | on(type: 'speedDone', callback: Callback\<number>): void |
| media.AVPlayer | on(type: 'seekDone', callback: Callback\<number>): void |
| media.AVPlayer | on(type: 'error', callback: ErrorCallback): void |
| media.AVPlayer | on(type: 'endOfStream', callback: Callback\<void>): void |
| media.AVPlayer | on(type: 'durationUpdate', callback: Callback\<number>): void |
| media.AVPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void |
| media.AVPlayer | on(type: 'bitrateDone', callback: Callback\<number>): void |
| media.AVPlayer | on(type: 'availableBitrates', callback: (bitrates: Array\<number>) => void): void |
| media.AVPlayer | on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void |
| media.AVPlayer | off(type: 'volumeChange'): void |
| media.AVPlayer | off(type: 'videoSizeChange'): void |
| media.AVPlayer | off(type: 'timeUpdate'): void |
| media.AVPlayer | off(type: 'stateChange'): void |
| media.AVPlayer | off(type: 'startRenderFrame'): void |
| media.AVPlayer | off(type: 'speedDone'): void |
| media.AVPlayer | off(type: 'seekDone'): void |
| media.AVPlayer | off(type: 'error'): void |
| media.AVPlayer | off(type: 'endOfStream'): void |
| media.AVPlayer | off(type: 'durationUpdate'): void |
| media.AVPlayer | off(type: 'bufferingUpdate'): void |
| media.AVPlayer | off(type: 'bitrateDone'): void |
| media.AVPlayer | off(type: 'availableBitrates'): void |
| media.AVPlayer | off(type: 'audioInterrupt'): void |
| media.AVPlayer | loop: boolean |
| media.AVPlayer | getTrackDescription(callback: AsyncCallback\<Array\<MediaDescription>>): void |
| media.AVPlayer | getTrackDescription() : Promise\<Array\<MediaDescription>> |
| media.AVPlayer | fdSrc ?: AVFileDescriptor |
| media.AVPlayer | audioInterruptMode ?: audio.InterruptMode |
| unnamed | type AVPlayerState = 'idle' \| 'initialized' \| 'prepared' \| 'playing' \| 'paused' \| 'completed' \| 'stopped' \| 'released' \| 'error' |
APIs no longer maintained
| Class | Declaration |
| ----------------- | ------------------------------------------------------------ |
| media | createVideoPlayer(callback: AsyncCallback\<VideoPlayer>): void |
| media | createVideoPlayer() : Promise\<VideoPlayer> |
| media | createAudioPlayer(): AudioPlayer |
| media.AudioPlayer | interface AudioPlayer |
| media.AudioPlayer | play(): void |
| media.AudioPlayer | release(): void |
| media.AudioPlayer | audioInterruptMode ?: audio.InterruptMode |
| media.AudioPlayer | fdSrc: AVFileDescriptor |
| media.AudioPlayer | seek(timeMs: number): void |
| media.AudioPlayer | readonly duration: number |
| media.AudioPlayer | loop: boolean |
| media.AudioPlayer | readonly state: AudioState |
| media.AudioPlayer | getTrackDescription(callback: AsyncCallback\<Array\<MediaDescription>>): void |
| media.AudioPlayer | getTrackDescription() : Promise\<Array\<MediaDescription>> |
| media.AudioPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void |
| media.AudioPlayer | on(type: 'play' \| 'pause' \| 'stop' \| 'reset' \| 'dataLoad' \| 'finish' \| 'volumeChange', callback: () => void): void |
| media.AudioPlayer | on(type: 'timeUpdate', callback: Callback\<number>): void |
| media.AudioPlayer | on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void |
| media.AudioPlayer | on(type: 'error', callback: ErrorCallback): void |
| media.AudioPlayer | setVolume(vol: number): void |
| media.AudioPlayer | pause(): void |
| media.AudioPlayer | readonly currentTime: number |
| media.AudioPlayer | stop(): void |
| media.AudioPlayer | reset(): void |
| media.AudioPlayer | src: string |
| media.VideoPlayer | interface VideoPlayer |
| media.VideoPlayer | play(callback: AsyncCallback\<void>): void |
| media.VideoPlayer | play(): Promise\<void> |
| media.VideoPlayer | prepare(callback: AsyncCallback\<void>): void |
| media.VideoPlayer | prepare(): Promise\<void> |
| media.VideoPlayer | release(callback: AsyncCallback\<void>): void |
| media.VideoPlayer | release(): Promise\<void> |
| media.VideoPlayer | audioInterruptMode ?: audio.InterruptMode |
| media.VideoPlayer | fdSrc: AVFileDescriptor |
| media.VideoPlayer | seek(timeMs: number, callback: AsyncCallback\<number>): void |
| media.VideoPlayer | seek(timeMs: number, mode:SeekMode, callback: AsyncCallback\<number>): void |
| media.VideoPlayer | seek(timeMs: number, mode?:SeekMode): Promise\<number> |
| media.VideoPlayer | readonly duration: number |
| media.VideoPlayer | loop: boolean |
| media.VideoPlayer | videoScaleType ?: VideoScaleType |
| media.VideoPlayer | readonly state: VideoPlayState |
| media.VideoPlayer | getTrackDescription(callback: AsyncCallback\<Array\<MediaDescription>>): void |
| media.VideoPlayer | getTrackDescription() : Promise\<Array\<MediaDescription>> |
| media.VideoPlayer | readonly height: number |
| media.VideoPlayer | on(type: 'playbackCompleted', callback: Callback\<void>): void |
| media.VideoPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void |
| media.VideoPlayer | on(type: 'startRenderFrame', callback: Callback\<void>): void |
| media.VideoPlayer | on(type: 'videoSizeChanged', callback: (width: number, height: number) => void): void |
| media.VideoPlayer | on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void |
| media.VideoPlayer | on(type: 'error', callback: ErrorCallback): void |
| media.VideoPlayer | setDisplaySurface(surfaceId: string, callback: AsyncCallback\<void>): void |
| media.VideoPlayer | setDisplaySurface(surfaceId: string): Promise\<void> |
| media.VideoPlayer | setVolume(vol: number, callback: AsyncCallback\<void>): void |
| media.VideoPlayer | setVolume(vol: number): Promise\<void> |
| media.VideoPlayer | url: string |
| media.VideoPlayer | pause(callback: AsyncCallback\<void>): void |
| media.VideoPlayer | pause(): Promise\<void> |
| media.VideoPlayer | readonly currentTime: number |
| media.VideoPlayer | setSpeed(speed:number, callback: AsyncCallback\<number>): void |
| media.VideoPlayer | setSpeed(speed:number): Promise\<number> |
| media.VideoPlayer | stop(callback: AsyncCallback\<void>): void |
| media.VideoPlayer | stop(): Promise\<void> |
| media.VideoPlayer | readonly width: number |
| media.VideoPlayer | reset(callback: AsyncCallback\<void>): void |
| media.VideoPlayer | reset(): Promise\<void> |
| unnamed | type AudioState = 'idle' \| 'playing' \| 'paused' \| 'stopped' \| 'error' |
| unnamed | type VideoPlayState = 'idle' \| 'prepared' \| 'playing' \| 'paused' \| 'stopped' \| 'error' |
**Adaptation Guide**
For details, see the [reference](../../../application-dev/reference/apis/js-apis-media.md) for each API.
## cl.media.2 API Change of the Recording Function
Added the [AVRecorder](../../../application-dev/reference/apis/js-apis-media.md#avrecorder9)<sup>9+</sup> API for audio and video recording, with the updated state machine and error codes, which is recommended. The following APIs for audio recording and video recording are no longer maintained: [AudioRecorder](../../../application-dev/reference/apis/js-apis-media.md#audiorecorder)<sup>6+</sup> and [VideoRecorder](../../../application-dev/reference/apis/js-apis-media.md#videorecorder9)<sup>9+</sup>.
The [AudioSourceType](../../../application-dev/reference/apis/js-apis-media.md#audiosourcetype9) and [VideoSourceType](../../../application-dev/reference/apis/js-apis-media.md#videosourcetype9) APIs shared by the old and new recording APIs are changed to non-system APIs.
**Change Impacts**
The [AudioRecorder](../../../application-dev/reference/apis/js-apis-media.md#audiorecorder)<sup>6+</sup> and [VideoRecorder](../../../application-dev/reference/apis/js-apis-media.md#videorecorder9)<sup>9+</sup> APIs can still be used but are no longer maintained. You are advised to use the [AVRecorder](../../../application-dev/reference/apis/js-apis-media.md#avrecorder9)<sup>9+</sup> API instead.
**Key API/Component Changes**
Added APIs
| Class | Declaration |
| ----------------------- | ------------------------------------------------------------ |
| media | createAVRecorder(callback: AsyncCallback\<AVRecorder>): void |
| media | createAVRecorder() : Promise\<AVRecorder> |
| media.AVRecorder | interface AVRecorder |
| media.AVRecorder | prepare(config: AVRecorderConfig, callback: AsyncCallback\<void>): void |
| media.AVRecorder | prepare(config: AVRecorderConfig): Promise\<void> |
| media.AVRecorder | release(callback: AsyncCallback\<void>): void |
| media.AVRecorder | release(): Promise\<void> |
| media.AVRecorder | readonly state: AVRecorderState |
| media.AVRecorder | on(type: 'stateChange', callback: (state: AVRecorderState, reason: StateChangeReason) => void): void |
| media.AVRecorder | on(type: 'error', callback: ErrorCallback): void |
| media.AVRecorder | resume(callback: AsyncCallback\<void>): void |
| media.AVRecorder | resume(): Promise\<void> |
| media.AVRecorder | start(callback: AsyncCallback\<void>): void |
| media.AVRecorder | start(): Promise\<void> |
| media.AVRecorder | off(type: 'stateChange'): void |
| media.AVRecorder | off(type: 'error'): void |
| media.AVRecorder | pause(callback: AsyncCallback\<void>): void |
| media.AVRecorder | pause(): Promise\<void> |
| media.AVRecorder | stop(callback: AsyncCallback\<void>): void |
| media.AVRecorder | stop(): Promise\<void> |
| media.AVRecorder | reset(callback: AsyncCallback\<void>): void |
| media.AVRecorder | reset(): Promise\<void> |
| media.AVRecorder | getInputSurface(callback: AsyncCallback\<string>): void |
| media.AVRecorder | getInputSurface(): Promise\<string> |
| media.AVRecorderConfig | videoSourceType?: VideoSourceType |
| media.AVRecorderConfig | audioSourceType?: AudioSourceType |
| media.AVRecorderConfig | profile: AVRecorderProfile |
| media.AVRecorderConfig | rotation?: number |
| media.AVRecorderConfig | url: string |
| media.AVRecorderConfig | location?: Location |
| media.AVRecorderConfig | interface AVRecorderConfig |
| media.AVRecorderProfile | videoBitrate?: number |
| media.AVRecorderProfile | videoCodec?: CodecMimeType |
| media.AVRecorderProfile | audioCodec?: CodecMimeType |
| media.AVRecorderProfile | videoFrameRate?: number |
| media.AVRecorderProfile | videoFrameHeight?: number |
| media.AVRecorderProfile | audioSampleRate?: number |
| media.AVRecorderProfile | audioBitrate?: number |
| media.AVRecorderProfile | videoFrameWidth?: number |
| media.AVRecorderProfile | audioChannels?: number |
| media.AVRecorderProfile | fileFormat: ContainerFormatType |
| media.AVRecorderProfile | interface AVRecorderProfile |
| unnamed | type AVRecorderState = 'idle' \| 'prepared' \| 'started' \| 'paused' \| 'stopped' \| 'released' \| 'error' |
APIs no longer maintained
| Class | Declaration |
| -------------------------- | ------------------------------------------------------------ |
| media | createVideoRecorder(callback: AsyncCallback\<VideoRecorder>): void |
| media | createVideoRecorder(): Promise\<VideoRecorder> |
| media | createAudioRecorder(): AudioRecorder |
| media.AudioRecorder | interface AudioRecorder |
| media.AudioRecorder | prepare(config: AudioRecorderConfig): void |
| media.AudioRecorder | release(): void |
| media.AudioRecorder | on(type: 'prepare' \| 'start' \| 'pause' \| 'resume' \| 'stop' \| 'release' \| 'reset', callback: () => void): void |
| media.AudioRecorder | on(type: 'error', callback: ErrorCallback): void |
| media.AudioRecorder | resume(): void |
| media.AudioRecorder | start(): void |
| media.AudioRecorder | pause(): void |
| media.AudioRecorder | stop(): void |
| media.AudioRecorder | reset(): void |
| media.AudioRecorderConfig | audioSampleRate?: number |
| media.AudioRecorderConfig | location?: Location |
| media.AudioRecorderConfig | fileFormat?: ContainerFormatType |
| media.AudioRecorderConfig | interface AudioRecorderConfig |
| media.AudioRecorderConfig | audioEncoder?: AudioEncoder |
| media.AudioRecorderConfig | audioEncodeBitRate?: number |
| media.AudioRecorderConfig | numberOfChannels?: number |
| media.AudioRecorderConfig | format?: AudioOutputFormat |
| media.AudioRecorderConfig | uri: string |
| media.AudioRecorderConfig | audioEncoderMime?: CodecMimeType |
| media.VideoRecorder | interface VideoRecorder |
| media.VideoRecorder | prepare(config: VideoRecorderConfig, callback: AsyncCallback\<void>): void |
| media.VideoRecorder | prepare(config: VideoRecorderConfig): Promise\<void> |
| media.VideoRecorder | release(callback: AsyncCallback\<void>): void |
| media.VideoRecorder | release(): Promise\<void> |
| media.VideoRecorder | readonly state: VideoRecordState |
| media.VideoRecorder | on(type: 'error', callback: ErrorCallback): void |
| media.VideoRecorder | resume(callback: AsyncCallback\<void>): void |
| media.VideoRecorder | resume(): Promise\<void> |
| media.VideoRecorder | start(callback: AsyncCallback\<void>): void |
| media.VideoRecorder | start(): Promise\<void> |
| media.VideoRecorder | pause(callback: AsyncCallback\<void>): void |
| media.VideoRecorder | pause(): Promise\<void> |
| media.VideoRecorder | stop(callback: AsyncCallback\<void>): void |
| media.VideoRecorder | stop(): Promise\<void> |
| media.VideoRecorder | reset(callback: AsyncCallback\<void>): void |
| media.VideoRecorder | reset(): Promise\<void> |
| media.VideoRecorder | getInputSurface(callback: AsyncCallback\<string>): void |
| media.VideoRecorder | getInputSurface(): Promise\<string> |
| media.VideoRecorderConfig | videoSourceType: VideoSourceType |
| media.VideoRecorderConfig | audioSourceType?: AudioSourceType |
| media.VideoRecorderConfig | profile: VideoRecorderProfile |
| media.VideoRecorderConfig | rotation?: number |
| media.VideoRecorderConfig | url: string |
| media.VideoRecorderConfig | location?: Location |
| media.VideoRecorderConfig | interface VideoRecorderConfig |
| media.VideoRecorderProfile | readonly videoBitrate: number |
| media.VideoRecorderProfile | readonly videoCodec: CodecMimeType |
| media.VideoRecorderProfile | readonly audioCodec: CodecMimeType |
| media.VideoRecorderProfile | readonly videoFrameRate: number |
| media.VideoRecorderProfile | readonly videoFrameHeight: number |
| media.VideoRecorderProfile | readonly audioSampleRate: number |
| media.VideoRecorderProfile | readonly audioBitrate: number |
| media.VideoRecorderProfile | readonly videoFrameWidth: number |
| media.VideoRecorderProfile | readonly audioChannels: number |
| media.VideoRecorderProfile | readonly fileFormat: ContainerFormatType |
| media.VideoRecorderProfile | interface VideoRecorderProfile |
| unnamed | type VideoRecordState = 'idle' \| 'prepared' \| 'playing' \| 'paused' \| 'stopped' \| 'error' |
Changed APIs
| Class | Declaration | Capability Before Change | Capability After Change | Whether a System API Before Change| Whether a System API After Change|
| --------------------- | ------------------------------------------------------------ | ----------------------------------------------- | -------------------------------------------- | -------------------- | -------------------- |
| media.AudioSourceType | enum AudioSourceType { /** * default audio source type. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ AUDIO_SOURCE_TYPE_DEFAULT = 0, /** * source type mic. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ AUDIO_SOURCE_TYPE_MIC = 1, } | SystemCapability.Multimedia.Media.VideoRecorder | SystemCapability.Multimedia.Media.AVRecorder | Yes | No |
| media.VideoSourceType | enum VideoSourceType { /** * surface raw data. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ VIDEO_SOURCE_TYPE_SURFACE_YUV = 0, /** * surface ES data. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ VIDEO_SOURCE_TYPE_SURFACE_ES = 1, } | SystemCapability.Multimedia.Media.VideoRecorder | SystemCapability.Multimedia.Media.AVRecorder | Yes | No |
**Adaptation Guide**
For details, see the [reference](../../../application-dev/reference/apis/js-apis-media.md) for each API.
## cl.media.3 Error Code Change
Added the standard error code enumeration type [AVErrorCode9](../../../application-dev/reference/apis/js-apis-media.md#averrorcode)<sup>9+</sup> that replaces the original error code enumeration type [MediaErrorCode](../../../application-dev/reference/apis/js-apis-media.md#mediaerrorcode)<sup>8+</sup>.
**Change Impacts**
The error code enumeration type [MediaErrorCode](../../../application-dev/reference/apis/js-apis-media.md#mediaerrorcode)<sup>8+</sup> is still used for original APIs. [AVErrorCode9](../../../application-dev/reference/apis/js-apis-media.md#averrorcode)<sup>9+</sup> is used for newly added APIs.
**Key API/Component Changes**
Added API
| Class | Declaration |
| ----------------- | ------------------------------------------------------------ |
| media.AVErrorCode | enum AVErrorCode { /** * operation success. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_OK = 0, /** * permission denied. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_NO_PERMISSION = 201, /** * invalid parameter. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_INVALID_PARAMETER = 401, /** * the api is not supported in the current version * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_UNSUPPORT_CAPABILITY = 801, /** * the system memory is insufficient or the number of services reaches the upper limit * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_NO_MEMORY = 5400101, /** * current status does not allow or do not have permission to perform this operation * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_OPERATE_NOT_PERMIT = 5400102, /** * data flow exception information * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_IO = 5400103, /** * system or network response timeout. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_TIMEOUT = 5400104, /** * service process died. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_SERVICE_DIED = 5400105, /** * unsupported media format * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_UNSUPPORT_FORMAT = 5400106, } |
API no longer maintained
| Class | Declaration |
| -------------------- | ------------------------------------------------------------ |
| media.MediaErrorCode | enum MediaErrorCode { /** * operation success. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_OK = 0, /** * malloc or new memory failed. maybe system have no memory. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_NO_MEMORY = 1, /** * no permission for the operation. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_OPERATION_NOT_PERMIT = 2, /** * invalid argument. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_INVALID_VAL = 3, /** * an I/O error occurred. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_IO = 4, /** * operation time out. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_TIMEOUT = 5, /** * unknown error. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_UNKNOWN = 6, /** * media service died. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_SERVICE_DIED = 7, /** * operation is not permit in current state. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_INVALID_STATE = 8, /** * operation is not supported in current version. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_UNSUPPORTED = 9, } |
<!--no_check-->
\ No newline at end of file
# Test Subsystem ChangeLog
## cl.testfwk_arkxtest.1 API Name Change of Rect
The definition of **Rect**, an enumeration type that indicates the component bound information, is changed since version 4.0.2.1.
## Change Impacts
This change affects the **Rect** API provided by **@ohos.uitest**. If you have used the **Rect** API 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
### Rect<sup>9+</sup>
Before change
| Name | Value | Description |
| ------- | ---- | ------------------------- |
| leftX | 1 | X-coordinate of the upper left corner of the component bounds.|
| topY | 2 | Y-coordinate of the upper left corner of the component bounds.|
| rightX | 3 | X-coordinate of the lower right corner of the component bounds.|
| bottomY | 4 | Y-coordinate of the lower right corner of the component bounds.|
After change
| Name | Value | Description |
| ------ | ---- | ------------------------- |
| left | 1 | X-coordinate of the upper left corner of the component bounds.|
| top | 2 | Y-coordinate of the upper left corner of the component bounds.|
| right | 3 | X-coordinate of the lower right corner of the component bounds.|
| bottom | 4 | Y-coordinate of the lower right corner of the component bounds.|
## Adaptation Guide
### Adaptation to the API Name Change
You can replace the class name according to the following rules:
- `leftX-->left`
- `topY-->top`
- `rightX-->right`
- `bottomY-->bottom`
# USB Subsystem API Changelog
## cl.usb_manager.1 System API Change
Runtime authentication is performed for system APIs of the USB manager. An asynchronous API throws an error code via **Promise.reject**.
If your application is developed based on earlier versions, modify the return values of functions. Otherwise, the original service logic will be affected.
**Key API/Component Changes**
| Bundle Name | Original API | New API |
| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| ohos.usbV9.d.ts | function setCurrentFunctions(funcs: FunctionType): Promise<boolean>; | function setCurrentFunctions(funcs: FunctionType): Promise<void>; |
| ohos.usbV9.d.ts | function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise<boolean>; | function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise<void>; |
## cl.usb_manager.2 SDK API Deletion
The **@ohos.usbV9.d.ts** file was deleted in OpenHarmony 4.0.5.5.
You need to import **@ohos.usbManager** to use USB service APIs.
```ts
import usbManager from '@ohos.usbManager';
```
**Adaptation Guide**
For details about usage of each API, see the [API Reference](../../../application-dev/reference/apis/js-apis-usbManager.md).
# Web Subsystem Changelog
Compared with earlier versions, OpenHarmony 4.0.2.2 has the following API changes in its web subsystem:
## cl.web.1 Removal of webDebuggingAccess
The definition of the **webDebuggingAccess** API is inappropriate. This API should take effect for all **Web** instances. In light of this, it is removed and replaced by the new API **setWebDebuggingAccess**.
**Change Impacts**
This API must be deprecated and replaced with the **setWebDebuggingAccess** API.
**Key API/Component Changes**
| Class| API Type| Declaration| Change Type|
| -- | -- | -- | -- |
|WebAttribute | method | webDebugggingAccess(webDebugggingAccess: boolean): WebAttribute| Deleted |
**Adaptation Guide**
Use the new API **setWebDebuggingAccess**.
## cl.web.2 Adding of setWebDebuggingAccess
Added the static API **setWebDebuggingAccess** to **WebviewController**. It sets whether to enable web debugging works for all **Web** instances.
**Change Impacts**
The original **webDebugggingAccess** API must be replaced with the new API in the application.
**Key API/Component Changes**
| Class| API Type| Declaration| Change Type|
| -- | -- | -- | -- |
|webview.WebviewController | method | static setWebDebugggingAccess(webDebugggingAccess: boolean): void| Added|
**Adaptation Guide**
The following exemplifies how to enable web debugging:
```ts
// xxx.ets
import web_webview from '@ohos.web.webview';
@Entry
@Component
struct WebComponent {
controller: web_webview.WebviewController = new web_webview.WebviewController();
aboutToAppear():void {
try {
web_webview.WebviewController.setWebDebuggingAccess(true);
} catch(error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
}
build() {
Column() {
Web({ src: 'www.example.com', controller: this.controller })
}
}
}
# Bundle Management Subsystem Changelog
## cl.bundlemanager.1 Changed Underlying Capability by Not Decompressing the HAP During HAP Installation
The HAP will no longer be decompressed during installation. After the installation is complete, only the HAP file exists in the installation directory. As a result, the application must use the standard resource management interface, rather than a combined path, to access a resource file.
**Change Impact**<br>
If the application uses a combined path to access a resource file, the access fails. It must use the resource management interface.
**Key API/Component Changes**<br>
No API or component change is involved.
**Adaptation Guide**<br>
The resource management subsystem provides the JS interface for accessing resource files. Reference: [Accessing Resource Files](../../../application-dev/reference/apis/js-apis-resource-manager.md#getrawfilecontent9)
# Globalization Subsystem Changelog
## cl.resourceManager.1 Change in the Meaning of the Return Value for the API Used to Obtain the rawfile Descriptor
Changed the meaning of the return value for the API used to obtain the rawfile descriptor after the non-decompression feature is added in this version. The change in the meaning of the return value, namely, **descriptor: RawFileDescriptor {fd, offset, length}**, is described as follows:
**Before change:**
**fd**: file descriptor for accessing the rawfile.
**offset**: offset for accessing the rawfile. In this case, the value is **0**.
**length**: size of the rawfile to access.
**After change:**
**fd**: file descriptor for accessing the HAP where the rawfile is located.
**offset**: offset of the accessed rawfile relative to the HAP.
**length**: size of the rawfile to access.
**Change Impact**
In versions earlier than 4.0.2.2, the rawfile can be accessed only through **fd**. In version 4.0.2.2 or later, the rawfile can be accessed only through **{fd, offset, and length}**.
**Key API/Component Changes**
| **Original API** |
| ---------------- |
| getRawFd(path: string, callback: AsyncCallback\<RawFileDescriptor>): void |
| getRawFd(path: string): Promise\<RawFileDescriptor> |
| getRawFileDescriptor(path: string, callback: AsyncCallback\<RawFileDescriptor>): void|
| getRawFileDescriptor(path: string): Promise\<RawFileDescriptor>|
||
**Sample Code**
The following is an example of calling the **getRawFd** API:
```
try {
this.context.resourceManager.getRawFd("test.ogg", (error, value) => {
if (error != null) {
console.log(`callback getRawFd failed error code: ${error.code}, message: ${error.message}.`);
} else {
let fileDescriptor = {
fd = value.fd,
offset = value.offset,
length = value.length
}
this.avPlayer.fdSrc(fileDescriptor); // Take the audio player as an example. When calling fdSrc, pass fileDescriptor in addition to fd.
}
});
} catch (error) {
console.error(`callback getRawFd failed, error code: ${error.code}, message: ${error.message}.`)
};
```
# Ability Subsystem Changelog
## cl.ability.1 RestartFlag Attribute Names Changed and Unsupported Attribute Deleted in appRecovery
In the **appRecovery** API, the enum names of **RestartFlag** are changed from **NO_RESTART** upon a specific fault to **RESTART** upon a specific fault.
The **CPP_CRASH_NO_RESTART** enum is deleted.
**Change Impact**
If your application uses the **CPP_CRASH_NO_RESTART**, **JS_CRASH_NO_RESTART**, or **APP_FREEZE_NO_RESTART** attribute in versions earlier than 4.0.2.3, its behavior will change after an upgrade to 4.0.2.3.
**Key API/Component Changes**
**RestartFlag** <sup>9+</sup>
Before change:
| Name | Value | Description |
| ----------------------------- | ---- | ------------------------------------------------------------ |
| ALWAYS_RESTART | 0 | The application is restarted in all cases.|
| CPP_CRASH_NO_RESTART | 0x0001 | The application is **not restarted** in the case of CPP_CRASH.|
| JS_CRASH_NO_RESTART | 0x0002 | The application is **not restarted** in the case of JS_CRASH.|
| APP_FREEZE_NO_RESTART | 0x0004 | The application is **not restarted** in the case of APP_FREEZE.|
| NO_RESTART | 0xFFFF | The application is not restarted in any case.|
After change:
| Name | Value | Description |
| ---------- | ---- | ---------- |
| ALWAYS_RESTART | 0 | The application is restarted in all cases.|
| CPP_CRASH_NO_RESTART | NA | **Deleted.** The restart in this scenario is not supported.|
| RESTART_WHEN_JS_CRASH | 0x0001 | The application is **restarted** in the case of JS_CRASH.|
| RESTART_WHEN_APP_FREEZE | 0x0002 | The application is **restarted** in the case of APP_FREEZE.|
| NO_RESTART | 0xFFFF | The application is not restarted in any case.|
**Adaptation Guide**
Perform adaptation based on the new semantics.
# ANS Subsystem Changelog
## cl.notificationManager.1 API Renaming
Renamed certain APIs to meet the naming conventions.
**Change Impact**
The underlying layer still supports the functions of the original APIs, and therefore these APIs can be called in OpenHarmony 4.0.2.3.
**Key API/Component Changes**
| Bundle Name | Original API | New API |
| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| ohos.notificationManager.d.ts | **function** supportDoNotDisturbMode(callback: AsyncCallback\<boolean>): **void**; | **function** isSupportDoNotDisturbMode(callback: AsyncCallback\<boolean>): **void**; |
| ohos.notificationManager.d.ts | **function** supportDoNotDisturbMode(): Promise\<boolean>; | **function** isSupportDoNotDisturbMode(): Promise\<boolean>; |
**Adaptation Guide**
Call the new API **isSupportDoNotDisturbMode**.
# ArkUI Subsystem ChangeLog
## cl.arkui.1 Restrictions on Data Type Declarations of State Variables
1. The data types of state variables decorated by state decorators must be explicitly declared. They cannot be declared as **any** or **Date**.
Example:
```ts
// xxx.ets
@Entry
@Component
struct DatePickerExample {
// Incorrect: @State isLunar: any = false
@State isLunar: boolean = false
// Incorrect: @State selectedDate: Date = new Date('2021-08-08')
private selectedDate: Date = new Date('2021-08-08')
build() {
Column() {
Button('Switch Calendar')
.margin({ top: 30 })
.onClick(() => {
this.isLunar = !this.isLunar
})
DatePicker({
start: new Date('1970-1-1'),
end: new Date('2100-1-1'),
selected: this.selectedDate
})
.lunar(this.isLunar)
.onChange((value: DatePickerResult) => {
this.selectedDate.setFullYear(value.year, value.month, value.day)
console.info('select current date is: ' + JSON.stringify(value))
})
}.width('100%')
}
}
```
![datePicker](../../../application-dev/reference/arkui-ts/figures/datePicker.gif)
2. The data type declaration of the **@State**, **@Provide**, **@Link**, or **@Consume** decorated state variables can consist of only one of the primitive data types or reference data types.
The **Length**, **ResourceStr**, and **ResourceColor** types are combinations of primitive data types or reference data types. Therefore, they cannot be used by the aforementioned types of state variables.
For details about the definitions of **Length**, **ResourceStr**, and **ResourceColor**, see [Types](../../../application-dev/reference/arkui-ts/ts-types.md).
Example:
```ts
// xxx.ets
@Entry
@Component
struct IndexPage {
// Incorrect: @State message: string | Resource = 'Hello World'
@State message: string = 'Hello World'
// Incorrect: @State message: ResourceStr = $r('app.string.hello')
@State resourceStr: Resource = $r('app.string.hello')
build() {
Row() {
Column() {
Text(`${this.message}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
```
![hello](../../../application-dev/quick-start/figures/hello.PNG)
**Change Impacts**
1. If the data type of a state variable decorated by a state decorator is declared as **any**, a build error will occur.
```ts
// ArkTS:ERROR Please define an explicit type, not any.
@State isLunar: any = false
```
2. If the data type of a state variable decorated by a state decorator is declared as **Date**, a build error will occur.
```ts
// ArkTS:ERROR The @State property 'selectedDate' cannot be a 'Date' object.
@State selectedDate: Date = new Date('2021-08-08')
```
3. If the data type of a **@State**, **@Provide**, **@Link**, and or **@Consume** decorated state variable is Length, **ResourceStr**, or **ResourceColor**, a build error will occur.
```ts
/* ArkTS:ERROR The state variable type here is 'ResourceStr', it contains both a simple type and an object type,
which are not allowed to be defined for state variable of a struct.*/
@State message: ResourceStr = $r('app.string.hello')
```
**Key API/Component Changes**
N/A
**Adaptation Guide**
1. Explicitly declare the data type for state variables decorated by state decorators.
2. If a state variable decorated by a state decorator uses the **Date** object, change it to a regular variable – a variable not decorated by any decorator.
3.
Adapt the **@State**, **@Provide**, **@Link**, and **@Consume** decorated variables based on the following code snippet so that they do not use the **Length(string|number|Resource)**, **ResourceStr(string|Resource)**, and **ResourceColor(string|number|Color|Resource)** types:
```ts
// Incorrect:
@State message: ResourceStr = $r('app.string.hello')
// Corrected:
@State resourceStr: Resource = $r('app.string.hello')
```
## cl.arkui.2 Initialization Rules and Restrictions of Custom Components' Member Variables
Comply with the following rules when using constructors to initialize member variables:
| **From the Variable in the Parent Component (Right) to the Variable in the Child Component (Below)**| **regular** | **@State** | **@Link** | **@Prop** | **@Provide** | **@Consume** | **@ObjectLink** |
|---------------------------------|----------------------------|------------|-----------|-----------|--------------|--------------|------------------|
| **regular** | Supported | Supported | Supported | Supported | Not supported | Not supported | Supported |
| **@State** | Supported | Supported | Supported | Supported | Supported | Supported | Supported |
| **@Link** | Not supported | Supported (1) | Supported (1) | Supported (1) | Supported (1) | Supported (1) | Supported (1) |
| **@Prop** | Supported | Supported | Supported | Supported | Supported | Supported | Supported |
| **@Provide** | Supported | Supported | Supported | Supported | Supported | Supported | Supported |
| **@Consume** | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported |
| **@ObjectLink** | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported |
| **From the Variable in the Parent Component (Right) to the Variable in the Child Component (Below)**| **@StorageLink** | **@StorageProp** | **@LocalStorageLink** | **@LocalStorageProp** |
|------------------|------------------|------------------|-----------------------|------------------------|
| **regular** | Supported | Not supported | Not supported | Not supported |
| **@State** | Supported | Supported | Supported | Supported |
| **@Link** | Supported (1) | Supported (1) | Supported (1) | Supported (1) |
| **@Prop** | Supported | Supported | Supported | Supported |
| **@Provide** | Supported | Supported | Supported | Supported |
| **@Consume** | Not supported | Not supported | Not supported | Not supported |
| **@ObjectLink** | Not supported | Not supported | Not supported | Not supported |
> **NOTE**
>
> **Supported (1)**: The dollar sign ($) must be used, for example, **this.$varA**.
>
> **regular**: refers to a regular variable that is not decorated by any decorator.
**@StorageLink**, **@StorageProp**, **@LocalStorageLink**, and **@LocalStorageProp** variables cannot be initialized from the parent component.
**Change Impacts**
1. Variables decorated by **@LocalStorageLink** and **@LocalStorageProp** cannot be initialized from the parent component.
```ts
@Entry
@Component
struct LocalStorageComponent {
build() {
Column() {
Child({
/* ArkTS:ERROR Property 'simpleVarName' in the custom component 'Child' cannot
initialize here (forbidden to specify). */
simpleVarName: 1,
/* ArkTS:ERROR Property 'objectName' in the custom component 'Child' cannot
initialize here (forbidden to specify). */
objectName: new ClassA("x")
})
}
}
}
@Component
struct Child {
@LocalStorageLink("storageSimpleProp") simpleVarName: number = 0;
@LocalStorageProp("storageObjectProp") objectName: ClassA = new ClassA("x");
build() {}
}
```
2. The **@ObjectLink** decorated variable cannot be directly initialized from a decorated variable in the parent component. The source of the parent component must be an array item or object attribute decorated by **@State**, **@Link**, **@Provide**, **@Consume**, or **@ObjectLink**.
```ts
let NextID : number = 0;
@Observed class ClassA {
public id : number;
public c: number;
constructor(c: number) {
this.id = NextID++;
this.c = c;
}
}
@Component
struct Child {
@ObjectLink varA : ClassA;
build() {
Row() {
Text('ViewA-' + this.varA.id)
}
}
}
@Component
struct Parent {
@Link linkValue: ClassA
build() {
Column() {
/* ArkTS:ERROR The @Link property 'linkValue' cannot be assigned to
the @ObjectLink property 'varA'.*/
Child({ varA: this.linkValue })
}
}
}
```
**Key API/Component Changes**
N/A
**Adaptation Guide**
1. When building a child component, do not perform the build on the variables decorated by **@LocalStorageLink** and **@LocalStorageProp** in the child component.
To change these variables from the parent component, use the API provided by the **LocalStorage** (such as the **set** API) to assign values to them.
2. For details about how to use **@ObjectLink**, see [@Observed and @ObjectLink](../../../application-dev/quick-start/arkts-observed-and-objectlink.md).
## cl.arkui.3 Change of the onScrollBegin Event of the \<List> and \<Scroll> Components
The **onScrollBegin** event of the **\<List>** and **\<Scroll>** components is renamed **onScrollFrameBegin**. In the **onScrollBegin** event, the amount to scroll by is indicated by the **dx** and **dy** parameters. In the **onScrollFrameBegin** event, it is indicated by the **offset** parameter. The **onScrollFrameBegin** event adds the **ScrollState** parameter to indicate whether the component is in the finger dragging or inertial scrolling state.
**Change Impacts**
The **onScrollBegin** event is deprecated and must be replaced with the **onScrollFrameBegin** event.
**Key API/Component Changes**
| Old Event | New Event |
|------------------ | ------------------- |
| onScrollBegin(event: (dx: number, dy: number) => { dxRemain: number, dyRemain: number }) | onScrollFrameBegin(event: (offset: number, state: ScrollState) => { offsetRemain: number }) |
For details about the **onScrollFrameBegin** event, see the following:
- [Scroll](../../../application-dev/reference/arkui-ts/ts-container-scroll.md#events)
- [List](../../../application-dev/reference/arkui-ts/ts-container-list.md#events)
**Adaptation Guide**
Switch the event from **onScrollBegin** to **onScrollFrameBegin**, and use the **offset** parameter in **onScrollFrameBegin**, rather than the **dx** and **dy** parameters in **onScrollBegin**, to indicate the amount to scroll by.
Example of using the **onScrollBegin** event:
```ts
@Entry
@Component
struct NestedScroll {
@State listPosition: number = 0; // 0 indicates scrolling to the top of the list, 1 indicates scrolling to the middle of the list, and 2 indicates scrolling to the bottom of the list.
private arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
private scrollerForScroll: Scroller = new Scroller()
private scrollerForList: Scroller = new Scroller()
build() {
Flex() {
Scroll(this.scrollerForScroll) {
Column() {
Text("Scroll Area")
.width("100%").height("40%").backgroundColor(0X330000FF)
.fontSize(16).textAlign(TextAlign.Center)
.onClick(() => {
this.scrollerForList.scrollToIndex(5)
})
List({ space: 20, scroller: this.scrollerForList }) {
ForEach(this.arr, (item) => {
ListItem() {
Text("ListItem" + item)
.width("100%").height("100%").borderRadius(15)
.fontSize(16).textAlign(TextAlign.Center).backgroundColor(Color.White)
}.width("100%").height(100)
}, item => item)
}
.width("100%")
.height("50%")
.edgeEffect(EdgeEffect.None)
.onReachStart(() => {
this.listPosition = 0
})
.onReachEnd(() => {
this.listPosition = 2
})
.onScrollBegin((dx: number, dy: number) => {
if ((this.listPosition == 0 && dy >= 0) || (this.listPosition == 2 && dy <= 0)) {
this.scrollerForScroll.scrollBy(0, -dy)
return { dxRemain: dx, dyRemain: 0 }
}
this.listPosition = 1
return { dxRemain: dx, dyRemain: dy };
})
Text("Scroll Area")
.width("100%").height("40%").backgroundColor(0X330000FF)
.fontSize(16).textAlign(TextAlign.Center)
}
}
.width("100%").height("100%")
}.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20)
}
}
```
Example of using the **onScrollFrameBegin** event:
```ts
@Entry
@Component
struct NestedScroll {
@State listPosition: number = 0; // 0 indicates scrolling to the top of the list, 1 indicates scrolling to the middle of the list, and 2 indicates scrolling to the bottom of the list.
private arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
private scrollerForScroll: Scroller = new Scroller()
private scrollerForList: Scroller = new Scroller()
build() {
Flex() {
Scroll(this.scrollerForScroll) {
Column() {
Text("Scroll Area")
.width("100%").height("40%").backgroundColor(0X330000FF)
.fontSize(16).textAlign(TextAlign.Center)
.onClick(() => {
this.scrollerForList.scrollToIndex(5)
})
List({ space: 20, scroller: this.scrollerForList }) {
ForEach(this.arr, (item) => {
ListItem() {
Text("ListItem" + item)
.width("100%").height("100%").borderRadius(15)
.fontSize(16).textAlign(TextAlign.Center).backgroundColor(Color.White)
}.width("100%").height(100)
}, item => item)
}
.width("100%")
.height("50%")
.edgeEffect(EdgeEffect.None)
.onReachStart(() => {
this.listPosition = 0
})
.onReachEnd(() => {
this.listPosition = 2
})
.onScrollFrameBegin((offset: number, state: ScrollState) => {
if ((this.listPosition == 0 && offset >= 0) || (this.listPosition == 2 && offset <= 0)) {
this.scrollerForScroll.scrollBy(0, -offset)
return { offsetRemain: 0 }
}
this.listPosition = 1
return { offsetRemain: offset };
})
Text("Scroll Area")
.width("100%").height("40%").backgroundColor(0X330000FF)
.fontSize(16).textAlign(TextAlign.Center)
}
}
.width("100%").height("100%")
}.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20)
}
}
```
# USB Subsystem API Changelog
## cl.usb_manager.1 Bundle Name Change
For applications developed based on earlier versions, you need to change the name of the imported bundle. Otherwise, the original service logic will be affected.
**Key API/Component Changes**
| Original Bundle Name | New Bundle Name |
|------------------ | ------------------- |
| ohos.usbV9.d.ts | ohos.usbManager.d.ts |
**Adaptation Guide**
Change **@ohos.usbV9** to **@ohos.usbManager** when importing the bundle.
## cl.usb_manager.2 API Parameter Type Change
For applications developed based on earlier versions, you need to modify the parameter type. Otherwise, the original service logic will be affected.
**Key API/Component Changes**
| Original Class Name | New Class Name |
|---------------| ------------- |
| interface USBConfig | interface USBConfiguration |
| Original Namespace | New Namespace |
|---------------| ------------- |
| @namespace usbV9 | @namespace usbManager |
| Bundle Name | Original API | New API |
| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| ohos.usbManager.d.ts | function setConfiguration(pipe: USBDevicePipe, config: USBConfig): number; | function setConfiguration(pipe: USBDevicePipe, config: USBConfiguration): number; |
**Adaptation Guide**
When calling **setConfiguration**, change the parameter type from **USBConfig** to **USBConfiguration**.
# App Access Control Subsystem ChangeLog
OpenHarmony 4.0.3.2 has the following changes in the APIs of the app access control subsystem:
## cl.access_token.1 getPermissionUsedRecords Name Change
Changed **getPermissionUsedRecords** to **getPermissionUsedRecord**.
**Change Impact**
The **getPermissionUsedRecords()** API cannot be used in OpenHarmony 4.0.3.3 and later versions.
**Key API/Component Changes**
- Involved APIs:
function getPermissionUsedRecords
- Before change:
```ts
function getPermissionUsedRecords
```
- After change:
```ts
function getPermissionUsedRecord
```
**Adaptation Guide**
Use **getPermissionUsedRecord()**.
# Security Subsystem Changelog
## cl.security.1 ParamsSpec Attribute Name Change
Changed **algoName** of the **ParamsSpec** structure to **algName**.
**Change Impact**
For the released JavaScript APIs that use **ParamsSpec** and its child classes **IvParamsSpec**, **GcmParamsSpec**, and **CcmParamsSpec** as parameters or return values, **algoName** must be changed to **algName**.
The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful.
**Key API/Component Changes**
API prototype before the change:
```ts
interface ParamsSpec {
/**
* Indicates the algorithm name. Should be set before initialization of a cipher object.
* @type { string }
* @syscap SystemCapability.Security.CryptoFramework
* @since 9
*/
algoName : string;
}
```
API prototype after the change:
```ts
interface ParamsSpec {
/**
* Indicates the algorithm name. Should be set before initialization of a cipher object.
* @type { string }
* @syscap SystemCapability.Security.CryptoFramework
* @since 9
*/
algName : string;
}
```
**Adaptation Guide**
Change **algoName** to **algName** in **ParamsSpec** and its child classes **IvParamsSpec**, **GcmParamsSpec**, and **CcmParamsSpec**.
```ts
function genGcmParamsSpec() {
let arr = [0, 0, 0, 0 , 0, 0, 0, 0, 0, 0 , 0, 0]; // 12 bytes
let dataIv = new Uint8Array(arr);
let ivBlob = {data : dataIv};
arr = [0, 0, 0, 0 , 0, 0, 0, 0]; // 8 bytes
let dataAad = new Uint8Array(arr);
let aadBlob = {data : dataAad};
arr = [0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0]; // 16 bytes
let dataTag = new Uint8Array(arr);
let tagBlob = {data : dataTag};
let gcmParamsSpec = {iv : ivBlob, aad : aadBlob, authTag : tagBlob, algName : "GcmParamsSpec"};
return gcmParamsSpec;
}
```
For details, see the APIs of **ParamsSpec** in [Crypto Framework](../../../application-dev/reference/apis/js-apis-cryptoFramework.md#paramsspec).
## Change of cl.security.2 ECC Algorithm Parameter Name from ECC512 to ECC521
**Change Impact**
Behavior of released JavaScript APIs will be changed.
The application needs to be adapted to obtain the correct result in the SDK of the new version.
**Key API/Component Changes**
The parameter passed in the APIs is changed from **ECC512** to **ECC521**. The related APIs remain unchanged. For details, see [Key Generation Specifications](../../../application-dev/security/cryptoFramework-overview.md#key-generation-specifications). The following APIs are involved:
cryptoFramework.createAsyKeyGenerator
cryptoFramework.createSign
cryptoFramework.createVerify
cryptoFramework.createKeyAgreement
**Adaptation Guide**
```js
import cryptoFramework from "@ohos.security.cryptoFramework"
let asyKeyGenerator = cryptoFramework.createAsyKeyGenerator("ECC521");
```
# Web Subsystem Changelog
Compared with earlier versions, OpenHarmony 4.0.3.2 has the following API changes in its web subsystem:
## cl.web.1 HitTestTypeV9 Name Change
Renamed the enum class **HitTestTypeV9** **WebHitTestType** to meet the naming conventions.
**Change Impact**
The enum class **HitTestTypeV9** and APIs that use **HitTestTypeV9** as a parameter or return value cannot be used in OpenHarmony 4.0.3.2 and later versions.
**Key API/Component Changes**
- Involved APIs:
enum HitTestTypeV9
- Before change:
```ts
enum HitTestTypeV9
```
- After change:
```ts
enum WebHitTestType
```
**Adaptation Guide**
Replace **HitTestTypeV9** with **WebHitTestType**.
## cl.web.2 HeaderV9 Name Change
Renamed the struct **HeaderV9** **WebHeader** to meet the naming conventions.
**Change Impact**
The struct **HeaderV9** and APIs that use **HeaderV9** as a parameter or return value cannot be used in OpenHarmony 4.0.3.2 and later versions.
**Key API/Component Changes**
- Involved APIs:
interface HeaderV9
- Before change:
```ts
interface HeaderV9
```
- After change:
```ts
interface WebHeader
```
**Adaptation Guide**
Replace **HeaderV9** with **WebHeader**.
## cl.web.3 Member Change of HitTestValue
Rename the member variable **HitTestTypeV9** in the **HitTestValue** struct **WebHitTestType** to meet the naming conventions.
**Change Impact**
The struct **HitTestValue** and APIs that use **HitTestValue** as a parameter or return value cannot be used in OpenHarmony 4.0.3.2 and later versions.
**Key API/Component Changes**
- Involved APIs:
interface HitTestValue
- Before change:
```ts
interface HitTestValue {
/**
* Get the hit test type.
*
* @since 9
*/
type: HitTestTypeV9;
/**
* Get the hit test extra data.
*
* @since 9
*/
extra: string;
}
```
- After change:
```ts
interface HitTestValue {
/**
* Get the hit test type.
*
* @since 9
*/
type: WebHitTestType;
/**
* Get the hit test extra data.
*
* @since 9
*/
extra: string;
}
```
**Adaptation Guide**
Replace **HitTestTypeV9** with **WebHitTestType**.
## cl.web.4 Parameter Type Change of loadUrl
Changed the type of the **headers** parameter in **loadUrl** to **WebHeader** to meet the naming conventions.
**Change Impact**
The **loadUrl** API that uses the **headers** parameter cannot be used in OpenHarmony 4.0.3.2 and later versions.
**Key API/Component Changes**
- Involved APIs:
loadUrl(url: string | Resource, headers?: Array\<HeaderV9>): void
- Before change:
```ts
loadUrl(url: string | Resource, headers?: Array<HeaderV9>): void
```
- After change:
```ts
loadUrl(url: string | Resource, headers?: Array<WebHeader>): void
```
**Adaptation Guide**
Change the type of the **headers** parameter in **loadUrl** from **HeaderV9** to **WebHeader**.
## cl.web.5 Return Value Type Change of getHitTest
Changed the return value type of the **getHitTest** API to **WebHitTest** to meet the naming conventions.
**Change Impact**
The **getHitTest** API cannot be used in OpenHarmony 4.0.3.2 and later versions.
**Key API/Component Changes**
- Involved APIs:
getHitTest(): HitTestTypeV9
- Before change:
```ts
getHitTest(): HitTestTypeV9
```
- After change:
```ts
getHitTest(): WebHitTestType
```
**Adaptation Guide**
Change the return value type of the **getHitTest** API from **HitTestTypeV9** to **WebHitTestType**.
## cl.web.6 Moving of the WebMessagePort Class
Moved the **WebMessagePort** class to **@ohos.web.webview.d.ts** and added error throwing.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. In addition, be mindful of the error codes now that the APIs in the class support error code processing.
**Key API/Component Changes**
- Involved APIs:
postMessageEvent(message: WebMessageEvent): void;
onMessageEvent(callback: (result: string) => void): void;
- Before change:
```ts
postMessageEvent(message: WebMessageEvent): void;
onMessageEvent(callback: (result: string) => void): void;
```
- After change:
```ts
postMessageEvent(message: WebMessage): void;
onMessageEvent(callback: (result: WebMessage) => void): void;
```
**Adaptation Guide**
Instead of importing APIs from the original **WebMessagePort** class, import APIs from **@ohos.web.webview** as follows:
```ts
import web_webview from '@ohos.web.webview';
```
## cl.web.7 Moving of the HitTestValue Class
Moved the **HitTestValue** class to **@ohos.web.webview.d.ts**; changed **HitTestValue** from a class to an API; changed the **getType** and **getExtra** from APIs to attributes.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed.
**Key API/Component Changes**
- Involved APIs:
getType(): HitTestType;
getExtra(): string;
- Before change:
```ts
getType(): HitTestType;
getExtra(): string;
```
- After change:
```ts
type: WebHitTestType;
extra: string;
```
**Adaptation Guide**
Instead of importing APIs from the original **HitTestValue** class, import APIs from **@ohos.web.webview** as follows:
```ts
import web_webview from '@ohos.web.webview';
```
## cl.web.8 Moving of API Version 9 APIs Under WebCookie
Moved APIs of API version 9 in the **WebCookie** class to **web.webview.webview.WebCookieManager**
and added error throwing.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. In addition, be mindful of the error codes now that the APIs in the class support error code processing.
The APIs in the class are static.
**Key API/Component Changes**
- Involved APIs:
isCookieAllowed(): boolean;
isThirdPartyCookieAllowed(): boolean;
putAcceptCookieEnabled(accept: boolean): void;
putAcceptThirdPartyCookieEnabled(accept: boolean): void;
setCookie(url: string, value: string): boolean;
saveCookieSync(): boolean;
getCookie(url: string): string;
existCookie(): boolean;
deleteEntireCookie(): void;
deleteSessionCookie(): void;
- Before change:
```ts
isCookieAllowed(): boolean;
isThirdPartyCookieAllowed(): boolean;
putAcceptCookieEnabled(accept: boolean): void;
putAcceptThirdPartyCookieEnabled(accept: boolean): void;
setCookie(url: string, value: string): boolean;
saveCookieSync(): boolean;
getCookie(url: string): string;
existCookie(): boolean;
deleteEntireCookie(): void;
deleteSessionCookie(): void;
```
- After change:
```ts
static isCookieAllowed(): boolean;
static isThirdPartyCookieAllowed(): boolean;
static putAcceptCookieEnabled(accept: boolean): void;
static putAcceptThirdPartyCookieEnabled(accept: boolean): void;
static setCookie(url: string, value: string): void;
static saveCookieAsync(): Promise<void>;
static saveCookieAsync(callback: AsyncCallback<void>): void;
static getCookie(url: string): string;
static existCookie(): boolean;
static deleteEntireCookie(): void;
static deleteSessionCookie(): void;
```
**Adaptation Guide**
Instead of importing APIs from the original **WebCookie** class, import APIs from **@ohos.web.webview** as follows:
```ts
import web_webview from '@ohos.web.webview';
```
## cl.web.9 Moving of API Version 9 APIs Under WebController
Moved APIs of API version 9 in the **WebController** class to **web.webview.webview.WebviewController** and added error throwing.
**Change Impact**
If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. In addition, be mindful of the error codes now that the APIs in the class support error code processing.
The **getDefaultUserAgent** API is renamed **getUserAgent**.
**Key API/Component Changes**
- Involved APIs:
zoomIn(): boolean;
zoomOut(): boolean;
createWebMessagePorts(): Array\<WebMessagePort>;
postMessage(options: { message: WebMessageEvent, uri: string}): void;
getHitTestValue(): HitTestValue;
getWebId(): number;
getDefaultUserAgent(): string;
getTitle(): string;
getPageHeight(): number;
backOrForward(step: number): void;
searchAllAsync(searchString: string): void;
clearMatches(): void;
searchNext(forward: boolean): void;
clearSslCache(): void;
clearClientAuthenticationCache(): void;
getUrl(): string;
- Before change:
```ts
zoomIn(): boolean;
zoomOut(): boolean;
createWebMessagePorts(): Array<WebMessagePort>;
postMessage(options: { message: WebMessageEvent, uri: string}): void;
getHitTestValue(): HitTestValue;
getWebId(): number;
getDefaultUserAgent(): string;
getTitle(): string;
getPageHeight(): number;
backOrForward(step: number): void;
searchAllAsync(searchString: string): void;
clearMatches(): void;
searchNext(forward: boolean): void;
clearSslCache(): void;
clearClientAuthenticationCache(): void;
getUrl(): string;
```
- After change:
```ts
zoomIn(): void;
zoomOut(): void;
createWebMessagePorts(): Array<WebMessagePort>;
postMessage(name: string, ports: Array<WebMessagePort>, uri: string): void;
getHitTestValue(): HitTestValue;
getWebId(): number;
getUserAgent(): string;
getTitle(): string;
getPageHeight(): number;
backOrForward(step: number): void;
searchAllAsync(searchString: string): void;
clearMatches(): void;
searchNext(forward: boolean): void;
clearSslCache(): void;
clearClientAuthenticationCache(): void;
getUrl(): string;
```
**Adaptation Guide**
Instead of importing APIs from the original **WebController** class, import APIs from **@ohos.web.webview** as follows:
```ts
import web_webview from '@ohos.web.webview';
```
## cl.web.10 Moving of the WebAsyncController Class
Moved the APIs in the **WebAsyncController** class to the **web.webview.webview.WebviewController** class and added error throwing.
**Change Impact**
If your application is developed based on earlier versions, pay attention to error code processing.
**Key API/Component Changes**
- Involved APIs:
storeWebArchive(baseName: string, autoName: boolean): Promise\<string>;
storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback\<string>): void;
- Before change:
```ts
storeWebArchive(baseName: string, autoName: boolean): Promise<string>;
storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback<string>): void;
```
- After change:
```ts
storeWebArchive(baseName: string, autoName: boolean): Promise<string>;
storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback<string>): void;
```
**Adaptation Guide**
Example:
```ts
// xxx.ets
import web_webview from '@ohos.web.webview'
@Entry
@Component
struct WebComponent {
controller: web_webview.WebviewController = new web_webview.WebviewController();
build() {
Column() {
Button('saveWebArchive')
.onClick(() => {
try {
this.controller.storeWebArchive("/data/storage/el2/base/", true, (error, filename) => {
if (error) {
console.info(`save web archive error: ` + JSON.stringify(error))
return;
}
if (filename != null) {
console.info(`save web archive success: ${filename}`)
}
});
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
})
Web({ src: 'www.example.com', controller: this.controller })
}
}
}
```
# 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>>;
```
# ArkUI Subsystem Changelog
## cl.arkui.1 Return Value Type Change of getInspectorTree
**Change Impact**
The code that uses the **getInspectorTree** API in versions earlier than OpenHarmony 4.0.3.2 must be adapted.
**Key API/Component Changes**
The return value of the **getInspectorTree** API is changed from the string type to the Object type.
**Adaptation Guide**
Adapt the code that takes the return value of **getInspectorTree** as a string.The sample code is as follows:
- Before change:
```typescript
console.info(getInspectorTree())
```
- After change:
```typescript
console.info(JSON.stringify(getInspectorTree()))
```
## cl.arkui.2 Deprecation the forceRebuild Attribute of \<GridItem>
**Change Impact**
None. The attribute has no effect.
**Key API/Component Changes**
Deprecate the **forceRebuild** attribute of the **\<GridItem>** component.
**Adaptation Guide**
Delete the code that uses the **forceRebuild** attribute. This will not affect the functionality of the **\<GridItem>** component.
## cl.arkui.1 API Changes of the Router Module in API Version 9
Replaced the **enableAlertBeforeBackPage**, **enableBackPageAlert**, **disableAlertBeforeBackPage** APIs in **ohos.router** to **showAlertBeforeBackPage** and **hideAlertBeforeBackPage** to facilitate development.
**Change Impact**
The **enableAlertBeforeBackPage** and **enableBackPageAlert** APIs must be replaced with **showAlertBeforeBackPage**.
The **disableAlertBeforeBackPage** API must be replaced with **hideAlertBeforeBackPage**.
**Key API/Component Changes**
**router.enableAlertBeforeBackPage**, **router.enableBackPageAlert**, and **router.disableAlertBeforeBackPage**
* Before change:
```ts
router.enableAlertBeforeBackPage();
router.enableBackPageAlert()
```
* After change:
```ts
router.showAlertBeforeBackPage()
```
* Before change:
```ts
router.disableAlertBeforeBackPage()
```
* After change:
```ts
router.hideAlertBeforeBackPage()
```
**Adaptation Guide**
Replace **enableAlertBeforeBackPage** and **enableBackPageAlert** with **showAlertBeforeBackPage**.
Replace **disableAlertBeforeBackPage** with **hideAlertBeforeBackPage**.
# Bundle Manager Subsystem Changelog
## cl.bundlemanager.1 Deleted getAbilityIcon
The **getAbilityIcon** API in [@ohos.bundle.bundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) is deleted. The **getMediaContent** API in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) can be used instead.
**Change Impact**<br>
The **getAbilityIcon** API does not take effect.
**Key API/Component Changes**<br>
The **getAbilityIcon** API is deleted from **@ohos.bundle.bundleManager.d.ts**.
**Adaptation Guide**<br>
If your application uses **getAbilityIcon** in **@ohos.bundle.bundleManager.d.ts**, replace it with **getMediaContent** in **@ohos.resourceManager.d.ts**. You need to obtain the icon ID in advance. For details, see [Usage Guide](../../../application-dev/reference/apis/js-apis-resource-manager.md#getmediacontent9).
## cl.bundlemanager.2 Added Error Code 202
Error code 202 is added to the bundle manager subsystem. If a non-system application calls a system API of API version 9 or later provided by the bundle manager subsystem, error code 202 is returned.
**Change Impact**<br>
Error code 202 is returned when a non-system application calls a system API of API version 9 or later provided by the bundle manager subsystem.
**Key API/Component Changes**<br>
If a non-system application calls a system API of API version 9 or later provided by the bundle manager subsystem, error code 202 is returned.
**Adaptation Guide**<br>
No adaptation is required.
# Common Event Subsystem Changelog
## cl.ces.1 Event Enum Change of ohos.commonEvent
**Change Impact**
For applications developed based on earlier versions, the following common events of the **.ohos.commonEvent** module must be adapted.
| Common Event |
| ----------------------------------- |
| COMMON_EVENT_PACKAGE_CACHE_CLEARED |
| COMMON_EVENT_USB_STATE |
| COMMON_EVENT_USB_PORT_CHANGED |
| COMMON_EVENT_VOLUME_REMOVED |
| COMMON_EVENT_VOLUME_UNMOUNTED |
| COMMON_EVENT_VOLUME_MOUNTED |
| COMMON_EVENT_VOLUME_BAD_REMOVAL |
| COMMON_EVENT_VOLUME_EJECT |
| COMMON_EVENT_SLOT_CHANGE |
| COMMON_EVENT_SPN_INFO_CHANGED |
| COMMON_EVENT_QUICK_FIX_APPLY_RESULT |
**Key API/Component Changes**
Replace the common events in **ohos.commonEvent** with those in **ohos.commonEventManager**.
| Common Event in ohos.commonEvent | Common Event in ohos.commonEventManager |
| ----------------------------------- | ----------------------------------- |
| COMMON_EVENT_PACKAGE_CACHE_CLEARED | COMMON_EVENT_PACKAGE_CACHE_CLEARED |
| COMMON_EVENT_USB_STATE | COMMON_EVENT_USB_STATE |
| COMMON_EVENT_USB_PORT_CHANGED | COMMON_EVENT_USB_PORT_CHANGED |
| COMMON_EVENT_VOLUME_REMOVED | COMMON_EVENT_VOLUME_REMOVED |
| COMMON_EVENT_VOLUME_UNMOUNTED | COMMON_EVENT_VOLUME_UNMOUNTED |
| COMMON_EVENT_VOLUME_MOUNTED | COMMON_EVENT_VOLUME_MOUNTED |
| COMMON_EVENT_VOLUME_BAD_REMOVAL | COMMON_EVENT_VOLUME_BAD_REMOVAL |
| COMMON_EVENT_VOLUME_EJECT | COMMON_EVENT_VOLUME_EJECT |
| COMMON_EVENT_SLOT_CHANGE | COMMON_EVENT_SLOT_CHANGE |
| COMMON_EVENT_SPN_INFO_CHANGED | COMMON_EVENT_SPN_INFO_CHANGED |
| COMMON_EVENT_QUICK_FIX_APPLY_RESULT | COMMON_EVENT_QUICK_FIX_APPLY_RESULT |
**Adaptation Guide**
Replace the events in **ohos.commonEvent** with those in **ohos.commonEventManager**.
Before change:
```typescript
import commonEvent from '@ohos.commonEvent';
let event: string = commonEvent.Support.COMMON_EVENT_PACKAGE_CACHE_CLEARED;
```
After change:
```typescript
import commonEventManager from '@ohos.commonEventManager';
let event: string = commonEventManager.Support.COMMON_EVENT_PACKAGE_CACHE_CLEARED;
```
# File Management Subsystem Changelog
## cl.filemanagement.1 Filter Module Change
Moved **Filter** from **@ohos.fileio** to **@ohos.file.fs**. The attributes of **Filter** remain unchanged.
**Change Impact**
If your application is developed using the APIs of earlier versions, note that the position of **Filter** in the **d.ts** file and the module name are changed. The **Filter** type is moved to **@ohos.file.fs**.
**Key API/Component Changes**
Before the change, **Filter** is in the **@ohos.fileio** module and imported as follows:
```js
import Filter from '@ohos.fileio';
```
**Adaptation Guide**
Now, **Filter** is in the **@ohos.file.fs** module and imported as follows:
```js
import Filter from '@ohos.file.fs';
```
# Pasteboard Subsystem Changelog
OpenHarmony 4.0.3.2 has the following changes in the APIs of the pasteboard subsystem:
## cl.pasteboard.1 convertToTextV9 API Change
Renamed **convertToTextV9** **toPlainText()** and changed the API from asynchronous to synchronous.
**Change Impact**
Applications developed using the **convertToTextV9** API in versions earlier than OpenHarmony 4.0.3.3 cannot be used in OpenHarmony 4.0.3.3 and later versions.
**Key API/Component Changes**
- Involved APIs:
function convertToTextV9
- Before change:
```ts
convertToTextV9(callback: AsyncCallback<string>): void;
convertToTextV9(): Promise<string>;
```
- After change:
```ts
toPlainText(): string;
```
**Adaptation Guide**
Replace **convertToTextV9**, an asynchronous API, with **toPlainText**, a synchronous API.
## cl.pasteboard.2 ShareOption Enum Name Change
Changed the enum names of **ShareOption** from UpperCamelCase to all caps.
**Change Impact**
Applications developed using the **InApp/LocalDevice/CrossDevice** attributes in versions earlier than OpenHarmony 4.0.3.3 cannot be used in OpenHarmony 4.0.3.3 and later versions.
**Key API/Component Changes**
ShareOption<sup>9+</sup>
Before change:
| Name| Value| Description |
| ---- |---|-------------------|
| InApp | 0 | Only intra-application pasting is allowed. |
| LocalDevice | 1 | Paste is allowed in any application on the local device.|
| CrossDevice | 2 | Paste is allowed in any application across devices. |
After change:
| Name| Value| Description |
| ---- |---|-------------------|
| INAPP | 0 | Only intra-application pasting is allowed. |
| LOCALDEVICE | 1 | Paste is allowed in any application on the local device.|
| CROSSDEVICE | 2 | Paste is allowed in any application across devices. |
**Adaptation Guide**
Perform adaptation based on the new semantics.
# Power Subsystem Changelog
## cl.powermgr.1 CommonEventBatteryChangedCode API Change
Changed the **CommonEventBatteryChangedCode** enum class in [@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) as follows:
- Changed the class name to **CommonEventBatteryChangedKey**.
- Deleted **EXTRA_MAX_CURRENT**, **EXTRA_MAX_VOLTAGE**, and **EXTRA_CHARGE_COUNTER**.
- Changed the enum value type from numeric to string.
#### Change Impact
The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
#### Key API/Component Changes
Before change:
| Name | Value | Description |
| -------------------- | ---- | -------------------------------------------------- |
| EXTRA_SOC | 0 | Remaining battery level in percentage. |
| EXTRA_VOLTAGE | 1 | Battery voltage of the device. |
| EXTRA_TEMPERATURE | 2 | Battery temperature of the device. |
| EXTRA_HEALTH_STATE | 3 | Battery health status of the device. |
| EXTRA_PLUGGED_TYPE | 4 | Type of the charger connected to the device. |
| EXTRA_MAX_CURRENT | 5 | Maximum battery current of the device. |
| EXTRA_MAX_VOLTAGE | 6 | Maximum battery voltage of the device. |
| EXTRA_CHARGE_STATE | 7 | Battery charging status of the device. |
| EXTRA_CHARGE_COUNTER | 8 | Number of battery charging times of the device. |
| EXTRA_PRESENT | 9 | Whether the battery is supported by the device or installed.|
| EXTRA_TECHNOLOGY | 10 | Battery technology of the device. |
| EXTRA_CAPACITY_LEVEL | 11 | Battery level of the device. |
After change:
| Name | Value | Description |
| -------------------- | --------------- | -------------------------------------------------- |
| EXTRA_SOC | "soc" | Remaining battery level in percentage. |
| EXTRA_CHARGE_STATE | "chargeState" | Battery charging status of the device. |
| EXTRA_HEALTH_STATE | "healthState" | Battery health status of the device. |
| EXTRA_PLUGGED_TYPE | "pluggedType" | Type of the charger connected to the device. |
| EXTRA_VOLTAGE | "voltage" | Battery voltage of the device. |
| EXTRA_TECHNOLOGY | "technology" | Battery technology of the device. |
| EXTRA_TEMPERATURE | "temperature" | Battery temperature of the device. |
| EXTRA_PRESENT | "present" | Whether the battery is supported by the device or installed.|
| EXTRA_CAPACITY_LEVEL | "capacityLevel" | Battery level of the device. |
#### Adaptation Guide
For details, see the API reference of the [@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) API.
## cl.powermgr.2 estimatedRemainingChargeTime API Change
Changed the **estimatedRemainingChargeTime** API in [@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) to a system API.
#### Change Impact
The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
#### Adaptation Guide
For details, see the API reference of the [@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) API.
## cl.powermgr.3 System Common Event Behavior Change
The following common events are provided in the battery information through [@ohos.commonEventManager (common event module)](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-commonEventManager.md):
- COMMON_EVENT_BATTERY_LOW: common event for low battery level. It includes the remaining battery in percentage.
- COMMON_EVENT_BATTERY_OKAY: common event for normal battery level. It includes the remaining battery in percentage.
- COMMON_EVENT_POWER_CONNECTED: common event for connection to an external power supply. It includes the type of the power supply to which the device is connected.
- COMMON_EVENT_POWER_DISCONNECTED: common event for disconnection from an external power supply. It includes the type of the power supply from which the device is disconnected.
- COMMON_EVENT_CHARGING: common event for starting of battery charging. It includes the battery charging status.
- COMMON_EVENT_DISCHARGING: common event for ending of battery charging. It includes the battery charging status.
Changed the method of obtaining data from common events from **CommonEventData.data** to **CommonEventData.code**.
#### Change Impact
The application developed based on earlier versions needs to adapt the method for obtaining common events in the battery information. Otherwise, the original service logic will be affected.
#### Adaptation Guide
For details, see the API reference of the [@ohos.commonEventManager (Common Event Manager)](../../../application-dev/reference/apis/js-apis-commonEventManager.md) API.
# Pan-sensor Subsystem Changelog
## cl.ability.1 Attribute Name Changed from venderName to vendorName in the Sensor API
**venderName** is changed to **vendorName**.
**Change Impact**
The **venderName** attribute cannot be used anymore. Use **vendorName** instead.
**Key API/Component Changes**
- Before change:
```js
interface Sensor {
sensorName:string; /**< Sensor name */
venderName:string; /**< Sensor vendor version */
firmwareVersion:string; /**< Sensor firmware version */
hardwareVersion:string; /**< Sensor hardware version */
sensorId:number; /**< Sensor type ID, {@code SensorType} */
maxRange:number; /**< Maximum measurement range of the sensor */
minSamplePeriod:number; /**< Minimum sample period allowed, in ns */
maxSamplePeriod:number; /**< maximum sample period allowed, in ns */
precision:number; /**< Sensor accuracy */
power:number; /**< Sensor power */
}
```
- After change:
```js
interface Sensor {
sensorName:string; /**< Sensor name */
vendorName:string; /**< Sensor vendor version */
firmwareVersion:string; /**< Sensor firmware version */
hardwareVersion:string; /**< Sensor hardware version */
sensorId:number; /**< Sensor type ID, {@code SensorType} */
maxRange:number; /**< Maximum measurement range of the sensor */
minSamplePeriod:number; /**< Minimum sample period allowed, in ns */
maxSamplePeriod:number; /**< maximum sample period allowed, in ns */
precision:number; /**< Sensor accuracy */
power:number; /**< Sensor power */
}
```
**Adaptation Guide**
Replace **venderName** with **vendorName**.
# Startup Subsystem JS API Changelog
## cl.startup.1 Bundle Name Change
**Change Impact**
The original bundle name **@ohos.systemParameterV9** will be deleted and cannot be used anymore. Use the new bundle name **@ohos.systemParameterEnhance** instead.
**Adaptation Guide**
Change the bundle name from **@ohos.systemParameterV9** to **@ohos.systemParameterEnhance**. The APIs remain unchanged. The following is the sample code:
```js
import @ohos.systemParameterEnhance
```
# Bundle Manager Subsystem Changelog
## cl.bundlemanager.1 Bottom-Layer Capability Changed So That Only the System Resource HAP Supports Custom Permissions
Only the system resource HAP supports custom permissions. During HAP parsing, the bundle manager module parses the **definePermissions** field only in the configuration file of the resource HAP (bundle name: **ohos.global.systemres**), but not this field in other HAPs. This field is used to define permissions.
If an application requires custom permissions, add the permissions under the **definePermissions** field in the [configuration file](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json) of the system resource HAP. For details about the permission format, see [Defining Permissions](../../../application-dev/quick-start/module-structure.md#internal-structure-of-the-definepermissions-attribute).
**Change Impact**<br>
After an upgrade to the new version image, the custom permission of the application does not take effect, and the authorization fails.
**Key API/Component Changes**<br>
The bottom-layer capability of the bundle manager module is changed. Only the system resource HAP supports custom permissions.
**Adaptation Guide**<br>
If an application requires custom permissions, add the permissions under the **definePermissions** field in the [configuration file](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json) of the system resource HAP. For details about the permission format, see [Defining Permissions](../../../application-dev/quick-start/module-structure.md#internal-structure-of-the-definepermissions-attribute).
## cl.bundlemanager.2 Level-2 Module File Names Changed
The level-2 module file names of the bundle manager module are changed to their respective API names in the file, as listed below.
| Original File Name|New File Name|
|----|----|
| bundleManager/abilityInfo.d.ts | bundleManager/AbilityInfo.d.ts |
| bundleManager/applicationInfo.d.ts | bundleManager/ApplicationInfo.d.ts |
| bundleManager/bundleInfo.d.ts | bundleManager/BundleInfo.d.ts |
| bundleManager/dispatchInfo.d.ts | bundleManager/DispatchInfo.d.ts |
| bundleManager/elementName.d.ts | bundleManager/ElementName.d.ts |
| bundleManager/extensionAbilityInfo.d.ts | bundleManager/ExtensionAbilityInfo.d.ts |
| bundleManager/hapModuleInfo.d.ts | bundleManager/HapModuleInfo.d.ts |
| bundleManager/launcherAbilityInfo.d.ts | bundleManager/LauncherAbilityInfo.d.ts |
| bundleManager/metadata.d.ts | bundleManager/Metadata.d.ts |
| bundleManager/packInfo.d.ts | bundleManager/BundlePackInfo.d.ts |
| bundleManager/permissionDef.d.ts | bundleManager/PermissionDef.d.ts |
| bundleManager/remoteAbilityInfo.d.ts | bundleManager/RemoteAbilityInfo.d.ts |
| bundleManager/shortcutInfo.d.ts | bundleManager/ShortcutInfo.d.ts |
To sum up, except **packInfo**, which is changed to **BundlePackInfo**, the other file names are changed to start with uppercase letters.
**Change Impact**<br>
The change of the level-2 module file names does not affect the use of the level-1 module. If a level-2 module interface under **bundleManager** is directly imported to the .ts file and an error is reported during compilation on DevEco Studio, you must change the name of the imported file.
**Key API/Component Changes**<br>
The .d.ts file names in the **bundleManager** folder are changed to their respective API names in the file.
**Adaptation Guide**<br>
Generally, no adaptation is required. If a file in the **bundleManager** folder is directly imported to the application, you must change the imported file name as follows:
**Before change:**
```ts
import {AbilityInfo} from 'bundleManger/abilityInfo';
import {ExtensionAbilityInfo} from 'bundleManger/extensionAbilityInfo';
import {BundlePackInfo} from 'bundleManger/packInfo';
```
**After change:**
```ts
import {AbilityInfo} from 'bundleManger/AbilityInfo';
import {ExtensionAbilityInfo} from 'bundleManger/ExtensionAbilityInfo';
import {BundlePackInfo} from 'bundleManger/BundlePackInfo';
```
## cl.bundlemanager.3 LaunchType Enum Type Name Changed from STANDARD to MULTITON
The enum type name of [LaunchType](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) is changed from **STANDARD** to **MULTITON**. The enum value remains unchanged, indicating the multi-instance type.
**Change Impact**<br>
The **LaunchType.STANDARD** type does not take effect.
**Key API/Component Changes**<br>
The enum type name of **LaunchType** is changed from **STANDARD** to **MULTITON**.
**Adaptation Guide**<br>
Change **LaunchType.STANDARD** to **LaunchType.MULTITON** for your application.
## cl.bundlemanager.4 Changed the isVisible Field in the AbilityInfo Struct to exported
The **isVisible** field in the [AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities.
**Change Impact**<br>
The **isVisible** field does not take effect.
**Key API/Component Changes**<br>
The **isVisible** field in the [AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts) struct is changed to **exported**, and the type remains unchanged.
**Adaptation Guide**<br>
Change **isVisible** to **exported** for your application.
## cl.bundlemanager.5 Changed the isVisible Field in the ExtensionAbilityInfo Struct to exported
The **isVisible** field in the [ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities.
**Change Impact**<br>
The **isVisible** field does not take effect.
**Key API/Component Changes**<br>
The **isVisible** field in the [ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts) struct is changed to **exported**, and the type remains unchanged.
**Adaptation Guide**<br>
Change **isVisible** to **exported** for your application.
## cl.bundlemanager.6 Changed the visible Field in the ModuleAbilityInfo Struct to exported
The **visible** field in the [ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities.
**Change Impact**<br>
The **visible** field does not take effect.
**Key API/Component Changes**<br>
The **visible** field in the [ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts) struct is changed to **exported**, and the type remains unchanged.
**Adaptation Guide**<br>
Change **visible** to **exported** for your application.
# Resource Scheduler Subsystem Changelog
## cl.resourceschedule.workScheduler
The WorkSchedulerExtensionAbility provides a default WorkSchedulerExtensionContext.
**Change Impact**
Applications developed based on OpenHarmony4.0.5.1 and later SDK versions can use the default context attribute as the context environment of a WorkSchedulerExtension.
**Key API/Component Changes**
The context attribute is added to **@ohos.WorkSchedulerExtensionAbility.d.ts**. The **application/WorkSchedulerExtensionContext.d.ts** file is added, which is inherited from ExtensionContext.
| Module| Class| Method/Attribute/Enum/Constant| Change Type|
| -- | -- | -- | -- |
| @ohos.WorkSchedulerExtensionAbility.d.ts | WorkSchedulerExtensionAbility | context: WorkSchedulerExtensionContext; | Added|
| application/WorkSchedulerExtensionContext.d.ts | WorkSchedulerExtensionContext | - | Added|
**Adaptation Guide**
The context is obtained through a WorkSchedulerExtensionAbility child class instance.
```ts
import WorkSchedulerExtensionAbility from '@ohos.WorkSchedulerExtensionAbility';
class MyWorkSchedulerExtensionAbility extends WorkSchedulerExtensionAbility {
onWorkStart(workInfo) {
let WorkSchedulerExtensionContext = this.context; // Obtain the WorkSchedulerExtensionContext.
}
}
```
# Ability Framework Changelog
## Added the saveAppState API to cl.ability.appRecovery
The API **saveAppState (context?: UIAbilityContext): boolean;** is added.
**Change Impact**
When developing an application based on OpenHarmony 4.0.5.2 or a later SDK version, you can use **saveAppState** with the ability context specified to save the state of the specified ability.
**Key API/Component Changes**
The **saveAppState** API is added to the **@ohos.app.ability.appRecovery.d.ts** file.
| Module| Class| Method/Attribute/Enum/Constant| Change Type|
| -- | -- | -- | -- |
| @ohos.app.ability.appRecovery.d.ts | appRecovery | saveAppState(context?: UIAbilityContext): boolean; | Added|
**Adaptation Guide**
Call **saveAppState** with the UIAbility context specified to save the ability state.
```ts
import appRecovery from '@ohos.app.ability.appRecovery';
onBackground() {
hilog.info(0x0000, '[demo]', '%{public}s', 'EntryAbility onBackground');
appRecovery.saveAppState(this.context)
}
```
## Added the setRestartWant API to cl.ability.appRecovery.
The API **setRestartWant (want: Want): void;** is added.
**Change Impact**
To develop an application based on OpenHarmony 4.0.5.2 or a later SDK version, you can use **setRestartWant** to set the ability to recover.
**Key API/Component Changes**
The **setRestartWant** API is added to the **@ohos.app.ability.appRecovery.d.ts** file.
| Module| Class| Method/Attribute/Enum/Constant| Change Type|
| -- | -- | -- | -- |
| @ohos.app.ability.appRecovery.d.ts | appRecovery | setRestartWant(want: Want): void; | Added|
**Adaptation Guide**
Call **setRestartWant** to set the ability to recover.
```ts
import appRecovery from '@ohos.app.ability.appRecovery';
Button ("Start to Recover Ability")
.fontSize(40)
.fontWeight(FontWeight.Bold)
.onClick(()=> {
// set restart want
let want = {
bundleName: "ohos.samples.recovery",
abilityName: "RecoveryAbility"
};
appRecovery.setRestartWant(want);
})
```
# Pan-sensor Subsystem Changelog
## cl.vibrator Added isSupportEffect
The **isSupportEffect** API is added.
**Change Impact**
Applications developed based on OpenHarmony4.0.5.2 or a later SDK version can use **isSupportEffect** to check whether the passed effect ID is supported.
**Key API/Component Changes**
The **isSupportEffect** API is added in **@ohos.vibrator.d.ts**.
| Module| Class| Method/Attribute/Enum/Constant| Change Type|
| -- | -- | -- | -- |
| @ohos.vibrator.d.ts | vibrator | isSupportEffect(effectId: string, callback: AsyncCallback&lt;boolean&gt;): void | Added|
| @ohos.vibrator.d.ts | vibrator | isSupportEffect(effectId: string): Promise&lt;boolean&gt; | Added|
**Adaptation Guide**
Call **isSupportEffect** to check whether the passed effect ID is supported.
```ts
import vibrator from '@ohos.vibrator';
try {
// Check whether 'haptic.clock.timer' is supported.
vibrator.isSupportEffect('haptic.clock.timer', function (err, state) {
if (err) {
console.error('isSupportEffect failed, error:' + JSON.stringify(err));
return;
}
console.log('The effectId is ' + (state ? 'supported' : 'unsupported'));
if (state) {
try {
vibrator.startVibration({ // To use startVibration, you must configure the ohos.permission.VIBRATE permission.
type: 'preset',
effectId: 'haptic.clock.timer',
count: 1,
}, {
usage: 'unknown'
}, (error) => {
if(error) {
console.error('haptic.clock.timer vibrator error:' + JSON.stringify(error));
} else {
console.log('haptic.clock.timer vibrator success');
}
});
} catch (error) {
console.error('Exception in, error:' + JSON.stringify(error));
}
}
})
} catch (error) {
console.error('Exception in, error:' + JSON.stringify(error));
}
```
## cl.vibrator Added stopVibration
The **stopVibration** API is added.
**Change Impact**
Applications developed based on OpenHarmony4.0.5.2 or a later SDK version can use **stopVibration** to stop vibration in all modes.
**Key API/Component Changes**
The **stopVibration** API is added in **@ohos.vibrator.d.ts**.
| Module | Class | Method/Attribute/Enum/Constant | Change Type|
| ------------------- | -------- | -------------------------------------------------------- | -------- |
| @ohos.vibrator.d.ts | vibrator | stopVibration(callback: AsyncCallback&lt;void&gt;): void | Added |
| @ohos.vibrator.d.ts | vibrator | stopVibration(): Promise&lt;void&gt; | Added |
**Adaptation Guide**
Call **stopVibration** to stop vibration in all modes.
```ts
import vibrator from '@ohos.vibrator';
try {
// Stop vibration in all modes.
vibrator.stopVibration(function (error) {
if (error) {
console.log('error.code' + error.code + 'error.message' + error.message);
return;
}
console.log('Callback returned to indicate successful.');
})
} catch (error) {
console.info('errCode: ' + error.code + ' ,msg: ' + error.message);
}
```
# Input Method Framework Subsystem – Input Method Framework Service Changelog
## @ohos.InputMethodSubtype Change of name, label, and id
Changed the **name**, **label**, and **id** attributes since API version 9.
**Change Impact**
Applications must be adapted to the following changes.
| Name| Before Change| After Change|
| -------- | -------- | -------- |
| label | (1) Value: ID of the input method subtype.| (1) Value: Label of the input method subtype.|
| name | (1) Description: Name of the input method subtype. (2) Value: Label of the input method subtype.| (1) Description: Bundle name of the input method; (2) Value: Bundle name of the input method.|
| id | (1) Value: Bundle name of the input method.| (1) Value: ID of the input method subtype.|
**Adaptation Guide**
Update the code to adapt to the preceding changes.
# Theme Framework Subsystem – Screenlock Management Service Changelog
## cl.screenlock.1 Permission Change of isLocked and unlock
Changed the **isLocked** and **unlock** APIs to system APIs since API version 9.
You need to adapt your application based on the following information.
**Change Impact**
The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
- Involved APIs:
```js
function isLocked(): boolean;
function unlock(callback: AsyncCallback<boolean>): void;
function unlock():Promise<boolean>;
```
- Before change:
```js
* Checks whether the screen is currently locked.
*
* @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise.
* @syscap SystemCapability.MiscServices.ScreenLock
* @since 9
*/
function isLocked(): boolean;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @systemapi Hide this for inner system use.
* @since 9
*/
function unlock(callback: AsyncCallback<boolean>): void;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @systemapi Hide this for inner system use.
* @since 9
*/
function unlock():Promise<boolean>;
```
- After change:
```js
* Checks whether the screen is currently locked.
*
* @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.ScreenLock
* @systemapi Hide this for inner system use.
* @since 9
*/
function isLocked(): boolean;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @since 9
*/
function unlock(callback: AsyncCallback<boolean>): void;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @since 9
*/
function unlock():Promise<boolean>;
```
**Adaptation Guide**
Make sure the APIs are only invoked by system applications.
The code snippet is as follows:
```js
try {
let ret = screenLock.isLocked();
console.error(`Obtain whether the screen is locked successfully , ret is: ${ret}`);
} catch (error) {
console.error(`Failed to obtain whether the screen is locked, error is : ${error.code}, ${error.message}`);
}
```
```js
screenlock.unlock((err, data) => {
if (err) {
console.error(`Failed to unlock the screen, because: ${err.message}`);
return;
}
console.info(`unlock the screen successfully. result: ${data}`);
});
```
```js
screenlock.unlock().then((data) => {
console.info(`unlock the screen successfully. result: ${data}`);
}).catch((err) => {
console.error(`Failed to unlock the screen, because: ${err.message}`);
});
```
## cl.screenlock.2 Deprecation of isSecure
Deprecated the **isSecure** API since API version 9.
You need to adapt your application based on the following information.
**Change Impact**
The API can no longer be used after being deleted.
- Involved APIs:
```js
function isSecure(): boolean;
```
- Before change:
```js
function isSecure(): boolean;
```
- After change:
The API is deleted.
**Adaptation Guide**
Update the code so that the deprecated API is not used.
# Theme Framework Subsystem – Wallpaper Management Service Changelog
## cl.wallpaper.1 Permission Change of getColorsSync, getMinHeightSync, getMinWidthSync, restore, and setImage
Changed the **getColorsSync**, **getMinHeightSync**, **getMinWidthSync**, restore, and **setImage** APIs to system APIs since API version 9.
You need to adapt your application based on the following information.
**Change Impact**
The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
- Involved APIs:
```js
function getColorsSync(wallpaperType: WallpaperType): Array<RgbaColor>;
function getMinHeightSync(): number;
function getMinWidthSync(): number;
function restore(wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
function restore(wallpaperType: WallpaperType): Promise<void>;
function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise<void>;
```
- Before change:
```js
/**
* Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function.
* @param wallpaperType Indicates the wallpaper type.
* @returns { Array<RgbaColor> } the Array<RgbaColor> returned by the function.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function getColorsSync(wallpaperType: WallpaperType): Array<RgbaColor>;
/**
* Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function getMinHeightSync(): number;
/**
* Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function getMinWidthSync(): number;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function restore(wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function restore(wallpaperType: WallpaperType): Promise<void>;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise<void>;
```
- After change:
```js
/**
* Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function.
* @param wallpaperType Indicates the wallpaper type.
* @returns { Array<RgbaColor> } the Array<RgbaColor> returned by the function.
* @throws {BusinessError} 401 - parameter error.
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function getColorsSync(wallpaperType: WallpaperType): Array<RgbaColor>;
/**
* Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function getMinHeightSync(): number;
/**
* Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function getMinWidthSync(): number;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function restore(wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function restore(wallpaperType: WallpaperType): Promise<void>;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise<void>;
```
**Adaptation Guide**
Make sure the APIs are only invoked by system applications.
The code snippet is as follows:
```js
try {
let colors = wallpaper.getColorsSync(wallpaper.WallpaperType.WALLPAPER_SYSTEM);
console.log(`success to getColorsSync: ${JSON.stringify(colors)}`);
} catch (error) {
console.error(`failed to getColorsSync because: ${JSON.stringify(error)}`);
}
```
```js
let minHeight = wallpaper.getMinHeightSync();
```
```js
let minWidth = wallpaper.getMinWidthSync();
```
```js
wallpaper.restore(wallpaper.WallpaperType.WALLPAPER_SYSTEM, (error) => {
if (error) {
console.error(`failed to restore because: ${JSON.stringify(error)}`);
return;
}
console.log(`success to restore.`);
});
```
```js
wallpaper.restore(wallpaper.WallpaperType.WALLPAPER_SYSTEM).then(() => {
console.log(`success to restore.`);
}).catch((error) => {
console.error(`failed to restore because: ${JSON.stringify(error)}`);
});
```
```js
// The source type is string.
let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg";
wallpaper.setImage(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM, (error) => {
if (error) {
console.error(`failed to setImage because: ${JSON.stringify(error)}`);
return;
}
console.log(`success to setImage.`);
});
```
```js
// The source type is string.
let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg";
wallpaper.setImage(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM).then(() => {
console.log(`success to setImage.`);
}).catch((error) => {
console.error(`failed to setImage because: ${JSON.stringify(error)}`);
});
```
## cl.wallpaper.2 Deprecation of getIdSync, getFileSync, isChangeAllowed, isUserChangeAllowed, on, off, and RgbaColor
Deprecated the **getIdSync**, **getFileSync**, **isChangeAllowed**, **isUserChangeAllowed**, **on**, **off**, and **RgbaColor** APIs since API version 9.
You need to adapt your application based on the following information.
**Change Impact**
The APIs can no longer be used after being deleted.
- Involved APIs:
```js
function getIdSync(wallpaperType: WallpaperType): number;
function getFileSync(wallpaperType: WallpaperType): number;
function isChangeAllowed(): boolean;
function isUserChangeAllowed(): boolean;
function on(type: 'colorChange', callback: (colors: Array<RgbaColor>, wallpaperType: WallpaperType) => void): void;
function off(type: 'colorChange', callback?: (colors: Array<RgbaColor>, wallpaperType: WallpaperType) => void): void;
interface RgbaColor {
red: number;
green: number;
blue: number;
alpha: number;
}
```
- Before change:
```js
function getIdSync(wallpaperType: WallpaperType): number;
function getFileSync(wallpaperType: WallpaperType): number;
function isChangeAllowed(): boolean;
function isUserChangeAllowed(): boolean;
function on(type: 'colorChange', callback: (colors: Array<RgbaColor>, wallpaperType: WallpaperType) => void): void;
function off(type: 'colorChange', callback?: (colors: Array<RgbaColor>, wallpaperType: WallpaperType) => void): void;
interface RgbaColor {
red: number;
green: number;
blue: number;
alpha: number;
}
```
- After change:
The APIs are deleted.
**Adaptation Guide**
Update the code so that the deprecated APIs are not used.
# ArkUI Subsystem Changelog
## cl.arkui.1 Change in the Default Scrollbar State of \<List> and \<Gird> Components
Changed the default state of the scrollbar in the **\<List>** and **\<Gird>** components from **BarState.Off** to **BarState.Auto**.
**Change Impact**
In the scenario where the scrollbar status is not set in the **\<List>** and **\<Gird>** components:
- Before change:
The scrollbar is not displayed.
- After change:
The scrollbar is displayed during scrolling and is hidden 2 seconds after the scrolling stops.
**Key API/Component Changes**
**scrollBar** attribute of the **\<List>** and **\<Gird>** components:
- [List](../../../application-dev/reference/arkui-ts/ts-container-list.md#attributes)
- [Grid](../../../application-dev/reference/arkui-ts/ts-container-grid.md#attributes)
**Adaptation Guide**
In scenarios where the scrollbar is not required, set the **scrollBar** attribute of the **\<List>** and **\<Gird>** components to **BarState.Off**.
The code snippet is as follows:
```ts
// xxx.ets
@Entry
@Component
struct ListItemExample {
private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
build() {
Column() {
List({ space: 20, initialIndex: 0 }) {
ForEach(this.arr, (item) => {
ListItem() {
Text('' + item)
.width('100%').height(100).fontSize(16)
.textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF)
}
}, item => item)
}
.width('90%')
.scrollBar(BarState.Off)
}.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 })
}
}
```
# HUKS Changelog
## cl.huks.1 Change of the Permission for Using attestKeyItem
The **attestKeyItem** interface attests a key using a public key encapsulated based on the device certificate chain. Any arbitrary export of the device certificate increases the risks on user privacy. Therefore, certain permissions are required for using this interface.
**Change Impact**
Applications without the **ohos.permission.ACCESS_IDS** permission or the system_basic or system_core permission cannot call **attestKeyItem()**.
**Key API/Component Changes**
- Involved APIs:
attestKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback\<HuksReturnResult\>): void;
attestKeyItem(keyAlias: string, options: HuksOptions): Promise\<HuksReturnResult\>;
- Before change:
The AccessToken permission is verified only for the applications that pass in a tag related to **ATTESTATION_ID**.
- After change:
**attestKeyItem()** can be called only by a system application with the system_basic or system_core permission or an application with the **ohos.permission.ACCESS_IDS** permission.
**Adaptation Guide**
Applications with the system_basic or system_core permission can call **attestKeyItem()**. If an application with the normal permission needs to call **attestKeyItem()**, it must have the **ohos.permission.ACCESS_IDS** permission. For details about how to apply for the permission, see [ACL](../../../application-dev/security/accesstoken-overview.md#acl).
# Web Subsystem Changelog
Compared with earlier versions, OpenHarmony 4.0.6.1 has the following API changes in its web subsystem:
## cl.web.1 Parameters in createWebMessagePorts
Added an optional parameter to the **WebMessagePort** API to accommodate more data types.
**Change Impact**
None (The added parameter is optional, and the API is forward compatible.)
**Key API/Component Changes**
- Involved APIs:
createWebMessagePorts(): Array\<WebMessagePort>;
- Before change:
```ts
createWebMessagePorts(): Array<WebMessagePort>;
```
- After change:
```ts
createWebMessagePorts(isExtentionType?: boolean): Array<WebMessagePort>;
```
**Adaptation Guide**
N/A
# USB Subsystem API Changelog
## cl.usb_manager.1 SDK API Deletion
For applications developed based on earlier versions, you need to change the name of the imported bundle. Otherwise, the original service logic will be affected.
**Key API/Component Changes**
The **@ohos.usbV9.d.ts** file is replaced by the **@ohos.usbManager.d.ts** file.
| New Bundle | Original Bundle | Deleted Bundle |
| -------------------- | ------------- | --------------- |
| ohos.usbManager.d.ts | ohos.usb.d.ts | ohos.usbV9.d.ts |
You need to import **@ohos.usbManager** to use USB service APIs.
```ts
import usbManager from '@ohos.usbManager';
```
**Adaptation Guide**
For details about usage of each API, see the [API Reference](../../../application-dev/reference/apis/js-apis-usbManager.md).
# ArkUI Subsystem Changelog
Fixed the issue where the layout of child components in the [\<Stack>](../../../application-dev/reference/arkui-ts/ts-container-stack.md) container does not follow the **alignContent** settings when the child components do not fit in the container.
Example:
```ts
@Entry
@Component
struct StackExample {
build() {
Stack({alignContent:Alignment.TopEnd}){
Text('First child, show in bottom')
.width(200).height(200).backgroundColor(0xd2cab3).margin(10)
}.width(150).height(150).backgroundColor(Color.Pink).margin(100)
}
}
```
Before: Child components are not arranged based on **alignContent:Alignment.TopEnd**.
![stack](figures/stack_before.jpg)
After: Child components are arranged based on **alignContent:Alignment.TopEnd**.
![stack](figures/stack_after.jpg)
**Change Impact**
The previous workaround – setting the **Offset** or **translate** attribute – needs to be removed.
**Adaptation Guide**
Remove the **Offset** and **translate** settings for the child components and use **alignContent** for layout.
# HUKS Changelog
## cl.huks.1 HUKS Supports RsaPssSaltLengthType
Before the change, the HUKS uses **RSA_PSS_SALT_LEN_MAX** for signing or signature verification by default.
After the change, the type defined by **HuksRsaPssSaltLenType** is passed in for signature or signature verification. If **HuksRsaPssSaltLenType** is not passed in, **RSA_PSS_SALT_LEN_MAX** is used by default.
**Change Impact**
Behaviors of released JavaScript APIs have been changed.
**Key API/Component Changes**
Released JavaScript APIs remain unchanged, but the parameter set passed to the APIs are changed.
**Adaptation Guide**
The following uses RSA signing as an example.
```js
import huks from '@ohos.security.huks';
let keyAlias = 'rsa_Key';
let inData = 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,
);
/* Parameters for signing */
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_PADDING,
value: huks.HuksKeyPadding.HUKS_PADDING_PSS,
}
signProperties[4] = {
tag: huks.HuksTag.HUKS_TAG_DIGEST,
value: huks.HuksKeyDigest.HUKS_DIGEST_SHA1,
}
signProperties[5] = {
tag: huks.HuksTag.HUKS_TAG_RSA_PSS_SALT_LEN_TYPE,
value: huks.HuksRsaPssSaltLenType.HUKS_RSA_PSS_SALT_LEN_MAX,
}
let signOptions = {
properties: signProperties,
inData: inData
}
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.huks.2 Resolved the Issues in Storage or Export of Derived or Agreed Keys
Before the change, the HUKS supports storage and export of derived keys and agreed keys, which poses security risks.
After the change, the application needs to pass in **HuksKeyStorageType** for key derivation or key agreement. Only storage or export is allowed at a time. If this parameter is not passed in, both storage and export are supported by default, which poses security risks and is not recommended.
**Change Impact**
Behaviors of released JavaScript APIs have been changed.
**Key API/Component Changes**
Released JavaScript APIs remain unchanged, but the parameter set passed to the APIs are changed.
**Adaptation Guide**
For more information, see [HUKS Development](../../../application-dev/security/huks-guidelines.md) and [HUKS](../../../application-dev/reference/apis/js-apis-huks.md).
## cl.huks.3 Adding Tags for Fine-grained User Identity Access Control
Added **HUKS_TAG_KEY_AUTH_PURPOSE** to **HuksTag** for fine-grained user identity access control. This tag specifies the user identity authentication used for specific algorithm.
**Change Impact**
The new HuksTag does not affect existing APIs.
**Key API/Component Changes**
**HuksTag** is added with **HUKS_TAG_KEY_AUTH_PURPOSE** to support fine-grained user identity access control.
**Adaptation Guide**
For more information, see [Fine-grained User Identity Authentication](../../../application-dev/security/huks-guidelines.md#fine-grained-user-identity-authentication) and [HuksTag](../../../application-dev/reference/apis/js-apis-huks.md#hukstag).
# Readme
- [Ability framework](changelogs-ability.md)
- [Bundle manager subsystem](changelogs-bundlemanager.md)
- [Resource scheduler subsystem](changelogs-resourceschedule.md)
- [Telephony subsystem](changelogs-telephony.md)
- [Util subsystem](changelogs-util.md)
...@@ -124,8 +124,8 @@ The **visible** field in the [ModuleAbilityInfo](https://gitee.com/openharmony/i ...@@ -124,8 +124,8 @@ The **visible** field in the [ModuleAbilityInfo](https://gitee.com/openharmony/i
**Adaptation Guide**<br> **Adaptation Guide**<br>
Change **visible** to **exported** for your application. Change **visible** to **exported** for your application.
## cl.bundlemanager.8 Deleted the distributedNotificationEnabled Tag from the app.json File ## cl.bundlemanager.8 Deleted the distributedNotificationEnabled Tag from the app.json Configuration File
The [distributedNotificationEnabled](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** file. The [distributedNotificationEnabled](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br> **Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio. If this tag is used, an error is reported during compilation on DevEco Studio.
...@@ -133,8 +133,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. ...@@ -133,8 +133,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br> **Adaptation Guide**<br>
Delete this tag from the configuration file. Delete this tag from the configuration file.
## cl.bundlemanager.9 Deleted the entityType Tag from the app.json File ## cl.bundlemanager.9 Deleted the entityType Tag from the app.json Configuration File
The [entityType](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** file. The [entityType](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br> **Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio. If this tag is used, an error is reported during compilation on DevEco Studio.
...@@ -142,8 +142,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. ...@@ -142,8 +142,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br> **Adaptation Guide**<br>
Delete this tag from the configuration file. Delete this tag from the configuration file.
## cl.bundlemanager.10 Deleted the keepAlive Tag from the app.json File ## cl.bundlemanager.10 Deleted the keepAlive Tag from the app.json Configuration File
The [keepAlive](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** file. The [keepAlive](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br> **Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio. If this tag is used, an error is reported during compilation on DevEco Studio.
...@@ -151,8 +151,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. ...@@ -151,8 +151,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br> **Adaptation Guide**<br>
Delete this tag from the configuration file. Delete this tag from the configuration file.
## cl.bundlemanager.11 Deleted the removable Tag from the app.json File ## cl.bundlemanager.11 Deleted the removable Tag from the app.json Configuration File
The [removable](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** file. The [removable](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br> **Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio. If this tag is used, an error is reported during compilation on DevEco Studio.
...@@ -160,8 +160,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. ...@@ -160,8 +160,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br> **Adaptation Guide**<br>
Delete this tag from the configuration file. Delete this tag from the configuration file.
## cl.bundlemanager.12 Deleted the singleton Tag from the app.json File ## cl.bundlemanager.12 Deleted the singleton Tag from the app.json Configuration File
The [singleton](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** file. The [singleton](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br> **Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio. If this tag is used, an error is reported during compilation on DevEco Studio.
...@@ -169,8 +169,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. ...@@ -169,8 +169,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br> **Adaptation Guide**<br>
Delete this tag from the configuration file. Delete this tag from the configuration file.
## cl.bundlemanager.13 Deleted the userDataClearable Tag from the app.json File ## cl.bundlemanager.13 Deleted the userDataClearable Tag from the app.json Configuration File
The [userDataClearable](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** file. The [userDataClearable](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br> **Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio. If this tag is used, an error is reported during compilation on DevEco Studio.
...@@ -178,8 +178,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. ...@@ -178,8 +178,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br> **Adaptation Guide**<br>
Delete this tag from the configuration file. Delete this tag from the configuration file.
## cl.bundlemanager.14 No Longer Chinese Characters for the name Tag under module in the module.json File ## cl.bundlemanager.14 No Longer Chinese Characters for the name Tag under module in the module.json Configuration File
The value of [name](../../../application-dev/quick-start/module-configuration-file.md) under **module** in the **module.json** file does not support Chinese characters. The value of [name](../../../application-dev/quick-start/module-configuration-file.md) under **module** in the **module.json** configuration file does not support Chinese characters.
**Change Impact**<br> **Change Impact**<br>
If the tag is set to Chinese, an error is reported during compilation on DevEco Studio. If the tag is set to Chinese, an error is reported during compilation on DevEco Studio.
...@@ -187,8 +187,8 @@ If the tag is set to Chinese, an error is reported during compilation on DevEco ...@@ -187,8 +187,8 @@ If the tag is set to Chinese, an error is reported during compilation on DevEco
**Adaptation Guide**<br> **Adaptation Guide**<br>
Set this tag to English. Set this tag to English.
## cl.bundlemanager.15 No Longer Chinese Characters for the name Tag under ability in the module.json File ## cl.bundlemanager.15 No Longer Chinese Characters for the name Tag under ability in the module.json Configuration File
The value of [name](../../../application-dev/quick-start/module-configuration-file.md) under **ability** in the **module.json** file does not support Chinese characters. The value of [name](../../../application-dev/quick-start/module-configuration-file.md) under **ability** in the **module.json** configuration file does not support Chinese characters.
**Change Impact**<br> **Change Impact**<br>
If the tag is set to Chinese, an error is reported during compilation on DevEco Studio. If the tag is set to Chinese, an error is reported during compilation on DevEco Studio.
...@@ -196,8 +196,8 @@ If the tag is set to Chinese, an error is reported during compilation on DevEco ...@@ -196,8 +196,8 @@ If the tag is set to Chinese, an error is reported during compilation on DevEco
**Adaptation Guide**<br> **Adaptation Guide**<br>
Set this tag to English. Set this tag to English.
## cl.bundlemanager.16 Deleted the uiSyntax Tag from the module.json File ## cl.bundlemanager.16 Deleted the uiSyntax Tag from the module.json Configuration File
The [uiSyntax](../../../application-dev/quick-start/module-configuration-file.md) tag is deleted from the **module.json** file. The [uiSyntax](../../../application-dev/quick-start/module-configuration-file.md) tag is deleted from the **module.json** configuration file.
**Change Impact**<br> **Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio. If this tag is used, an error is reported during compilation on DevEco Studio.
...@@ -205,8 +205,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. ...@@ -205,8 +205,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br> **Adaptation Guide**<br>
Delete this tag from the configuration file. Delete this tag from the configuration file.
## cl.bundlemanager.17 Changed srcEntrance to srcEntry in the module.json File ## cl.bundlemanager.17 Changed srcEntrance to srcEntry in the module.json Configuration File
The [srcEntrance](../../../application-dev/quick-start/module-configuration-file.md) tag under **module** and **ability** in the **module.json** file is changed to **srcEntry**. The [srcEntrance](../../../application-dev/quick-start/module-configuration-file.md) tag under **module** and **ability** in the **module.json** configuration file is changed to **srcEntry**.
**Change Impact**<br> **Change Impact**<br>
If the **srcEntrance** tag is used, an error is reported during compilation on DevEco Studio. If the **srcEntrance** tag is used, an error is reported during compilation on DevEco Studio.
...@@ -214,8 +214,8 @@ If the **srcEntrance** tag is used, an error is reported during compilation on D ...@@ -214,8 +214,8 @@ If the **srcEntrance** tag is used, an error is reported during compilation on D
**Adaptation Guide**<br> **Adaptation Guide**<br>
Replace the **srcEntrance** tag with **srcEntry** in the configuration file. Replace the **srcEntrance** tag with **srcEntry** in the configuration file.
## cl.bundlemanager.18 Deleted the apiVersion Tag Under distroFilter from the module.json File ## cl.bundlemanager.18 Deleted the apiVersion Tag Under distroFilter from the module.json Configuration File
The **apiVersion** tag under [distroFilter](../../../application-dev/quick-start/module-configuration-file.md) is deleted from the **module.json** file. The **apiVersion** tag under [distroFilter](../../../application-dev/quick-start/module-configuration-file.md) is deleted from the **module.json** configuration file.
**Change Impact**<br> **Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio. If this tag is used, an error is reported during compilation on DevEco Studio.
...@@ -223,8 +223,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. ...@@ -223,8 +223,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br> **Adaptation Guide**<br>
Delete this tag from the configuration file. Delete this tag from the configuration file.
## cl.bundlemanager.19 Changed distroFilter to distributionFilter in the module.json File ## cl.bundlemanager.19 Changed distroFilter to distributionFilter in the module.json Configuration File
The [distroFilter](../../../application-dev/quick-start/module-configuration-file.md) tag in the **module.json** file is changed to **distributionFilter**. The [distroFilter](../../../application-dev/quick-start/module-configuration-file.md) tag in the **module.json** configuration file is changed to **distributionFilter**.
**Change Impact**<br> **Change Impact**<br>
If the **distroFilter** tag is used, an error is reported during compilation on DevEco Studio. If the **distroFilter** tag is used, an error is reported during compilation on DevEco Studio.
...@@ -232,14 +232,67 @@ If the **distroFilter** tag is used, an error is reported during compilation on ...@@ -232,14 +232,67 @@ If the **distroFilter** tag is used, an error is reported during compilation on
**Adaptation Guide**<br> **Adaptation Guide**<br>
Replace **distroFilter** with **distributionFilter** in the configuration file. Replace **distroFilter** with **distributionFilter** in the configuration file.
## cl.bundlemanager.20 Changed standard of launchType to multiton in the module.json File ## cl.bundlemanager.20 Changed standard of launchType to multiton in the module.json Configuration File
The **standard** mode of the [launchType](../../../application-dev/quick-start/module-configuration-file.md) tag in the **module.json** file is changed to **multiton**. The **standard** mode of the [launchType](../../../application-dev/quick-start/module-configuration-file.md) tag in the **module.json** file is changed to **multiton**.
**Adaptation Guide**<br> **Adaptation Guide**<br>
Replace **standard** of **launchType** with **multiton** in the configuration file. Replace **standard** of **launchType** to **multiton** in the configuration file.
## cl.bundlemanager.20 Changed visible of abilities to exported in the module.json File ## cl.bundlemanager.21 Deleted the atomicService Tag from the app.json File
The **visible** tag under [abilities](../../../application-dev/quick-start/module-configuration-file.md) in the [module.json] file is changed to **exported**, indicating whether the ability supports export and can be used by other ability. The **atomicService** tag is deleted from the **app.json** file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete the **atomicService** tag from your code.
## cl.bundlemanager.22 Added the bundleType Tag to the app.json File
The **bundleType** tag is added to the **app.json** file.
**Change Impact**<br>
For an existing ability with [installationFree](../../../application-dev/quick-start/module-configuration-file.md) set to **true**, **bundleType** must be set to **atomicService** in the **app.json** file. Otherwise, the packaging fails.
**Adaptation Guide**<br>
Add the [bundleType](../../../application-dev/quick-start/app-configuration-file.md) tag. This tag can be left blank. The default value is **app**. The setting of this tag and the [installationFree](../../../application-dev/quick-start/module-configuration-file.md) field in the **module.json** file must meet the following rules:
- If **bundleType** is **app**, **installationFree** must be set to **false**.
- If **bundleType** is **atomicService**, **installationFree** must be set to **true**.
## cl.bundlemanager.23 Deleted the split Field from the ApplicationInfo Struct
The **split** field is deleted from the [ApplicationInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) struct.
**Change Impact**<br>
If the **split** field is used in your code, the compilation fails.
**Key API/Component Changes**<br>
The **split** field is deleted from the [ApplicationInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) struct.
**Adaptation Guide**<br>
Delete the **split** field from the **ApplicationInfo** struct of your code. The stage model always forcibly splits bundles.
## cl.bundlemanager.24 Deleted the atomicServiceModuleType Field from the HapModuleInfo Struct
The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
**Change Impact**<br>
If the **atomicServiceModuleType** field is used in your code, the compilation fails.
**Key API/Component Changes**<br>
The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
**Adaptation Guide**<br>
Record the setting of the **atomicServiceModuleType** field, delete it from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct, and set the **moduleType** field in the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct to the recorded value.
## cl.bundlemanager.25 Deleted the AtomicServiceModuleType Enumerated Value
The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
**Change Impact**<br>
If the **atomicServiceModuleType** field is used in your code, the compilation fails.
**Key API/Component Changes**<br>
The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
**Adaptation Guide**<br> **Adaptation Guide**<br>
Replace **visible** under **abilities** with **exported** in the configuration file. Record the setting of the **atomicServiceModuleType** field, delete it from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct, and set the **moduleType** field in the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct to the recorded value.
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
## cl.telephony.1 Call Module reject API Change ## cl.telephony.1 Call Module reject API Change
Changed the `reject` API to the `rejectCall` API in the call module of the telephony subsystem since API version 9. Changed the `reject` API to the `rejectCall` API in the call module of the telephony subsystem since API version 9.
You need to adapt your application. You need to adapt your application based on the following information.
**Change Impact** **Change Impact**
The `reject` API is deprecated and cannot be used any more. Use the `rejectCall` API instead. Otherwise, relevant functions will be affected. The `reject` API is deprecated and cannot be used anymore. Use the `rejectCall` API instead. Otherwise, relevant functions will be affected.
- Involved APIs: - Involved APIs:
...@@ -44,7 +44,7 @@ The `reject` API is deprecated and cannot be used any more. Use the `rejectCall` ...@@ -44,7 +44,7 @@ The `reject` API is deprecated and cannot be used any more. Use the `rejectCall`
**Adaptation Guide** **Adaptation Guide**
The `reject` API is deprecated and cannot be used any more. Use the `rejectCall` API instead. The `reject` API is deprecated and cannot be used anymore. Use the `rejectCall` API instead.
Use the new API. The sample code is as follows: Use the new API. The sample code is as follows:
```js ```js
...@@ -100,11 +100,11 @@ call.rejectCall(rejectMessageOptions, (err, data) => { ...@@ -100,11 +100,11 @@ call.rejectCall(rejectMessageOptions, (err, data) => {
## cl.telephony.2 Call Module answer API Change ## cl.telephony.2 Call Module answer API Change
Changed the `answer` API to the `answerCall` API in the call module of the telephony subsystem since API version 9. Changed the `answer` API to the `answerCall` API in the call module of the telephony subsystem since API version 9.
You need to adapt your application. You need to adapt your application based on the following information.
**Change Impact** **Change Impact**
The `answer` API is deprecated and cannot be used any more. Use the `answerCall` API instead. Otherwise, relevant functions will be affected. The `answer` API is deprecated and cannot be used anymore. Use the `answerCall` API instead. Otherwise, relevant functions will be affected.
- Involved APIs: - Involved APIs:
...@@ -133,7 +133,7 @@ The `answer` API is deprecated and cannot be used any more. Use the `answerCall` ...@@ -133,7 +133,7 @@ The `answer` API is deprecated and cannot be used any more. Use the `answerCall`
**Adaptation Guide** **Adaptation Guide**
The `answer` API is deprecated and cannot be used any more. Use the `answerCall` API instead. The `answer` API is deprecated and cannot be used anymore. Use the `answerCall` API instead.
Use the new API. The sample code is as follows: Use the new API. The sample code is as follows:
```js ```js
...@@ -163,11 +163,11 @@ call.answerCall((err, data) => { ...@@ -163,11 +163,11 @@ call.answerCall((err, data) => {
## cl.telephony.1 Call Module hangup API Change ## cl.telephony.1 Call Module hangup API Change
Changed the `hangup` API to the `hangUpCall` API in the call module of the telephony subsystem since API version 9. Changed the `hangup` API to the `hangUpCall` API in the call module of the telephony subsystem since API version 9.
You need to adapt your application. You need to adapt your application based on the following information.
**Change Impact** **Change Impact**
The `hangup` API is deprecated and cannot be used any more. Use the `hangUpCall` API instead. Otherwise, relevant functions will be affected. The `hangup` API is deprecated and cannot be used anymore. Use the `hangUpCall` API instead. Otherwise, relevant functions will be affected.
- Involved APIs: - Involved APIs:
...@@ -196,7 +196,7 @@ The `hangup` API is deprecated and cannot be used any more. Use the `hangUpCall` ...@@ -196,7 +196,7 @@ The `hangup` API is deprecated and cannot be used any more. Use the `hangUpCall`
**Adaptation Guide** **Adaptation Guide**
The `hangup` API is deprecated and cannot be used any more. Use the `hangUpCall` API instead. The `hangup` API is deprecated and cannot be used anymore. Use the `hangUpCall` API instead.
Use the new API. The sample code is as follows: Use the new API. The sample code is as follows:
```js ```js
......
# Readme
- [Ability framework](changelogs-ability.md)
- [Account subsystem](changelogs-account_os_account.md)
- [ArkUI development framework](changelogs-arkui.md)
- [Multimedia subsystem - camera](changelogs-camera.md)
- [Device management subsystem](changelogs-device-manager.md)
- [USB](changelogs-device-usb.md)
- [Distributed scheduler subsystem](changelogs-dmsfwk.md)
- [DSoftBus](changelogs-dsoftbus.md)
- [Customization subsystem](changelogs-enterprise_device_management.md)
- [File management subsystem](changelogs-filemanagement.md)
- [Location subsystem](changelogs-geolocation.md)
- [Globalization subsystem](changelogs-global.md)
- [Input method framework](changelogs-inputmethod-framworks.md)
- [Multimedia subsystem](changelogs-multimedia.md)
- [Multimodal input subsystem](changelogs-multimodalinput.md)
- [Common event and notification subsystem](changelogs-notification.md)
- [Power management subsystem](changelogs-power.md)
- [Upload and download](changelogs-request.md)
- [Resource manager subsystem](changelogs-resource-manager.md)
- [Resource scheduler subsystem](changelogs-resourceschedule.md)
- [Telephony subsystem](changelogs-telephony.md)
- [Test subsystem](changelogs-testfwk_arkxtest.md)
- [Theme](changelogs-theme.md)
- [User IAM subsystem](changelogs-useriam.md)
- [Ability framework - WantAgent](changelogs-wantAgent.md)
- [Web subsystem](changelogs-web.md)
- [Communication subsystem - WiFi](changelogs-wifi.md)
# *Example* Subsystem ChangeLog # *Example* Subsystem Changelog
Changes that affect contract compatibility of the last version should be described in the ChangeLog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions. Changes that affect contract compatibility of the last version should be described in the changelog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions.
## cl.subsystemname.x xxx Function Change (Example: DeviceType Attribute Change or Camera Permission Change. Use a short description.) ## cl.subsystemname.x xxx Function Change (Example: DeviceType Attribute Change or Camera Permission Change. Use a short description.)
Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of ChangeLog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order). Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of changelog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order).
Describe the changes in terms of functions. Example: *n* and *m* of the *a* function are changed. Developers need to adapt their applications based on the change description. Describe the changes in terms of functions. Example: *n* and *m* of the *a* function are changed. Developers need to adapt their applications based on the change description.
If there is a requirement or design document corresponding to the change, attach the requirement number or design document number in the description. If there is a requirement or design document corresponding to the change, attach the requirement number or design document number in the description.
**Change Impacts** **Change Impact**
Describe whether released APIs (JS or native APIs) are affected or API behavior is changed. Describe whether released APIs (JS or native APIs) are affected or API behavior is changed.
Describe whether available applications are affected, that is, whether an adaptation is required for building the application code in the SDK environment of the new version. Describe whether available applications are affected, that is, whether an adaptation is required for building the application code in the SDK environment of the new version.
**Key API/Component Changes** **Key API/Component Changes**
List the API/component changes involved in the function change. List the API/component changes involved in the function change.
**Adaptation Guide (Optional)** **Adaptation Guide**
Provide guidance for developers on how to adapt their application to the changes to be compatible with the new version. Provide guidance for developers on how to adapt their application to the changes to be compatible with the new version.
Example: Example:
Change parameter *n* to *m* in the *a* file. Change parameter *n* to *m* in the *a* file.
``` ```
......
# Ability Subsystem ChangeLog # Ability Framework Changelog
## cl.ability.1 Application Component Startup Rule Change ## cl.ability.1 Application Component Startup Rule Change
The rules for starting application components of the ability subsystem are changed in the following scenarios: The rules for starting application components are changed in the following scenarios:
- Start application components when the application is in the background. - Start an application component when the application is in the background.
- Start invisible application components across applications. - Start an invisible application component across applications.
- Start **serviceAbility** and **dataAbility** of the FA model across applications. - Start a ServiceAbility and DataAbility of the FA model across applications.
- Use the **startAbilityByCall** API. - Use the **startAbilityByCall** API.
You need to adapt your application based on the following information. You need to adapt your application.
**Change Impacts**
**Change Impact**
If new rules are not adapted, application components cannot be started in the previous scenarios. If new rules are not adapted, application components cannot be started in the previous scenarios.
> **NOTE** > **NOTE**
> >
> Starting application components refers to any behavior starting or connecting to an ability. > Starting application components refers to any behavior starting or connecting to an ability.
> >
...@@ -69,13 +70,13 @@ If new rules are not adapted, application components cannot be started in the pr ...@@ -69,13 +70,13 @@ If new rules are not adapted, application components cannot be started in the pr
**Adaptation Guide** **Adaptation Guide**
Startup rules for different scenarios are as follows: Startup rules for different scenarios are as follows:
- **Start application components when the application is in the background.** - **Starting an application component when the application is in the background**
- OpenHarmony 3.2 Beta3 rules: - Rule in OpenHarmony 3.2 Beta3:
- Starting application components when the application is in the background is not restricted. - There is no restriction.
- OpenHarmony 3.2 Beta4 rules: - Rule in OpenHarmony 3.2 Beta4:
- When the application is in the background, starting application components requires authentication. The following permission needs to be applied for: - Authentication is required. The following permissions must be configured:
```json - ```json
{ {
"name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND", "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND",
"grantMode": "system_grant", "grantMode": "system_grant",
...@@ -84,18 +85,19 @@ Startup rules for different scenarios are as follows: ...@@ -84,18 +85,19 @@ Startup rules for different scenarios are as follows:
"distributedSceneEnable": false "distributedSceneEnable": false
} }
``` ```
> **NOTE** > **NOTE**
> >
> 1. Starting components of the same application is also restricted by this rule. > 1. Starting an application component of the same application is also restricted by this rule.
> 2. For SDKs of API version 8 or earlier, starting **serviceAbility** and **dataAbility** is not restricted by this rule. > 2. For SDKs of API version 8 or earlier, starting a ServiceAbility and DataAbility is not restricted by this rule.
- **Starting an invisible application component across applications**
- **Start invisible application components across applications.** - Rule in OpenHarmony 3.2 Beta3:
- OpenHarmony 3.2 Beta3 rules:
- For applications whose APL is normal, invisible application components cannot be started across applications. - For applications whose APL is normal, invisible application components cannot be started across applications.
- OpenHarmony 3.2 Beta4 rules: - Rule in OpenHarmony 3.2 Beta4:
- For all applications, starting invisible application components across applications requires authentication. The following permission needs to be applied for: - For all applications, starting an invisible application component across applications requires authentication. The following permissions must be configured:
```json - ```json
{ {
"name": "ohos.permission.START_INVISIBLE_ABILITY", "name": "ohos.permission.START_INVISIBLE_ABILITY",
"grantMode": "system_grant", "grantMode": "system_grant",
...@@ -103,26 +105,26 @@ Startup rules for different scenarios are as follows: ...@@ -103,26 +105,26 @@ Startup rules for different scenarios are as follows:
"provisionEnable": true, "provisionEnable": true,
"distributedSceneEnable": false "distributedSceneEnable": false
} }
``` ```
- **Start serviceAbility and dataAbility of the FA model across applications.** - **Starting a ServiceAbility and DataAbility of the FA model across applications**
- OpenHarmony 3.2 Beta3 rules: - Rule in OpenHarmony 3.2 Beta3:
- Starting **serviceAbility** and **dataAbility** across applications is not restricted. - There is no restriction.
- OpenHarmony 3.2 Beta4 rules: - Rule in OpenHarmony 3.2 Beta4:
- Associated startup needs to be configured for the provider of **serviceAbility** and **dataAbility**. Otherwise, **serviceAbility** and **dataAbility** cannot be started across applications. (Associated startup cannot be configured for common applications.) - Associated startup must be configured for the provider of the ServiceAbility and DataAbility. Otherwise, they cannot be started across applications. (Associated startup cannot be configured for common applications.)
- **Use the startAbilityByCall API.** - **Using the startAbilityByCall API**
- OpenHarmony 3.2 Beta3 rules: - Rule in OpenHarmony 3.2 Beta3:
- The API call is not restricted. - This is no restriction.
- OpenHarmony 3.2 Beta4 rules: - Rule in OpenHarmony 3.2 Beta4:
- The **startAbilityByCall** API cannot be called by the same application. - The **startAbilityByCall** API cannot be called by the same application.
- Calling the **startAbilityByCall** API across applications requires authentication. The following permission needs to be applied for: - Calling the **startAbilityByCall** API across applications requires authentication. The following permissions must be configured:
```json - ```json
{ {
"name": "ohos.permission.ABILITY_BACKGROUND_COMMUNICATION", "name": "ohos.permission.ABILITY_BACKGROUND_COMMUNICATION",
"grantMode": "system_grant", "grantMode": "system_grant",
...@@ -137,24 +139,24 @@ Startup rules for different scenarios are as follows: ...@@ -137,24 +139,24 @@ Startup rules for different scenarios are as follows:
## cl.ability.2 Cross-Device Application Component Startup Rule Change (for System Applications Only) ## cl.ability.2 Cross-Device Application Component Startup Rule Change (for System Applications Only)
The rules for starting cross-device application components of the ability subsystem are changed in the following scenarios: The rules for starting cross-device application components are changed in the following scenarios:
- Start application components when the application is in the background. - Start an application component when the application is in the background.
- Start invisible application components across applications. - Start an invisible application component across applications.
- Start **serviceAbility** of the FA model across applications. - Start a ServiceAbility of the FA model across applications.
You need to adapt your application based on the following information. You need to adapt your application.
**Change Impacts** **Change Impact**
If new rules are not adapted, application components cannot be started in the previous scenarios. If new rules are not adapted, application components cannot be started in the previous scenarios.
>**NOTE** > **NOTE**
> >
>Starting application components refers to any behavior starting or connecting to an ability. > Starting application components refers to any behavior starting or connecting to an ability.
> >
>1. Start an ability using APIs such as **startAbility**, **startAbilityForResult**, and **startAbilityByCall**. > 1. Start an ability using APIs such as **startAbility**, **startAbilityForResult**, and **startAbilityByCall**.
>2. Connect to an ability using APIs such as **connectAbility**. > 2. Connect to an ability using APIs such as **connectAbility**.
**Key API/Component Changes** **Key API/Component Changes**
...@@ -181,13 +183,13 @@ If new rules are not adapted, application components cannot be started in the pr ...@@ -181,13 +183,13 @@ If new rules are not adapted, application components cannot be started in the pr
**Adaptation Guide** **Adaptation Guide**
Startup rules for different scenarios are as follows: Startup rules for different scenarios are as follows:
- **Start application components when the application is in the background.** - **Starting an application component when the application is in the background**
- OpenHarmony 3.2 Beta3 rules: - Rule in OpenHarmony 3.2 Beta3:
- Starting application components when the application is in the background is not restricted. - There is no restriction.
- OpenHarmony 3.2 Beta4 rules: - Rule in OpenHarmony 3.2 Beta4:
- When the application is in the background, starting application components requires authentication. The following permission needs to be applied for: - Authentication is required. The following permissions must be configured:
```json - ```json
{ {
"name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND", "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND",
"grantMode": "system_grant", "grantMode": "system_grant",
...@@ -196,18 +198,18 @@ Startup rules for different scenarios are as follows: ...@@ -196,18 +198,18 @@ Startup rules for different scenarios are as follows:
"distributedSceneEnable": false "distributedSceneEnable": false
} }
``` ```
> **NOTE** > **NOTE**
> 1. Starting an application component of the same application is also restricted by this rule.
> 1. Starting components of the same application is also restricted by this rule. 2. For SDKs of API version 8 or earlier, starting a ServiceAbility is not restricted by this rule.
> 2. For SDKs of API version 8 or earlier, starting **serviceAbility** is not restricted by this rule.
- **Starting an invisible application component across applications**
- **Start invisible application components across applications.** - Rule in OpenHarmony 3.2 Beta3:
- OpenHarmony 3.2 Beta3 rules:
- Invisible application components cannot be started across applications. - Invisible application components cannot be started across applications.
- OpenHarmony 3.2 Beta4 rules: - Rule in OpenHarmony 3.2 Beta4:
- Starting invisible application components across applications requires authentication. The following permission needs to be applied for: - Authentication is required. The following permissions must be configured:
```json - ```json
{ {
"name": "ohos.permission.START_INVISIBLE_ABILITY", "name": "ohos.permission.START_INVISIBLE_ABILITY",
"grantMode": "system_grant", "grantMode": "system_grant",
...@@ -215,31 +217,31 @@ Startup rules for different scenarios are as follows: ...@@ -215,31 +217,31 @@ Startup rules for different scenarios are as follows:
"provisionEnable": true, "provisionEnable": true,
"distributedSceneEnable": false "distributedSceneEnable": false
} }
``` ```
- **Start serviceAbility of the FA model across applications.** - **Starting a ServiceAbility of the FA model across applications**
- OpenHarmony 3.2 Beta3 rules: - Rule in OpenHarmony 3.2 Beta3:
- Starting **serviceAbility** across applications is not restricted. - There is no restriction.
- OpenHarmony 3.2 Beta4 rules: - Rule in OpenHarmony 3.2 Beta4:
- Associated startup needs to be configured for the **serviceAbility** provider application. Otherwise, **serviceAbility** cannot be started across applications. (Associated startup cannot be configured for common applications.) - Associated startup needs to be configured for the provider of the ServiceAbility. Otherwise, the ServiceAbility cannot be started across applications. (Associated startup cannot be configured for common applications.)
- Configure associated startup as follows: - Configure associated startup as follows:
```json - ```json
{ {
"bundleName": "", "bundleName": "",
"app_signature": ["xxxxxxxxxxxxxxxxxxx"], "app_signature": ["xxxxxxxxxxxxxxxxxxx"],
"associatedWakeUp": true "associatedWakeUp": true
} }
``` ```
## cl.ability.3 API Exception Handling Method Change ## cl.ability.3 API Exception Handling Method Change
Certain APIs of the ability subsystem use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. Certain APIs of the ability subsystem use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony.
**Change Impacts** **Change Impact**
The application developed based on earlier versions needs to adapt the new APIs and their method for returning API error information. Otherwise, the original service logic will be affected. The application developed based on earlier versions needs to be adapted. Otherwise, the service logic will be affected.
**Key API/Component Changes** **Key API/Component Changes**
...@@ -275,7 +277,7 @@ For adaptation to the unified API exception handling mode, certain ability subsy ...@@ -275,7 +277,7 @@ For adaptation to the unified API exception handling mode, certain ability subsy
**Adaptation Guide** **Adaptation Guide**
The original APIs are only migrated to the new namespace. Therefore, you can modify **import** to solve the adaptation problem. The original APIs are only moved to the new namespace. Therefore, you can modify **import** to solve the adaptation problem.
If the original API uses **@ohos.application.missionManager**: If the original API uses **@ohos.application.missionManager**:
...@@ -293,11 +295,11 @@ In addition, exception handling is needed. For details, see the API reference fo ...@@ -293,11 +295,11 @@ In addition, exception handling is needed. For details, see the API reference fo
## cl.ability.4 API Change ## cl.ability.4 API Change
The names of some ability subsystem APIs are changed. The names of certain ability subsystem APIs are changed.
**Key API/Component Changes** **Key API/Component Changes**
| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| | Module | Class | Method/Attribute/Enum/Constant | Change Type|
| ----------------------------------------- | ----------------------- | ------------------------------------------------------------ | -------- | | ----------------------------------------- | ----------------------- | ------------------------------------------------------------ | -------- |
| @ohos.application.Ability | Caller | onRelease(callback: OnReleaseCallBack): **void**; | Deprecated | | @ohos.application.Ability | Caller | onRelease(callback: OnReleaseCallBack): **void**; | Deprecated |
| @ohos.app.ability.UIAbility | Caller | on(**type**: "release", callback: OnReleaseCallBack): **void**; | Added | | @ohos.app.ability.UIAbility | Caller | on(**type**: "release", callback: OnReleaseCallBack): **void**; | Added |
......
# Account Subsystem ChangeLog # Account Subsystem Changelog
## cl.account_os_account.1 Change of Definition and Return Mode of Error Codes ## cl.account_os_account.1 Change of Definition and Return Mode of Error Codes
To solve the issues that error code definitions of the account subsystem APIs were inconsistent and that the return mode of the error codes did not comply with relevant specifications of OpenHarmony, the following changes are made and take effect in API version 9 and later: 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 unified error code definitions: - Added the following error code definitions: [Account Error Codes](../../../application-dev/reference/errorcodes/errorcode-account.md)
- [Account Error Codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-account.md)
- [App Account Error Codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-account.md) - Changed the error code return modes as follows:
- Asynchronous APIs: Return error information in the **error** object of **AsyncCallback** or **Promise**. Throw an exception to return an error related to the parameter type or quantity.
- Synchronous APIs: Throw an exception to return an error message.
- Returned an error code in either of the following ways, according to the API type: **Change Impact**
- Asynchronous API: An error message is returned via **AsyncCallback** or the **error** object of **Promise**. An error message related to the parameter type or quantity is returned via an exception.
- Synchronous API: An error message is returned via an exception.
**Change Impacts** The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the service logic will be affected.
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** **Key API/Component Changes**
The mentioned changes involve the following APIs: Involved APIs:
- class AccountManager - class AccountManager
- activateOsAccount(localId: number, callback: AsyncCallback&lt;void&gt;): void; - activateOsAccount(localId: number, callback: AsyncCallback&lt;void&gt;): void;
- removeOsAccount(localId: number, callback: AsyncCallback&lt;void&gt;): void; - removeOsAccount(localId: number, callback: AsyncCallback&lt;void&gt;): void;
...@@ -63,13 +61,13 @@ The mentioned changes involve the following APIs: ...@@ -63,13 +61,13 @@ The mentioned changes involve the following APIs:
**Adaptation Guide** **Adaptation Guide**
The following uses **activateOsAccount** as an example to illustrate the error information processing logic of an asynchronous API: The following uses **activateOsAccount** as an example to describe the error information processing logic of an asynchronous API:
```ts ```ts
import account_osAccount from "@ohos.account.osAccount" import account_osAccount from "@ohos.account.osAccount"
let accountMgr = account_osAccount.getAccountManager() let accountMgr = account_osAccount.getAccountManager()
let callbackFunc = (err) => { let callbackFunc = (err) => {
if (err != null) { // Handle the business error. if (err != null) { // handle the bussiness error
console.log("account_osAccount failed, error: " + JSON.stringify(err)); console.log("account_osAccount failed, error: " + JSON.stringify(err));
} else { } else {
console.log("account_osAccount successfully"); console.log("account_osAccount successfully");
...@@ -77,29 +75,159 @@ let callbackFunc = (err) => { ...@@ -77,29 +75,159 @@ let callbackFunc = (err) => {
} }
try { try {
accountMgr.activateOsAccount("100", callbackFunc); accountMgr.activateOsAccount("100", callbackFunc);
} catch (err) { // Process the error that is related to the parameter type. } catch (err) { // handle the parameter type error
console.log("account_osAccount failed for incorrect parameter type, error: " + JSON.stringify(err)); console.log("account_osAccount failed for incorrect parameter type, error: " + JSON.stringify(err));
} }
try { try {
accountMgr.activateOsAccount(); accountMgr.activateOsAccount();
} catch (err) { // Process the error that is related to the parameter quantity. } catch (err) { // handle the parameter number error
console.log("account_osAccount failed for incorrect parameter number, error: " + JSON.stringify(err)); console.log("account_osAccount failed for incorrect parameter number, error: " + JSON.stringify(err));
} }
``` ```
The following uses **registerInputer** as an example to illustrate the error information processing logic of a synchronous API: The following uses **registerInputer** as an example to describe the error information processing logic of a synchronous API:
```ts ```ts
import account_osAccount from "@ohos.account.osAccount" import account_osAccount from "@ohos.account.osAccount"
let pinAuth = new account_osAccount.PINAuth() let pinAuth = new account_osAccount.PINAuth()
try { try {
pinAuth.registerInputer({}) pinAuth.registerInputer({})
} catch (err) { // Process the error that is related to the parameter type. } catch (err) { // handle the parameter type error
console.log("account_osAccount failed for incorrect parameter type, error: " + JSON.stringify(err)); console.log("account_osAccount failed for incorrect parameter type, error: " + JSON.stringify(err));
} }
try { try {
pinAuth.registerInputer() pinAuth.registerInputer()
} catch (err) { // Process the error that is related to the parameter quantity. } catch (err) { // handle the parameter number error
console.log("account_osAccount failed for incorrect parameter number, error: " + JSON.stringify(err)); console.log("account_osAccount failed for incorrect parameter number, error: " + JSON.stringify(err));
} }
``` ```
# Account Subsystem Changelog
## 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 APIs: Return error information in the **error** object of **AsyncCallback** or **Promise**.
Synchronous APIs: Throw an exception to return error information.
**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 ACTION Definition Change for the Application 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",
"srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts",
...
"visible": true,
"skills": {
{
"actions": [
"ohos.appAccount.action.auth"
]
}
}
}]
}
```
# ArkUI Subsystem ChangeLog
## cl.arkui.1 xcomponent API Change
Changed the following APIs of the **xcomponent** component of the ArkUI subsystem:
- **getXComponentSurfaceId** and **setXComponentSurfaceSize**: Removed the **@systemapi** tag.
- **getXComponentSurfaceId**, **getXComponentContext**, and **setXComponentSurfaceSize**: Specified the return value type.
You need to adapt your application based on the following information.
**Change Impact**
Released JS APIs are affected. The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
**Key API/Component Changes**
- **getXComponentSurfaceId**: is changed to a public API, with its return value type specified as string.
- **setXComponentSurfaceSize**: is changed to a public API, with its return value type specified as void.
- **getXComponentContext**: has its return value type specified as object.
**Adaptation Guide**
Startup rules for different scenarios are as follows:
Adaptions to be made:
- **getXComponentSurfaceId**
- Rule in OpenHarmony 3.2 Beta3:
- System API
- No specified return value
- OpenHarmony 3.2 Beta4 rules:
- Public API
- Return value type specified as string
- You need to process the return value as a string.
- **setXComponentSurfaceSize**
- Rule in OpenHarmony 3.2 Beta3:
- System API
- No specified return value
- OpenHarmony 3.2 Beta4 rules:
- Public API
- Return value type specified as void
- You need to process the return value as a void.
- **getXComponentContext**
- Rule in OpenHarmony 3.2 Beta3:
- No specified return value
- OpenHarmony 3.2 Beta4 rules:
- Return value type specified as object
- You need to process the return value as an object.
## cl.arkui.2 Change of Styles of Popup Component and APIs
Changed the styles of the **alertDialog**, **actionSheet**, and **customDialog** components, as well as the **prompt** and **promptAction** APIs. Specifically speaking:
- Added the popup background blur effect to **promptAction.showDialog**, **promptAction.showActionMenu**, **alertDialog**, **actionSheet**, and **customDialog**.
**Change Impact**
The popup background blur effect is set by default.
**Key API/Component Changes**
APIs: **promptAction.showDialog** and **promptAction.showActionMenu;**
Components: **alertDialog**, **actionSheet**, and **customDialog**
**Adaptation Guide**
No adaptation is required.
## cl.arkui.3 Supplementation of the Initialization Mode and Restriction Verification Scenarios of Custom Components' Member Variables
For details, see **Restrictions and Extensions**.
**Change Impact**
If custom components' member variables are initialized or assigned with values not according to the document specifications, an error will be reported during compilation.
**Key API/Component Changes**
N/A.
**Adaptation Guide**
Make modification according to specifications in the above document.
## cl.arkui.4 Supplementation of Verification Scenarios of Value Assignment Restrictions on Member Variables of Custom Parent Components and Child Components
For details, see **Restrictions and Extensions**.
**Change Impact**
If member variables of the parent component or child component are initialized not according to the document specifications, an error will be reported during compilation.
**Key API/Component Changes**
N/A.
**Adaptation Guide**
Make modification according to specifications in the above document, using other decorators or normal member variables for value assignment.
## cl.arkui.5 Supplementation of Verification for a Single Subcomponent
Added the check rule that allows only one child component to be enabled for the following components: **Button**, **FlowItem**, **GridItem**, **GridCol**, **ListItem**, **Navigator**, **Refresh**, **RichText**, **ScrollBar**, **StepperItem**, and **TabContent**.
**Change Impact**
If one of the preceding components contains more than one child component, an error will be reported during compilation.
**Key API/Component Changes**
```js
RichText('RichText') {
Text('Text1')
Text('Text2')
}
/* ArkTS:ERROR File: /root/newOH/developtools/ace-ets2bundle/compiler/sample/pages/home.ets:25:7
The component 'RichText' can only have a single child component. */
```
**Adaptation Guide**
Make modification based on the error message. Make sure that the specified component contains only one child component.
# ChangeLog of JS API Changes in the Multimedia Subsystem # Multimedia Subsystem Changelog
Compared with OpenHarmony 3.2 Beta3, OpenHarmony 3.2 Beta4 has the following changes in APIs of the camera component in the multimedia subsystem.
## Camera API Changes ## Camera API Changes
Some functional APIs are added and some others are deprecated to: Some functional APIs are added and some others are deprecated to:
...@@ -10,13 +8,13 @@ Some functional APIs are added and some others are deprecated to: ...@@ -10,13 +8,13 @@ Some functional APIs are added and some others are deprecated to:
You need to refer to the following change description to adapt your application. You need to refer to the following change description to adapt your application.
**Change Impacts** **Change Impact**
JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement functions in the SDK environment of the new version. 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** **Key API/Component Changes**
| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| | Module | Class | Method/Attribute/Enum/Constant | Change Type|
| ---------------------- | ----------------------- | ------------------------------------------------------------ | -------- | | ---------------------- | ----------------------- | ------------------------------------------------------------ | -------- |
| ohos.multimedia.camera | Profile | readonly format:CameraFormat; | Added | | ohos.multimedia.camera | Profile | readonly format:CameraFormat; | Added |
| ohos.multimedia.camera | Profile | readonly size: Size; | Added | | ohos.multimedia.camera | Profile | readonly size: Size; | Added |
...@@ -195,7 +193,7 @@ In Beta4 and later versions, the following APIs are changed. ...@@ -195,7 +193,7 @@ In Beta4 and later versions, the following APIs are changed.
getSupportedOutputCapability(camera: CameraDevice): Promise<CameraOutputCapability>; getSupportedOutputCapability(camera: CameraDevice): Promise<CameraOutputCapability>;
The sample code is as follows: The code snippet is as follows:
``` ```
cameraManager.getSupportedCameras().then((cameras) => { cameraManager.getSupportedCameras().then((cameras) => {
...@@ -221,7 +219,7 @@ In Beta4 and later versions, the following APIs are changed. ...@@ -221,7 +219,7 @@ In Beta4 and later versions, the following APIs are changed.
6. The **isCameraMuted(): boolean;** API is added to **CameraManager**. 6. The **isCameraMuted(): boolean;** API is added to **CameraManager**.
The sample code is as follows: The code snippet is as follows:
``` ```
let ismuted = cameraManager.isCameraMuted(); let ismuted = cameraManager.isCameraMuted();
...@@ -229,7 +227,7 @@ In Beta4 and later versions, the following APIs are changed. ...@@ -229,7 +227,7 @@ In Beta4 and later versions, the following APIs are changed.
7. The **isCameraMuteSupported(): boolean;** API is added to **CameraManager**. 7. The **isCameraMuteSupported(): boolean;** API is added to **CameraManager**.
The sample code is as follows: The code snippet is as follows:
``` ```
let ismutesuppotred = cameraManager.isCameraMuteSupported(); let ismutesuppotred = cameraManager.isCameraMuteSupported();
...@@ -237,7 +235,7 @@ In Beta4 and later versions, the following APIs are changed. ...@@ -237,7 +235,7 @@ In Beta4 and later versions, the following APIs are changed.
8. The **muteCamera(mute: boolean): void;** API is added to **CameraManager**. 8. The **muteCamera(mute: boolean): void;** API is added to **CameraManager**.
The sample code is as follows: The code snippet is as follows:
``` ```
let mute = true; let mute = true;
...@@ -246,7 +244,7 @@ In Beta4 and later versions, the following APIs are changed. ...@@ -246,7 +244,7 @@ In Beta4 and later versions, the following APIs are changed.
9. The **on(type: 'cameraMute', callback: AsyncCallback<boolean>): void;** API is added to **CameraManager**. 9. The **on(type: 'cameraMute', callback: AsyncCallback<boolean>): void;** API is added to **CameraManager**.
The sample code is as follows: The code snippet is as follows:
``` ```
cameraManager.on('cameraMute', (err, curMuetd) => { cameraManager.on('cameraMute', (err, curMuetd) => {
...@@ -259,27 +257,27 @@ In Beta4 and later versions, the following APIs are changed. ...@@ -259,27 +257,27 @@ In Beta4 and later versions, the following APIs are changed.
10. The **open(callback: AsyncCallback<void>): void;** and **open(): Promise<void>;** APIs are added to **CameraInput**. 10. The **open(callback: AsyncCallback<void>): void;** and **open(): Promise<void>;** APIs are added to **CameraInput**.
The sample code is as follows: The code snippet is as follows:
``` ```
cameraInput.open((err) => { cameraInput.open((err) => {
if (err) { if (err) {
console.error(`Failed to open the camera. ${err.message}`); console.error(`Failed to open the camera. ${err.message}`);
return; return;
} }
console.log('Callback returned with camera opened.'); console.log('Callback returned with camera opened.');
}) })
``` ```
``` ```
cameraInput.open().then(() => { cameraInput.open().then(() => {
console.log('Promise returned with camera opened.'); console.log('Promise returned with camera opened.');
}) })
``` ```
11. The **close(callback: AsyncCallback<void>): void;** and **close(): Promise<void>;** APIs are added to **CameraInput**. 11. The **close(callback: AsyncCallback<void>): void;** and **close(): Promise<void>;** APIs are added to **CameraInput**.
The sample code is as follows: The code snippet is as follows:
``` ```
cameraInput.close((err) => { cameraInput.close((err) => {
...@@ -297,25 +295,25 @@ cameraInput.open().then(() => { ...@@ -297,25 +295,25 @@ cameraInput.open().then(() => {
}) })
``` ```
12. The following enumerations are added to **CameraInputErrorCode**: 12. The following enums are added to **CameraInputErrorCode**:
Enumeration: ERROR_NO_PERMISSION; value: 0 Enum: ERROR_NO_PERMISSION; value: 0
Enumeration: ERROR_DEVICE_PREEMPTED; value: 1 Enum: ERROR_DEVICE_PREEMPTED; value: 1
Enumeration: ERROR_DEVICE_DISCONNECTED; value: 2 Enum: ERROR_DEVICE_DISCONNECTED; value: 2
Enumeration: ERROR_DEVICE_IN_USE; value: 3 Enum: ERROR_DEVICE_IN_USE; value: 3
Enumeration: ERROR_DRIVER_ERROR; value: 4 Enum: ERROR_DRIVER_ERROR; value: 4
13. The following enumeration is added to **CameraFormat**: 13. The following enum is added to **CameraFormat**:
Enumeration: CAMERA_FORMAT_RGBA_8888; value: 3 Enum: CAMERA_FORMAT_RGBA_8888; value: 3
14. The **getMeteringPoint(callback: AsyncCallback<Point>): void;** and **getMeteringPoint(): Promise<Point>;** APIs are added to **CaptureSession**. 14. The **getMeteringPoint(callback: AsyncCallback<Point>): void;** and **getMeteringPoint(): Promise<Point>;** APIs are added to **CaptureSession**.
The sample code is as follows: The code snippet is as follows:
``` ```
captureSession.getMeteringPoint((err, exposurePoint) => { captureSession.getMeteringPoint((err, exposurePoint) => {
...@@ -335,7 +333,7 @@ cameraInput.open().then(() => { ...@@ -335,7 +333,7 @@ cameraInput.open().then(() => {
15. The **setMeteringPoint(point: Point, callback: AsyncCallback<void>): void;** and **setMeteringPoint(point: Point): Promise<void>;** APIs are added to **CaptureSession**. 15. The **setMeteringPoint(point: Point, callback: AsyncCallback<void>): void;** and **setMeteringPoint(point: Point): Promise<void>;** APIs are added to **CaptureSession**.
The sample code is as follows: The code snippet is as follows:
``` ```
const Point1 = {x: 1, y: 1}; const Point1 = {x: 1, y: 1};
...@@ -357,11 +355,11 @@ cameraInput.open().then(() => { ...@@ -357,11 +355,11 @@ cameraInput.open().then(() => {
}) })
``` ```
16. The following enumerations are added to **CaptureSessionErrorCode**: 16. The following enums are added to **CaptureSessionErrorCode**:
Enumeration: ERROR_INSUFFICIENT_RESOURCES; value: 0 Enum: ERROR_INSUFFICIENT_RESOURCES; value: 0
Enumeration: ERROR_TIMEOUT; value: 1 Enum: ERROR_TIMEOUT; value: 1
17. The **CameraOutput** API is added and contains the **release(callback: AsyncCallback<void>): void;** and **release(): Promise<void>;** methods. 17. The **CameraOutput** API is added and contains the **release(callback: AsyncCallback<void>): void;** and **release(): Promise<void>;** methods.
...@@ -385,7 +383,7 @@ cameraInput.open().then(() => { ...@@ -385,7 +383,7 @@ cameraInput.open().then(() => {
18. The **start(callback: AsyncCallback<void>): void;** and **start(): Promise<void>;** APIs are added to **PreviewOutput**. 18. The **start(callback: AsyncCallback<void>): void;** and **start(): Promise<void>;** APIs are added to **PreviewOutput**.
The sample code is as follows: The code snippet is as follows:
``` ```
previewOutput.start((err) => { previewOutput.start((err) => {
...@@ -405,7 +403,7 @@ cameraInput.open().then(() => { ...@@ -405,7 +403,7 @@ cameraInput.open().then(() => {
19. The **stop(callback: AsyncCallback<void>): void;** and **stop(): Promise<void>;** APIs are added to **PreviewOutput**. 19. The **stop(callback: AsyncCallback<void>): void;** and **stop(): Promise<void>;** APIs are added to **PreviewOutput**.
The sample code is as follows: The code snippet is as follows:
``` ```
previewOutput.stop((err) => { previewOutput.stop((err) => {
...@@ -427,21 +425,21 @@ cameraInput.open().then(() => { ...@@ -427,21 +425,21 @@ cameraInput.open().then(() => {
Attribute 1: mirror?; type: boolean Attribute 1: mirror?; type: boolean
21. The following enumerations are added to **PhotoOutputErrorCode**: 21. The following enums are added to **PhotoOutputErrorCode**:
Enumeration: ERROR_DRIVER_ERROR; value: 0 Enum: ERROR_DRIVER_ERROR; value: 0
Enumeration: ERROR_INSUFFICIENT_RESOURCES; value: 1 Enum: ERROR_INSUFFICIENT_RESOURCES; value: 1
Enumeration: ERROR_TIMEOUT; value: 2 Enum: ERROR_TIMEOUT; value: 2
22. The following enumeration is added to **VideoOutputErrorCode**: 22. The following enum is added to **VideoOutputErrorCode**:
Enumeration: ERROR_DRIVER_ERROR; value: 0 Enum: ERROR_DRIVER_ERROR; value: 0
23. The **on(type: 'error', callback: ErrorCallback<MetadataOutputError>): void;** API is added to **MetadataOutput**. 23. The **on(type: 'error', callback: ErrorCallback<MetadataOutputError>): void;** API is added to **MetadataOutput**.
The sample code is as follows: The code snippet is as follows:
``` ```
metadataOutput.on('error', (metadataOutputError) => { metadataOutput.on('error', (metadataOutputError) => {
...@@ -449,11 +447,11 @@ cameraInput.open().then(() => { ...@@ -449,11 +447,11 @@ cameraInput.open().then(() => {
}) })
``` ```
24. The following enumerations are added to **MetadataOutputErrorCode**. 24. The following enums are added to **MetadataOutputErrorCode**.
Enumeration: ERROR_UNKNOWN; value: -1 Enum: ERROR_UNKNOWN; value: -1
Enumeration: ERROR_INSUFFICIENT_RESOURCES; value: 0 Enum: ERROR_INSUFFICIENT_RESOURCES; value: 0
25. **MetadataOutputError** API 25. **MetadataOutputError** API
...@@ -489,7 +487,7 @@ cameraInput.open().then(() => { ...@@ -489,7 +487,7 @@ cameraInput.open().then(() => {
1. In **CameraManager**, the return value of **getCameras** is changed from **Array<Camera>** to **Array<CameraDevice>**, and the API name is changed from **getCameras** to **getSupportedCameras**. Therefore, the **getCameras(callback: AsyncCallback<Array<Camera>>): void;** and **getCameras(): Promise<Array<Camera>>;** APIs are changed to **getSupportedCameras(callback: AsyncCallback<Array<CameraDevice>>): void** and **getSupportedCameras(): Promise<Array<CameraDevice>>;**. 1. In **CameraManager**, the return value of **getCameras** is changed from **Array<Camera>** to **Array<CameraDevice>**, and the API name is changed from **getCameras** to **getSupportedCameras**. Therefore, the **getCameras(callback: AsyncCallback<Array<Camera>>): void;** and **getCameras(): Promise<Array<Camera>>;** APIs are changed to **getSupportedCameras(callback: AsyncCallback<Array<CameraDevice>>): void** and **getSupportedCameras(): Promise<Array<CameraDevice>>;**.
The sample code is as follows: The code snippet is as follows:
``` ```
cameraManager.getSupportedCameras((err, cameras) => { cameraManager.getSupportedCameras((err, cameras) => {
...@@ -509,7 +507,7 @@ cameraInput.open().then(() => { ...@@ -509,7 +507,7 @@ cameraInput.open().then(() => {
2. In **CameraManager**, the input parameter of **createCameraInput** is changed from **cameraId: string** to **camera: CameraDevice**. Therefore, the **createCameraInput(cameraId: string, callback: AsyncCallback<CameraInput>): void;** and **createCameraInput(cameraId: string): Promise<CameraInput>;** APIs are changed to **createCameraInput(camera: CameraDevice, callback: AsyncCallback<CameraInput>): void;** and **createCameraInput(camera: CameraDevice): Promise<CameraInput>;**. 2. In **CameraManager**, the input parameter of **createCameraInput** is changed from **cameraId: string** to **camera: CameraDevice**. Therefore, the **createCameraInput(cameraId: string, callback: AsyncCallback<CameraInput>): void;** and **createCameraInput(cameraId: string): Promise<CameraInput>;** APIs are changed to **createCameraInput(camera: CameraDevice, callback: AsyncCallback<CameraInput>): void;** and **createCameraInput(camera: CameraDevice): Promise<CameraInput>;**.
The sample code is as follows: The code snippet is as follows:
``` ```
let cameraDevice = cameras[0]; let cameraDevice = cameras[0];
...@@ -531,7 +529,7 @@ cameraInput.open().then(() => { ...@@ -531,7 +529,7 @@ cameraInput.open().then(() => {
3. In **CameraManager**, the input parameter **profile: Profile** is added to **createPreviewOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **createPreviewOutput(surfaceId: string, callback: AsyncCallback<PreviewOutput>): void;** and **createPreviewOutput(surfaceId: string): Promise<PreviewOutput>;** APIs are changed to **createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PreviewOutput>): void;** and **createPreviewOutput(profile: Profile, surfaceId: string): Promise<PreviewOutput>;**. 3. In **CameraManager**, the input parameter **profile: Profile** is added to **createPreviewOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **createPreviewOutput(surfaceId: string, callback: AsyncCallback<PreviewOutput>): void;** and **createPreviewOutput(surfaceId: string): Promise<PreviewOutput>;** APIs are changed to **createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PreviewOutput>): void;** and **createPreviewOutput(profile: Profile, surfaceId: string): Promise<PreviewOutput>;**.
The sample code is as follows: The code snippet is as follows:
``` ```
let profile = cameraoutputcapability.previewProfiles[0]; let profile = cameraoutputcapability.previewProfiles[0];
...@@ -553,7 +551,7 @@ cameraInput.open().then(() => { ...@@ -553,7 +551,7 @@ cameraInput.open().then(() => {
4. In **CameraManager**, the input parameter **profile: Profile** is added to **createPhotoOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **CreatePhotoOutput(surfaceId: string, callback: AsyncCallback<PhotoOutput>): void;** and **CreatePhotoOutput(surfaceId: string): Promise<PhotoOutput>;** APIs are changed to **createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PhotoOutput>): void;** and **createPhotoOutput(profile: Profile, surfaceId: string): Promise<PhotoOutput>;**. 4. In **CameraManager**, the input parameter **profile: Profile** is added to **createPhotoOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **CreatePhotoOutput(surfaceId: string, callback: AsyncCallback<PhotoOutput>): void;** and **CreatePhotoOutput(surfaceId: string): Promise<PhotoOutput>;** APIs are changed to **createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PhotoOutput>): void;** and **createPhotoOutput(profile: Profile, surfaceId: string): Promise<PhotoOutput>;**.
The sample code is as follows: The code snippet is as follows:
``` ```
let profile = cameraoutputcapability.photoProfiles[0]; let profile = cameraoutputcapability.photoProfiles[0];
...@@ -575,7 +573,7 @@ cameraInput.open().then(() => { ...@@ -575,7 +573,7 @@ cameraInput.open().then(() => {
5. In **CameraManager**, the input parameter **profile: Profile** is added to **createVideoOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **createVideoOutput(surfaceId: string, callback: AsyncCallback<VideoOutput>): void;** and **createVideoOutput(surfaceId: string): Promise<VideoOutput>;** APIs are changed to **createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback<VideoOutput>): void;** and **createVideoOutput(profile: VideoProfile, surfaceId: string): Promise<VideoOutput>;**. 5. In **CameraManager**, the input parameter **profile: Profile** is added to **createVideoOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **createVideoOutput(surfaceId: string, callback: AsyncCallback<VideoOutput>): void;** and **createVideoOutput(surfaceId: string): Promise<VideoOutput>;** APIs are changed to **createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback<VideoOutput>): void;** and **createVideoOutput(profile: VideoProfile, surfaceId: string): Promise<VideoOutput>;**.
The sample code is as follows: The code snippet is as follows:
``` ```
let profile = cameraoutputcapability.videoProfiles[0]; let profile = cameraoutputcapability.videoProfiles[0];
...@@ -597,7 +595,7 @@ cameraInput.open().then(() => { ...@@ -597,7 +595,7 @@ cameraInput.open().then(() => {
6. In **CameraManager**, the input parameter **metadataObjectTypes: Array<MetadataObjectType>** is added to **createMetadataOutput**, and the **metadataObjectTypes** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **function createMetadataOutput(callback: AsyncCallback<MetadataOutput>): void;** and **function createMetadataOutput(): Promise<MetadataOutput>;** APIs are changed to **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>, callback: AsyncCallback<MetadataOutput>): void;** and **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): Promise<MetadataOutput>;**. 6. In **CameraManager**, the input parameter **metadataObjectTypes: Array<MetadataObjectType>** is added to **createMetadataOutput**, and the **metadataObjectTypes** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **function createMetadataOutput(callback: AsyncCallback<MetadataOutput>): void;** and **function createMetadataOutput(): Promise<MetadataOutput>;** APIs are changed to **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>, callback: AsyncCallback<MetadataOutput>): void;** and **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): Promise<MetadataOutput>;**.
The sample code is as follows: The code snippet is as follows:
``` ```
let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes; let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes;
...@@ -619,7 +617,7 @@ cameraInput.open().then(() => { ...@@ -619,7 +617,7 @@ cameraInput.open().then(() => {
7. In **CameraManager**, **createCaptureSession** does not need to consider the context attribute. Therefore, the **createCaptureSession(context: Context, callback: AsyncCallback<CaptureSession>): void;** and **createCaptureSession(context: Context): Promise<CaptureSession>;** APIs are changed to **createCaptureSession(callback: AsyncCallback<CaptureSession>): void;** and **createCaptureSession(): Promise<CaptureSession>;**. 7. In **CameraManager**, **createCaptureSession** does not need to consider the context attribute. Therefore, the **createCaptureSession(context: Context, callback: AsyncCallback<CaptureSession>): void;** and **createCaptureSession(context: Context): Promise<CaptureSession>;** APIs are changed to **createCaptureSession(callback: AsyncCallback<CaptureSession>): void;** and **createCaptureSession(): Promise<CaptureSession>;**.
The sample code is as follows: The code snippet is as follows:
```typescript ```typescript
cameraManager.createCaptureSession((err, captureSession) => { cameraManager.createCaptureSession((err, captureSession) => {
...@@ -641,7 +639,7 @@ cameraInput.open().then(() => { ...@@ -641,7 +639,7 @@ cameraInput.open().then(() => {
9. In **CameraInput**, the input parameter **camera: CameraDevice** is added to the **on(type: 'error')** API. Therefore, the **on(type: 'error', callback: ErrorCallback<CameraInputError>): void;** API is changed to **on(type: 'error', camera: CameraDevice, callback: ErrorCallback<CameraInputError>): void;**. 9. In **CameraInput**, the input parameter **camera: CameraDevice** is added to the **on(type: 'error')** API. Therefore, the **on(type: 'error', callback: ErrorCallback<CameraInputError>): void;** API is changed to **on(type: 'error', camera: CameraDevice, callback: ErrorCallback<CameraInputError>): void;**.
The sample code is as follows: The code snippet is as follows:
``` ```
let cameraDevice = cameras[0]; let cameraDevice = cameras[0];
...@@ -696,7 +694,7 @@ cameraInput.open().then(() => { ...@@ -696,7 +694,7 @@ cameraInput.open().then(() => {
11. The **on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void;** API is moved from **CameraInput** to **CaptureSession**. 11. The **on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void;** API is moved from **CameraInput** to **CaptureSession**.
The sample code is as follows: The code snippet is as follows:
``` ```
captureSession.on('focusStateChange', (focusState) => { captureSession.on('focusStateChange', (focusState) => {
...@@ -704,23 +702,23 @@ cameraInput.open().then(() => { ...@@ -704,23 +702,23 @@ cameraInput.open().then(() => {
}) })
``` ```
12. The following enumerations are added to **ExposureMode**: 12. The following enums are added to **ExposureMode**:
Enumeration: EXPOSURE_MODE_AUTO; initial value: changed from the default value to **1** Enum: EXPOSURE_MODE_AUTO; initial value: changed from the default value to **1**
Enumeration: EXPOSURE_MODE_CONTINUOUS_AUTO; initial value: changed from the default value to **2** Enum: EXPOSURE_MODE_CONTINUOUS_AUTO; initial value: changed from the default value to **2**
13. The following enumerations are added to **VideoStabilizationMode**: 13. The following enums are added to **VideoStabilizationMode**:
Enumeration: LOW; initial value: changed from the default value to **1** Enum: LOW; initial value: changed from the default value to **1**
Enumeration: MIDDLE; initial value: changed from the default value to **2** Enum: MIDDLE; initial value: changed from the default value to **2**
Enumeration: HIGH; initial value: changed from the default value to **3** Enum: HIGH; initial value: changed from the default value to **3**
Enumeration: AUTO; initial value: changed from the default value to **4** Enum: AUTO; initial value: changed from the default value to **4**
14. In **CaptureSession**, the parameter of the **addOutput** API is changed from the original subclass type (**PreviewOutput**, **PhotoOutput**, **VideoOutput**, and **MetadataOutput**) to the base class type (**CameraOutput**). After the change, the number of APIs is reduced from 8 to 2. 14. In **CaptureSession**, the parameter of the **addOutput** API is changed from the original child class type (**PreviewOutput**, **PhotoOutput**, **VideoOutput**, and **MetadataOutput**) to the base class type (**CameraOutput**). After the change, the number of APIs is reduced from 8 to 2.
APIs before change: APIs before change:
...@@ -730,7 +728,7 @@ cameraInput.open().then(() => { ...@@ -730,7 +728,7 @@ cameraInput.open().then(() => {
addOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>addOutput(cameraOutput: CameraOutput): Promise<void>; addOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>addOutput(cameraOutput: CameraOutput): Promise<void>;
The sample code (for **PreviewOutput**) is as follows: The sample code (for **previewOutput**) is as follows:
``` ```
captureSession.addOutput(previewOutput, (err) => { captureSession.addOutput(previewOutput, (err) => {
...@@ -748,7 +746,7 @@ cameraInput.open().then(() => { ...@@ -748,7 +746,7 @@ cameraInput.open().then(() => {
}) })
``` ```
15. In **CaptureSession**, the parameter of the **removeOutput** API is changed from the original subclass type (**PreviewOutput**, **PhotoOutput**, **VideoOutput**, and **MetadataOutput**) to the base class type (**CameraOutput**). After the change, the number of APIs is reduced from 8 to 2. 15. In **CaptureSession**, the parameter of the **removeOutput** API is changed from the original child class type (**PreviewOutput**, **PhotoOutput**, **VideoOutput**, and **MetadataOutput**) to the base class type (**CameraOutput**). After the change, the number of APIs is reduced from 8 to 2.
APIs before change: APIs before change:
...@@ -758,7 +756,7 @@ cameraInput.open().then(() => { ...@@ -758,7 +756,7 @@ cameraInput.open().then(() => {
removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>removeOutput(cameraOutput: CameraOutput): Promise<void>; removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>removeOutput(cameraOutput: CameraOutput): Promise<void>;
The sample code (for **PreviewOutput**) is as follows: The sample code (for **previewOutput**) is as follows:
``` ```
captureSession.removeOutput(previewOutput, (err) => { captureSession.removeOutput(previewOutput, (err) => {
...@@ -776,8 +774,8 @@ cameraInput.open().then(() => { ...@@ -776,8 +774,8 @@ cameraInput.open().then(() => {
}) })
``` ```
16. The following enumeration in **MetadataObjectType** is changed: 16. The following enum in **MetadataObjectType** is changed:
The enumeration value name is changed from **FACE** to **FACE_DETECTION**. The enum value name is changed from **FACE** to **FACE_DETECTION**.
17. The name of the **Camera** API is changed to **CameraDevice**. 17. The name of the **Camera** API is changed to **CameraDevice**.
# USB Manager ChangeLog # USB Manager Changelog
## cl.usb_manager.1 Error Information Return Method Change of APIs ## cl.usb_manager.1 Error Information Return Method Change of APIs
The USB manager API uses service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. Beginning from API version 9, error information is returned by throwing exceptions. The USB manager API uses service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. Beginning from API version 9, error information is returned by throwing exceptions.
**Change Impacts** **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. 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.
......
# Distributed Scheduler Subsystem ChangeLog # Distributed Scheduler Subsystem Changelog
## cl.DistributedManagerService.1 continuationManager API Changes ## cl.DistributedManagerService.1 continuationManager on()/off() Changes
- Event names passed to the **continuationManager** API do not comply with the OpenHarmony API specifications. - The event types passed to the **continuationManager.on** and **continuationManager.off** APIs do not comply with the OpenHarmony API specifications.
- The **continuationManager.on** API does not have a unified return value for various events, which does not comply with the OpenHarmony API specifications. - The return value of **continuationManager.on** varies with the event type, which does not comply with the OpenHarmony API specifications.
The following changes have been made: The following changes have been made:
- The device selection event name of **continuationManager.on** and **continuationManager.off** is changed from **deviceConnect** to **deviceSelected**, and the device deselection event name is changed from **deviceDisconnect** to **deviceUnselected**. - Changed the event type **deviceConnect** to **deviceSelected** and **deviceDisconnect** to **deviceUnselected** in the **continuationManager.on** and **continuationManager.off** APIs.
- The **continuationManager.on** API returns **Callback&lt;Array&lt;ContinuationResult&gt;&gt;** for all events. - Changed the return value of **continuationManager.on** to **Callback&lt;Array&lt;ContinuationResult&gt;&gt;** for all events.
**Change Impacts** **Change Impact**
The application developed based on earlier versions needs to adapt the new APIs. Otherwise, the original service logic will be affected. The application developed based on earlier versions needs to be adapted. Otherwise, the service logic will be affected.
**Key API/Component Changes** **Key API/Component Changes**
...@@ -40,10 +40,9 @@ The application developed based on earlier versions needs to adapt the new APIs. ...@@ -40,10 +40,9 @@ The application developed based on earlier versions needs to adapt the new APIs.
``` ```
**Adaptation Guide** **Adaptation Guide**
Change the event names. The sample code is as follows: Change the event names. The sample code is as follows:
Device selection event of **continuationManager.on**: Event of device selection in **continuationManager.on**:
```ts ```ts
let token = 1; let token = 1;
...@@ -61,7 +60,7 @@ Device selection event of **continuationManager.on**: ...@@ -61,7 +60,7 @@ Device selection event of **continuationManager.on**:
} }
``` ```
Device selection event of **continuationManager.off**: Event of device selection in **continuationManager.off**:
```ts ```ts
let token = 1; let token = 1;
...@@ -72,7 +71,7 @@ Device selection event of **continuationManager.off**: ...@@ -72,7 +71,7 @@ Device selection event of **continuationManager.off**:
} }
``` ```
Device deselection event of **continuationManager.on**: Event of device deselection in **continuationManager.on**:
```ts ```ts
let token = 1; let token = 1;
...@@ -91,7 +90,7 @@ Device deselection event of **continuationManager.on**: ...@@ -91,7 +90,7 @@ Device deselection event of **continuationManager.on**:
} }
``` ```
Device deselection event of **continuationManager.off**: Event of device deselection in **continuationManager.off**:
```ts ```ts
let token = 1; let token = 1;
...@@ -101,3 +100,23 @@ Device deselection event of **continuationManager.off**: ...@@ -101,3 +100,23 @@ Device deselection event of **continuationManager.off**:
console.error('off failed, cause: ' + JSON.stringify(err)); console.error('off failed, cause: ' + JSON.stringify(err));
} }
``` ```
## cl.DistributedManagerService.2 Adding DATASYNC Permission Verification to continuationManager APIs
In earlier versions, the **continuationManager** APIs do not verify the caller, which does not comply with the OpenHarmony API specifications.
Now, before using a **continuationManager** API, the caller must apply for the **ohos.permission.DISTRIBUTED_DATASYNC** permission.
**Change Impact**
The application developed based on earlier versions needs to apply for the **ohos.permission.DISTRIBUTED_DATASYNC** permission in advance. Otherwise, the service logic will be affected.
**Key API/Component Changes**
Involved APIs:
- continuationManager.registerContinuation;
- continuationManager.on;
- continuationManager.off;
- continuationManager.unregisterContinuation;
- continuationManager.updateContinuationState;
- continuationManager.startContinuationDeviceManager;
# DSoftBus Subsystem ChangeLog # DSoftBus Subsystem Changelog
## IPC&RPC APIs support the exception handling mode and the selection of synchronous or asynchronous message sending by passing a Boolean value or a numeric value. ## Support for Exception Handling and Selecting Synchronous or Asynchronous Message Sending by Using a Boolean or Numeric Value in IPC&RPC APIs
1. Some IPC&RPC APIs of DSoftBus use service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. 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 to specify the mode of sending information as asynchronous or synchronous. 2. A Boolean value can be passed in to specify the asynchronous or synchronous message transfer mode.
#### Change Impacts #### 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: No adaptation is required. Use the new APIs provided by this version to:
1. Supports exception handling and return of error codes. 1. Implement exception handling and return of error codes.
2. Supports selection of synchronous or asynchronous message sending by passing a Boolean value or by passing 0 or a non-0 number. 2. Select synchronous or asynchronous message transfer by using a Boolean value or a number of 0 or non-0.
#### **Key API/Component Changes** #### **Key API/Component Changes**
For adaptation to the unified API exception handling mode, related IPC&RPC APIs are deprecated, and corresponding new APIs and methods are added. The newly added APIs support unified error code handling specifications and function the same as the original APIs. For easy use, related IPC&RPC APIs are deprecated, and new APIs are added to implement unified error code handling. The functionalities of these APIs remain unchanged.
| Class| Deprecated API | New Class | New API | | Class| Deprecated API | New Class | New API |
| ------------ | ------------ | ------------ | ------------ | | ------------ | ------------ | ------------ | ------------ |
| MessageParcel | static create(): MessageParcel | MessageSequence | static create(): MessageSequence | | MessageParcel | static create(): MessageParcel | MessageSequence | static create(): MessageSequence |
...@@ -130,7 +130,7 @@ For adaptation to the unified API exception handling mode, related IPC&RPC APIs ...@@ -130,7 +130,7 @@ For adaptation to the unified API exception handling mode, related IPC&RPC APIs
#### Adaptation Guide #### Adaptation Guide
The newly added APIs return error codes and corresponding error information by throwing exceptions. Take the **create** API in **MessageParcel** as an example. The sample code is as follows: The new APIs return error codes and error information by throwing exceptions. The following uses the **create()** API of **MessageParcel** as an example.
```js ```js
import rpc from '@ohos.rpc' import rpc from '@ohos.rpc'
...@@ -142,4 +142,4 @@ try { ...@@ -142,4 +142,4 @@ try {
console.info("create meassageParcel failed, errorMessage = " + error.errorMessage); console.info("create meassageParcel failed, errorMessage = " + error.errorMessage);
} }
``` ```
For details about sample code of more APIs, see [RPC API reference](../../../application-dev/reference/apis/js-apis-rpc.md). For details about the APIs, see [RPC](../../../application-dev/reference/apis/js-apis-rpc.md).
# Customization Subsystem ChangeLog # Customization Subsystem ChangeLog
Compared with OpenHarmony 3.2.8.1, OpenHarmony 3.2.8.3 has the following API changes in the customization subsystem:
## cl.Customization.1 Change of the Enterprise Device Management Module Name ## cl.Customization.1 Change of the Enterprise Device Management Module Name
Beginning from OpenHarmony 3.2.8.3, **@ohos.enterpriseDeviceManager.d.ts** is changed to **@ohos.enterprise.adminManager.d.ts**. You need to adapt your applications according to the following information. Changed **@ohos.enterpriseDeviceManager.d.ts** to **@ohos.enterprise.adminManager.d.ts**.
**Change Impacts** **Change Impact**
The application developed based on OpenHarmony earlier than 3.2.8.3 must be adapted so that it can be properly compiled in the SDK environment of the new version. The application developed based on OpenHarmony earlier than 3.2.8.3 must be adapted so that it can be properly compiled in the SDK environment of the new version.
...@@ -18,7 +16,7 @@ The application developed based on OpenHarmony earlier than 3.2.8.3 must be adap ...@@ -18,7 +16,7 @@ The application developed based on OpenHarmony earlier than 3.2.8.3 must be adap
**Adaptation Guide** **Adaptation Guide**
The original APIs are only migrated to the new namespace. Therefore, you can modify **import** to solve the adaptation problem. The original APIs are only moved to the new namespace. Therefore, you can modify **import** to solve the adaptation problem.
If the original API uses **@ohos.enterpriseDeviceManager**: If the original API uses **@ohos.enterpriseDeviceManager**:
...@@ -26,7 +24,7 @@ If the original API uses **@ohos.enterpriseDeviceManager**: ...@@ -26,7 +24,7 @@ If the original API uses **@ohos.enterpriseDeviceManager**:
import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager'; import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager';
``` ```
You can directly modify **import** to switch to the new namespace: You can modify **import** to switch to the new namespace:
```js ```js
import enterpriseDeviceManager from '@ohos.enterprise.adminManager'; import enterpriseDeviceManager from '@ohos.enterprise.adminManager';
...@@ -34,9 +32,9 @@ import enterpriseDeviceManager from '@ohos.enterprise.adminManager'; ...@@ -34,9 +32,9 @@ import enterpriseDeviceManager from '@ohos.enterprise.adminManager';
## cl.Customization.2 enterpriseDeviceManager/DeviceSettingsManager.d.ts Module Change ## cl.Customization.2 enterpriseDeviceManager/DeviceSettingsManager.d.ts Module Change
Beginning from OpenHarmony 3.2.8.3, **enterpriseDeviceManager/DeviceSettingsManager.d.ts** is changed to **ohos.enterprise.dateTimeManager.d.ts**. Changed **enterpriseDeviceManager/DeviceSettingsManager.d.ts** to **ohos.enterprise.dateTimeManager.d.ts**.
**Change Impacts** **Change Impact**
The application developed based on OpenHarmony earlier than 3.2.8.3 must be adapted so that it can be properly compiled in the SDK environment of the new version. The application developed based on OpenHarmony earlier than 3.2.8.3 must be adapted so that it can be properly compiled in the SDK environment of the new version.
...@@ -88,54 +86,54 @@ dateTimeManager.setDateTime(wantTemp, 1526003846000, (error) => { ...@@ -88,54 +86,54 @@ dateTimeManager.setDateTime(wantTemp, 1526003846000, (error) => {
## cl.Customization.3 System API Change ## cl.Customization.3 System API Change
Beginning from OpenHarmony 3.2.8.3, all enterprise device management APIs are changed to system APIs. Changed all enterprise device management APIs to system APIs.
**Change Impacts** **Change Impact**
All APIs can be called only by system applications. All APIs can be called only by system applications.
**Key API/Component Changes** **Key API/Component Changes**
| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| | Module | Class | Method/Attribute/Enum/Constant | Change Type|
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | | ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<**void**>): void; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<**void**>): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<**void**>): void; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<**void**>): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise<**void**>; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise<**void**>; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, callback: AsyncCallback<**void**>): void; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, callback: AsyncCallback<**void**>): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId: number, callback: AsyncCallback<**void**>): void; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId: number, callback: AsyncCallback<**void**>): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId?: number): Promise<**void**>; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId?: number): Promise<**void**>; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String, callback: AsyncCallback<**void**>): void; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String, callback: AsyncCallback<**void**>): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String): Promise<**void**>; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String): Promise<**void**>; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, callback: AsyncCallback<**boolean**>): void; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, callback: AsyncCallback<**boolean**>): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback<**boolean**>): void; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback<**boolean**>): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, userId?: number): Promise<**boolean**>; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, userId?: number): Promise<**boolean**>; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** getEnterpriseInfo(admin: Want, callback: AsyncCallback<**EnterpriseInfo**>): void; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** getEnterpriseInfo(admin: Want, callback: AsyncCallback<**EnterpriseInfo**>): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** getEnterpriseInfo(admin: Want): Promise<**EnterpriseInfo**>; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** getEnterpriseInfo(admin: Want): Promise<**EnterpriseInfo**>; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback<**void**>): void; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback<**void**>): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<**void**>; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<**void**>; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** isSuperAdmin(bundleName: String, callback: AsyncCallback<**boolean**>): void; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** isSuperAdmin(bundleName: String, callback: AsyncCallback<**boolean**>): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** isSuperAdmin(bundleName: String): Promise<**boolean**>; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** isSuperAdmin(bundleName: String): Promise<**boolean**>; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | systemapi |
| @ohos.enterprise.adminManager | adminManager | **interface** EnterpriseInfo | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **interface** EnterpriseInfo | systemapi |
| @ohos.enterprise.adminManager | adminManager | **enum** AdminType | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **enum** AdminType | systemapi |
| @ohos.enterprise.adminManager | adminManager | **enum** ManagedEvent | Changed to a system API | | @ohos.enterprise.adminManager | adminManager | **enum** ManagedEvent | systemapi |
| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number, callback: AsyncCallback<**void**>): void; | Changed to a system API | | @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number, callback: AsyncCallback<**void**>): void; | systemapi |
| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number): Promise<**void**>; | Changed to a system API | | @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number): Promise<**void**>; | systemapi |
## cl.Customization.4 API Permission Change ## cl.Customization.4 API Permission Change
Beginning from OpenHarmony 3.2.8.3, permission verification is required for some APIs. Added permission verification for some APIs.
**Change Impacts** **Change Impact**
The application developed based on OpenHarmony earlier than 3.2.8.3 must have the corresponding permission so that it can properly call these APIs. The application developed based on OpenHarmony earlier than 3.2.8.3 must have the corresponding permission so that it can properly call these APIs.
**Key API/Component Changes** **Key API/Component Changes**
| Module | Class | Method/Attribute/Enumeration/Constant | New Permission| | Module | Class | Method/Attribute/Enum/Constant | New Permission|
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | | ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | | @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN |
| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | | @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN |
......
# 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 changes of 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 are added in **@ohos.file.fs** to support unified error code handling and have slight changes in parameters. 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**
Before the change, the APIs are imported as follows:
```js
import fileio from '@ohos.fileio';
```
Now, the APIs are imported as follows:
```js
import fs from '@ohos.file.fs';
```
In addition, exception handling needs to be adapted.
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);
}
```
# Location Subsystem ChangeLog # Location Subsystem Changelog
## cl.location.1 Migration of System APIs and APIs in API Version 9 to the New @ohos.geoLocationManager.d.ts ## cl.location.1 Migration of System APIs and APIs in API Version 9 to the New @ohos.geoLocationManager.d.ts
...@@ -9,7 +9,7 @@ To use system APIs and APIs in API version 9 of the location subsystem, you need ...@@ -9,7 +9,7 @@ To use system APIs and APIs in API version 9 of the location subsystem, you need
import geoLocationManager from '@ohos.geoLocationManager'; import geoLocationManager from '@ohos.geoLocationManager';
**Change Impacts** **Change Impact**
System APIs and APIs in API version 9 are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**. System APIs and APIs in API version 9 are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**.
...@@ -19,7 +19,7 @@ Other APIs are not affected. ...@@ -19,7 +19,7 @@ Other APIs are not affected.
**Key API/Component Changes** **Key API/Component Changes**
| Class| Type| Declaration| Change Type| | Class| API Type| Declaration| Change Type|
| -- | -- | -- | -- | | -- | -- | -- | -- |
|geolocation| namespace | declare namespacegeolocation| Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| |geolocation| namespace | declare namespacegeolocation| Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.|
|geolocation | interface | export interface ReverseGeocodingMockInfo | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| |geolocation | interface | export interface ReverseGeocodingMockInfo | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.|
...@@ -57,7 +57,7 @@ Other APIs are not affected. ...@@ -57,7 +57,7 @@ Other APIs are not affected.
**(Optional) Adaptation Guide** **(Optional) Adaptation Guide**
The following uses **enableLocation** as an example to show how it is called in the new version: The following sample code shows how to call **enableLocation** in the new version:
```ts ```ts
import geoLocationManager from '@ohos.geoLocationManager'; import geoLocationManager from '@ohos.geoLocationManager';
...@@ -78,7 +78,7 @@ From API version 9, the **ohos.permission.APPROXIMATELY_LOCATION** permission is ...@@ -78,7 +78,7 @@ From API version 9, the **ohos.permission.APPROXIMATELY_LOCATION** permission is
If you use API version 9 or later, you need to apply for both the **ohos.permission.LOCATION** and **ohos.permission.APPROXIMATELY_LOCATION** permissions. Applying for only the **ohos.permission.LOCATION** permission will fail. If you use API version 9 or later, you need to apply for both the **ohos.permission.LOCATION** and **ohos.permission.APPROXIMATELY_LOCATION** permissions. Applying for only the **ohos.permission.LOCATION** permission will fail.
**Change Impacts** **Change Impact**
Applications using API versions earlier than 9 are not affected. For an application using API version 9 or later, the method for applying for the location permission is changed. The details are as follows: Applications using API versions earlier than 9 are not affected. For an application using API version 9 or later, the method for applying for the location permission is changed. The details are as follows:
...@@ -101,13 +101,13 @@ API version 9 and later: Apply for **ohos.permission.APPROXIMATELY_LOCATION**, o ...@@ -101,13 +101,13 @@ API version 9 and later: Apply for **ohos.permission.APPROXIMATELY_LOCATION**, o
| API Version| Location Permission| Permission Application Result| Location Accuracy| | API Version| Location Permission| Permission Application Result| Location Accuracy|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| Earlier than 9| ohos.permission.LOCATION | Success| Location accurate to meters| | Earlier than 9| ohos.permission.LOCATION | Success| Location accurate to meters|
| 9 and later| ohos.permission.LOCATION | Failure| No location obtained| | 9 and later| ohos.permission.LOCATION | Failed| No location obtained.|
| 9 and later| ohos.permission.APPROXIMATELY_LOCATION | Success| Location accurate to 5 kilometers| | 9 and later| ohos.permission.APPROXIMATELY_LOCATION | Success| Location accurate to 5 kilometers.|
| 9 and later| ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.LOCATION| Success| Location accurate to meters| | 9 and later| ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.LOCATION| Success| Location accurate to meters|
If your application needs to access the device location information when running in the background, it must be configured to be able to run in the background and be granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information after your application moves to the background. If your application needs to access the device location information when running in the background, it must be configured to be able to run in the background and be granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information after your application moves to the background.
You can declare the required permission in your application's configuration file. For details, see the [permission application guide](../../../application-dev/security/accesstoken-guidelines.md). You can declare the required permissions in your application's configuration file. For details, see the [permission application guide](../../../application-dev/security/accesstoken-guidelines.md).
**Key API/Component Changes** **Key API/Component Changes**
......
# Globalization Subsystem ChangeLog # Globalization Subsystem Changelog
## cl.global.1 Support of Error Codes for the Internalization Module ## cl.global.1 Support of Error Codes for the Internalization Module
APIs provided by the internationalization component of the globalization subsystem are changed to support error codes in the following scenarios. The following changes are made in API version 9 and later: APIs provided by the internationalization component of the globalization subsystem are changed to support error codes in the following scenarios. The following changes are made in API version 9:
- Obtaining the local expression of a country or language - Obtaining the local expression of a country or language
- Obtaining the list of languages supported by the system and the list of areas supported by a language - Obtaining the list of languages supported by the system and the list of areas supported by a language
- Checking whether a language matches an area - Checking whether a language matches an area
...@@ -11,37 +11,37 @@ APIs provided by the internationalization component of the globalization subsyst ...@@ -11,37 +11,37 @@ APIs provided by the internationalization component of the globalization subsyst
- Obtaining, adding, and removing the preferred language - Obtaining, adding, and removing the preferred language
- Obtaining and setting localized numbers - Obtaining and setting localized numbers
You need to adapt your applications based on the following information: You need to adapt your application based on the following information.
**Change Impacts** **Change Impact**
The preceding APIs are changed to the static methods of the **System** class. When such an API is called, add the class name to the end of the module name. The preceding APIs are changed to the static methods of the **System** class. When such an API is called, add the class name to the end of the module name.
The return value data type of the setting APIs (for example, **setSystemLanguage**) is changed from boolean to void. For setter APIs, the type of the return value is changed from boolean to void, for example, setSystemLanguage.
When a call to an API fails, an error code is returned according to the failure cause. For example, when permissions are not correctly configured for an application, **201** is returned. When a call to an API fails, an error code is returned according to the failure cause. For example, when permissions are not correctly configured for an application, **201** is returned.
**Key API/Component Changes** **Key API/Component Changes**
Involved APIs: - Involved APIs:
- getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): string; - getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): string;
- getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): string; - getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): string;
- getSystemLanguages(): Array<string>; - getSystemLanguages(): Array<string>;
- getSystemCountries(language: string): Array<string>; - getSystemCountries(language: string): Array<string>;
- isSuggested(language: string, region?: string): boolean; - isSuggested(language: string, region?: string): boolean;
- getSystemLanguage(): string; - getSystemLanguage(): string;
- setSystemLanguage(language: string): void; - setSystemLanguage(language: string): void;
- getSystemRegion(): string; - getSystemRegion(): string;
- setSystemRegion(region: string): void; - setSystemRegion(region: string): void;
- getSystemLocale(): string; - getSystemLocale(): string;
- setSystemLocale(locale: string): void; - setSystemLocale(locale: string): void;
- is24HourClock(): boolean; - is24HourClock(): boolean;
- set24HourClock(option: boolean): void; - set24HourClock(option: boolean): void;
- addPreferredLanguage(language: string, index?: number): void; - addPreferredLanguage(language: string, index?: number): void;
- removePreferredLanguage(index: number): void; - removePreferredLanguage(index: number): void;
- getPreferredLanguageList(): Array<string>; - getPreferredLanguageList(): Array<string>;
- getFirstPreferredLanguage(): string; - getFirstPreferredLanguage(): string;
- getAppPreferredLanguage(): string; - getAppPreferredLanguage(): string;
- setUsingLocalDigit(flag: boolean): void; - setUsingLocalDigit(flag: boolean): void;
- getUsingLocalDigit(): boolean; - getUsingLocalDigit(): boolean;
**Adaptation Guide** **Adaptation Guide**
......
...@@ -18,7 +18,7 @@ Asynchronous API: An error message is returned via **AsyncCallback** or the **er ...@@ -18,7 +18,7 @@ Asynchronous API: An error message is returned via **AsyncCallback** or the **er
Synchronous API: An error message is returned via an exception. Synchronous API: An error message is returned via an exception.
**Change Impacts** **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. 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.
...@@ -26,51 +26,97 @@ The application developed based on earlier versions needs to adapt the method fo ...@@ -26,51 +26,97 @@ The application developed based on earlier versions needs to adapt the method fo
Error code processing is added for the following APIs: Error code processing is added for the following APIs:
- getSetting(): InputMethodSetting; - getSetting(): InputMethodSetting;
- getController(): InputMethodController; - getController(): InputMethodController;
- switchInputMethod(target: InputMethodProperty, callback: AsyncCallback<boolean>): void;
- switchInputMethod(target: InputMethodProperty): Promise<boolean>; - switchInputMethod(target: InputMethodProperty, callback: AsyncCallback\<boolean>): void;
- switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback<boolean>): void;
- switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise<boolean>; - switchInputMethod(target: InputMethodProperty): Promise\<boolean>;
- switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype, callback: AsyncCallback<boolean>): void;
- switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype): Promise<boolean>; - switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback\<boolean>): void;
- listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: AsyncCallback<Array<InputMethodSubtype>>): void;
- listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise<Array<InputMethodSubtype>>; - switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise\<boolean>;
- listCurrentInputMethodSubtype(callback: AsyncCallback<Array<InputMethodSubtype>>): void;
- listCurrentInputMethodSubtype(): Promise<Array<InputMethodSubtype>>; - switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype, callback: AsyncCallback\<boolean>): void;
- getInputMethods(enable: boolean, callback: AsyncCallback<Array<InputMethodProperty>>): void;
- getInputMethods(enable: boolean): Promise<Array<InputMethodProperty>>; - switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype): Promise\<boolean>;
- showOptionalInputMethods(callback: AsyncCallback<boolean>): void;
- showOptionalInputMethods(): Promise<boolean>; - listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: AsyncCallback<Array\<InputMethodSubtype>>): void;
- stopInputSession(callback: AsyncCallback<boolean>): void;
- stopInputSession(): Promise<boolean>; - listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise<Array\<InputMethodSubtype>>;
- showSoftKeyboard(callback: AsyncCallback<void>): void;
- showSoftKeyboard():Promise<void>; - listCurrentInputMethodSubtype(callback: AsyncCallback<Array\<InputMethodSubtype>>): void;
- hideSoftKeyboard(callback: AsyncCallback<void>): void;
- hideSoftKeyboard():Promise<void>; - listCurrentInputMethodSubtype(): Promise<Array\<InputMethodSubtype>>;
- hide(callback: AsyncCallback<void>): void;
- hide(): Promise<void>; - getInputMethods(enable: boolean, callback: AsyncCallback<Array\<InputMethodProperty>>): void;
- onCreate(want: Want): void;
- onDestroy(): void; - getInputMethods(enable: boolean): Promise<Array\<InputMethodProperty>>;
In **InputClient**:
- sendKeyFunction(action: number, callback: AsyncCallback<boolean>): void; - showOptionalInputMethods(callback: AsyncCallback\<boolean>): void;
- sendKeyFunction(action: number): Promise<boolean>;
- deleteForward(length: number, callback: AsyncCallback<boolean>): void; - showOptionalInputMethods(): Promise\<boolean>;
- deleteForward(length: number): Promise<boolean>;
- deleteBackward(length: number, callback: AsyncCallback<boolean>): void; - stopInputSession(callback: AsyncCallback\<boolean>): void;
- deleteBackward(length: number): Promise<boolean>;
- insertText(text: string, callback: AsyncCallback<boolean>): void; - stopInputSession(): Promise\<boolean>;
- insertText(text: string): Promise<boolean>;
- getForward(length: number, callback: AsyncCallback<string>): void; - showSoftKeyboard(callback: AsyncCallback\<void>): void;
- getForward(length: number): Promise<string>;
- getBackward(length: number, callback: AsyncCallback<string>): void; - showSoftKeyboard():Promise\<void>;
- getBackward(length: number): Promise<string>;
- getEditorAttribute(callback: AsyncCallback<EditorAttribute>): void; - hideSoftKeyboard(callback: AsyncCallback\<void>): void;
- getEditorAttribute(): Promise<EditorAttribute>;
- moveCursor(direction: number, callback: AsyncCallback<void>): void; - hideSoftKeyboard():Promise\<void>;
- moveCursor(direction: number): Promise<void>;
In **InputMethodExtensionAbility**: - hide(callback: AsyncCallback\<void>): void;
- hide(): Promise\<void>;
- onCreate(want: Want): void; - onCreate(want: Want): void;
- onDestroy(): void; - onDestroy(): void;
- In **InputClient**:
- sendKeyFunction(action: number, callback: AsyncCallback\<boolean>): void;
- sendKeyFunction(action: number): Promise\<boolean>;
- deleteForward(length: number, callback: AsyncCallback\<boolean>): void;
- deleteForward(length: number): Promise\<boolean>;
- deleteBackward(length: number, callback: AsyncCallback\<boolean>): void;
- deleteBackward(length: number): Promise\<boolean>;
- insertText(text: string, callback: AsyncCallback\<boolean>): void;
- insertText(text: string): Promise\<boolean>;
- getForward(length: number, callback: AsyncCallback\<string>): void;
- getForward(length: number): Promise\<string>;
- getBackward(length: number, callback: AsyncCallback\<string>): void;
- getBackward(length: number): Promise\<string>;
- getEditorAttribute(callback: AsyncCallback\<EditorAttribute>): void;
- getEditorAttribute(): Promise\EditorAttribute>;
- moveCursor(direction: number, callback: AsyncCallback\<void>): void;
- moveCursor(direction: number): Promise\<void>;
- In **InputMethodExtensionAbility**:
- onCreate(want: Want): void;
- onDestroy(): void;
**Adaptation Guide** **Adaptation Guide**
...@@ -143,11 +189,9 @@ Substitute APIs: ...@@ -143,11 +189,9 @@ Substitute APIs:
- hide(): Promise<void>; - hide(): Promise<void>;
**NOTE** **NOTE**
Use the **getInputMethodAbility()** API to obtain an **InputMethodAbility** object, and do not use **getInputMethodEngine()** to obtain an **InputMethodEngine** object.
- Use the **getInputMethodAbility()** API to obtain an **InputMethodAbility** object, and do not use **getInputMethodEngine()** to obtain an **InputMethodEngine** object. Use methods in **InputMethodAbility**, and do not use methods in **InputMethodEngine**.
- Use methods in **InputMethodAbility**, and do not use methods in **InputMethodEngine**. Use the **on('inputStart')** method in **InputMethodAbility** to obtain a **KeyboardController** instance and an **InputClient** instance, and do not use the **on('inputStart')** method in **InputMethodEngine** to obtain a **TextInputClient** instance.
- Use the **on('inputStart')** method in **InputMethodAbility** to obtain a **KeyboardController** instance and an **InputClient** instance, and do not use the **on('inputStart')** method in **InputMethodEngine** to obtain a **TextInputClient** instance.
Before: Before:
```js ```js
......
# Multimedia Subsystem ChangeLog # Multimedia Subsystem Changelog
## cl.multimedia.audio.001 Call Mode Change of getRoutingManager() ## cl.multimedia.audio.001 Call Mode Change of getRoutingManager()
**getRoutingManager()** is changed from asynchronous to synchronous. **getRoutingManager()** is changed from asynchronous to synchronous.
**Change Impacts** **Change Impact**
If the new mode is not used, an error will be reported during compilation. If the new mode is not used, an error will be reported during compilation.
...@@ -25,7 +25,7 @@ getRoutingManager(): AudioRoutingManager; ...@@ -25,7 +25,7 @@ getRoutingManager(): AudioRoutingManager;
**getStreamManager()** is changed from asynchronous to synchronous. **getStreamManager()** is changed from asynchronous to synchronous.
**Change Impacts** **Change Impact**
If the new mode is not used, an error will be reported during compilation. If the new mode is not used, an error will be reported during compilation.
...@@ -46,7 +46,7 @@ getStreamManager(): AudioStreamManager; ...@@ -46,7 +46,7 @@ getStreamManager(): AudioStreamManager;
In the original **AudioRoutingManager**, the registration mode of the **micStateChange** listener of the **on()** function is changed. In the original **AudioRoutingManager**, the registration mode of the **micStateChange** listener of the **on()** function is changed.
**Change Impacts** **Change Impact**
If the new mode is not used, an error will be reported during compilation. If the new mode is not used, an error will be reported during compilation.
...@@ -71,7 +71,7 @@ interface AudioVolumeGroupManager { ...@@ -71,7 +71,7 @@ interface AudioVolumeGroupManager {
The call mode of **getVolumeGroups()** is changed. The call mode of **getVolumeGroups()** is changed.
**Change Impacts** **Change Impact**
If the new mode is not used, an error will be reported during compilation. If the new mode is not used, an error will be reported during compilation.
...@@ -96,7 +96,7 @@ interface AudioVolumeManager{ ...@@ -96,7 +96,7 @@ interface AudioVolumeManager{
The call mode of **getGroupManager()** is changed. The call mode of **getGroupManager()** is changed.
**Change Impacts** **Change Impact**
If the new mode is not used, an error will be reported during compilation. If the new mode is not used, an error will be reported during compilation.
...@@ -121,9 +121,9 @@ interface AudioVolumeManager{ ...@@ -121,9 +121,9 @@ interface AudioVolumeManager{
**FOCUS_TYPE_RECORDING** of **FocusType** is renamed as **FOCUS_TYPE_DEFAULT**. **FOCUS_TYPE_RECORDING** of **FocusType** is renamed as **FOCUS_TYPE_DEFAULT**.
**Change Impacts** **Change Impact**
If the new name is not used, an error will be reported during compilation. If the new mode is not used, an error will be reported during compilation.
**Key API/Component Changes** **Key API/Component Changes**
...@@ -145,9 +145,9 @@ enum InterruptRequestType { ...@@ -145,9 +145,9 @@ enum InterruptRequestType {
The listener registration name of **interrupt** of the **on()** function in **AudioRenderer** is changed. The listener registration name of **interrupt** of the **on()** function in **AudioRenderer** is changed.
**Change Impacts** **Change Impact**
If the new name is not used, an error will be reported during compilation. If the new mode is not used, an error will be reported during compilation.
**Key API/Component Changes** **Key API/Component Changes**
...@@ -170,141 +170,84 @@ interface AudioRenderer { ...@@ -170,141 +170,84 @@ interface AudioRenderer {
In the MR version, the formal **AVRecorder** APIs (integrating audio and video) will be provided for external use. In the MR version, the formal **AVRecorder** APIs (integrating audio and video) will be provided for external use.
**VideoRecorder** APIs in API version 9 are changed to system APIs, which are available only to system users. In the future, **VideoRecorder** APIs will be deprecated after system users switch to **AVRecorder**. **VideoRecorder** APIs in API version 9 are changed to system APIs, which are available only to system users. In the future, **VideoRecorder** APIs will be deprecated after system users switch to **AVRecorder**.
**Change Impacts** **Change Impact**
If the **VideoRecorder** caller is not a system user, the call will fail. If the **VideoRecorder** caller is not a system user, the call will fail.
Involved APIs and enums:
Involved APIs and enumerations:
function createVideoRecorder(callback: AsyncCallback<VideoRecorder>): void; function createVideoRecorder(callback: AsyncCallback<VideoRecorder>): void;
function createVideoRecorder(): Promise<VideoRecorder>; function createVideoRecorder(): Promise<VideoRecorder>;
type VideoRecordState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error'; type VideoRecordState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error';
interface VideoRecorder{ interface VideoRecorder{
prepare(config: VideoRecorderConfig, callback: AsyncCallback<void>): void;
​ prepare(config: VideoRecorderConfig, callback: AsyncCallback<void>): void; prepare(config: VideoRecorderConfig): Promise<void>;
getInputSurface(callback: AsyncCallback<string>): void;
​ prepare(config: VideoRecorderConfig): Promise<void>; getInputSurface(): Promise<string>;
start(callback: AsyncCallback<void>): void;
​ getInputSurface(callback: AsyncCallback<string>): void; start(): Promise<void>;
pause(callback: AsyncCallback<void>): void;
​ getInputSurface(): Promise<string>; pause(): Promise<void>;
resume(callback: AsyncCallback<void>): void;
​ start(callback: AsyncCallback<void>): void; resume(): Promise<void>;
stop(callback: AsyncCallback<void>): void;
​ start(): Promise<void>; stop(): Promise<void>;
release(callback: AsyncCallback<void>): void;
​ pause(callback: AsyncCallback<void>): void; release(): Promise<void>;
reset(callback: AsyncCallback<void>): void;
​ pause(): Promise<void>; reset(): Promise<void>;
on(type: 'error', callback: ErrorCallback): void;
​ resume(callback: AsyncCallback<void>): void; readonly state: VideoRecordState;
​ resume(): Promise<void>;
​ stop(callback: AsyncCallback<void>): void;
​ stop(): Promise<void>;
​ release(callback: AsyncCallback<void>): void;
​ release(): Promise<void>;
​ reset(callback: AsyncCallback<void>): void;
​ reset(): Promise<void>;
​ on(type: 'error', callback: ErrorCallback): void;
​ readonly state: VideoRecordState;
} }
interface VideoRecorderProfile { interface VideoRecorderProfile {
readonly audioBitrate: number;
​ readonly audioBitrate: number; readonly audioChannels: number;
readonly audioCodec: CodecMimeType;
​ readonly audioChannels: number; readonly audioSampleRate: number;
readonly fileFormat: ContainerFormatType;
​ readonly audioCodec: CodecMimeType; readonly videoBitrate: number;
readonly videoCodec: CodecMimeType;
​ readonly audioSampleRate: number; readonly videoFrameWidth: number;
readonly videoFrameHeight: number;
​ readonly fileFormat: ContainerFormatType; readonly videoFrameRate: number;
​ readonly videoBitrate: number;
​ readonly videoCodec: CodecMimeType;
​ readonly videoFrameWidth: number;
​ readonly videoFrameHeight: number;
​ readonly videoFrameRate: number;
} }
enum AudioSourceType { enum AudioSourceType {
AUDIO_SOURCE_TYPE_DEFAULT = 0,
​ AUDIO_SOURCE_TYPE_DEFAULT = 0, AUDIO_SOURCE_TYPE_MIC = 1,
​ AUDIO_SOURCE_TYPE_MIC = 1,
} }
enum VideoSourceType { enum VideoSourceType {
VIDEO_SOURCE_TYPE_SURFACE_YUV = 0,
​ VIDEO_SOURCE_TYPE_SURFACE_YUV = 0, VIDEO_SOURCE_TYPE_SURFACE_ES = 1,
​ VIDEO_SOURCE_TYPE_SURFACE_ES = 1,
} }
enum VideoRecorderConfig { enum VideoRecorderConfig {
audioSourceType?: AudioSourceType;
​ audioSourceType?: AudioSourceType; videoSourceType: VideoSourceType;
profile: VideoRecorderProfile;
​ videoSourceType: VideoSourceType; url: string;
rotation?: number;
​ profile: VideoRecorderProfile; location?: Location;
​ url: string;
​ rotation?: number;
​ location?: Location;
} }
## cl.multimedia.media.002 No Externally Provided Bit Rate Selection API in VideoPlayer ## cl.multimedia.media.002 No Externally Provided Bit Rate Selection API in VideoPlayer
In API version 9, **VideoPlayer** does not externally provide the bit rate selection API. Such an API will be provided by **AVPlayer** in the MR version. In API version 9, **VideoPlayer** does not externally provide the bit rate selection API. Such an API will be provided by **AVPlayer** in the MR version.
**Change Impacts** **Change Impact**
Bit rate selection cannot be performed in the multi-bit rate scenario of **VideoPlayer**. Relevant functions will be provided by **AVPlayer**. Bit rate selection cannot be performed in the multi-bit rate scenario of **VideoPlayer**. Relevant functions will be provided by **AVPlayer**.
**Key API/Component Changes** **Key API/Component Changes**
Deleted APIs: Deleted APIs:
interface VideoPlayer { interface VideoPlayer {
selectBitrate(bitrate: number): Promise<number>;
​ selectBitrate(bitrate: number): Promise<number>; selectBitrate(bitrate: number, callback: AsyncCallback<number>): void;
on(type: 'availableBitratesCollect', callback: (bitrates: Array<number>) => void): void;
​ selectBitrate(bitrate: number, callback: AsyncCallback<number>): void;
​ on(type: 'availableBitratesCollect', callback: (bitrates: Array<number>) => void): void;
} }
## cl.multimedia.media.003 Error Information Change of VideoRecorder ## cl.multimedia.media.003 Error Information Change of VideoRecorder
Original error codes of **VideoRecorder** are changed because they do not comply with the error code specifications. Original error codes of **VideoRecorder** are changed because they do not comply with the error code specifications.
**Change Impacts** **Change Impact**
Error codes returned from **VideoRecorder** are changed. Error codes returned from **VideoRecorder** are changed.
...@@ -315,5 +258,5 @@ Error codes returned from **VideoRecorder** are changed. ...@@ -315,5 +258,5 @@ Error codes returned from **VideoRecorder** are changed.
**Adaptation Guide** **Adaptation Guide**
For details about exception handling, see the following documents: For details about exception handling, see the following documents:
[Media](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-media.md) https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-media.md
[Media Error Codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-media.md) https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/errorcodes/errorcode-media.md
# Multimodal Input ChangeLog # Multimodal Input Changelog
## cl.multimodalinput.1 Error Information Return Method Change of APIs ## cl.multimodalinput.1 Error Information Return Method Change of APIs
...@@ -17,45 +17,45 @@ The internal APIs of the following modules used service logic return values to i ...@@ -17,45 +17,45 @@ The internal APIs of the following modules used service logic return values to i
Asynchronous APIs in the preceding modules have the following changes: A parameter check error is returned synchronously; a service logic error is returned via **AsyncCallback** or the **error** object of **Promise**. No change is made to synchronous APIs. Asynchronous APIs in the preceding modules have the following changes: A parameter check error is returned synchronously; a service logic error is returned via **AsyncCallback** or the **error** object of **Promise**. No change is made to synchronous APIs.
**Change Impacts** **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. 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** **Key API/Component Changes**
- supportKeys(deviceId: number, keys: Array&lt;KeyCode&gt;, callback: AsyncCallback&lt;Array&lt;boolean&gt;&gt;): void; - supportKeys(deviceId: number, keys: Array&lt;KeyCode&gt;, callback: AsyncCallback&lt;Array&lt;boolean&gt;&gt;): void;
- supportKeys(deviceId: number, keys: Array&lt;KeyCode&gt;): Promise&lt;Array&lt;boolean&gt;&gt;; - supportKeys(deviceId: number, keys: Array&lt;KeyCode&gt;): Promise&lt;Array&lt;boolean&gt;&gt;;
- getKeyboardType(deviceId: number, callback: AsyncCallback&lt;KeyboardType&gt;): void; &gt; - getKeyboardType(deviceId: number, callback: AsyncCallback&lt;KeyboardType&gt;): void; &gt;
- getKeyboardType(deviceId: number): Promise&lt;KeyboardType&gt;; - getKeyboardType(deviceId: number): Promise&lt;KeyboardType&gt;;
- setPointerSpeed(speed: number, callback: AsyncCallback&lt;void&gt;): void; - setPointerSpeed(speed: number, callback: AsyncCallback&lt;void&gt;): void;
- setPointerSpeed(speed: number): Promise&lt;void&gt;; - setPointerSpeed(speed: number): Promise&lt;void&gt;;
- getPointerSpeed(callback: AsyncCallback&lt;number&gt;): void; - getPointerSpeed(callback: AsyncCallback&lt;number&gt;): void;
- getPointerSpeed(): Promise&lt;number&gt;; - getPointerSpeed(): Promise&lt;number&gt;;
- setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCallback&lt;void&gt;): void; - setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCallback&lt;void&gt;): void;
- setPointerStyle(windowId: number, pointerStyle: PointerStyle): Promise&lt;void&gt;; - setPointerStyle(windowId: number, pointerStyle: PointerStyle): Promise&lt;void&gt;;
- getPointerStyle(windowId: number, callback: AsyncCallback&lt;PointerStyle&gt;): void; - getPointerStyle(windowId: number, callback: AsyncCallback&lt;PointerStyle&gt;): void;
- getPointerStyle(windowId: number): Promise&lt;PointerStyle&gt;; - getPointerStyle(windowId: number): Promise&lt;PointerStyle&gt;;
- setPointerVisible(visible: boolean, callback: AsyncCallback&lt;void&gt;): void; - setPointerVisible(visible: boolean, callback: AsyncCallback&lt;void&gt;): void;
- setPointerVisible(visible: boolean): Promise&lt;void&gt;; - setPointerVisible(visible: boolean): Promise&lt;void&gt;;
- isPointerVisible(callback: AsyncCallback&lt;boolean&gt;): void; - isPointerVisible(callback: AsyncCallback&lt;boolean&gt;): void;
- isPointerVisible(): Promise&lt;boolean&gt;; - isPointerVisible(): Promise&lt;boolean&gt;;
- on(type:"touch", receiver:TouchEventReceiver):void; - on(type:"touch", receiver:TouchEventReceiver):void;
- on(type:"mouse", receiver:Callback&lt;MouseEvent&gt;):void; - on(type:"mouse", receiver:Callback&lt;MouseEvent&gt;):void;
- off(type:"touch", receiver?:TouchEventReceiver):void; - off(type:"touch", receiver?:TouchEventReceiver):void;
- off(type:"mouse", receiver?:Callback&lt;MouseEvent&gt;):void; - off(type:"mouse", receiver?:Callback&lt;MouseEvent&gt;):void;
- injectEvent({KeyEvent: KeyEvent}): void; - injectEvent({KeyEvent: KeyEvent}): void;
- enable(enable: boolean, callback: AsyncCallback&lt;void&gt;): void; - enable(enable: boolean, callback: AsyncCallback&lt;void&gt;): void;
- enable(enable: boolean): Promise&lt;void&gt;; - enable(enable: boolean): Promise&lt;void&gt;;
- start(sinkDeviceDescriptor: string, srcInputDeviceId: number, callback: AsyncCallback&lt;void&gt;): void; - start(sinkDeviceDescriptor: string, srcInputDeviceId: number, callback: AsyncCallback&lt;void&gt;): void;
- start(sinkDeviceDescriptor: string, srcInputDeviceId: number): Promise&lt;void&gt;; - start(sinkDeviceDescriptor: string, srcInputDeviceId: number): Promise&lt;void&gt;;
- stop(callback: AsyncCallback&lt;void&gt;): void; - stop(callback: AsyncCallback&lt;void&gt;): void;
- stop(): Promise&lt;void&gt;; - stop(): Promise&lt;void&gt;;
- getState(deviceDescriptor: string, callback: AsyncCallback&lt;{ state: boolean }&gt;): void; - getState(deviceDescriptor: string, callback: AsyncCallback&lt;{ state: boolean }&gt;): void;
- getState(deviceDescriptor: string): Promise&lt;{ state: boolean }&gt;; - getState(deviceDescriptor: string): Promise&lt;{ state: boolean }&gt;;
- on(type: 'cooperation', callback: AsyncCallback&lt;{ deviceDescriptor: string, eventMsg: EventMsg }&gt;): void; - on(type: 'cooperation', callback: AsyncCallback&lt;{ deviceDescriptor: string, eventMsg: EventMsg }&gt;): void;
- off(type: 'cooperation', callback?: AsyncCallback&lt;void&gt;): void; - off(type: 'cooperation', callback?: AsyncCallback&lt;void&gt;): void;
- on(type: "key", keyOptions: KeyOptions, callback: Callback&lt;KeyOptions&gt;): void; - on(type: "key", keyOptions: KeyOptions, callback: Callback&lt;KeyOptions&gt;): void;
- off(type: "key", keyOptions: KeyOptions, callback?: Callback&lt;KeyOptions&gt;): void; - off(type: "key", keyOptions: KeyOptions, callback?: Callback&lt;KeyOptions&gt;): void;
Deprecated APIs: Deprecated APIs:
- getDeviceIds(callback: AsyncCallback&lt;Array&lt;number&gt;&gt;): void; - getDeviceIds(callback: AsyncCallback&lt;Array&lt;number&gt;&gt;): void;
......
# Power Subsystem ChangeLog # Power Subsystem Changelog
## cl.powermgr.1 Error Information Return Method Change of APIs ## cl.powermgr.1 Error Information Return Method Change of APIs
The following APIs used service logic return values to indicate error information, which did not comply with the error code specifications of OpenHarmony. Therefore, they are modified in API version 9 and later. The **power** module uses service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. Therefore, modification is made in API version 9 and later.
- Power consumption statistics: [@ohos.batteryStatistics](../../../application-dev/reference/apis/js-apis-batteryStatistics.md) - Power consumption statistics: [@ohos.batteryStatistics](../../../application-dev/reference/apis/js-apis-batteryStatistics.md)
- Brightness: [@ohos.brightness](../../../application-dev/reference/apis/js-apis-brightness.md) - Brightness: [@ohos.brightness](../../../application-dev/reference/apis/js-apis-brightness.md)
...@@ -14,7 +14,7 @@ Asynchronous API: An error message is returned via **AsyncCallback** or the **er ...@@ -14,7 +14,7 @@ Asynchronous API: An error message is returned via **AsyncCallback** or the **er
Synchronous API: An error message is returned via an exception. Synchronous API: An error message is returned via an exception.
#### Change Impacts #### 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. 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.
...@@ -50,7 +50,7 @@ Error code processing is added for the following APIs: ...@@ -50,7 +50,7 @@ Error code processing is added for the following APIs:
For details, see the API reference document of each API. For details, see the API reference document of each API.
## cl.powermgr.2 System API Change ## cl.powermgr.2 System API Change
#### Change Impacts #### Change Impact
The application developed based on earlier versions needs to adapt to new API names and the new method for returning API error information. Otherwise, the original service logic will be affected. The application developed based on earlier versions needs to adapt to new API names and the new method for returning API error information. Otherwise, the original service logic will be affected.
......
# Upload and Download Subsystem Changelog
## cl.request.1 Changes of Error Code Definitions and Some API Names
- The processing of the [upload and download error codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-request.md) is added to the upload and download APIs.
- An error message is returned via **AsyncCallback** or the **error** object of **Promise**. An error message related to the parameter type or quantity is returned via an exception.
- Some APIs need to be replaced with new APIs, and the parameters remain unchanged.
**Change 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**
| Module | Class | Method/Attribute/Enumeration/Constant | Change Type |
|--------------|--------------|-----------------------------------------------------------------------------------------------------------------------|-----------|
| ohos.request | request | EXCEPTION_PERMISSION | Added|
| ohos.request | request | EXCEPTION_PARAMCHECK | Added|
| ohos.request | request | EXCEPTION_UNSUPPORTED | Added|
| ohos.request | request | EXCEPTION_FILEIO | Added|
| ohos.request | request | EXCEPTION_FILEPATH | Added|
| ohos.request | request | EXCEPTION_SERVICE | Added|
| ohos.request | request | EXCEPTION_OTHERS | Added|
| ohos.request | request | ERROR_OFFLINE | Added|
| ohos.request | request | ERROR_UNSUPPORTED_NETWORK_TYPE | Added|
| ohos.request | request | function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void; | Added|
| ohos.request | request | function downloadFile(context: BaseContext, config: DownloadConfig): Promise<DownloadTask>; | Added|
| ohos.request | request | function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback<UploadTask>): void; | Added|
| ohos.request | request | function uploadFile(context: BaseContext, config: UploadConfig): Promise<UploadTask>; | Added|
| ohos.request | DownloadTask | delete(callback: AsyncCallback<boolean>): void; | Added|
| ohos.request | DownloadTask | delete(): Promise<boolean>; | Added|
| ohos.request | DownloadTask | suspend(callback: AsyncCallback<boolean>): void; | Added|
| ohos.request | DownloadTask | suspend(): Promise<boolean>; | Added|
| ohos.request | DownloadTask | restore(callback: AsyncCallback<boolean>): void; | Added|
| ohos.request | DownloadTask | restore(): Promise<boolean>; | Added|
| ohos.request | DownloadTask | getTaskInfo(callback: AsyncCallback<DownloadInfo>): void; | Added|
| ohos.request | DownloadTask | getTaskInfo(): Promise<DownloadInfo>; | Added|
| ohos.request | DownloadTask | getTaskMimeType(callback: AsyncCallback<string>): void; | Added|
| ohos.request | DownloadTask | getTaskMimeType(): Promise<string>; | Added|
| ohos.request | UploadTask | delete(callback: AsyncCallback<boolean>): void; | Added|
| ohos.request | UploadTask | delete(): Promise<boolean>; | Added|
| ohos.request | request | function download(config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void;<br>Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void;| Deprecated|
| ohos.request | request | function download(config: DownloadConfig): Promise<DownloadTask>;<br>Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig): Promise<DownloadTask>; | Deprecated|
| ohos.request | request | function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void;<br>Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void;| Deprecated|
| ohos.request | request | function download(context: BaseContext, config: DownloadConfig): Promise<DownloadTask>;<br>Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig): Promise<DownloadTask>; | Deprecated|
| ohos.request | request | function upload(config: UploadConfig, callback: AsyncCallback<UploadTask>): void;<br>Substitute API: function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback<UploadTask>): void; | Deprecated|
| ohos.request | request | function upload(config: UploadConfig): Promise<UploadTask>;<br>Substitute API: function uploadFile(context: BaseContext, config: UploadConfig): Promise<UploadTask>; | Deprecated|
| ohos.request | request | function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback<UploadTask>): void;<br>Substitute API: function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback<UploadTask>): void; | Deprecated|
| ohos.request | request | function upload(context: BaseContext, config: UploadConfig): Promise<UploadTask>;<br>Substitute API: function uploadFile(context: BaseContext, config: UploadConfig): Promise<UploadTask>; | Deprecated|
| ohos.request | DownloadTask | remove(callback: AsyncCallback<boolean>): void;<br>Substitute API: delete(callback: AsyncCallback<boolean>): void | Deprecated|
| ohos.request | DownloadTask | remove(): Promise<boolean>;<br>Substitute API: delete(): Promise<boolean>; | Deprecated|
| ohos.request | DownloadTask | pause(callback: AsyncCallback<boolean>): void;<br>Substitute API: suspend(callback: AsyncCallback<boolean>): void; | Deprecated|
| ohos.request | DownloadTask | pause(): Promise<boolean>;<br>Substitute API: suspend(): Promise<boolean>; | Deprecated|
| ohos.request | DownloadTask | resume(callback: AsyncCallback<boolean>): void;<br>Substitute API: restore(callback: AsyncCallback<boolean>): void; | Deprecated|
| ohos.request | DownloadTask | resume(): Promise<boolean>;<br>Substitute API: restore(): Promise<boolean>; | Deprecated|
| ohos.request | DownloadTask | query(callback: AsyncCallback<DownloadInfo>): void;<br>Substitute API: getTaskInfo(callback: AsyncCallback<DownloadInfo>): void; | Deprecated|
| ohos.request | DownloadTask | query(): Promise<DownloadInfo>;<br>Substitute API: getTaskInfo(): Promise<DownloadInfo>; | Deprecated|
| ohos.request | DownloadTask | queryMimeType(callback: AsyncCallback<string>): void;<br>Substitute API: getTaskMimeType(callback: AsyncCallback<string>): void; | Deprecated|
| ohos.request | DownloadTask | queryMimeType(): Promise<string>;<br>Substitute API: getTaskMimeType(): Promise<string>; | Deprecated|
| ohos.request | UploadTask | remove(callback: AsyncCallback<boolean>): void;<br>Substitute API: delete(callback: AsyncCallback<boolean>): void; | Deprecated|
| ohos.request | UploadTask | remove(): Promise<boolean>;<br>Substitute API: delete(): Promise<boolean>; | Deprecated|
| system.request | UploadResponse | code | Deprecated|
| system.request | UploadResponse | data | Deprecated|
| system.request | UploadResponse | headers | Deprecated|
| system.request | DownloadResponse | token | Deprecated|
| system.request | OnDownloadCompleteResponse | uri | Deprecated|
| system.request | RequestFile | filename | Deprecated|
| system.request | RequestFile | name | Deprecated|
| system.request | RequestFile | uri | Deprecated|
| system.request | RequestFile | type | Deprecated|
| system.request | RequestData | name | Deprecated|
| system.request | RequestData | value | Deprecated|
| system.request | UploadRequestOptions | url | Deprecated|
| system.request | UploadRequestOptions | data | Deprecated|
| system.request | UploadRequestOptions | files | Deprecated|
| system.request | UploadRequestOptions | header | Deprecated|
| system.request | UploadRequestOptions | description | Deprecated|
| system.request | UploadRequestOptions | success | Deprecated|
| system.request | UploadRequestOptions | fail | Deprecated|
| system.request | UploadRequestOptions | complete | Deprecated|
| system.request | OnDownloadCompleteOptions | token | Deprecated|
| system.request | OnDownloadCompleteOptions | success | Deprecated|
| system.request | OnDownloadCompleteOptions | fail | Deprecated|
| system.request | OnDownloadCompleteOptions | complete | Deprecated|
| system.request | Request | static upload(options: UploadRequestOptions): void; | Deprecated|
| system.request | Request | static download(options: DownloadRequestOptions): void; | Deprecated|
| system.request | Request | static onDownloadComplete(options: OnDownloadCompleteOptions): void; | Deprecated|
**Adaptation Guide**
The following uses **downloadFile** as an example to show how it is called in the new version:
```ts
try {
request.downloadFile(globalThis.abilityContext, { url: 'https://xxxx/xxxxx.hap',
filePath: 'xxx/xxxxx.hap'}, (err, data) => {
if (err) {
console.error('Failed to request the download. Cause: ' + JSON.stringify(err));
return;
}
});
} catch (err) {
console.log("downloadFile callback fail." + "errCode:" + err.code + ",errMessage:" + err.message);
}
```
# Resource Manager ChangeLog # Resource Manager Changelog
## cl.resourceManager.1 Name Change of Some Multi-Project APIs in API Version 9 of Resource Manager ## cl.resourceManager.1 Name Change of Some Multi-Project APIs in API Version 9 of Resource Manager
The resource manager can return error codes and error information for APIs in API version 9 and later. Some multi-project APIs in API version 9 need to be adapted. The following changes are made in API version 9 and later: The resource manager can return error codes and error information for APIs in API version 9 and later. Some multi-project APIs in API version 9 need to be adapted. The following changes are made in API version 9:
Some multi-project APIs of the resource manager need to be replaced with new APIs, and the parameters remain unchanged. Some multi-project APIs of the resource manager need to be replaced with new APIs, and the parameters remain unchanged.
**Change Impacts** **Change Impact**
For applications developed based on earlier versions, relevant JavaScript multi-project APIs need to be replaced with new APIs. For applications developed based on earlier versions, relevant JavaScript multi-project APIs need to be replaced with new APIs.
...@@ -27,10 +27,10 @@ For applications developed based on earlier versions, relevant JavaScript multi- ...@@ -27,10 +27,10 @@ For applications developed based on earlier versions, relevant JavaScript multi-
**Adaptation Guide** **Adaptation Guide**
The following describes how to change **getMedia** to **getMediaContent** in callback mode. The promise mode is similar. You only need to change the function name, add the error code and error information, and keep other information unchanged. The sample code is as follows: The following describes how to change **getMedia** to **getMediaContent** in callback mode. The promise mode is similar. You only need to change the function name, add the error code and error information, and keep other information unchanged. The code snippet is as follows:
- Before the change: **getMedia(resource: Resource, callback: AsyncCallback<Uint8Array>): void;** - Before the change: **getMedia(resource: Resource, callback: AsyncCallback<Uint8Array>): void;**
```ts ```ts
let resource = { let resource = {
bundleName: "com.example.myapplication", bundleName: "com.example.myapplication",
moduleName: "entry", moduleName: "entry",
......
# Resource Scheduler Subsystem ChangeLog # Resource Scheduler Subsystem Changelog
## cl.resourceschedule.backgroundTaskManager ## cl.resourceschedule.backgroundTaskManager
Rectified original APIs of **backgroundTaskManager** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. Rectified original APIs of **backgroundTaskManager** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications.
**Change Impacts** **Change Impact**
The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected.
**Key API/Component Changes** **Key API/Component Changes**
The following methods, attributes, enumerations, and constants are changed in API version 9 and later versions. The **@ohos.backgroundTaskManager.d.ts** file is deprecated and related APIs are migrated to the newly added **@ohos.resourceschedule.backgroundTaskManager.d.ts** file. The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.backgroundTaskManager.d.ts** file is deprecated and related APIs are moved to the newly added **@ohos.resourceschedule.backgroundTaskManager.d.ts** file.
| Class| API Type| Declaration| Description| | Class| API Type| Declaration| Description|
| -- | -- | -- | -- | | -- | -- | -- | -- |
| backgroundTaskManager | namespace | declare namespace backgroundTaskManager | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager | namespace | declare namespace backgroundTaskManager | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager | method | function resetAllEfficiencyResources(): void; | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager | method | function resetAllEfficiencyResources(): void; | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager | method | function applyEfficiencyResources(request: EfficiencyResourcesRequest): bool; | This API is changed in API version 9 to **function applyEfficiencyResources(request: EfficiencyResourcesRequest): void;** and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager | method | function applyEfficiencyResources(request: EfficiencyResourcesRequest): bool; | Changed in API version 9 to **function applyEfficiencyResources(request: EfficiencyResourcesRequest): void;** and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager | method | function stopBackgroundRunning(context: Context): Promise<void>; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager | method | function stopBackgroundRunning(context: Context): Promise<void>; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager | method | function stopBackgroundRunning(context: Context, callback: AsyncCallback<void>): void; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager | method | function stopBackgroundRunning(context: Context, callback: AsyncCallback<void>): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise<void>; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise<void>; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback<void>): void; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback<void>): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager | method | function requestSuspendDelay(reason: string, callback: Callback<void>): DelaySuspendInfo; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager | method | function requestSuspendDelay(reason: string, callback: Callback<void>): DelaySuspendInfo; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number): Promise<number>; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager | method | function getRemainingDelayTime(requestId: number): Promise<number>; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number, callback: AsyncCallback<number>): void; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager | method | function getRemainingDelayTime(requestId: number, callback: AsyncCallback<number>): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager | method | function cancelSuspendDelay(requestId: number): void; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager | method | function cancelSuspendDelay(requestId: number): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.BackgroundMode | enum | export enum BackgroundMode | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.BackgroundMode | enum | export enum BackgroundMode | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.BackgroundMode | enum | DATA_TRANSFER = 1 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.BackgroundMode | enum | DATA_TRANSFER = 1 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.BackgroundMode | enum | AUDIO_PLAYBACK = 2 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.BackgroundMode | enum | AUDIO_PLAYBACK = 2 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.BackgroundMode | enum | AUDIO_RECORDING = 3 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.BackgroundMode | enum | AUDIO_RECORDING = 3 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.BackgroundMode | enum | LOCATION = 4 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.BackgroundMode | enum | LOCATION = 4 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.BackgroundMode | enum | BLUETOOTH_INTERACTION = 5 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.BackgroundMode | enum | BLUETOOTH_INTERACTION = 5 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.BackgroundMode | enum | MULTI_DEVICE_CONNECTION = 6 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.BackgroundMode | enum | MULTI_DEVICE_CONNECTION = 6 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.BackgroundMode | enum | WIFI_INTERACTION = 7 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.BackgroundMode | enum | WIFI_INTERACTION = 7 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.BackgroundMode | enum | VOIP = 8 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.BackgroundMode | enum | VOIP = 8 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.BackgroundMode | enum | TASK_KEEPING = 9 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.BackgroundMode | enum | TASK_KEEPING = 9 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.DelaySuspendInfo | interface | interface DelaySuspendInfo | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.DelaySuspendInfo | interface | interface DelaySuspendInfo | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.DelaySuspendInfo | field | requestId: number | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.DelaySuspendInfo | field | requestId: number | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.DelaySuspendInfo | field | actualDelayTime: number | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.DelaySuspendInfo | field | actualDelayTime: number | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | export enum ResourceType | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.ResourceType | enum | export enum ResourceType | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | CPU = 1 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.ResourceType | enum | CPU = 1 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | COMMON_EVENT = 1 << 1 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.ResourceType | enum | COMMON_EVENT = 1 << 1 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | TIMER = 1 << 2 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.ResourceType | enum | TIMER = 1 << 2 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | WORK_SCHEDULER = 1 << 3 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.ResourceType | enum | WORK_SCHEDULER = 1 << 3 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | BLUETOOTH = 1 << 4 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.ResourceType | enum | BLUETOOTH = 1 << 4 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | GPS = 1 << 5 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.ResourceType | enum | GPS = 1 << 5 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | AUDIO = 1 << 6 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.ResourceType | enum | AUDIO = 1 << 6 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | interface | export interface EfficiencyResourcesRequest | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.EfficiencyResourcesRequest | interface | export interface EfficiencyResourcesRequest | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | field | reason: string | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.EfficiencyResourcesRequest | field | reason: string | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | field | isProcess?: bool | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.EfficiencyResourcesRequest | field | isProcess?: bool | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | field | isPersist?: bool | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.EfficiencyResourcesRequest | field | isPersist?: bool | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | field | timeOut: number | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.EfficiencyResourcesRequest | field | timeOut: number | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | field | isApply: bool | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.EfficiencyResourcesRequest | field | isApply: bool | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | field | resourceTypes: number | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| | backgroundTaskManager.EfficiencyResourcesRequest | field | resourceTypes: number | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
**Adaptation Guide**<br> **Adaptation Guide**
Import the **backgroundTaskManager** module. Import the **backgroundTaskManager** module.
``` ```
...@@ -63,107 +62,106 @@ import bundle form '@ohos.resourceschedule.backgroundTaskManager' ...@@ -63,107 +62,106 @@ import bundle form '@ohos.resourceschedule.backgroundTaskManager'
``` ```
Exception handling also needs to be adapted. For details, see the [backgroundTaskManager API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md). Exception handling also needs to be adapted. For details, see the [backgroundTaskManager API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md).
## c2.resourceschedule.usageStatistics ## c2.resourceschedule.usageStatistics
Rectified original APIs of **deviceUsageStatistics** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. Rectified original APIs of **deviceUsageStatistics** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications.
**Change Impacts** **Change Impact**
The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected.
**Key API/Component Changes** **Key API/Component Changes**
The following methods, attributes, enumerations, and constants are changed in API version 9 and later versions. The **@ohos.bundleState.d.ts** file is deprecated, the **@ohos.resourceschedule.usageStatistics.d.ts** file is added, and the class name is changed from **bundleState** to **usageStatistics**. The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.bundleState.d.ts** file is deprecated, the **@ohos.resourceschedule.usageStatistics.d.ts** file is added, and the class name is changed from **bundleState** to **usageStatistics**.
| Class | API Type | Method/Attribute/Enumeration/Constant | Change Type | | Class | API Type | Method/Attribute/Enum/Constant | Change Type |
| ----------------------------------------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ | | ----------------------------------------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| bundleState | method | function isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void; | Deprecated and migrated to **usageStatistics.isIdleState** | | bundleState | method | function isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void; | Deprecated and moved to **usageStatistics.isIdleState**. |
| bundleState | method | function isIdleState(bundleName: string): Promise<boolean>; | Deprecated and migrated to **usageStatistics.isIdleState** | | bundleState | method | function isIdleState(bundleName: string): Promise<boolean>; | Deprecated and moved to **usageStatistics.isIdleState**. |
| bundleState | method | function queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void; | Deprecated and changed to **function queryAppGroup(callback: AsyncCallback<number>): void;**| | bundleState | method | function queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void; | Deprecated and changed to **function queryAppGroup(callback: AsyncCallback<number>): void;**.|
| bundleState | method | function queryAppUsagePriorityGroup(): Promise<number>; | Deprecated and changed to **function queryAppGroup(): Promise<number>;** | | bundleState | method | function queryAppUsagePriorityGroup(): Promise<number>; | Deprecated and changed to **function queryAppGroup(): Promise<number>;**. |
| bundleState | method | function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback<BundleActiveInfoResponse>): void; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback<BundleStatsMap>): void;**| | bundleState | method | function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback<BundleActiveInfoResponse>): void; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback<BundleStatsMap>): void;**.|
| bundleState | method | function queryBundleStateInfos(begin: number, end: number): Promise<BundleActiveInfoResponse>; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number): Promise<BundleStatsMap>;**| | bundleState | method | function queryBundleStateInfos(begin: number, end: number): Promise<BundleActiveInfoResponse>; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number): Promise<BundleStatsMap>;**.|
| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array<BundleStateInfo>>; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array<BundleStatsInfo>>;**| | bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array<BundleStateInfo>>; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array<BundleStatsInfo>>;**.|
| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback<Array<BundleStateInfo>>): void; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback<Array<BundleStatsInfo>>): void;**| | bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback<Array<BundleStateInfo>>): void; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback<Array<BundleStatsInfo>>): void;**.|
| bundleState | method | function queryBundleActiveStates(begin: number, end: number): Promise<Array<BundleActiveState>>; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number): Promise<Array<BundleEvents>>;**| | bundleState | method | function queryBundleActiveStates(begin: number, end: number): Promise<Array<BundleActiveState>>; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number): Promise<Array<BundleEvents>>;**.|
| bundleState | method | function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveState>>): void; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number, callback: AsyncCallback<Array<BundleEvents>>): void;**| | bundleState | method | function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveState>>): void; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number, callback: AsyncCallback<Array<BundleEvents>>): void;**.|
| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number): Promise<Array<BundleActiveState>>; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number): Promise<Array<BundleEvents>>;**| | bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number): Promise<Array<BundleActiveState>>; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number): Promise<Array<BundleEvents>>;**.|
| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveState>>): void; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback<Array<BundleEvents>>): void;**| | bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveState>>): void; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback<Array<BundleEvents>>): void;**.|
| bundleState | method | function getRecentlyUsedModules(maxNum?: number): Promise<Array<BundleActiveModuleInfo>>; | Deprecated and changed to the following two APIs: **function QueryModuleUsageRecords(maxNum: number): Promise<Array<HapModuleInfo>>;** and **function QueryModuleUsageRecords(): Promise<Array<HapModuleInfo>>;**| | bundleState | method | function getRecentlyUsedModules(maxNum?: number): Promise<Array<BundleActiveModuleInfo>>; | Deprecated and changed to **function QueryModuleUsageRecords(maxNum: number): Promise<Array<HapModuleInfo>>;** and **function QueryModuleUsageRecords(): Promise<Array<HapModuleInfo>>;**.|
| bundleState | method | function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback<Array<BundleActiveModuleInfo>>): void; | Deprecated and changed to the following two APIs: **function QueryModuleUsageRecords(maxNum: number, callback: AsyncCallback<Array<HapModuleInfo>>): void;** and **function QueryModuleUsageRecords(callback: AsyncCallback<Array<HapModuleInfo>>): void;**| | bundleState | method | function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback<Array<BundleActiveModuleInfo>>): void; | Deprecated and changed to **function QueryModuleUsageRecords(maxNum: number, callback: AsyncCallback<Array<HapModuleInfo>>): void;** and **function QueryModuleUsageRecords(callback: AsyncCallback<Array<HapModuleInfo>>): void;**.|
| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string): Promise<number>; | Deprecated and changed to **function queryAppGroup(bundleName: string): Promise<number>;**| | bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string): Promise<number>; | Deprecated and changed to **function queryAppGroup(bundleName: string): Promise<number>;**.|
| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback<number>): void; | Deprecated and changed to **function queryAppGroup(bundleName: string, callback: AsyncCallback<number>): void;**| | bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback<number>): void; | Deprecated and changed to **function queryAppGroup(bundleName: string, callback: AsyncCallback<number>): void;**.|
| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback<void>): void; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback<void>): void;**| | bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback<void>): void; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback<void>): void;**.|
| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType): Promise<void>; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType): Promise<void>;**| | bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType): Promise<void>; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType): Promise<void>;**.|
| bundleState | method | function registerGroupCallBack(callback: Callback<BundleActiveGroupCallbackInfo>, callback: AsyncCallback<void>): void; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback<AppGroupCallbackInfo>, callback: AsyncCallback<void>): void;**| | bundleState | method | function registerGroupCallBack(callback: Callback<BundleActiveGroupCallbackInfo>, callback: AsyncCallback<void>): void; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback<AppGroupCallbackInfo>, callback: AsyncCallback<void>): void;**.|
| bundleState | method | function registerGroupCallBack(callback: Callback<BundleActiveGroupCallbackInfo>): Promise<void>; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback<AppGroupCallbackInfo>): Promise<void>;**| | bundleState | method | function registerGroupCallBack(callback: Callback<BundleActiveGroupCallbackInfo>): Promise<void>; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback<AppGroupCallbackInfo>): Promise<void>;**.|
| bundleState | method | function unRegisterGroupCallBack(callback: AsyncCallback<void>): void; | Deprecated and changed to **function unregisterAppGroupCallBack(): Promise<void>;**| | bundleState | method | function unRegisterGroupCallBack(callback: AsyncCallback<void>): void; | Changed to **function unregisterAppGroupCallBack(): Promise<void>;**.|
| bundleState | method | function unRegisterGroupCallBack(): Promise<void>; | Deprecated and changed to **function unregisterAppGroupCallBack(): Promise<void>;**| | bundleState | method | function unRegisterGroupCallBack(): Promise<void>; | Changed to **function unregisterAppGroupCallBack(): Promise<void>;**.|
| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void; | Changed to **function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback<Array<DeviceEventStats>>): void;**| | bundleState | method | function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void; | Changed to **function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback<Array<DeviceEventStats>>): void;**|
| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number): Promise<Array<BundleActiveEventState>>; | Changed in API version 9 and later versions to **function queryDeviceEventStats(begin: number, end: number): Promise<Array<DeviceEventStats>>;**| | bundleState | method | function queryBundleActiveEventStates(begin: number, end: number): Promise<Array<BundleActiveEventState>>; | Changed in API version 9 to **function queryDeviceEventStats(begin: number, end: number): Promise<Array<DeviceEventStats>>;**.|
| bundleState | method | function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void; | Changed in API version 9 and later versions to **function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback<Array<NotificationEventStats >>): void;**| | bundleState | method | function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void; | Changed in API version 9 to **function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback<Array<NotificationEventStats >>): void;**.|
| bundleState | method | function queryAppNotificationNumber(begin: number, end: number): Promise<Array<BundleActiveEventState>>; | Changed in API version 9 and later versions to **function queryNotificationEventStats(begin: number, end: number): Promise<Array<NotificationEventStats >>;**| | bundleState | method | function queryAppNotificationNumber(begin: number, end: number): Promise<Array<BundleActiveEventState>>; | Changed in API version 9 to **function queryNotificationEventStats(begin: number, end: number): Promise<Array<NotificationEventStats >>;**.|
| bundleState.BundleActiveGroupCallbackInfo | interface | interface BundleActiveGroupCallbackInfo | Changed to **usageStatistics.AppGroupCallbackInfo** | | bundleState.BundleActiveGroupCallbackInfo | interface | interface BundleActiveGroupCallbackInfo | Moved to **usageStatistics.AppGroupCallbackInfo**. |
| bundleState.BundleActiveGroupCallbackInfo | field | bundleName: string | Changed and migrated to **usageStatistics.AppGroupCallbackInfo** | | bundleState.BundleActiveGroupCallbackInfo | field | bundleName: string | Moved to **usageStatistics.AppGroupCallbackInfo**. |
| bundleState.BundleActiveGroupCallbackInfo | field | changeReason: number | Changed and migrated to **usageStatistics.AppGroupCallbackInfo** | | bundleState.BundleActiveGroupCallbackInfo | field | changeReason: number | Moved to **usageStatistics.AppGroupCallbackInfo**. |
| bundleState.BundleActiveGroupCallbackInfo | field | userId: number | Changed and migrated to **usageStatistics.AppGroupCallbackInfo** | | bundleState.BundleActiveGroupCallbackInfo | field | userId: number | Moved to **usageStatistics.AppGroupCallbackInfo**. |
| bundleState.BundleActiveGroupCallbackInfo | field | appUsageNewGroup: number | Deprecated and changed to **appNewGroup** | | bundleState.BundleActiveGroupCallbackInfo | field | appUsageNewGroup: number | Deprecated and changed to **appNewGroup**. |
| bundleState.BundleActiveGroupCallbackInfo | field | appUsageOldGroup: number | Deprecated and changed to **appOldGroup** | | bundleState.BundleActiveGroupCallbackInfo | field | appUsageOldGroup: number | Deprecated and changed to **appOldGroup**. |
| bundleState.BundleActiveEventState | interface | interface BundleActiveEventState | Deprecated and changed to **usageStatistics.DeviceEventStats** | | bundleState.BundleActiveEventState | interface | interface BundleActiveEventState | Deprecated and changed to **usageStatistics.DeviceEventStats**. |
| bundleState.BundleActiveEventState | field | count: number | Changed and migrated to **usageStatistics.DeviceEventStats** | | bundleState.BundleActiveEventState | field | count: number | Moved to **usageStatistics.DeviceEventStats**. |
| bundleState.BundleActiveEventState | field | eventId: number | Changed and migrated to **usageStatistics.DeviceEventStats** | | bundleState.BundleActiveEventState | field | eventId: number | Moved to **usageStatistics.DeviceEventStats**. |
| bundleState.BundleActiveEventState | field | name: string | Changed and migrated to **usageStatistics.DeviceEventStats** | | bundleState.BundleActiveEventState | field | name: string | Moved to **usageStatistics.DeviceEventStats**. |
| bundleState.BundleActiveModuleInfo | interface | interface BundleActiveModuleInfo | Changed in API version 9 and later versions to **usageStatistics.HapModuleInfo** | | bundleState.BundleActiveModuleInfo | interface | interface BundleActiveModuleInfo | Changed in API version 9 to **usageStatistics.HapModuleInfo**. |
| bundleState.BundleActiveModuleInfo | field | formRecords: Array<BundleActiveFormInfo> | Changed to **formRecords: Array<HapModuleInfo>** | | bundleState.BundleActiveModuleInfo | field | formRecords: Array<BundleActiveFormInfo> | Changed to **formRecords: Array<HapModuleInfo>**. |
| bundleState.BundleActiveModuleInfo | field | lastModuleUsedTime: number | Changed and migrated to **usageStatistics.HapModuleInfo** | | bundleState.BundleActiveModuleInfo | field | lastModuleUsedTime: number | Moved to **usageStatistics.HapModuleInfo**. |
| bundleState.BundleActiveModuleInfo | field | launchedCount: number | Changed and migrated to **usageStatistics.HapModuleInfo** | | bundleState.BundleActiveModuleInfo | field | launchedCount: number | Moved to **usageStatistics.HapModuleInfo**. |
| bundleState.BundleActiveModuleInfo | field | abilityIconId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | | bundleState.BundleActiveModuleInfo | field | abilityIconId?: number | Moved to **usageStatistics.HapModuleInfo**. |
| bundleState.BundleActiveModuleInfo | field | abilityDescriptionId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | | bundleState.BundleActiveModuleInfo | field | abilityDescriptionId?: number | Moved to **usageStatistics.HapModuleInfo**. |
| bundleState.BundleActiveModuleInfo | field | abilityLableId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | | bundleState.BundleActiveModuleInfo | field | abilityLableId?: number | Moved to **usageStatistics.HapModuleInfo**. |
| bundleState.BundleActiveModuleInfo | field | descriptionId?: number; | Changed and migrated to **usageStatistics.HapModuleInfo** | | bundleState.BundleActiveModuleInfo | field | descriptionId?: number; | Moved to **usageStatistics.HapModuleInfo**. |
| bundleState.BundleActiveModuleInfo | field | labelId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | | bundleState.BundleActiveModuleInfo | field | labelId?: number | Moved to **usageStatistics.HapModuleInfo**. |
| bundleState.BundleActiveModuleInfo | field | appLabelId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | | bundleState.BundleActiveModuleInfo | field | appLabelId?: number | Moved to **usageStatistics.HapModuleInfo**. |
| bundleState.BundleActiveModuleInfo | field | abilityName?: string | Changed and migrated to **usageStatistics.HapModuleInfo** | | bundleState.BundleActiveModuleInfo | field | abilityName?: string | Moved to **usageStatistics.HapModuleInfo**. |
| bundleState.BundleActiveModuleInfo | field | moduleName: string | Changed and migrated to **usageStatistics.HapModuleInfo** | | bundleState.BundleActiveModuleInfo | field | moduleName: string | Moved to **usageStatistics.HapModuleInfo**. |
| bundleState.BundleActiveModuleInfo | field | bundleName: string | Changed and migrated to **usageStatistics.HapModuleInfo** | | bundleState.BundleActiveModuleInfo | field | bundleName: string | Moved to **usageStatistics.HapModuleInfo**. |
| bundleState.BundleActiveModuleInfo | field | deviceId?: string | Changed and migrated to **usageStatistics.HapModuleInfo** | | bundleState.BundleActiveModuleInfo | field | deviceId?: string | Moved to **usageStatistics.HapModuleInfo**. |
| bundleState.GroupType | enum | enum GroupType | Changed and migrated to **usageStatistics.GroupType** | | bundleState.GroupType | enum | enum GroupType | Moved to **usageStatistics.GroupType**. |
| bundleState.GroupType | enum | ACTIVE_GROUP_ALIVE | Deprecated and changed to **ALIVE_GROUP** | | bundleState.GroupType | enum | ACTIVE_GROUP_ALIVE | Deprecated and changed to **ALIVE_GROUP**. |
| bundleState.GroupType | enum | ACTIVE_GROUP_DAILY | Deprecated and changed to **DAILY_GROUP** | | bundleState.GroupType | enum | ACTIVE_GROUP_DAILY | Deprecated and changed to **DAILY_GROUP**. |
| bundleState.GroupType | enum | ACTIVE_GROUP_FIXED | Deprecated and changed to **FIXED_GROUP** | | bundleState.GroupType | enum | ACTIVE_GROUP_FIXED | Deprecated and changed to **FIXED_GROUP**. |
| bundleState.GroupType | enum | ACTIVE_GROUP_RARE | Deprecated and changed to **RARE_GROUP** | | bundleState.GroupType | enum | ACTIVE_GROUP_RARE | Deprecated and changed to **RARE_GROUP**. |
| bundleState.GroupType | enum | ACTIVE_GROUP_LIMIT | Deprecated and changed to **LIMITED_GROUP** | | bundleState.GroupType | enum | ACTIVE_GROUP_LIMIT | Deprecated and changed to **LIMITED_GROUP**. |
| bundleState.GroupType | enum | ACTIVE_GROUP_NEVER | Deprecated and changed to **NEVER_GROUP** | | bundleState.GroupType | enum | ACTIVE_GROUP_NEVER | Deprecated and changed to **NEVER_GROUP**. |
| bundleState.IntervalType | enum | enum IntervalType | Deprecated and migrated to **usageStatistics.IntervalType** | | bundleState.IntervalType | enum | enum IntervalType | Deprecated and moved to **usageStatistics.IntervalType**. |
| bundleState.IntervalType | enum | BY_OPTIMIZED | Deprecated and migrated to **usageStatistics.IntervalType** | | bundleState.IntervalType | enum | BY_OPTIMIZED | Deprecated and moved to **usageStatistics.IntervalType**. |
| bundleState.IntervalType | enum | BY_DAILY | Deprecated and migrated to **usageStatistics.IntervalType** | | bundleState.IntervalType | enum | BY_DAILY | Deprecated and moved to **usageStatistics.IntervalType**. |
| bundleState.IntervalType | enum | BY_WEEKLY | Deprecated and migrated to **usageStatistics.IntervalType** | | bundleState.IntervalType | enum | BY_WEEKLY | Deprecated and moved to **usageStatistics.IntervalType**. |
| bundleState.IntervalType | enum | BY_MONTHLY | Deprecated and migrated to **usageStatistics.IntervalType** | | bundleState.IntervalType | enum | BY_MONTHLY | Deprecated and moved to **usageStatistics.IntervalType**. |
| bundleState.IntervalType | enum | BY_ANNUALLY | Deprecated and migrated to **usageStatistics.IntervalType** | | bundleState.IntervalType | enum | BY_ANNUALLY | Deprecated and moved to **usageStatistics.IntervalType**. |
| bundleState.BundleActiveInfoResponse | interface | interface BundleActiveInfoResponse | Deprecated and changed to **usageStatistics.BundleStatsMap** | | bundleState.BundleActiveInfoResponse | interface | interface BundleActiveInfoResponse | Deprecated and changed to **usageStatistics.BundleStatsMap**. |
| bundleState.BundleActiveState | interface | interface BundleActiveState | Deprecated and changed to **usageStatistics.BundleEvents** | | bundleState.BundleActiveState | interface | interface BundleActiveState | Deprecated and changed to **usageStatistics.BundleEvents**. |
| bundleState.BundleActiveState | field | stateType?: number | Deprecated and changed to **eventId** | | bundleState.BundleActiveState | field | stateType?: number | Deprecated and changed to **eventId**. |
| bundleState.BundleActiveState | field | stateOccurredTime?: number | Deprecated and changed to **eventOccurredTime** | | bundleState.BundleActiveState | field | stateOccurredTime?: number | Deprecated and changed to **eventOccurredTime**. |
| bundleState.BundleActiveState | field | nameOfClass?: string | Deprecated and migrated to **usageStatistics.BundleEvents** | | bundleState.BundleActiveState | field | nameOfClass?: string | Deprecated and moved to **usageStatistics.BundleEvents**. |
| bundleState.BundleActiveState | field | indexOfLink?: string | Deprecated and migrated to **usageStatistics.BundleEvents** | | bundleState.BundleActiveState | field | indexOfLink?: string | Deprecated and moved to **usageStatistics.BundleEvents**. |
| bundleState.BundleActiveState | field | bundleName?: string | Deprecated and migrated to **usageStatistics.BundleEvents** | | bundleState.BundleActiveState | field | bundleName?: string | Deprecated and moved to **usageStatistics.BundleEvents**. |
| bundleState.BundleActiveState | field | appUsagePriorityGroup?: number | Deprecated and changed to **appGroup** | | bundleState.BundleActiveState | field | appUsagePriorityGroup?: number | Deprecated and changed to **appGroup**. |
| bundleState.BundleStateInfo | interface | interface BundleStateInfo | Deprecated and changed to **usageStatistics.BundleStatsInfo** | | bundleState.BundleStateInfo | interface | interface BundleStateInfo | Deprecated and changed to **usageStatistics.BundleStatsInfo**. |
| bundleState.BundleStateInfo | method | merge(toMerge: BundleStateInfo): void | Deprecated | | bundleState.BundleStateInfo | method | merge(toMerge: BundleStateInfo): void | Deprecated. |
| bundleState.BundleStateInfo | field | infosEndTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | | bundleState.BundleStateInfo | field | infosEndTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. |
| bundleState.BundleStateInfo | field | infosBeginTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | | bundleState.BundleStateInfo | field | infosBeginTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. |
| bundleState.BundleStateInfo | field | fgAbilityPrevAccessTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | | bundleState.BundleStateInfo | field | fgAbilityPrevAccessTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. |
| bundleState.BundleStateInfo | field | fgAbilityAccessTotalTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | | bundleState.BundleStateInfo | field | fgAbilityAccessTotalTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. |
| bundleState.BundleStateInfo | field | bundleName?: string | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | | bundleState.BundleStateInfo | field | bundleName?: string | Deprecated and moved to **usageStatistics.BundleStatsInfo**. |
| bundleState.BundleStateInfo | field | abilitySeenTotalTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | | bundleState.BundleStateInfo | field | abilitySeenTotalTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. |
| bundleState.BundleStateInfo | field | abilityPrevSeenTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | | bundleState.BundleStateInfo | field | abilityPrevSeenTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. |
| bundleState.BundleStateInfo | field | abilityPrevAccessTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | | bundleState.BundleStateInfo | field | abilityPrevAccessTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. |
| bundleState.BundleStateInfo | field | abilityInFgTotalTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | | bundleState.BundleStateInfo | field | abilityInFgTotalTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. |
| bundleState.BundleStateInfo | field | id: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | | bundleState.BundleStateInfo | field | id: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. |
| bundleState | namespace | declare namespace bundleState | Deprecated and changed to **usageStatistics**, and migrated to **ohos.resourceschedule.usageStatistics.d.ts**| | bundleState | namespace | declare namespace bundleState | Deprecated and changed to **usageStatistics**, and moved to **ohos.resourceschedule.usageStatistics.d.ts**.|
**Adaptation Guide**<br> **Adaptation Guide**
Import the **usageStatistics** module. Import the **usageStatistics** module.
``` ```
...@@ -172,70 +170,69 @@ import bundle form '@ohos.resourceschedule.usageStatistics' ...@@ -172,70 +170,69 @@ import bundle form '@ohos.resourceschedule.usageStatistics'
Exception handling also needs to be adapted. For details, see the [usageStatistics API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md). Exception handling also needs to be adapted. For details, see the [usageStatistics API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md).
## c3.resourceschedule.workScheduler ## c3.resourceschedule.workScheduler
Rectified original APIs of **workScheduler** of the resource scheduler subsystem. The original APIs in API version 9 are changed to new APIs in API version 9. The new APIs in API version 9 comply with the error code specifications. Rectified original APIs of **workScheduler** of the resource scheduler subsystem. The original APIs in API version 9 are changed to new APIs in API version 9. The new APIs in API version 9 comply with the error code specifications.
**Change Impacts** **Change Impact**
The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected.
**Key API/Component Changes** **Key API/Component Changes**
The following methods, attributes, enumerations, and constants are changed in API version 9 and later versions. The **@ohos.workScheduler.d.ts** file is deprecated and related APIs are migrated to the newly added **@ohos.resourceschedule.workScheduler.d.ts** file. The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.workScheduler.d.ts** file is deprecated and related APIs are moved to the newly added **@ohos.resourceschedule.workScheduler.d.ts** file.
| Class| API Type| Declaration| Change Type| | Class| API Type| Declaration| Change Type|
| -- | -- | -- | -- | | -- | -- | -- | -- |
| workScheduler | namespace | declare namespace workScheduler | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler | namespace | declare namespace workScheduler | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | interface | export interface WorkInfo | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | interface | export interface WorkInfo | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | idleWaitTime?: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | idleWaitTime?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | isDeepIdle?: boolean | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | isDeepIdle?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | repeatCount?: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | repeatCount?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | isRepeat?: boolean | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | isRepeat?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | repeatCycleTime?: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | repeatCycleTime?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | storageRequest?: StorageRequest | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | storageRequest?: StorageRequest | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | batteryStatus?: BatteryStatus | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | batteryStatus?: BatteryStatus | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | batteryLevel?: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | batteryLevel?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | chargerType?: ChargingType | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | chargerType?: ChargingType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | isCharging?: boolean | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | isCharging?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | networkType?: NetworkType | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | networkType?: NetworkType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | isPersisted?: boolean | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | isPersisted?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | abilityName: string | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | abilityName: string | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | bundleName: string | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | bundleName: string | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | workId: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.WorkInfo | field | workId: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function isLastWorkTimeOut(workId: number): Promise; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler | method | function isLastWorkTimeOut(workId: number): Promise; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function isLastWorkTimeOut(workId: number, callback: AsyncCallback<void>): boolean; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler | method | function isLastWorkTimeOut(workId: number, callback: AsyncCallback<void>): boolean; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function stopAndClearWorks(): boolean; | Changed in API version 8 to **function stopAndClearWorks(): boolean;** and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler | method | function stopAndClearWorks(): boolean; | Changed in API version 8 to **function stopAndClearWorks(): boolean;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function obtainAllWorks(): Promise<Array<WorkInfo>>; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler | method | function obtainAllWorks(): Promise<Array<WorkInfo>>; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function obtainAllWorks(callback: AsyncCallback<void>): Array<WorkInfo>; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler | method | function obtainAllWorks(callback: AsyncCallback<void>): Array<WorkInfo>; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function getWorkStatus(workId: number): Promise<WorkInfo>; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler | method | function getWorkStatus(workId: number): Promise<WorkInfo>; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback<WorkInfo>): void; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback<WorkInfo>): void; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function stopWork(work: WorkInfo, needCancel?: boolean): boolean; | Changed in API version 8 to **function stopWork(work: WorkInfo, needCancel?: boolean): void;** and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler | method | function stopWork(work: WorkInfo, needCancel?: boolean): boolean; | Changed in API version 8 to **function stopWork(work: WorkInfo, needCancel?: boolean): void;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function startWork(work: WorkInfo): boolean; | Changed in API version 9 to **function startWork(work: WorkInfo): void;** and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler | method | function startWork(work: WorkInfo): boolean; | Changed in API version 9 to **function startWork(work: WorkInfo): void;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.NetworkType | enum | export enum NetworkType | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.NetworkType | enum | export enum NetworkType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.NetworkType | enum | NETWORK_TYPE_ANY = 0 | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.NetworkType | enum | NETWORK_TYPE_ANY = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.NetworkType | enum | NETWORK_TYPE_MOBILE | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.NetworkType | enum | NETWORK_TYPE_MOBILE | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.NetworkType | enum | NETWORK_TYPE_BLUETOOTH | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.NetworkType | enum | NETWORK_TYPE_BLUETOOTH | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI_P2P | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI_P2P | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.NetworkType | enum | NETWORK_TYPE_ETHERNET | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.NetworkType | enum | NETWORK_TYPE_ETHERNET | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.ChargingType | enum | export enum ChargingType | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.ChargingType | enum | export enum ChargingType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_ANY = 0 | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.ChargingType | enum | CHARGING_PLUGGED_ANY = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_AC | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.ChargingType | enum | CHARGING_PLUGGED_AC | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_USB | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.ChargingType | enum | CHARGING_PLUGGED_USB | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_WIRELESS | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.ChargingType | enum | CHARGING_PLUGGED_WIRELESS | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | export enum BatteryStatus | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.BatteryStatus | enum | export enum BatteryStatus | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW = 0 | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | BATTERY_STATUS_OKAY | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.BatteryStatus | enum | BATTERY_STATUS_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW_OR_OKAY | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW_OR_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.StorageRequest | enum | export enum StorageRequest | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.StorageRequest | enum | export enum StorageRequest | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW = 0 | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_OKAY | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.BatteryStatus | enum | STORAGE_LEVEL_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW_OR_OKAY | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| | workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW_OR_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
**Adaptation Guide**<br> **Adaptation Guide**
Import the **workScheduler** module. Import the **workScheduler** module.
``` ```
...@@ -245,71 +242,70 @@ Exception handling also needs to be adapted. For details, see the [workScheduler ...@@ -245,71 +242,70 @@ Exception handling also needs to be adapted. For details, see the [workScheduler
## c4.resourceschedule.reminderAgent ## c4.resourceschedule.reminderAgent
Rectified original APIs of **reminderAgent** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. Rectified original APIs of **reminderAgent** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications.
**Change Impacts** **Change Impact**
The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected.
**Key API/Component Changes** **Key API/Component Changes**
The following methods, attributes, enumerations, and constants are changed in API version 9 and later versions. The **@ohos.reminderAgent.d.ts** file is deprecated, the **@ohos.reminderAgentManager.d.ts** file is added, and the class name is changed from **reminderAgent** to **reminderAgentManager**. The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.reminderAgent.d.ts** file is deprecated, the **@ohos.reminderAgentManager.d.ts** file is added, and the class name is changed from **reminderAgent** to **reminderAgentManager**.
| Class | API Type | Method/Attribute/Enumeration/Constant | Change Type | | Class | API Type | Method/Attribute/Enum/Constant | Change Type |
| --------------------- | ----------- | ------------------------------------------------------------ | ------------------------------------------------------------ | | --------------------- | ----------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| reminderAgent | method | publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void; | Deprecated and migrated to **reminderAgentManager**| | reminderAgent | method | publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void; | Deprecated and moved to **reminderAgentManager**.|
| reminderAgent | method | publishReminder(reminderReq: ReminderRequest): Promise<number>; | Deprecated and migrated to **reminderAgentManager**| | reminderAgent | method | publishReminder(reminderReq: ReminderRequest): Promise<number>; | Deprecated and moved to **reminderAgentManager**.|
| reminderAgent | method | cancelReminder(reminderId: number, callback: AsyncCallback<void>): void; | Deprecated and migrated to **reminderAgentManager**| | reminderAgent | method | cancelReminder(reminderId: number, callback: AsyncCallback<void>): void; | Deprecated and moved to **reminderAgentManager**.|
| reminderAgent | method | cancelReminder(reminderId: number): Promise<void>; | Deprecated and migrated to **reminderAgentManager**| | reminderAgent | method | cancelReminder(reminderId: number): Promise<void>; | Deprecated and moved to **reminderAgentManager**.|
| reminderAgent | method | getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void; | Deprecated and migrated to **reminderAgentManager**| | reminderAgent | method | getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void; | Deprecated and moved to **reminderAgentManager**.|
| reminderAgent | method | getValidReminders(): Promise<Array<ReminderRequest>>; | Deprecated and migrated to **reminderAgentManager**| | reminderAgent | method | getValidReminders(): Promise<Array<ReminderRequest>>; | Deprecated and moved to **reminderAgentManager**.|
| reminderAgent | method | cancelAllReminders(callback: AsyncCallback<void>): void; | Deprecated and migrated to **reminderAgentManager**| | reminderAgent | method | cancelAllReminders(callback: AsyncCallback<void>): void; | Deprecated and moved to **reminderAgentManager**.|
| reminderAgent | method | cancelAllReminders(): Promise<void>; | Deprecated and migrated to **reminderAgentManager**| | reminderAgent | method | cancelAllReminders(): Promise<void>; | Deprecated and moved to **reminderAgentManager**.|
| reminderAgent | method | addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void; | Deprecated and migrated to **reminderAgentManager**| | reminderAgent | method | addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void; | Deprecated and moved to **reminderAgentManager**.|
| reminderAgent | method | addNotificationSlot(slot: NotificationSlot): Promise<void>; | Deprecated and migrated to **reminderAgentManager**| | reminderAgent | method | addNotificationSlot(slot: NotificationSlot): Promise<void>; | Deprecated and moved to **reminderAgentManager**.|
| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback<void>): void; | Deprecated and migrated to **reminderAgentManager**| | reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback<void>): void; | Deprecated and moved to **reminderAgentManager**.|
| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType): Promise<void>; | Deprecated and migrated to **reminderAgentManager**| | reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType): Promise<void>; | Deprecated and moved to **reminderAgentManager**.|
| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_CLOSE | Deprecated and migrated to **reminderAgentManager.ActionButtonType**| | reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_CLOSE | Deprecated and moved to **reminderAgentManager.ActionButtonType**.|
| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_SNOOZE | Deprecated and migrated to **reminderAgentManager.ActionButtonType**| | reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_SNOOZE | Deprecated and moved to **reminderAgentManager.ActionButtonType**.|
| reminderAgent.ReminderType | enum | REMINDER_TYPE_TIMER | Deprecated and migrated to **reminderAgentManager.ReminderType**| | reminderAgent.ReminderType | enum | REMINDER_TYPE_TIMER | Deprecated and moved to **reminderAgentManager.ReminderType**.|
| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and migrated to **reminderAgentManager.ReminderType**| | reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and moved to **reminderAgentManager.ReminderType**.|
| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and migrated to **reminderAgentManager.ReminderType**| | reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and moved to **reminderAgentManager.ReminderType**.|
| reminderAgent.ActionButton | field | title:string | Deprecated and migrated to **reminderAgentManager.ActionButton**| | reminderAgent.ActionButton | field | title:string | Deprecated and moved to **reminderAgentManager.ActionButton**.|
| reminderAgent.ActionButton | field | type:ActionButtonType | Deprecated and migrated to **reminderAgentManager.ActionButton**| | reminderAgent.ActionButton | field | type:ActionButtonType | Deprecated and moved to **reminderAgentManager.ActionButton**.|
| reminderAgent.WantAgent | field | pkgName:string | Deprecated and migrated to **reminderAgentManager.WantAgent**| | reminderAgent.WantAgent | field | pkgName:string | Deprecated and moved to **reminderAgentManager.WantAgent**.|
| reminderAgent.WantAgent | field | abilityName:string | Deprecated and migrated to **reminderAgentManager.WantAgent**| | reminderAgent.WantAgent | field | abilityName:string | Deprecated and moved to **reminderAgentManager.WantAgent**.|
| reminderAgent.MaxScreenWantAgent | field | pkgName:string | Deprecated and migrated to **reminderAgentManager.MaxScreenWantAgent**| | reminderAgent.MaxScreenWantAgent | field | pkgName:string | Deprecated and moved to **reminderAgentManager.MaxScreenWantAgent**.|
| reminderAgent.MaxScreenWantAgent | field | abilityName:string | Deprecated and migrated to **reminderAgentManager.MaxScreenWantAgent**| | reminderAgent.MaxScreenWantAgent | field | abilityName:string | Deprecated and moved to **reminderAgentManager.MaxScreenWantAgent**.|
| reminderAgent.ReminderRequest | field | reminderType:ReminderType | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| | reminderAgent.ReminderRequest | field | reminderType:ReminderType | Deprecated and moved to **reminderAgentManager.ReminderRequest**.|
| reminderAgent.ReminderRequest | field | actionButton?:ActionButton | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| | reminderAgent.ReminderRequest | field | actionButton?:ActionButton | Deprecated and moved to **reminderAgentManager.ReminderRequest**.|
| reminderAgent.ReminderRequest | field | wantAgent?:WantAgent | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| | reminderAgent.ReminderRequest | field | wantAgent?:WantAgent | Deprecated and moved to **reminderAgentManager.ReminderRequest**.|
| reminderAgent.ReminderRequest | field | maxScreenWantAgent?:MaxScreenWantAgent | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| | reminderAgent.ReminderRequest | field | maxScreenWantAgent?:MaxScreenWantAgent | Deprecated and moved to **reminderAgentManager.ReminderRequest**.|
| reminderAgent.ReminderRequest | field | ringDuration?:number | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| | reminderAgent.ReminderRequest | field | ringDuration?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.|
| reminderAgent.ReminderRequest | field | snoozeTimes?:number | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| | reminderAgent.ReminderRequest | field | snoozeTimes?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.|
| reminderAgent.ReminderRequest | field | timeInterval?:number | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| | reminderAgent.ReminderRequest | field | timeInterval?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.|
| reminderAgent.ReminderRequest | field | title?:string | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| | reminderAgent.ReminderRequest | field | title?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.|
| reminderAgent.ReminderRequest | field | content?:string | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| | reminderAgent.ReminderRequest | field | content?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.|
| reminderAgent.ReminderRequest | field | expiredContent?:string | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| | reminderAgent.ReminderRequest | field | expiredContent?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.|
| reminderAgent.ReminderRequest | field | snoozeContent?:string | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| | reminderAgent.ReminderRequest | field | snoozeContent?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.|
| reminderAgent.ReminderRequest | field | notificationId?:number | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| | reminderAgent.ReminderRequest | field | notificationId?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.|
| reminderAgent.ReminderRequest | field | slotType?: notification.SlotType | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| | reminderAgent.ReminderRequest | field | slotType?: notification.SlotType | Deprecated and moved to **reminderAgentManager.ReminderRequest**.|
| reminderAgent.ReminderRequestCalendar | field | dateTime:LocalDateTime | Deprecated and migrated to **reminderAgentManager.ReminderRequestCalendar**| | reminderAgent.ReminderRequestCalendar | field | dateTime:LocalDateTime | Deprecated and moved to **reminderAgentManager.ReminderRequestCalendar**.|
| reminderAgent.ReminderRequestCalendar | field | repeatMonths?:Array<number> | Deprecated and migrated to **reminderAgentManager.ReminderRequestCalendar**| | reminderAgent.ReminderRequestCalendar | field | repeatMonths?:Array<number> | Deprecated and moved to **reminderAgentManager.ReminderRequestCalendar**.|
| reminderAgent.ReminderRequestCalendar | field | repeatDays?:Array<number> | Deprecated and migrated to **reminderAgentManager.ReminderRequestCalendar**| | reminderAgent.ReminderRequestCalendar | field | repeatDays?:Array<number> | Deprecated and moved to **reminderAgentManager.ReminderRequestCalendar**.|
| reminderAgent.ReminderRequestAlarm | field | hour:number | Deprecated and migrated to **reminderAgentManager.ReminderRequestAlarm**| | reminderAgent.ReminderRequestAlarm | field | hour:number | Deprecated and moved to **reminderAgentManager.ReminderRequestAlarm**.|
| reminderAgent.ReminderRequestAlarm | field | minute:number | Deprecated and migrated to **reminderAgentManager.ReminderRequestAlarm**| | reminderAgent.ReminderRequestAlarm | field | minute:number | Deprecated and moved to **reminderAgentManager.ReminderRequestAlarm**.|
| reminderAgent.ReminderRequestAlarm | field | daysOfWeek?:Array<number> | Deprecated and migrated to **reminderAgentManager.ReminderRequestAlarm**| | reminderAgent.ReminderRequestAlarm | field | daysOfWeek?:Array<number> | Deprecated and moved to **reminderAgentManager.ReminderRequestAlarm**.|
| reminderAgent.ReminderRequestTimer | field | triggerTimeInSeconds:number | Deprecated and migrated to **reminderAgentManager.ReminderRequestTimer**| | reminderAgent.ReminderRequestTimer | field | triggerTimeInSeconds:number | Deprecated and moved to **reminderAgentManager.ReminderRequestTimer**.|
| reminderAgent.LocalDateTime | field | year:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| | reminderAgent.LocalDateTime | field | year:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.|
| reminderAgent.LocalDateTime | field | month:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| | reminderAgent.LocalDateTime | field | month:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.|
| reminderAgent.LocalDateTime | field | day:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| | reminderAgent.LocalDateTime | field | day:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.|
| reminderAgent.LocalDateTime | field | hour:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| | reminderAgent.LocalDateTime | field | hour:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.|
| reminderAgent.LocalDateTime | field | minute:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| | reminderAgent.LocalDateTime | field | minute:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.|
| reminderAgent.LocalDateTime | field | second?:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| | reminderAgent.LocalDateTime | field | second?:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.|
**Adaptation Guide**<br> **Adaptation Guide**
Import the **reminderAgentManager** module. Import the **reminderAgentManager** module.
``` ```
......
...@@ -4,17 +4,21 @@ ...@@ -4,17 +4,21 @@
## cl.telephony.1 Input Parameter Change of System APIs of the SMS Module ## cl.telephony.1 Input Parameter Change of System APIs of the SMS Module
Input parameters are changed for some released system APIs of the SMS module of the telephony subsystem, which do not comply with the API specifications of OpenHarmony. The following changes are made in API version 9 and later: Input parameters are changed for some released system APIs of the SMS module of the telephony subsystem, leading to noncompliance with the API specifications of OpenHarmony. The following changes are made in API version 9 and later:
The **slotId** parameter is added to the **isImsSmsSupported** API, indicating the slot ID. The **slotId** parameter is added to the **isImsSmsSupported** API, indicating the slot ID.
**Change Impacts**
Input parameters of JavaScript APIs need to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
**Change Impact**
Input parameters of JS APIs need to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
**Key API/Component Changes** **Key API/Component Changes**
- Involved APIs - Involved APIs:
isImsSmsSupported(callback: AsyncCallback<boolean>): void; isImsSmsSupported(callback: AsyncCallback<boolean>): void;
isImsSmsSupported(): Promise<boolean>; isImsSmsSupported(): Promise<boolean>;
...@@ -33,6 +37,8 @@ function isImsSmsSupported(slotId: number, callback: AsyncCallback<boolean>): vo ...@@ -33,6 +37,8 @@ function isImsSmsSupported(slotId: number, callback: AsyncCallback<boolean>): vo
function isImsSmsSupported(slotId: number): Promise<boolean>; function isImsSmsSupported(slotId: number): Promise<boolean>;
``` ```
**Adaptation Guide** **Adaptation Guide**
Add an input parameter. The sample code is as follows: Add an input parameter. The sample code is as follows:
...@@ -56,4 +62,4 @@ promise.then(data => { ...@@ -56,4 +62,4 @@ promise.then(data => {
}).catch(err => { }).catch(err => {
console.error(`isImsSmsSupported failed, promise: err->${JSON.stringify(err)}`); console.error(`isImsSmsSupported failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
## cl.testfwk_arkxtest.1 Exception Handling Support of On, Driver, and Component APIs ## cl.testfwk_arkxtest.1 Exception Handling Support of On, Driver, and Component APIs
The original APIs in API version 8 are deprecated, and substitute APIs that support exception handling are introduced in API version 9. You must use **try catch** to capture exceptions thrown by the APIs. Deprecated the original APIs in API version 8, and introduced substitute APIs that support exception handling in API version 9. You must use **try catch** to capture exceptions thrown by the APIs.
## Change Impacts ## Change Impacts
...@@ -17,25 +17,25 @@ This change affects the JS APIs in API version 9 provided by **@ohos.uitest**. I ...@@ -17,25 +17,25 @@ This change affects the JS APIs in API version 9 provided by **@ohos.uitest**. I
## Adaptation Guide ## Adaptation Guide
1. Adapt to the API name changes. ### 1. Adapt to the API name changes.
You can replace the class name according to the following rules: You can replace the class name according to the following rules:
- `By-->On` - `By-->On`
- `BY-->ON` - `BY-->ON`
- `UiDriver-->Driver` - `UiDriver-->Driver`
- `UiComponent-->Component` - `UiComponent-->Component`
2. Catch and handle exceptions. ### 2. Catch and handle exceptions.
Use **try-catch** to catch and handle exceptions thrown by the APIs. Below is the sample code: Use **try-catch** to catch and handle exceptions thrown by the APIs. Below is the sample code:
```typescript ```typescript
import {Driver,ON,Component} from '@ohos.uitest' import {Driver,ON,Component} from '@ohos.uitest'
try { try {
let driver = Driver.create(); let driver = Driver.create();
} catch (error) { } catch (error) {
// error handle; error.code indicates the error code. // error handle; error.code indicates the error code.
} }
``` ```
\ No newline at end of file
# User IAM Subsystem ChangeLog # User IAM Subsystem Changelog
## cl.useriam.1 API Exception Handling Method Change ## cl.useriam.1 API Exception Handling Change in APIs
Certain APIs of user IAM use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. The following changes are made in API version 9 and later: 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 via an exception. An error message is returned by throwing an exception.
**Change Impacts** **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 the error information. Otherwise, service logic will be affected. 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** **Key API/Component Changes**
For adaptation to the unified API exception handling mode, certain APIs of user IAM are deprecated (original APIs in the following table) and corresponding new APIs in the following table are added. The newly added APIs support unified error code handling specifications and function the same as the original APIs. For easy use, related user IAM APIs are deprecated, and new APIs are added to implement unified error code handling. The functionalities of these APIs remain unchanged.
| Module | Class | Method/Attribute/Enumeration/Constant | Change Type | | Module | Class | Method/Attribute/Enum/Constant | Change Type |
| ---------------------- | ------------------- | ------------------------- | ------------------------ | | ---------------------- | ------------------- | ------------------------- | ------------------------ |
| ohos.userIAM.userAuth | UserAuth | constructor() | Deprecated| | ohos.userIAM.userAuth | UserAuth | constructor() | Deprecated|
| ohos.userIAM.userAuth | UserAuth | getVersion() : number | Deprecated| | ohos.userIAM.userAuth | UserAuth | getVersion() : number | Deprecated|
...@@ -24,18 +24,18 @@ For adaptation to the unified API exception handling mode, certain APIs of user ...@@ -24,18 +24,18 @@ For adaptation to the unified API exception handling mode, certain APIs of user
| ohos.userIAM.userAuth | IUserAuthCallback | onResult: (result : number, extraInfo : AuthResult) => void | 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 | 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 | AuthResult | AuthResult {<br>token ?: Uint8Array; <br>remainTimes ?: number; <br>freezingTime ?: number;} | Deprecated|
| ohos.userIAM.userAuth | Enumeration| 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 | 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 | AuthEventKey = "result" | Added|
| ohos.userIAM.userAuth | type | EventInfo = AuthResultInfo | 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 | 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 | 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 | AuthInstance | AuthInstance {<br>on: (name: AuthEventKey, callback: AuthEvent) => void; <br>off: (name: AuthEventKey) => void; <br>start: () => void; <br>cancel: () => void;} | Added|
| ohos.userIAM.userAuth | Enumeration| 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 | 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 | getAuthInstance(challenge : Uint8Array, authType : UserAuthType, authTrustLevel : AuthTrustLevel) : AuthInstance | Added|
| ohos.userIAM.userAuth | function | getVersion() : number | Added| | ohos.userIAM.userAuth | function | getVersion() : number | Added|
| ohos.userIAM.userAuth | function | getAvailableStatus(authType : UserAuthType, authTrustLevel : AuthTrustLevel) : void | Added| | ohos.userIAM.userAuth | function | getAvailableStatus(authType : UserAuthType, authTrustLevel : AuthTrustLevel) : void | Added|
| ohos.userIAM.faceAuth | FaceAuthManager | setSurfaceId(surfaceId : string) : ResultCode | Deleted| | ohos.userIAM.faceAuth | FaceAuthManager | setSurfaceId(surfaceId : string) : ResultCode | Deleted|
| ohos.userIAM.faceAuth | Enumeration| ResultCode {<br>SUCCESS = 0, <br>FAIL = 1,} | Deleted| | ohos.userIAM.faceAuth | Enum| ResultCode {<br>SUCCESS = 0, <br>FAIL = 1,} | Deleted|
| ohos.userIAM.faceAuth | FaceAuthManager | setSurfaceId(surfaceId: string) : void | Added| | ohos.userIAM.faceAuth | FaceAuthManager | setSurfaceId(surfaceId: string) : void | Added|
**Adaptation Guide** **Adaptation Guide**
...@@ -53,22 +53,22 @@ try { ...@@ -53,22 +53,22 @@ try {
} }
``` ```
For sample code of more APIs, see the [user authentication API reference](../../../application-dev/reference/apis/js-apis-useriam-userauth.md) and [face authentication API reference](../../../application-dev/reference/apis/js-apis-useriam-faceauth.md). 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 Call Permission Change ## cl.useriam.2 API Invoking Permission Change
Some APIs of user IAM can only be called by system applications, and system application runtime authentication is required. The following changes are made in API version 9 and later: 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:
The service logic for checking whether an application is a system application is added for the **setSurfaceId** API of the face authentication module. Non-system applications cannot call this API. 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 Impacts** **Change Impact**
Applications developed based on earlier versions are not affected. If your application uses API version 9 or later and wants to call this API, your application must be a system application. Applications developed based on earlier versions are not affected.
**Key API/Component Changes** **Key API/Component Changes**
The service logic for checking whether an application is a system application is added for the **setSurfaceId** API. Error code **202** will be returned if the API is called by a non-system application. 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** **Adaptation Guide**
Modify the **UnsgnedReleasedProfileTemplate.json** file related to [app signing](https://gitee.com/openharmony/developtools_hapsigner/tree/master/dist) to change the **app-feature** field to **hos_system_app**, so that the signed application is a system application. 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.
# ChangeLog of JS API Changes in the WantAgent # WantAgent JS API Changelog
This document describes the WantAgent API changes in OpenHarmony 3.2.9.1 SP8 when compared with OpenHarmony 3.2.8.1.
## cl.url.1 Trigger API Changes ## cl.url.1 Trigger API Changes
trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback<CompleteData>): void ; trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback<CompleteData>): void ;
...@@ -9,7 +7,7 @@ This API has been deleted, because some functions have not been implemented. You ...@@ -9,7 +7,7 @@ This API has been deleted, because some functions have not been implemented. You
trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback<CompleteData>): void trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback<CompleteData>): void
**Change Impacts** **Change Impact**
Released JS APIs are affected. The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. Released JS APIs are affected. The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
...@@ -71,7 +69,7 @@ function getWantAgentCallback(err, data) { ...@@ -71,7 +69,7 @@ function getWantAgentCallback(err, data) {
// getUid callback // getUid callback
function triggerCallback(err, data) { function triggerCallback(err, data) {
if(err) { if(err) {
console.info('getUid failed!' + err.code + err.message); console.info('getUid failed!' + JSON.stringify(err.code) + JSON.stringify(err.message));
} else { } else {
console.info('getUid ok!' + JSON.stringify(data)); console.info('getUid ok!' + JSON.stringify(data));
} }
...@@ -79,12 +77,12 @@ function getWantAgentCallback(err, data) { ...@@ -79,12 +77,12 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.trigger(wantAgent, triggerInfo, triggerCallback); WantAgent.trigger(wantAgent, triggerInfo, triggerCallback);
} catch(err) { } catch(err) {
console.info('getUid failed!' + err.code + err.message); console.info('getUid failed!' + JSON.stringify(err.code) + JSON.stringify(err.message));
} }
} }
try{ try{
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err){ } catch(err){
console.info('getWantAgent failed!' + err.code + err.message); console.info('getWantAgent failed!' + JSON.stringify(err.code) + JSON.stringify(err.message));
} }
``` ```
# Web Subsystem ChangeLog # Web Subsystem ChangeLog
This document describes the web API changes in OpenHarmony 3.2.9.1 SP8 when compared with OpenHarmony 3.2.8.1.
## cl.web.1 Deletion of Unnecessary Error Codes ## cl.web.1 Deletion of Unnecessary Error Codes
APIs in the webviewController component of the web subsystem are changed: APIs in the webviewController component of the web subsystem are changed:
......
# Wi-Fi Subsystem Changelog
## cl.wifi.1 Change of System APIs and APIs of Version 9
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 description. 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|
| 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**|
**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 description.
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
- [Ability framework](changelogs-ability.md)
- [Account subsystem](changelogs-account_os_account.md)
- [ArkUI development framework](changelogs-arkui.md)
- [Multimedia subsystem - camera](changelogs-camera-sync.md)
- [Common library subsystem - container](changelogs-container.md)
- [Distributed data management](changelogs-distributeddatamgr.md)
- [File management subsystem](changelogs-filemanagement.md)
- [Input method framework](changelogs-inputmethod-framworks.md)
- [File management subsystem - MediaLibrary](changelogs-mediaLibrary.md)
- [Multimedia subsystem](changelogs-multimedia.md)
- [Communication subsystem - NFC](changelogs-nfc.md)
- [Common event and notification subsystem](changelogs-notification.md)
- Location subsystem
- [ohos.geoLocationManager](changelogs-ohos-geoLocationManager.md)
- [ohos.geoLocation](changelogs-ohos-geolocation.md)
- [system.geolocation](changelogs-system-geolocation.md)
- [Upload and download](changelogs-request.md)
- [Resource scheduler subsystem](changelogs-resourceschedule.md)
- [Security subsystem](changelogs-security.md)
- [Telephony subsystem](changelogs-telephony.md)
- [Time service](changelogs-time.md)
- [Common library subsystem - URL](changelogs-url.md)
- [User IAM subsystem](changelogs-useriam.md)
- [Window manager subsystem](changelogs-window.md)
# *Example* Subsystem ChangeLog # *Example* Subsystem Changelog
Changes that affect contract compatibility of the last version should be described in the ChangeLog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions. Changes that affect contract compatibility of the last version should be described in the changelog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions.
## cl.subsystemname.x xxx Function Change (Example: DeviceType Attribute Change or Camera Permission Change. Use a short description.) ## cl.subsystemname.x xxx Function Change (Example: DeviceType Attribute Change or Camera Permission Change. Use a short description.)
Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of ChangeLog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order). Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of changelog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order).
Describe the changes in terms of functions. Example: *n* and *m* of the *a* function are changed. Developers need to adapt their applications based on the change description. Describe the changes in terms of functions. Example: *n* and *m* of the *a* function are changed. Developers need to adapt their applications based on the change description.
If there is a requirement or design document corresponding to the change, attach the requirement number or design document number in the description. If there is a requirement or design document corresponding to the change, attach the requirement number or design document number in the description.
**Change Impacts** **Change Impact**
Describe whether released APIs (JS or native APIs) are affected or API behavior is changed. Describe whether released APIs (JS or native APIs) are affected or API behavior is changed.
Describe whether available applications are affected, that is, whether an adaptation is required for building the application code in the SDK environment of the new version. Describe whether available applications are affected, that is, whether an adaptation is required for building the application code in the SDK environment of the new version.
**Key API/Component Changes** **Key API/Component Changes**
List the API/component changes involved in the function change. List the API/component changes involved in the function change.
**Adaptation Guide (Optional)** **Adaptation Guide**
Provide guidance for developers on how to adapt their application to the changes to be compatible with the new version. Provide guidance for developers on how to adapt their application to the changes to be compatible with the new version.
Example: Example:
Change parameter *n* to *m* in the *a* file. Change parameter *n* to *m* in the *a* file.
``` ```
......
# Ability Subsystem Changelog # Ability Framework Changelog
Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(MR) has the following API changes in the ability subsystem:
## cl.ability.1 API Migration ## cl.ability.1 API Migration
The **requestPermissionsFromUser** API of **UIAbilityContext** is migrated from the ability subsystem to the security subsystem. The **requestPermissionsFromUser** API of **UIAbilityContext** is migrated from the ability subsystem to the security subsystem.
Previously, the permission popup was implemented based on **UIAbility**, which used the **startAbilityForResult** API of **UIAbilityContext** to return the permission authorization result to the caller. Therefore, **requestPermissionsFromUser** was temporarily placed in **UIAbilityContext**. The permission popup is now implemented based on **ServiceExtensionAbility**, which no longer requires **startAbilityForResult** of **UIAbilityContext**. Therefore, **requestPermissionsFromUser** is migrated to the security subsystem. Previously, the permission popup was implemented based on **UIAbility**, which used the **startAbilityForResult** API of **UIAbilityContext** to return the permission authorization result to the caller. Therefore, **requestPermissionsFromUser** was temporarily placed in **UIAbilityContext**. The permission popup is now implemented based on **ServiceExtensionAbility**, which no longer requires **startAbilityForResult** of **UIAbilityContext**. Therefore, **requestPermissionsFromUser** is migrated to the security subsystem.
You need to adapt your application. You need to adapt your application based on the following information.
**Change Impact** **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. 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.
...@@ -50,7 +48,7 @@ onWindowStageCreate() { ...@@ -50,7 +48,7 @@ onWindowStageCreate() {
## cl.ability.2 Deletion of Deprecated APIs in API Version 9 ## cl.ability.2 Deletion of Deprecated APIs in API Version 9
In the [Ability Exception Rectification](../OpenHarmony_3.2.8.3/changelogs-ability.md) document, some APIs in API version 9 have been marked as deprecated. According to API specifications of OpenHarmony, these APIs should be deleted. In the **Ability Exception Rectification** document, some APIs in API version 9 have been marked as deprecated. According to API specifications of OpenHarmony, these APIs should be deleted.
**Change Impact** **Change Impact**
...@@ -112,10 +110,6 @@ APIs or attributes are deleted: ...@@ -112,10 +110,6 @@ APIs or attributes are deleted:
- @ohos.wantAgent.d.ts - @ohos.wantAgent.d.ts
- **TriggerInfo** and **WantAgentInfo** are deleted. Use the classes with the same name in **@ohos.app.ability.wantAgent.d.ts**. - **TriggerInfo** and **WantAgentInfo** are deleted. Use the classes with the same name in **@ohos.app.ability.wantAgent.d.ts**.
**Adaptation Guide** **Adaptation Guide**
As mentioned above, only several APIs have their names changed in terms of, for example, the registration callbacks (**registerAbilityLifecycleCallback**, **unregisterAbilityLifecycleCallback**, **registerEnvironmentCallback**, and **unregisterEnvironmentCallback**) and connection and disconnection **ServiceExtensionAbility** (**connectAbility**, **connectAbilityWithAccount**, and **disconnectAbility**). For such APIs, replace their names with those of their corresponding new APIs in the lifecycle callbacks. As mentioned above, only several APIs have their names changed in terms of, for example, the registration callbacks (**registerAbilityLifecycleCallback**, **unregisterAbilityLifecycleCallback**, **registerEnvironmentCallback**, and **unregisterEnvironmentCallback**) and connection and disconnection **ServiceExtensionAbility** (**connectAbility**, **connectAbilityWithAccount**, and **disconnectAbility**). For such APIs, replace their names with those of their corresponding new APIs in the lifecycle callbacks.
...@@ -135,3 +129,40 @@ import Ability from '@ohos.app.ability.UIAbility'; ...@@ -135,3 +129,40 @@ import Ability from '@ohos.app.ability.UIAbility';
``` ```
In addition, exception handling is needed. For details, see the API reference for the new APIs. In addition, exception handling is needed. For details, see the API reference for the new APIs.
## cl.ability.3 RestartFlag Attribute Names Changed and Unsupported Attribute Deleted in appRecovery
In the **appRecovery** API, the enum names of **RestartFlag** are changed from **NO_RESTART** upon a specific fault to **RESTART** upon a specific fault.
The **CPP_CRASH_NO_RESTART** enum is deleted.
**Change Impact**
If your application uses the **CPP_CRASH_NO_RESTART**, **JS_CRASH_NO_RESTART**, or **APP_FREEZE_NO_RESTART** attribute in versions earlier than 3.2.10.6, its behavior will change after an upgrade to 3.2.10.6.
**Key API/Component Changes**
**RestartFlag** <sup>9+</sup>
Before change
| Name | Value | Description |
| --------------------- | ------ | -------------------------------- |
| ALWAYS_RESTART | 0 | The application is restarted in all cases. |
| CPP_CRASH_NO_RESTART | 0x0001 | The application is **not restarted** in the case of CPP_CRASH. |
| JS_CRASH_NO_RESTART | 0x0002 | The application is **not restarted** in the case of JS_CRASH. |
| APP_FREEZE_NO_RESTART | 0x0004 | The application is **not restarted** in the case of APP_FREEZE.|
| NO_RESTART | 0xFFFF | The application is not restarted in any case. |
After change
| Name | Value | Description |
| ----------------------- | ------ | ------------------------------ |
| ALWAYS_RESTART | 0 | The application is restarted in all cases. |
| CPP_CRASH_NO_RESTART | NA | **Deleted.** The restart in this scenario is not supported.|
| RESTART_WHEN_JS_CRASH | 0x0001 | The application is **restarted** in the case of JS_CRASH. |
| RESTART_WHEN_APP_FREEZE | 0x0002 | The application is **restarted** in the case of APP_FREEZE.|
| NO_RESTART | 0xFFFF | The application is not restarted in any case. |
**Adaptation Guide**
Perform adaptation based on the new semantics.
...@@ -102,7 +102,7 @@ N/A ...@@ -102,7 +102,7 @@ N/A
1. Explicitly declare the data type for state variables decorated by state decorators. 1. Explicitly declare the data type for state variables decorated by state decorators.
2. If a state variable decorated by a state decorator uses the **Date** object, change it to a regular variable – a variable not decorated by any decorator. 2. If a state variable decorated by a state decorator uses the **Date** object, change it to a regular variable – a variable not decorated by any decorator.
3. Adapt the **@State**, **@Provide**, **@Link**, and **@Consume** decorated variables based on the following code snippet so that they do not use the **Length(string|number|Resource)**, **ResourceStr(string|Resource)**, and **ResourceColor(string|number|Color|Resource)** types: 3. Adapt the **@State**, **@Provide**, **@Link**, and **@Consume** decorated variables based on the following code snippet so that they do not use the **Length(string|number|Resource)**, **ResourceStr(string|Resource)**, and **ResourceColor(string|number|Color|Resource)** types:
```ts ```ts
// Incorrect: // Incorrect:
@State message: ResourceStr = $r('app.string.hello') @State message: ResourceStr = $r('app.string.hello')
...@@ -214,4 +214,121 @@ N/A ...@@ -214,4 +214,121 @@ N/A
To change these variables from the parent component, use the API provided by the **LocalStorage** (such as the **set** API) to assign values to them. To change these variables from the parent component, use the API provided by the **LocalStorage** (such as the **set** API) to assign values to them.
2. For details about how to use **@ObjectLink**, see [@Observed and @ObjectLink](../../../application-dev/quick-start/arkts-observed-and-objectlink.md). 2. For details about how to use **@ObjectLink**, see @ObjectLink.
## cl.LocalStorage.1 Return Type Change of the get API
Changed the return type from **get\<T>(propName: string): T** to **get\<T>(propName: string): T | undefined**.
**Change Impact**
None
## cl.arkui.LocalStorage.2 Mandatory/Optional Change of the newValue Parameter in setOrCreate
**Change Impact**
API declaration before change:
```js
setOrCreate<T>(propName: string, newValue?: T): boolean
```
API declaration after change:
```js
setOrCreate<T>(propName: string, newValue: T): boolean
```
The **newValue** parameter becomes mandatory.
If it is not specified when an application calls the API, the build will fail after the SDK is replaced.
**Adaptation Guide**
```js
let storage = new LocalStorage();
storage.setOrCreate('propA', 'hello');
```
## cl.arkui.LocalStorage.3 link Parameter and Return Type Changes
**Change Impact**
API declaration before change:
```js
link<T>(propName: string, linkUser?: T, subscribersName?: string): T
```
API declaration after change:
```js
link<T>(propName: string): SubscribedAbstractProperty<T>
```
1. The second and third parameters of the **link** API are reserved for internal use by the framework. Therefore, the API is changed to contain only one parameter.
2. The return type **T** is changed to **SubscribedAbstractProperty**.
**Adaptation Guide**
```js
let storage = new LocalStorage({"PropA": "47"});
let linA = storage.link("PropA");
linA.set(50);
```
## cl.arkui.LocalStorage.4 setAndLink Parameter and Return Type Changes
**Change Impact**
API declaration before change:
```js
setAndLink<T>(propName: string, defaultValue: T, linkUser?: T, subscribersName?: string): T
```
API declaration after change:
```js
setAndLink<T>(propName: string, defaultValue: T): SubscribedAbstractProperty<T>
```
1. The third and fourth parameters of the **setAndLink** API are reserved for internal use by the framework. Therefore, the API is changed to contain two parameters.
2. The return type **T** is changed to **SubscribedAbstractProperty**.
**Adaptation Guide**
```js
let storage = new LocalStorage({"PropA": "47"});
let linA = storage.setAndLink("PropA", "48")
linA.set(50);
```
## cl.arkui.LocalStorage.5 prop Parameter and Return Type Changes
**Change Impact**
API declaration before change:
```js
prop<T>(propName: string, propUser?: T, subscribersName?: string): T
```
API declaration after change:
```js
prop<S>(propName: string): SubscribedAbstractProperty<S>
```
1. The second and third parameters of the **prop** API are reserved for internal use by the framework. Therefore, the API is changed to contain only one parameter.
2. The return type **T** is changed to **SubscribedAbstractProperty**.
**Adaptation Guide**
```js
let storage = new LocalStorage({"PropA": "47"});
let propA = storage.prop("PropA");
propA.set(51); // one-way sync
```
## cl.arkui.LocalStorage.6 setAndProp Parameter and Return Type Changes
**Change Impact**
API declaration before change:
```js
setAndProp<T>(propName: string, defaultValue: T, propUser?: T, subscribersName?: string): T
```
API declaration after change:
```js
setAndProp<S>(propName: string, defaultValue: S): SubscribedAbstractProperty<S>
```
1. The third and fourth parameters of the **setAndProp** API are reserved for internal use by the framework. Therefore, the API is changed to contain two parameters.
2. The return type **T** is changed to **SubscribedAbstractProperty**.
**Adaptation Guide**
```js
let storage = new LocalStorage({"PropA": "47"});
let propA = storage.setAndProp("PropA", "48");
propA.set(51); // one-way sync
```
\ No newline at end of file
# Multimedia Subsystem ChangeLog # Multimedia Subsystem Changelog
Compared with OpenHarmony 3.2 Beta4, OpenHarmony3.2.10.3 has the following changes in APIs of the camera component in the multimedia subsystem.
## cl.subsystemname.1 Camera API Changed ## cl.subsystemname.1 Camera API Changed
1. All the APIs of the camera component are changed to system APIs in the API version 9. 1. All the APIs of the camera component are changed to system APIs in the API version 9.
2. Some functional APIs are added and some others are deprecated to: 2. Some functional APIs are added and some others are deprecated to:
- Improve the usability of camera APIs. Improve the usability of camera APIs.
- Help you quickly understand camera APIs and use them for development. Help you quickly understand camera APIs and use them for development.
- Facilitate expansion of framework functions in later versions, and reduce coupling between framework modules. Facilitate expansion of framework functions in later versions, and reduce coupling between framework modules.
You need to refer to the following change description to adapt your application. You need to refer to the following change description to adapt your application.
**Change Impacts** **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. 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.
...@@ -57,7 +55,7 @@ JS APIs in API version 9 are affected. Your application needs to adapt these API ...@@ -57,7 +55,7 @@ JS APIs in API version 9 are affected. Your application needs to adapt these API
**Adaptation Guide** **Adaptation Guide**
In addition to the new APIs and deprecated APIs, you need to adapt your application to the changed APIs. In addition to new APIs and deprecated APIs, you need to adapt your application to changed APIs.
In Beta4 and later versions, the following APIs are changed. In Beta4 and later versions, the following APIs are changed.
...@@ -135,388 +133,388 @@ In Beta4 and later versions, the following APIs are changed. ...@@ -135,388 +133,388 @@ In Beta4 and later versions, the following APIs are changed.
1. Changed the return modes of the **getCameraManager** API in the camera module from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getCameraManager(context: Context, callback: AsyncCallback<CameraManager>): void** and **getCameraManager(context: Context): Promise<CameraManager>** are changed to **getCameraManager(context: Context): CameraManager**. 1. Changed the return modes of the **getCameraManager** API in the camera module from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getCameraManager(context: Context, callback: AsyncCallback<CameraManager>): void** and **getCameraManager(context: Context): Promise<CameraManager>** are changed to **getCameraManager(context: Context): CameraManager**.
The sample code is as follows: The code snippet is as follows:
``` ```
let cameraManager = camera.getCameraManager(context); let cameraManager = camera.getCameraManager(context);
``` ```
2. Changed the return modes of the **getSupportedCameras** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedCameras(callback: AsyncCallback<Array<CameraDevice>>): void** and **getSupportedCameras(): Promise<Array<CameraDevice>>** are changed to **getSupportedCameras(): Array<CameraDevice>**. 2. Changed the return modes of the **getSupportedCameras** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedCameras(callback: AsyncCallback<Array<CameraDevice>>): void** and **getSupportedCameras(): Promise<Array<CameraDevice>>** are changed to **getSupportedCameras(): Array<CameraDevice>**.
The sample code is as follows: The code snippet is as follows:
``` ```
let cameras = cameraManager.getSupportedCameras(); let cameras = cameraManager.getSupportedCameras();
``` ```
3. Changed the return modes of the **getSupportedOutputCapability** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback<CameraOutputCapability>): void** and **getSupportedOutputCapability(camera: CameraDevice): Promise<CameraOutputCapability>** are changed to **getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability**. 3. Changed the return modes of the **getSupportedOutputCapability** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback<CameraOutputCapability>): void** and **getSupportedOutputCapability(camera: CameraDevice): Promise<CameraOutputCapability>** are changed to **getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability**.
The sample code is as follows: The code snippet is as follows:
``` ```
let cameraDevice = cameras[0]; let cameraDevice = cameras[0];
let CameraOutputCapability = cameraManager.getSupportedOutputCapability(cameraDevice); let CameraOutputCapability = cameraManager.getSupportedOutputCapability(cameraDevice);
``` ```
4. Changed the return modes of the **createCameraInput(camera: CameraDevice)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(camera: CameraDevice, callback: AsyncCallback<CameraInput>): void** and **createCameraInput(camera: CameraDevice): Promise<CameraInput>** are changed to **createCameraInput(camera: CameraDevice): CameraInput**. 4. Changed the return modes of the **createCameraInput(camera: CameraDevice)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(camera: CameraDevice, callback: AsyncCallback<CameraInput>): void** and **createCameraInput(camera: CameraDevice): Promise<CameraInput>** are changed to **createCameraInput(camera: CameraDevice): CameraInput**.
The sample code is as follows: The code snippet is as follows:
``` ```
let cameraDevice = cameras[0]; let cameraDevice = cameras[0];
let cameraInput = cameraManager.createCameraInput(cameraDevice); let cameraInput = cameraManager.createCameraInput(cameraDevice);
``` ```
5. Changed the return modes of the **createCameraInput(position: CameraPosition, type: CameraType)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback<CameraInput>): void** and **createCameraInput(position: CameraPosition, type: CameraType): Promise<CameraInput>** are changed to **createCameraInput(position: CameraPosition, type: CameraType): CameraInput**. 5. Changed the return modes of the **createCameraInput(position: CameraPosition, type: CameraType)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback<CameraInput>): void** and **createCameraInput(position: CameraPosition, type: CameraType): Promise<CameraInput>** are changed to **createCameraInput(position: CameraPosition, type: CameraType): CameraInput**.
The sample code is as follows: The code snippet is as follows:
``` ```
let cameraDevice = cameras[0]; let cameraDevice = cameras[0];
let position = cameraDevice.cameraPosition; let position = cameraDevice.cameraPosition;
let type = cameraDevice.cameraType; let type = cameraDevice.cameraType;
let cameraInput = cameraManager.createCameraInput(position, type); let cameraInput = cameraManager.createCameraInput(position, type);
``` ```
6. Changed the return modes of the **createPreviewOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PreviewOutput>): void** and **createPreviewOutput(profile: Profile, surfaceId: string): Promise<PreviewOutput>** are changed to **createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput**. 6. Changed the return modes of the **createPreviewOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PreviewOutput>): void** and **createPreviewOutput(profile: Profile, surfaceId: string): Promise<PreviewOutput>** are changed to **createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput**.
The sample code is as follows: The code snippet is as follows:
``` ```
let profile = cameraoutputcapability.previewProfiles[0]; let profile = cameraoutputcapability.previewProfiles[0];
let previewOutput = cameraManager.createPreviewOutput(profile, surfaceId); let previewOutput = cameraManager.createPreviewOutput(profile, surfaceId);
``` ```
7. Changed the return modes of the **createPhotoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PhotoOutput>): void** and **createPhotoOutput(profile: Profile, surfaceId: string): Promise<PhotoOutput>** are changed to **createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput**. 7. Changed the return modes of the **createPhotoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PhotoOutput>): void** and **createPhotoOutput(profile: Profile, surfaceId: string): Promise<PhotoOutput>** are changed to **createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput**.
The sample code is as follows: The code snippet is as follows:
``` ```
let profile = cameraoutputcapability.photoProfiles[0]; let profile = cameraoutputcapability.photoProfiles[0];
let photoOutput = cameraManager.createPhotoOutput(profile, surfaceId); let photoOutput = cameraManager.createPhotoOutput(profile, surfaceId);
``` ```
8. Changed the return modes of the **createVideoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback<VideoOutput>): void** and **createVideoOutput(profile: VideoProfile, surfaceId: string): Promise<VideoOutput>** are changed to **createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput**. 8. Changed the return modes of the **createVideoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback<VideoOutput>): void** and **createVideoOutput(profile: VideoProfile, surfaceId: string): Promise<VideoOutput>** are changed to **createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput**.
The sample code is as follows: The code snippet is as follows:
``` ```
let profile = cameraoutputcapability.videoProfiles[0]; let profile = cameraoutputcapability.videoProfiles[0];
let videoOutput = cameraManager.createVideoOutput(profile, surfaceId); let videoOutput = cameraManager.createVideoOutput(profile, surfaceId);
``` ```
9. Changed the return modes of the **createMetadataOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>, callback: AsyncCallback<MetadataOutput>): void** and **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): Promise<MetadataOutput>** are changed to **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): MetadataOutput**. 9. Changed the return modes of the **createMetadataOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>, callback: AsyncCallback<MetadataOutput>): void** and **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): Promise<MetadataOutput>** are changed to **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): MetadataOutput**.
The sample code is as follows: The code snippet is as follows:
``` ```
let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes; let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes;
let metadataOutput = cameraManager.createMetadataOutput(metadataObjectTypes); let metadataOutput = cameraManager.createMetadataOutput(metadataObjectTypes);
``` ```
10. Changed the return modes of the **createCaptureSession** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCaptureSession(callback: AsyncCallback<CaptureSession>): void** and **createCaptureSession(): Promise<CaptureSession>** are changed to **createCaptureSession(): CaptureSession**. 10. Changed the return modes of the **createCaptureSession** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCaptureSession(callback: AsyncCallback<CaptureSession>): void** and **createCaptureSession(): Promise<CaptureSession>** are changed to **createCaptureSession(): CaptureSession**.
The sample code is as follows: The code snippet is as follows:
``` ```
let captureSession = cameraManager.createCaptureSession(); let captureSession = cameraManager.createCaptureSession();
``` ```
11. Changed the enum **CAMERA_TYPE_UNSPECIFIED** of **CameraType** to **CAMERA_TYPE_DEFAULT**. 11. Changed the enum **CAMERA_TYPE_UNSPECIFIED** of **CameraType** to **CAMERA_TYPE_DEFAULT**.
12. Changed the return value type of the **on** API in CameraInput from **CameraInputError** to **BusinessError**. Therefore, the original API **on(type: 'error', camera: CameraDevice, callback: ErrorCallback<CameraInputError>): void** is changed to **on(type: 'error', camera: CameraDevice, callback: ErrorCallback<BusinessError>): void**. 12. Changed the return value type of the **on** API in CameraInput from **CameraInputError** to **BusinessError**. Therefore, the original API **on(type: 'error', camera: CameraDevice, callback: ErrorCallback<CameraInputError>): void** is changed to **on(type: 'error', camera: CameraDevice, callback: ErrorCallback<BusinessError>): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
let cameraDevice = cameras[0]; let cameraDevice = cameras[0];
cameraInput.on('error', cameraDevice, (BusinessError) => { cameraInput.on('error', cameraDevice, (BusinessError) => {
}) })
``` ```
13. Changed the return modes of the **beginConfig** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **beginConfig(callback: AsyncCallback<void>): void** and **beginConfig(): Promise<void>** are changed to **beginConfig(): void**. 13. Changed the return modes of the **beginConfig** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **beginConfig(callback: AsyncCallback<void>): void** and **beginConfig(): Promise<void>** are changed to **beginConfig(): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
captureSession.beginConfig(); captureSession.beginConfig();
``` ```
14. Changed the return modes of the **addInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void** and **addInput(cameraInput: CameraInput): Promise<void>** are changed to **addInput(cameraInput: CameraInput): void**. 14. Changed the return modes of the **addInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void** and **addInput(cameraInput: CameraInput): Promise<void>** are changed to **addInput(cameraInput: CameraInput): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
captureSession.addInput(cameraInput); captureSession.addInput(cameraInput);
``` ```
15. Changed the return modes of the **removeInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void** and **removeInput(cameraInput: CameraInput): Promise<void>** are changed to **removeInput(cameraInput: CameraInput): void**. 15. Changed the return modes of the **removeInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void** and **removeInput(cameraInput: CameraInput): Promise<void>** are changed to **removeInput(cameraInput: CameraInput): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
captureSession.removeInput(cameraInput); captureSession.removeInput(cameraInput);
``` ```
16. Changed the return modes of the **addOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void** and **addOutput(cameraOutput: CameraOutput): Promise<void>** are changed to **addOutput(cameraOutput: CameraOutput): void**. 16. Changed the return modes of the **addOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void** and **addOutput(cameraOutput: CameraOutput): Promise<void>** are changed to **addOutput(cameraOutput: CameraOutput): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
captureSession.addOutput(previewOutput); captureSession.addOutput(previewOutput);
``` ```
17. Changed the return modes of the **removeOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void** and **removeOutput(cameraOutput: CameraOutput): Promise<void>** are changed to **removeOutput(cameraOutput: CameraOutput): void**. 17. Changed the return modes of the **removeOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void** and **removeOutput(cameraOutput: CameraOutput): Promise<void>** are changed to **removeOutput(cameraOutput: CameraOutput): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
captureSession.removeOutput(previewOutput); captureSession.removeOutput(previewOutput);
``` ```
18. Changed the return modes of the **hasFlash** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **hasFlash(callback: AsyncCallback<boolean>): void** and **hasFlash(): Promise<boolean>** are changed to **hasFlash(): boolean**. 18. Changed the return modes of the **hasFlash** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **hasFlash(callback: AsyncCallback<boolean>): void** and **hasFlash(): Promise<boolean>** are changed to **hasFlash(): boolean**.
The sample code is as follows: The code snippet is as follows:
``` ```
let status = captureSession.hasFlash(); let status = captureSession.hasFlash();
``` ```
19. Changed the return modes of the **isFlashModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback<boolean>): void** and **isFlashModeSupported(flashMode: FlashMode): Promise<boolean>** are changed to **isFlashModeSupported(flashMode: FlashMode): boolean**. 19. Changed the return modes of the **isFlashModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback<boolean>): void** and **isFlashModeSupported(flashMode: FlashMode): Promise<boolean>** are changed to **isFlashModeSupported(flashMode: FlashMode): boolean**.
The sample code is as follows: The code snippet is as follows:
``` ```
let status = captureSession.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO); let status = captureSession.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO);
``` ```
20. Changed the return modes of the **getFlashMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFlashMode(callback: AsyncCallback<FlashMode>): void** and **getFlashMode(): Promise<FlashMode>** are changed to **getFlashMode(): FlashMode**. 20. Changed the return modes of the **getFlashMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFlashMode(callback: AsyncCallback<FlashMode>): void** and **getFlashMode(): Promise<FlashMode>** are changed to **getFlashMode(): FlashMode**.
The sample code is as follows: The code snippet is as follows:
``` ```
let flashMode = captureSession.getFlashMode(); let flashMode = captureSession.getFlashMode();
``` ```
21. Changed the return modes of the **isExposureModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback<boolean>): void** and **isExposureModeSupported(aeMode: ExposureMode): Promise<boolean>** are changed to **isExposureModeSupported(aeMode: ExposureMode): boolean**. 21. Changed the return modes of the **isExposureModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback<boolean>): void** and **isExposureModeSupported(aeMode: ExposureMode): Promise<boolean>** are changed to **isExposureModeSupported(aeMode: ExposureMode): boolean**.
The sample code is as follows: The code snippet is as follows:
``` ```
let isSupported = captureSession.isExposureModeSupported(camera.ExposureMode.EXPOSURE_MODE_LOCKED); let isSupported = captureSession.isExposureModeSupported(camera.ExposureMode.EXPOSURE_MODE_LOCKED);
``` ```
22. Changed the return modes of the **getExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureMode(callback: AsyncCallback<ExposureMode>): void** and **getExposureMode(): Promise<ExposureMode>** are changed to **getExposureMode(): ExposureMode**. 22. Changed the return modes of the **getExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureMode(callback: AsyncCallback<ExposureMode>): void** and **getExposureMode(): Promise<ExposureMode>** are changed to **getExposureMode(): ExposureMode**.
The sample code is as follows: The code snippet is as follows:
``` ```
let exposureMode = captureSession.getExposureMode(); let exposureMode = captureSession.getExposureMode();
``` ```
23. Changed the return modes of the **setExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureMode(aeMode: ExposureMode, callback: AsyncCallback<void>): void** and **setExposureMode(aeMode: ExposureMode): Promise<void>** are changed to **setExposureMode(aeMode: ExposureMode): void**. 23. Changed the return modes of the **setExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureMode(aeMode: ExposureMode, callback: AsyncCallback<void>): void** and **setExposureMode(aeMode: ExposureMode): Promise<void>** are changed to **setExposureMode(aeMode: ExposureMode): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
captureSession.setExposureMode(camera.ExposureMode.EXPOSURE_MODE_LOCKED); captureSession.setExposureMode(camera.ExposureMode.EXPOSURE_MODE_LOCKED);
``` ```
24. Changed the return modes of the **getMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getMeteringPoint(callback: AsyncCallback<Point>): void** and **getMeteringPoint(): Promise<Point>** are changed to **getMeteringPoint(): Point**. 24. Changed the return modes of the **getMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getMeteringPoint(callback: AsyncCallback<Point>): void** and **getMeteringPoint(): Promise<Point>** are changed to **getMeteringPoint(): Point**.
The sample code is as follows: The code snippet is as follows:
``` ```
let exposurePoint = captureSession.getMeteringPoint(); let exposurePoint = captureSession.getMeteringPoint();
``` ```
25. Changed the return modes of the **setMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setMeteringPoint(point: Point, callback: AsyncCallback<void>): void** and **setMeteringPoint(point: Point): Promise<void>** are changed to **setMeteringPoint(point: Point): void**. 25. Changed the return modes of the **setMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setMeteringPoint(point: Point, callback: AsyncCallback<void>): void** and **setMeteringPoint(point: Point): Promise<void>** are changed to **setMeteringPoint(point: Point): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
let Point2 = {x: 2, y: 2}; let Point2 = {x: 2, y: 2};
captureSession.setMeteringPoint(Point2); captureSession.setMeteringPoint(Point2);
``` ```
26. Changed the return modes of the **getExposureBiasRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureBiasRange(callback: AsyncCallback<Array<number>>): void** and **getExposureBiasRange(): Promise<Array<number>>** are changed to **getExposureBiasRange(): Array<number>**. 26. Changed the return modes of the **getExposureBiasRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureBiasRange(callback: AsyncCallback<Array<number>>): void** and **getExposureBiasRange(): Promise<Array<number>>** are changed to **getExposureBiasRange(): Array<number>**.
The sample code is as follows: The code snippet is as follows:
``` ```
let biasRangeArray = captureSession.getExposureBiasRange(); let biasRangeArray = captureSession.getExposureBiasRange();
``` ```
27. Changed the return modes of the **setExposureBias** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureBias(exposureBias: number, callback: AsyncCallback<void>): void** and **setExposureBias(exposureBias: number): Promise<void>** are changed to **setExposureBias(exposureBias: number): void**. 27. Changed the return modes of the **setExposureBias** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureBias(exposureBias: number, callback: AsyncCallback<void>): void** and **setExposureBias(exposureBias: number): Promise<void>** are changed to **setExposureBias(exposureBias: number): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
let exposureBias = biasRangeArray[0]; let exposureBias = biasRangeArray[0];
captureSession.setExposureBias(exposureBias); captureSession.setExposureBias(exposureBias);
``` ```
28. Changed the return modes of the **getExposureValue** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureValue(callback: AsyncCallback<number>): void** and **getExposureValue(): Promise<number>** are changed to **getExposureValue(): number**. 28. Changed the return modes of the **getExposureValue** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureValue(callback: AsyncCallback<number>): void** and **getExposureValue(): Promise<number>** are changed to **getExposureValue(): number**.
The sample code is as follows: The code snippet is as follows:
``` ```
let exposureValue = captureSession.getExposureValue(); let exposureValue = captureSession.getExposureValue();
``` ```
29. Changed the return modes of the **isFocusModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean>): void** and **isFocusModeSupported(afMode: FocusMode): Promise<boolean>** are changed to **isFocusModeSupported(afMode: FocusMode): boolean**. 29. Changed the return modes of the **isFocusModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean>): void** and **isFocusModeSupported(afMode: FocusMode): Promise<boolean>** are changed to **isFocusModeSupported(afMode: FocusMode): boolean**.
The sample code is as follows: The code snippet is as follows:
``` ```
let status = captureSession.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_AUTO); let status = captureSession.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_AUTO);
``` ```
30. Changed the return modes of the **getFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusMode(callback: AsyncCallback<FocusMode>): void** and **getFocusMode(): Promise<FocusMode>** are changed to **getFocusMode(): FocusMode**. 30. Changed the return modes of the **getFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusMode(callback: AsyncCallback<FocusMode>): void** and **getFocusMode(): Promise<FocusMode>** are changed to **getFocusMode(): FocusMode**.
The sample code is as follows: The code snippet is as follows:
``` ```
let afMode = captureSession.getFocusMode(); let afMode = captureSession.getFocusMode();
``` ```
31. Changed the return modes of the **setFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusMode(afMode: FocusMode, callback: AsyncCallback<void>): void** and **setFocusMode(afMode: FocusMode): Promise<void>** are changed to **setFocusMode(afMode: FocusMode): void**. 31. Changed the return modes of the **setFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusMode(afMode: FocusMode, callback: AsyncCallback<void>): void** and **setFocusMode(afMode: FocusMode): Promise<void>** are changed to **setFocusMode(afMode: FocusMode): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
captureSession.setFocusMode(camera.FocusMode.FOCUS_MODE_AUTO); captureSession.setFocusMode(camera.FocusMode.FOCUS_MODE_AUTO);
``` ```
32. Changed the return modes of the **setFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusPoint(point: Point, callback: AsyncCallback<void>): void** and **setFocusPoint(point: Point): Promise<void>** are changed to **setFocusPoint(point: Point): void**. 32. Changed the return modes of the **setFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusPoint(point: Point, callback: AsyncCallback<void>): void** and **setFocusPoint(point: Point): Promise<void>** are changed to **setFocusPoint(point: Point): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
let Point2 = {x: 2, y: 2}; let Point2 = {x: 2, y: 2};
captureSession.setFocusPoint(Point2); captureSession.setFocusPoint(Point2);
``` ```
33. Changed the return modes of the **getFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusPoint(callback: AsyncCallback<Point>): void** and **getFocusPoint(): Promise<Point>** are changed to **getFocusPoint(): Point**. 33. Changed the return modes of the **getFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusPoint(callback: AsyncCallback<Point>): void** and **getFocusPoint(): Promise<Point>** are changed to **getFocusPoint(): Point**.
The sample code is as follows: The code snippet is as follows:
``` ```
let point = captureSession.getFocusPoint(); let point = captureSession.getFocusPoint();
``` ```
34. Changed the return modes of the **getFocalLength** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocalLength(callback: AsyncCallback<number>): void** and **getFocalLength(): Promise<number>** are changed to **getFocalLength(): number**. 34. Changed the return modes of the **getFocalLength** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocalLength(callback: AsyncCallback<number>): void** and **getFocalLength(): Promise<number>** are changed to **getFocalLength(): number**.
The sample code is as follows: The code snippet is as follows:
``` ```
let focalLength = captureSession.getFocalLength(); let focalLength = captureSession.getFocalLength();
``` ```
35. Changed the return modes of the **getZoomRatioRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatioRange(callback: AsyncCallback<Array<number>>): void** and **getZoomRatioRange(): Promise<Array<number>>** are changed to **getZoomRatioRange(): Array<number>**. 35. Changed the return modes of the **getZoomRatioRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatioRange(callback: AsyncCallback<Array<number>>): void** and **getZoomRatioRange(): Promise<Array<number>>** are changed to **getZoomRatioRange(): Array<number>**.
The sample code is as follows: The code snippet is as follows:
``` ```
let zoomRatioRange = captureSession.getZoomRatioRange(); let zoomRatioRange = captureSession.getZoomRatioRange();
``` ```
36. Changed the return modes of the **getZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatio(callback: AsyncCallback<number>): void** and **getZoomRatio(): Promise<number>** are changed to **getZoomRatio(): number**. 36. Changed the return modes of the **getZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatio(callback: AsyncCallback<number>): void** and **getZoomRatio(): Promise<number>** are changed to **getZoomRatio(): number**.
The sample code is as follows: The code snippet is as follows:
``` ```
let zoomRatio = captureSession.getZoomRatio(); let zoomRatio = captureSession.getZoomRatio();
``` ```
37. Changed the return modes of the **setZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setZoomRatio(zoomRatio: number, callback: AsyncCallback<void>): void** and **setZoomRatio(zoomRatio: number): Promise<void>** are changed to **setZoomRatio(zoomRatio: number): void**. 37. Changed the return modes of the **setZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setZoomRatio(zoomRatio: number, callback: AsyncCallback<void>): void** and **setZoomRatio(zoomRatio: number): Promise<void>** are changed to **setZoomRatio(zoomRatio: number): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
let zoomRatio = zoomRatioRange[0]; let zoomRatio = zoomRatioRange[0];
captureSession.setZoomRatio(zoomRatio); captureSession.setZoomRatio(zoomRatio);
``` ```
38. Changed the return modes of the **isVideoStabilizationModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback<boolean>): void** and **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise<boolean>** are changed to **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean**. 38. Changed the return modes of the **isVideoStabilizationModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback<boolean>): void** and **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise<boolean>** are changed to **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean**.
The sample code is as follows: The code snippet is as follows:
``` ```
let isSupported = captureSession.isVideoStabilizationModeSupported(camera.VideoStabilizationMode.OFF); let isSupported = captureSession.isVideoStabilizationModeSupported(camera.VideoStabilizationMode.OFF);
``` ```
39. Changed the return modes of the **getActiveVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getActiveVideoStabilizationMode(callback: AsyncCallback<VideoStabilizationMode>): void** and **getActiveVideoStabilizationMode(): Promise<VideoStabilizationMode>** are changed to **getActiveVideoStabilizationMode(): VideoStabilizationMode**. 39. Changed the return modes of the **getActiveVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getActiveVideoStabilizationMode(callback: AsyncCallback<VideoStabilizationMode>): void** and **getActiveVideoStabilizationMode(): Promise<VideoStabilizationMode>** are changed to **getActiveVideoStabilizationMode(): VideoStabilizationMode**.
The sample code is as follows: The code snippet is as follows:
``` ```
let vsMode = captureSession.getActiveVideoStabilizationMode(); let vsMode = captureSession.getActiveVideoStabilizationMode();
``` ```
40. Changed the return modes of the **setVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback<void>): void** and **setVideoStabilizationMode(mode: VideoStabilizationMode): Promise<void>** are changed to **setVideoStabilizationMode(mode: VideoStabilizationMode): void**. 40. Changed the return modes of the **setVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback<void>): void** and **setVideoStabilizationMode(mode: VideoStabilizationMode): Promise<void>** are changed to **setVideoStabilizationMode(mode: VideoStabilizationMode): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
captureSession.setVideoStabilizationMode(camera.VideoStabilizationMode.OFF); captureSession.setVideoStabilizationMode(camera.VideoStabilizationMode.OFF);
``` ```
41. Changed the **on(type:'error') callback** type in CaptureSession from **ErrorCallback<CaptureSessionError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<CaptureSessionError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 41. Changed the **on(type:'error') callback** type in CaptureSession from **ErrorCallback<CaptureSessionError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<CaptureSessionError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
captureSession.on('error', (BusinessError) => { captureSession.on('error', (BusinessError) => {
}) })
``` ```
42. Changed the **on(type:'error') callback** type in PreviewOutput, from **ErrorCallback<PreviewOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<PreviewOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 42. Changed the **on(type:'error') callback** type in PreviewOutput, from **ErrorCallback<PreviewOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<PreviewOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
previewOutput.on('error', (BusinessError) => { previewOutput.on('error', (BusinessError) => {
}) })
``` ```
43. Changed the return modes of the **isMirrorSupported** API in PhotoOutput from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isMirrorSupported(callback: AsyncCallback<boolean>): void** and **isMirrorSupported(): Promise<boolean>** are changed to **isMirrorSupported(): boolean**. 43. Changed the return modes of the **isMirrorSupported** API in PhotoOutput from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isMirrorSupported(callback: AsyncCallback<boolean>): void** and **isMirrorSupported(): Promise<boolean>** are changed to **isMirrorSupported(): boolean**.
The sample code is as follows: The code snippet is as follows:
``` ```
let isSupported = photoOutput.isMirrorSupported(); let isSupported = photoOutput.isMirrorSupported();
``` ```
44. Changed the **on(type:'error') callback** type in PhotoOutput, from **ErrorCallback<PhotoOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<PhotoOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 44. Changed the **on(type:'error') callback** type in PhotoOutput, from **ErrorCallback<PhotoOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<PhotoOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
PhotoOutput.on('error', (BusinessError) => { PhotoOutput.on('error', (BusinessError) => {
}) })
``` ```
45. Changed the **on(type:'error') callback** type in VideoOutput, from **ErrorCallback<VideoOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<VideoOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 45. Changed the **on(type:'error') callback** type in VideoOutput, from **ErrorCallback<VideoOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<VideoOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
VideoOutput.on('error', (BusinessError) => { VideoOutput.on('error', (BusinessError) => {
}) })
``` ```
46. Changed the **on(type:'error') callback** type in MetadataOutput, from **ErrorCallback<MetadataOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<MetadataOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 46. Changed the **on(type:'error') callback** type in MetadataOutput, from **ErrorCallback<MetadataOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<MetadataOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**.
The sample code is as follows: The code snippet is as follows:
``` ```
MetadataOutput.on('error', (BusinessError) => { MetadataOutput.on('error', (BusinessError) => {
}) })
``` ```
\ No newline at end of file \ No newline at end of file
# ChangeLog of JS API Changes in the commonlibrary Subsystem # Common Library Subsystem Changelog
Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(Mr) has the following API changes in the commonlibrary subsystem.
## cl.commonlibrary.1 Error Code and Information Change ## cl.commonlibrary.1 Error Code and Information Change
Changed error codes and information returned by APIs of the **ArrayList**, **List**, **LinkedList**, **Stack**, **Queue**, **Deque**, **PlainArray**, **LightWeightMap**, **LightWeightSet**, **HashMap**, **HashSet**, **TreeMap**, and **TreeSet** classes in the commonlibrary subsystem. The error codes and information returned by APIs of the **ArrayList**, **List**, **LinkedList**, **Stack**, **Queue**, **Deque**, **PlainArray**, **LightWeightMap**, **LightWeightSet**, **HashMap**, **HashSet**, **TreeMap**, and **TreeSet** classes are changed.
For details about the changed error codes, see [error codes of language basic class libraries](../../../application-dev/reference/errorcodes/errorcode-utils.md). For details about the changed error codes, see [Utils Error Codes](../../../application-dev/reference/errorcodes/errorcode-utils.md).
No adaptation is required for applications developed using these APIs. No adaptation is required for applications developed using these APIs.
**Key API/Component Changes** **Key API/Component Changes**
Error code information is redefined for APIs in these classes and marked using **'@throws'** in the *.d.ts file of the corresponding module.
Error code information is redefined for APIs in these classes and marked using **'@throws'** in the `*.d.ts` file of the corresponding module.
The sample code is as follows: The sample code is as follows:
**ArrayList** class before the change: **ArrayList** class before the change:
constructor(); constructor();
**ArrayList** class after the change: **ArrayList** class after the change:
@throws { BusinessError } 10200012 - The ArrayList's constructor cannot be directly invoked. @throws { BusinessError } 10200012 - The ArrayList's constructor cannot be directly invoked.
constructor(); constructor();
**Change Impacts** **Change Impact**
None No impact.
# Distributed Data Management Subsystem JS API Changelog
## cl.distributeddatamgr.1 API Change
Changed the APIs in **kv_store** of the distributed data management subsystem:
Changed the **createKVManager()** implementation from asynchronous mode to synchronous mode because the execution duration is fixed and short.
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.
**Change Impact**
JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enum/Constant | Change Type|
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): Promise\<KVManager\>; | Deleted |
| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): KVManager; | Changed |
**Adaptation Guide**
The following illustrates how to call **createKVManager** to create a **KVManager** object.
Stage model:
```ts
import AbilityStage from '@ohos.application.Ability'
let kvManager;
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("MyAbilityStage onCreate")
let context = this.context
const kvManagerConfig = {
context: context,
bundleName: 'com.example.datamanagertest',
}
try {
kvManager = distributedKVStore.createKVManager(kvManagerConfig);
} catch (e) {
console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`);
}
}
}
```
FA model:
```ts
import featureAbility from '@ohos.ability.featureAbility'
let kvManager;
let context = featureAbility.getContext()
const kvManagerConfig = {
context: context,
bundleName: 'com.example.datamanagertest',
}
try {
kvManager = distributedKVStore.createKVManager(kvManagerConfig);
} catch (e) {
console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`);
}
```
## cl.distributeddatamgr.2 Move of getRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
Moved **getRdbStoreV9()** from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts, and renamed it **getRdbStore()**.
**Change Impact**
The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful.
**Key API/Component Changes**
APIs:
```ts
function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number, callback: AsyncCallback<RdbStoreV9>): void;
function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number): Promise<RdbStoreV9>;
```
Moved the above APIs from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**.
```
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 the **getRdbStore()** APIs.
## cl.distributeddatamgr.3 Move of deleteRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
Moved **deleteRdbStoreV9()** from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts, and renamed it **deleteRdbStore()**.
**Change Impact**
The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful.
**Key API/Component Changes**
APIs:
```ts
function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback<void>): void;
function deleteRdbStoreV9(context: Context, name: string): Promise<void>;
```
Moved the above APIs from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**.
```
function deleteRdbStore(context: Context, name: string, callback: AsyncCallback<void>): void;
function deleteRdbStore(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 the **deleteRdbStoreV9()** APIs.
## cl.distributeddatamgr.4 Move of StoreConfigV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impact**
The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful.
**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 **StoreConfigV9** in APIs.
## cl.distributeddatamgr.5 Move of enum SecurityLevel from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impact**
The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful.
**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"**.
## cl.distributeddatamgr.6 Mover of RdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impact**
The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful.
**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 **RdbStoreV9** in relevant APIs.
## cl.distributeddatamgr.7 Move of class RdbPredicatesV9 from ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
**Change Impact**
The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful.
**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 **RdbPredicatesV9** in the relevant APIs.
## cl.distributeddatamgr.8 Move of ResultSetV9 from api/@ohos.data.relationalStore.d.ts to @ohos.data.relationalStore.d.ts
**Change Impact**
The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful.
**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**.
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
## cl.filemanagement.1 environment Module Change ## 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 processing. Moved the file management subsystem **d.ts** file to the **file** directory. The **environment** module supports error code processing.
**Change Impact** **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 processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. 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 processing. See [Adaptation Guide](../v3.2-beta4/changelogs-filemanagement.md) for more details.
**Key API/Component Changes** **Key API/Component Changes**
Before the change, **environment** is imported from **@ohos.environment**: Before the change, **environment** was imported from **@ohos.environment**:
```js ```js
import environment from '@ohos.environment'; import environment from '@ohos.environment';
...@@ -28,11 +28,11 @@ Moved the file management subsystem **d.ts** file to the **file** directory. The ...@@ -28,11 +28,11 @@ Moved the file management subsystem **d.ts** file to the **file** directory. The
**Change Impact** **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 processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. 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 processing. See [Adaptation Guide](../v3.2-beta4/changelogs-filemanagement.md) for more details.
**Key API/Component Changes** **Key API/Component Changes**
Before the change, **securityLabel** is imported from **@ohos.securityLabel**: Before the change, **securityLabel** was imported from **@ohos.securityLabel**:
```js ```js
import securityLabel from '@ohos.securityLabel'; import securityLabel from '@ohos.securityLabel';
...@@ -62,11 +62,11 @@ Moved the file management subsystem **d.ts** file to the **file** directory. The ...@@ -62,11 +62,11 @@ Moved the file management subsystem **d.ts** file to the **file** directory. The
**Change Impact** **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 processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. 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 processing. See [Adaptation Guide](../v3.2-beta4/changelogs-filemanagement.md) for more details.
**Key API/Component Changes** **Key API/Component Changes**
Before the change, **fileAccess** is imported from **@ohos.data.fileAccess**: Before the change, **fileAccess** was imported from **@ohos.data.fileAccess**:
```js ```js
import fileAccess from '@ohos.data.fileAccess'; import fileAccess from '@ohos.data.fileAccess';
...@@ -84,11 +84,11 @@ Moved the file management subsystem **d.ts** file to the **file** directory. The ...@@ -84,11 +84,11 @@ Moved the file management subsystem **d.ts** file to the **file** directory. The
**Change Impact** **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 processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. 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 processing. See [Adaptation Guide](../v3.2-beta4/changelogs-filemanagement.md) for more details.
**Key API/Component Changes** **Key API/Component Changes**
Before the change, **fileExtensionInfo** is imported from **@ohos.fileExtensionInfo**: Before the change, **fileExtensionInfo** was imported from **@ohos.fileExtensionInfo**:
```js ```js
import fileExtensionInfo from '@ohos.fileExtensionInfo'; import fileExtensionInfo from '@ohos.fileExtensionInfo';
...@@ -106,7 +106,7 @@ Moved the file management subsystem **d.ts** file to the **file** directory. The ...@@ -106,7 +106,7 @@ Moved the file management subsystem **d.ts** file to the **file** directory. The
**Change Impact** **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 processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. 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 processing. See [Adaptation Guide](../v3.2-beta4/changelogs-filemanagement.md) for more details.
**Key API/Component Changes** **Key API/Component Changes**
...@@ -128,7 +128,7 @@ Moved the file management subsystem **d.ts** file to the **file** directory. The ...@@ -128,7 +128,7 @@ Moved the file management subsystem **d.ts** file to the **file** directory. The
**Change Impact** **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 processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. 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 processing. See [Adaptation Guide](../v3.2-beta4/changelogs-filemanagement.md) for more details.
**Key API/Component Changes** **Key API/Component Changes**
...@@ -143,47 +143,3 @@ Now, **volumeManager** is imported from **@ohos.file.volumeManager**: ...@@ -143,47 +143,3 @@ Now, **volumeManager** is imported from **@ohos.file.volumeManager**:
```js ```js
import volumeManager from '@ohos.file.volumeManager'; 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).
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
The following modules do not comply with the OpenHarmony API file naming rules. Therefore, they are modified in API version 9 and later. The following modules do not comply with the OpenHarmony API file naming rules. Therefore, they are modified in API version 9 and later.
**Change Impacts** **Change Impacts**
The SDK after the change is incompatible with the earlier versions. Therefore, adaptation is required for applications developed in earlier versions so that they can be properly built with the SDK in the new version. The SDK after the change is incompatible with the earlier versions. Therefore, adaptation is required for applications developed in earlier versions so that they can be properly built with the SDK in the new version.
**Key API/Component Changes** **Key API/Component Changes**
| Module| File Name Before Change| File Name After Change| | Module| File Name Before Change| File Name After Change|
|------|--------------|--------------| |------|--------------|--------------|
| Input method framework module| @ohos.inputmethod.d.ts |@ohos.inputMethod.d.ts | | Input method framework module| @ohos.inputmethod.d.ts |@ohos.inputMethod.d.ts |
...@@ -17,15 +17,14 @@ The SDK after the change is incompatible with the earlier versions. Therefore, a ...@@ -17,15 +17,14 @@ The SDK after the change is incompatible with the earlier versions. Therefore, a
| Input method ExtentionAbility module| @ohos.inputmethodextensionability.d.ts | @ohos.InputMethodExtensionAbility.d.ts | | Input method ExtentionAbility module| @ohos.inputmethodextensionability.d.ts | @ohos.InputMethodExtensionAbility.d.ts |
| Input method ExtentionContext module|@ohos.inputmethodextensioncontext.d.ts | @ohos.InputMethodExtensionContext.d.ts | | Input method ExtentionContext module|@ohos.inputmethodextensioncontext.d.ts | @ohos.InputMethodExtensionContext.d.ts |
| Input method subtype module| @ohos.inputMethodSubtype.d.ts | @ohos.InputMethodSubtype.d.ts | | Input method subtype module| @ohos.inputMethodSubtype.d.ts | @ohos.InputMethodSubtype.d.ts |
**Adaptation Guide** **Adaptation Guide**
In the application code, change the name of the d.ts file following **import** to the new file name, which complies with the UpperCamelCase or lowerCamelCase style. In the application code, change the name of the d.ts file following **import** to the new file name, which complies with the UpperCamelCase or lowerCamelCase style.
Example:
Example:
```js ```js
import inputMethodEngine from '@ohos.inputMethodEngine'; import inputMethodEngine from '@ohos.inputMethodEngine';
``` ```
# File Subsystem Changelog # File Management Subsystem Changelog
## cl.file.1 mediaLibrary APIs Changed ## cl.file.1 mediaLibrary APIs Changed
All APIs provided by the mediaLibrary module of the multimedia subsystem are deprecated. The **MediaLibrary** class of the multimedia component is replaced by the **FilePicker** class.
**Change Impact** **Change Impact**
All APIs described in [mediaLibrary](../../../application-dev/reference/apis/js-apis-medialibrary.md) are deprecated. Third-party applications can only select and save files in the public directory by calling the APIs of [FilePicker](../../../application-dev/reference/apis/js-apis-file-picker.md). For applications developed based on earlier versions, pay attention to the changes of APIs. **FilePicker** is a system application preset in OpenHarmony. You can use it to select and save files.
For applications developed based on earlier versions, pay attention to the changes of APIs.
**Key API/Component Changes** **Key API/Component Changes**
The table below lists the **mediaLibrary** APIs that can be substituted by the **FilePicker** APIs. The APIs of **MediaLibrary**, located in **@ohos.multimedia.medialibrary**, are deprecated. The **FilePicker** class, located in [@ohos.file.picker](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.file.picker.d.ts) is used.
| Module | Method/Attribute/Enum/Constant | Change Type| | Module | Method/Attribute/Enum/Constant | Change Type|
| ------------------------- | ------------------------------------------------------------ | -------- | | ------------------------- | ------------------------------------------------------------ | -------- |
| medialibrary | **function** getMediaLibrary(): MediaLibrary; | Deprecated |
| medialibrary | **function** getMediaLibrary(context: Context): MediaLibrary; | Deprecated | | medialibrary | **function** getMediaLibrary(context: Context): MediaLibrary; | Deprecated |
| medialibrary | **function** getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\<FetchFileResult\>): void | Deprecated | | medialibrary | **function** getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\<FetchFileResult\>): void | Deprecated |
| medialibrary | **function** getFileAssets(options: MediaFetchOptions): Promise\<FetchFileResult\> | Deprecated | | medialibrary | **function** getFileAssets(options: MediaFetchOptions): Promise\<FetchFileResult\> | Deprecated |
| medialibrary | **function** on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\<void\>): void | Deprecated |
| medialibrary | **function** off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\<void\>): void | Deprecated |
| medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string, callback: AsyncCallback\<FileAsset\>): void | Deprecated | | medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string, callback: AsyncCallback\<FileAsset\>): void | Deprecated |
| medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise\<FileAsset\> | Deprecated | | medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise\<FileAsset\> | Deprecated |
| medialibrary | **function** deleteAsset(uri: string): Promise\<void\> | Deprecated |
| medialibrary | **function** deleteAsset(uri: string, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** getPublicDirectory(type: DirectoryType, callback: AsyncCallback\<string\>): void | Deprecated | | medialibrary | **function** getPublicDirectory(type: DirectoryType, callback: AsyncCallback\<string\>): void | Deprecated |
| medialibrary | **function** getPublicDirectory(type: DirectoryType): Promise\<string\> | Deprecated | | medialibrary | **function** getPublicDirectory(type: DirectoryType): Promise\<string\> | Deprecated |
| medialibrary | **function** release(callback: AsyncCallback\<void\>): void | Deprecated | | medialibrary | **function** getAlbums(options: MediaFetchOptions, callback: AsyncCallback\<Array\<Album\>\>): void | Deprecated |
| medialibrary | **function** getAlbums(options: MediaFetchOptions): Promise\<Array\<Album\>\> | Deprecated |
| medialibrary | **function** release(callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** release(): Promise\<void\> | Deprecated | | medialibrary | **function** release(): Promise\<void\> | Deprecated |
| medialibrary | **function** storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback\<string\>): void | Deprecated |
| medialibrary | **function** storeMediaAsset(option: MediaAssetOption): Promise\<string\> | Deprecated |
| medialibrary | **function** startImagePreview(images: Array\<string\>, index: number, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** startImagePreview(images: Array\<string\>, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** startImagePreview(images: Array\<string\>, index?: number): Promise\<void\> | Deprecated |
| medialibrary | **function** startMediaSelect(option: MediaSelectOption, callback: AsyncCallback\<Array\<string\>\>): void | Deprecated |
| medialibrary | **function** startMediaSelect(option: MediaSelectOption): Promise\<Array\<string\>\> | Deprecated |
| medialibrary | **function** getActivePeers(): Promise\<Array\<PeerInfo\>\>; | Deprecated |
| medialibrary | **function** getActivePeers(callback: AsyncCallback\<Array\<PeerInfo\>\>): void; | Deprecated |
| medialibrary | **function** getAllPeers(): Promise\<Array\<PeerInfo\>\>; | Deprecated |
| medialibrary | **function** FileAsset.isDirectory(callback: AsyncCallback\<boolean\>): void | Deprecated |
| medialibrary | **function** FileAsset.isDirectory():Promise\<boolean\> | Deprecated |
| medialibrary | **function** FileAsset.commitModify(callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** FileAsset.commitModify(): Promise\<void\> | Deprecated |
| medialibrary | **function** FileAsset.open(mode: string, callback: AsyncCallback\<number\>): void | Deprecated | | medialibrary | **function** FileAsset.open(mode: string, callback: AsyncCallback\<number\>): void | Deprecated |
| medialibrary | **function** FileAsset.open(mode: string): Promise\<number\> | Deprecated | | medialibrary | **function** FileAsset.open(mode: string): Promise\<number\> | Deprecated |
| medialibrary | **function** FileAsset.close(fd: number, callback: AsyncCallback\<void\>): void | Deprecated | | medialibrary | **function** FileAsset.close(fd: number, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** FileAsset.close(fd: number): Promise\<void\> | Deprecated | | medialibrary | **function** FileAsset.close(fd: number): Promise\<void\> | Deprecated |
| medialibrary | **function** FileAsset.getThumbnail(callback: AsyncCallback\<image.PixelMap\>): void | Deprecated |
| medialibrary | **function** FileAsset.getThumbnail(size: Size, callback: AsyncCallback\<image.PixelMap\>): void | Deprecated |
| medialibrary | **function** FileAsset.getThumbnail(size?: Size): Promise\<image.PixelMap\> | Deprecated |
| medialibrary | **function** FileAsset.favorite(isFavorite: boolean, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** FileAsset.favorite(isFavorite: boolean): Promise\<void\> | Deprecated |
| medialibrary | **function** FileAsset.isFavorite(callback: AsyncCallback\<boolean\>): void | Deprecated |
| medialibrary | **function** FileAsset.isFavorite():Promise\<boolean\> | Deprecated |
| medialibrary | **function** FileAsset.trash(isTrash: boolean, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** FileAsset.trash(isTrash: boolean): Promise\<void\> | Deprecated |
| medialibrary | **function** FileAsset.isTrash(callback: AsyncCallback\<boolean\>): void | Deprecated |
| medialibrary | **function** FileAsset.isTrash():Promise\<boolean\> | Deprecated |
| medialibrary | **function** FetchFileResult.getCount(): number | Deprecated | | medialibrary | **function** FetchFileResult.getCount(): number | Deprecated |
| medialibrary | **function** FetchFileResult.isAfterLast(): boolean | Deprecated | | medialibrary | **function** FetchFileResult.isAfterLast(): boolean | Deprecated |
| medialibrary | **function** FetchFileResult.close(): void | Deprecated | | medialibrary | **function** FetchFileResult.close(): void | Deprecated |
...@@ -41,232 +72,45 @@ The table below lists the **mediaLibrary** APIs that can be substituted by the * ...@@ -41,232 +72,45 @@ The table below lists the **mediaLibrary** APIs that can be substituted by the *
| medialibrary | **function** FetchFileResult.getPositionObject(index: number): Promise\<FileAsset\> | Deprecated | | medialibrary | **function** FetchFileResult.getPositionObject(index: number): Promise\<FileAsset\> | Deprecated |
| medialibrary | **function** FetchFileResult.getAllObject(callback: AsyncCallback\<Array\<FileAsset\>\>): void | Deprecated | | medialibrary | **function** FetchFileResult.getAllObject(callback: AsyncCallback\<Array\<FileAsset\>\>): void | Deprecated |
| medialibrary | **function** FetchFileResult.getAllObject(): Promise\<Array\<FileAsset\>\> | Deprecated | | medialibrary | **function** FetchFileResult.getAllObject(): Promise\<Array\<FileAsset\>\> | Deprecated |
| medialibrary | **function** Album.commitModify(callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** Album.commitModify(): Promise\<void\> | Deprecated |
| medialibrary | **function** Album.getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\<FetchFileResult\>): void | Deprecated | | medialibrary | **function** Album.getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\<FetchFileResult\>): void | Deprecated |
| medialibrary | **function** Album.getFileAssets(options?: MediaFetchOptions): Promise\<FetchFileResult\> | Deprecated | | medialibrary | **function** Album.getFileAssets(options?: MediaFetchOptions): Promise\<FetchFileResult\> | Deprecated |
| medialibrary | **enum** DeviceType | Deprecated |
| medialibrary | **enum** FileKey | Deprecated | | medialibrary | **enum** FileKey | Deprecated |
| medialibrary | **enum** DirectoryType | Deprecated | | medialibrary | **enum** DirectoryType | Deprecated |
| medialibrary | **enum** MediaType | Deprecated | | medialibrary | **enum** MediaType | Deprecated |
| medialibrary | **interface** PeerInfo | Deprecated |
| medialibrary | **interface** Size | Deprecated |
| medialibrary | **interface** MediaFetchOptions | Deprecated | | medialibrary | **interface** MediaFetchOptions | Deprecated |
| medialibrary | **interface** MediaAssetOption | Deprecated |
| medialibrary | **interface** MediaSelectOption | Deprecated |
| medialibrary | **interface** FileAsset | Deprecated | | medialibrary | **interface** FileAsset | Deprecated |
**Adaptation Guide** **Adaptation Guide**
**The following example shows how to use the mediaLibrary APIs to edit a file in the public directory:** For example, refer to the code snippet below to call an API to select an image:
1. Call **getMediaLibrary** to obtain a **mediaLibrary** instance.
2. Create a **MediaFetchOptions** object, and call **getFileAssets** to obtain files in the public directory.
3. Call the **FetchFileResult** APIs to obtain the file asset of the target file.
4. Call **fileAsset.open** to open the file and obtain the FD.
5. Call [fs.writeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#writesync) to edit the file through the FD.
6. After the edit, call **fileAsset.close** to close the FD of the file.
7. Call **fetchFileResult.close** to release the resources occupied by **getFileAssets**.
8. Call **release** to release the **mediaLibrary** instance.
**Example**
```js
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import fs from '@ohos.file.fs';
async function example() {
try {
let context = getContext(this);
let media = mediaLibrary.getMediaLibrary(context);
let fileKeyObj = mediaLibrary.FileKey;
let imageType = mediaLibrary.MediaType.IMAGE;
let getImageOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
order: fileKeyObj.DATE_ADDED + ' DESC',
};
const fetchFileResult = await media.getFileAssets(getImageOp);
const fileAsset = await fetchFileResult.getFirstObject();
console.info('mediaLibrary fileAsset displayName: ' + fileAsset.displayName);
let fd = await fileAsset.open('rw');
console.info('mediaLibrary fileAsset open fd: ' + fd);
let writeLen = fs.writeSync(fd, 'hello, world');
console.info('write data to file succeed and size is: ' + writeLen);
fileAsset.close(fd);
fetchFileResult.close();
media.release();
} catch (err) {
console.error('mediaLibrary fail, err: ' + err);
}
}
```
**The following example shows how to use the FilePicker APIs to edit a file in the public directory:**
1. Obtain a **DocumentViewPicker** object.
2. Call **DocumentViewPicker.select** to select a file.
3. After a file is selected, a file URI is returned.
4. After the UI is returned from DocumentViewPicker, call [fs.openSync](../../../application-dev/reference/apis/js-apis-file-fs.md#fsopensync) to open the file based on the URI and obtain the FD.
5. Call [fs.writeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#writesync) to edit the file through the FD.
6. After the edit, call [fs.closeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#closesync) to close the FD.
**Example**
```js
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import picker from '@ohos.file.picker';
import fs from '@ohos.file.fs';
let uri;
async function example() {
try {
let DocumentSelectOptions = new picker.DocumentSelectOptions();
let documentPicker = new picker.DocumentViewPicker();
documentPicker.select(DocumentSelectOptions).then((DocumentSelectResult) => {
console.info('DocumentViewPicker.select successfully, DocumentSelectResult uri: ' + JSON.stringify(DocumentSelectResult));
uri = DocumentSelectResult[0];
}).catch((err) => {
console.error('DocumentViewPicker.select failed with err: ' + err);
});
} catch (err) {
console.error('DocumentViewPicker failed with err: ' + err);
}
}
async function writeFile() {
try {
let file = fs.openSync(uri, fs.OpenMode.READ_WRITE);
console.info('DocumentViewPicker file fd: ' + file.fd);
let writeLen = fs.writeSync(file.fd, 'hello, world');
console.info('write data to file succeed and size is: ' + writeLen);
fs.closeSync(file);
} catch (err) {
console.error('DocumentViewPicker fail, err: ' + err);
}
}
```
**The following example shows how to use the mediaLibrary APIs to create a file in the public directory:**
1. Call **getMediaLibrary** to obtain a **mediaLibrary** instance.
2. Call **getPublicDirectory** to obtain the path of the public directory.
3. Call **createAsset** to create a file and obtain the file asset.
4. Call **fileAsset.open** to open the file and obtain the FD.
5. Call **fs.write** to edit the file through the FD.
6. After the edit, call **fileAsset.close** to close the FD.
7. Call **release** to release the **mediaLibrary** instance.
**Example**
```js ```js
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import fs from '@ohos.file.fs';
async function example() {
try {
let context = getContext(this);
let media = mediaLibrary.getMediaLibrary(context);
let mediaType = mediaLibrary.MediaType.FILE;
let DIR_DOWNLOAD = mediaLibrary.DirectoryType.DIR_DOWNLOAD;
const path = await media.getPublicDirectory(DIR_DOWNLOAD);
const fileAsset = await media.createAsset(mediaType, 'test.txt', path);
console.info('mediaLibrary fileAsset displayName: ' + fileAsset.displayName);
let fd = await fileAsset.open('rw');
console.info('mediaLibrary fileAsset open fd: ' + fd);
let writeLen = fs.writeSync(fd, 'hello, world');
console.info('write data to file succeed and size is: ' + writeLen);
fileAsset.close(fd);
media.release();
} catch (err) {
console.error('mediaLibrary fail, err: ' + err);
}
}
```
**The following example shows how to use the FilePicker APIs to create a file in the public directory:**
1. Obtain a **DocumentViewPicker** object.
2. Call **DocumentViewPicker.save** to create and save an empty file.
3. After the file is saved, a file URI is returned.
4. After the UI is returned from DocumentViewPicker, call [fs.openSync](../../../application-dev/reference/apis/js-apis-file-fs.md#fsopensync) to open the file based on the URI and obtain the FD.
5. Call [fs.writeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#writesync) to edit the file through the FD.
6. After the edit, call [fs.closeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#closesync) to close the FD.
**Example**
```js
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import picker from '@ohos.file.picker'; import picker from '@ohos.file.picker';
import fs from '@ohos.file.fs';
let uri;
async function example() { async function example() {
try { try {
let DocumentSaveOptions = new picker.DocumentSaveOptions(); let PhotoSelectOptions = new picker.PhotoSelectOptions();
DocumentSaveOptions.newFileNames = ['DocumentViewPicker01.txt']; PhotoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE;
let documentPicker = new picker.DocumentViewPicker(); PhotoSelectOptions.maxSelectNumber = 1;
documentPicker.save(DocumentSaveOptions).then((DocumentSaveResult) => { let photoPicker = new picker.PhotoViewPicker();
console.info('DocumentViewPicker.save successfully, DocumentSaveResult uri: ' + JSON.stringify(DocumentSaveResult)); photoPicker.select(PhotoSelectOptions).then((PhotoSelectResult) => {
uri = DocumentSaveResult[0]; if (PhotoSelectResult !== undefined) {
}).catch((err) => { console.info("PhotoViewPicker.select pass, PhotoSelectResult uri: " + JSON.stringify(PhotoSelectResult));
console.error('DocumentViewPicker.save failed with err: ' + err); } else {
}); console.error("PhotoViewPicker.select PhotoSelectResult is undefined");
} catch (err) { }
console.error('DocumentViewPicker failed with err: ' + err); }).catch((err) => {
} console.error("PhotoViewPicker.select fail, err: " + err);
} });
} catch (err) {
async function writeFile() { console.error("PhotoViewPicker fail, err: " + err);
try { }
let file = fs.openSync(uri, fs.OpenMode.READ_WRITE);
console.info('DocumentViewPicker file fd: ' + file.fd);
let writeLen = fs.writeSync(file.fd, 'hello, world');
console.info('write data to file succeed and size is: ' + writeLen);
fs.closeSync(file);
} catch (err) {
console.error('DocumentViewPicker fail, err: ' + err);
}
} }
``` ```
**Key API/Component Changes**
The table below lists the mediaLibrary APIs that are not open to third-party applications due to function control. There are no substitute APIs for them.
| Module | Method/Attribute/Enum/Constant | Change Type|
| ------------------------- | ------------------------------------------------------------ | -------- |
| medialibrary | **function** getMediaLibrary(): MediaLibrary; | Deprecated |
| medialibrary | **function** on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\<void\>): void | Deprecated |
| medialibrary | **function** off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\<void\>): void | Deprecated |
| medialibrary | **function** deleteAsset(uri: string): Promise\<void\> | Deprecated |
| medialibrary | **function** deleteAsset(uri: string, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback\<string\>): void | Deprecated |
| medialibrary | **function** storeMediaAsset(option: MediaAssetOption): Promise\<string\> | Deprecated |
| medialibrary | **function** startImagePreview(images: Array\<string\>, index: number, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** startImagePreview(images: Array\<string\>, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** startImagePreview(images: Array\<string\>, index?: number): Promise\<void\> | Deprecated |
| medialibrary | **function** startMediaSelect(option: MediaSelectOption, callback: AsyncCallback\<Array\<string\>\>): void | Deprecated |
| medialibrary | **function** startMediaSelect(option: MediaSelectOption): Promise\<Array\<string\>\> | Deprecated |
| medialibrary | **function** getActivePeers(): Promise\<Array\<PeerInfo\>\>; | Deprecated |
| medialibrary | **function** getActivePeers(callback: AsyncCallback\<Array\<PeerInfo\>\>): void; | Deprecated |
| medialibrary | **function** getAllPeers(): Promise\<Array\<PeerInfo\>\>; | Deprecated |
| medialibrary | **function** FileAsset.isDirectory(callback: AsyncCallback\<boolean\>): void | Deprecated |
| medialibrary | **function** FileAsset.isDirectory():Promise\<boolean\> | Deprecated |
| medialibrary | **function** FileAsset.commitModify(callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** FileAsset.commitModify(): Promise\<void\> | Deprecated |
| medialibrary | **function** FileAsset.getThumbnail(callback: AsyncCallback\<image.PixelMap\>): void | Deprecated |
| medialibrary | **function** FileAsset.getThumbnail(size: Size, callback: AsyncCallback\<image.PixelMap\>): void | Deprecated |
| medialibrary | **function** FileAsset.getThumbnail(size?: Size): Promise\<image.PixelMap\> | Deprecated |
| medialibrary | **function** FileAsset.favorite(isFavorite: boolean, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** FileAsset.favorite(isFavorite: boolean): Promise\<void\> | Deprecated |
| medialibrary | **function** FileAsset.isFavorite(callback: AsyncCallback\<boolean\>): void | Deprecated |
| medialibrary | **function** FileAsset.isFavorite():Promise\<boolean\> | Deprecated |
| medialibrary | **function** FileAsset.trash(isTrash: boolean, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** FileAsset.trash(isTrash: boolean): Promise\<void\> | Deprecated |
| medialibrary | **function** FileAsset.isTrash(callback: AsyncCallback\<boolean\>): void | Deprecated |
| medialibrary | **function** FileAsset.isTrash():Promise\<boolean\> | Deprecated |
| medialibrary | **function** getAlbums(options: MediaFetchOptions, callback: AsyncCallback\<Array\<Album\>\>): void | Deprecated |
| medialibrary | **function** getAlbums(options: MediaFetchOptions): Promise\<Array\<Album\>\> | Deprecated |
| medialibrary | **function** Album.commitModify(callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** Album.commitModify(): Promise\<void\> | Deprecated |
| medialibrary | **enum** DeviceType | Deprecated |
| medialibrary | **interface** PeerInfo | Deprecated |
| medialibrary | **interface** Size | Deprecated |
| medialibrary | **interface** MediaAssetOption | Deprecated |
| medialibrary | **interface** MediaSelectOption | Deprecated |
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
All av_session APIs are changed to system APIs. All av_session APIs are changed to system APIs.
**Change Impacts** **Change Impact**
Non-system applications and applications without system API permission cannot call system APIs. Non-system applications and applications without system API permission cannot call system APIs.
...@@ -10,7 +10,7 @@ Non-system applications and applications without system API permission cannot ca ...@@ -10,7 +10,7 @@ Non-system applications and applications without system API permission cannot ca
All APIs are changed to system APIs. The table below describes the APIs. All APIs are changed to system APIs. The table below describes the APIs.
| API, Enumeration, or Variable| Type| Is System API| | API/Enum/Variable| Type| Is System API|
| -------- | -------- | ------- | | -------- | -------- | ------- |
| SessionToken | interface | Yes| | SessionToken | interface | Yes|
| AVMetadata | interface | Yes| | AVMetadata | interface | Yes|
......
# Changelog of NFC JS APIs in the Communication Subsystem
## 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.
You need to adapt your application based on the following information.
**Change Impact**
The deprecated JS APIs in API versions 6 to 8 are affected. Your application needs to adapt new APIs so that it can properly implement functions in the SDK environment of the new version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enumeration/Constant | Change Type|
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | FeatureType | Deprecated |
| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | isSupported | Deprecated |
| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | hasHceCapability | Added |
| api/@ohos.nfc.controller.d.ts | nfcController | isNfcAvailable | Deprecated |
| api/@ohos.nfc.controller.d.ts | nfcController | openNfc | Deprecated |
| api/@ohos.nfc.controller.d.ts | nfcController | closeNfc | Deprecated |
| api/@ohos.nfc.controller.d.ts | nfcController | enableNfc | Added |
| api/@ohos.nfc.controller.d.ts | nfcController | disableNfc | Added |
| api/@ohos.nfc.tag.d.ts | tag | getNfcATag | Deprecated |
| api/@ohos.nfc.tag.d.ts | tag | getNfcBTag | Deprecated |
| api/@ohos.nfc.tag.d.ts | tag | getNfcFTag | Deprecated |
| api/@ohos.nfc.tag.d.ts | tag | getNfcVTag | Deprecated |
| api/@ohos.nfc.tag.d.ts | tag | getNfcA | Added |
| api/@ohos.nfc.tag.d.ts | tag | getNfcB | Added |
| api/@ohos.nfc.tag.d.ts | tag | getNfcF | Added |
| api/@ohos.nfc.tag.d.ts | tag | getNfcV | Added |
| api/tag/tagSession.d.ts | TagSession | getTagInfo | Deprecated |
| api/tag/tagSession.d.ts | TagSession | connectTag | Deprecated |
| api/tag/tagSession.d.ts | TagSession | reset | Deprecated |
| api/tag/tagSession.d.ts | TagSession | isTagConnected | Deprecated |
| api/tag/tagSession.d.ts | TagSession | setSendDataTimeout | Deprecated |
| api/tag/tagSession.d.ts | TagSession | getSendDataTimeout | Deprecated |
| api/tag/tagSession.d.ts | TagSession | sendData | Deprecated |
| api/tag/tagSession.d.ts | TagSession | getMaxSendLength | Deprecated |
| api/tag/tagSession.d.ts | TagSession | connect | Added |
| api/tag/tagSession.d.ts | TagSession | resetConnection | Added |
| api/tag/tagSession.d.ts | TagSession | isConnected | Added |
| api/tag/tagSession.d.ts | TagSession | setTimeout | Added |
| api/tag/tagSession.d.ts | TagSession | getTimeout | Added |
| api/tag/tagSession.d.ts | TagSession | transmit | Added |
| api/tag/tagSession.d.ts | TagSession | getMaxTransmitSize | Added |
**Adaptation Guide**
See the following:
[@ohos.nfc.cardEmulation (Standard NFC Card Emulation)](../../../application-dev/reference/apis/js-apis-cardEmulation.md)
[@ohos.nfc.controller (Standard NFC)](../../../application-dev/reference/apis/js-apis-nfcController.md)
[@ohos.nfc.tag (Standard NFC Tags)](../../../application-dev/reference/apis/js-apis-nfcTag.md)
[tagSession (Standard NFC Tag Session)](../../../application-dev/reference/apis/js-apis-tagSession.md)
```
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
## cl.notification.1 Deleting Deprecated APIs (Version 9) ## cl.notification.1 Deleting Deprecated APIs (Version 9)
In the [event notification exception handling rectification](../OpenHarmony_3.2.8.3/changelogs-notification.md), some APIs in API version 9 are marked as deprecated, and these APIs need to be deleted, according to OpenHarmony API specifications. In the event notification exception handling rectification, some APIs in API version 9 are marked as deprecated, and these APIs need to be deleted, according to OpenHarmony API specifications.
**Change Impacts** **Change Impacts**
......
# Location Subsystem Changelog
## cl.location.1 API Migration from @ohos.geolocation.d.ts to @ohos.geoLocationManager.d.ts
APIs in **@ohos.geolocation.d.ts** do not support throwing error codes. To support this function, all APIs in **@ohos.geolocation.d.ts** are migrated to the newly added **@ohos.geoLocationManager.d.ts** file, and corresponding error code description is added.
To use APIs of the location subsystem, you need to import **@ohos.geoLocationManager**.
import geoLocationManager from '@ohos.geoLocationManager';
**Change Impact**
All APIs of the location subsystem are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**.
import geoLocationManager from '@ohos.geoLocationManager';
**Key API/Component Changes**
| Class| API Type| Declaration| Change Type|
| -- | -- | -- | -- |
|geolocation| method | function on(type: 'locationChange', request: LocationRequest, callback: Callback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function off(type: 'locationChange', callback?: Callback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function on(type: 'locationServiceState', callback: Callback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'locationServiceState'** to **type: 'locationEnabledChange'**.|
|geolocation| method | function off(type: 'locationServiceState', callback?: Callback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'locationServiceState'** to **type: 'locationEnabledChange'**.|
|geolocation| method | function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback<Array<Location>>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'cachedGnssLocationsReporting'** to **type: 'cachedGnssLocationsChange'**.|
|geolocation| method | function off(type: 'cachedGnssLocationsReporting', callback?: Callback<Array<Location>>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'cachedGnssLocationsReporting'** to **type: 'cachedGnssLocationsChange'**.|
|geolocation| method | function on(type: 'gnssStatusChange', callback: Callback<SatelliteStatusInfo>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'gnssStatusChange'** to **type: 'satelliteStatusChange'**.|
|geolocation| method | function off(type: 'gnssStatusChange', callback?: Callback<SatelliteStatusInfo>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'gnssStatusChange'** to **type: 'satelliteStatusChange'**.|
|geolocation| method | function on(type: 'nmeaMessageChange', callback: Callback<string>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'nmeaMessageChange'** to **type: 'nmeaMessage'**.|
|geolocation| method | function off(type: 'nmeaMessageChange', callback?: Callback<string>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'nmeaMessageChange'** to **type: 'nmeaMessage'**.|
|geolocation| method | function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'fenceStatusChange'** to **type: 'gnssFenceStatusChange'**.|
|geolocation| method | function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'fenceStatusChange'** to **type: 'gnssFenceStatusChange'**.|
|geolocation| method | function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getCurrentLocation(callback: AsyncCallback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getCurrentLocation(request?: CurrentLocationRequest): Promise<Location>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getLastLocation(callback: AsyncCallback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function getLastLocation(): Location**.|
|geolocation| method | function getLastLocation(): Promise<Location>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function getLastLocation(): Location**.|
|geolocation| method | function isLocationEnabled(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isLocationEnabled(): boolean**.|
|geolocation| method | function isLocationEnabled(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isLocationEnabled(): boolean**.|
|geolocation| method | function requestEnableLocation(callback: AsyncCallback<boolean>): void; | Deleted.|
|geolocation| method | function requestEnableLocation(): Promise<boolean>; | Deleted.|
|geolocation| method | function enableLocation(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function enableLocation(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function disableLocation(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableLocation(): void**.|
|geolocation| method | function disableLocation(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableLocation(): void**.|
|geolocation| method | function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise<Array<GeoAddress>>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getAddressesFromLocationName(request: GeoCodeRequest): Promise<Array<GeoAddress>>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function isGeoServiceAvailable(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isGeocoderAvailable(): boolean**.|
|geolocation| method | function isGeoServiceAvailable(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isGeocoderAvailable(): boolean**.|
|geolocation| method | function getCachedGnssLocationsSize(callback: AsyncCallback<number>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getCachedGnssLocationsSize(): Promise<number>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function flushCachedGnssLocations(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function flushCachedGnssLocations(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function sendCommand(command: LocationCommand, callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function sendCommand(command: LocationCommand): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function enableLocationMock(callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function enableLocationMock(): void**.|
|geolocation| method | function enableLocationMock(): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function enableLocationMock(): void**.|
|geolocation| method | function disableLocationMock(callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableLocationMock(): void**.|
|geolocation| method | function disableLocationMock(): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableLocationMock(): void**.|
|geolocation| method | function setMockedLocations(config: LocationMockConfig, callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setMockedLocations(config: LocationMockConfig): void**.|
|geolocation| method | function setMockedLocations(config: LocationMockConfig): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setMockedLocations(config: LocationMockConfig): void**.|
|geolocation| method | function enableReverseGeocodingMock(callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function enableReverseGeocodingMock(): void**.|
|geolocation| method | function enableReverseGeocodingMock(): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function enableReverseGeocodingMock(): void**.|
|geolocation| method | function disableReverseGeocodingMock(callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableReverseGeocodingMock(): void**.|
|geolocation| method | function disableReverseGeocodingMock(): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableReverseGeocodingMock(): void**.|
|geolocation| method | function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>, callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>): void**.|
|geolocation| method | function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>): void**.|
|geolocation| method | function isLocationPrivacyConfirmed(type: LocationPrivacyType, callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean**.|
|geolocation| method | function isLocationPrivacyConfirmed(type: LocationPrivacyType,): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean**.|
|geolocation| method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean, callback: AsyncCallback<void>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void**.|
|geolocation| method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): Promise<void>; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void**.|
|geolocation| interface | SatelliteStatusInfo | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | CachedGnssLocationsRequest | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | GeofenceRequest | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | Geofence | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | ReverseGeoCodeRequest | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | GeoCodeRequest | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | GeoAddress | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | LocationRequest | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | CurrentLocationRequest | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | Location | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| enum | LocationRequestPriority | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| enum | LocationRequestScenario | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| enum | GeoLocationErrorCode | Deprecated.|
|geolocation| enum | LocationPrivacyType | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| enum | LocationCommand | Migrated to **@ohos.geoLocationManager.d.ts**.|
**(Optional) Adaptation Guide**
The following sample code shows how to call **enableLocation** in the new version:
```ts
import geoLocationManager from '@ohos.geoLocationManager';
try {
geoLocationManager.enableLocation((err, data) => {
if (err) {
console.log('enableLocation: err=' + JSON.stringify(err));
}
});
} catch (err) {
console.error("errCode:" + err.code + ",errMessage:" + err.message);
}
```
# Location Subsystem Changelog
## cl.location.1 API Migration from @ohos.geolocation.d.ts to @ohos.geoLocationManager.d.ts
APIs in **@ohos.geolocation.d.ts** do not support throwing error codes. To support this function, all APIs in **@ohos.geolocation.d.ts** are migrated to the newly added **@ohos.geoLocationManager.d.ts** file, and corresponding error code description is added.
To use APIs of the location subsystem, you need to import **@ohos.geoLocationManager**.
import geoLocationManager from '@ohos.geoLocationManager';
**Change Impact**
All APIs of the location subsystem are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**.
import geoLocationManager from '@ohos.geoLocationManager';
**Key API/Component Changes**
| Class| API Type| Declaration| Change Type|
| -- | -- | -- | -- |
|geolocation| namespace | declare namespace geolocation| Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **namespace geoLocationManager**.|
|geolocation| method | function on(type: 'locationChange', request: LocationRequest, callback: Callback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function off(type: 'locationChange', callback?: Callback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function on(type: 'locationServiceState', callback: Callback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function off(type: 'locationServiceState', callback?: Callback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback<Array<Location>>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function off(type: 'cachedGnssLocationsReporting', callback?: Callback<Array<Location>>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function on(type: 'gnssStatusChange', callback: Callback<SatelliteStatusInfo>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function off(type: 'gnssStatusChange', callback?: Callback<SatelliteStatusInfo>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function on(type: 'nmeaMessageChange', callback: Callback<string>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function off(type: 'nmeaMessageChange', callback?: Callback<string>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getCurrentLocation(callback: AsyncCallback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getCurrentLocation(request?: CurrentLocationRequest): Promise<Location>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getLastLocation(callback: AsyncCallback<Location>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getLastLocation(): Promise<Location>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function isLocationEnabled(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function isLocationEnabled(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function requestEnableLocation(callback: AsyncCallback<boolean>): void; | Deleted.|
|geolocation| method | function requestEnableLocation(): Promise<boolean>; | Deleted.|
|geolocation| method | function enableLocation(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function enableLocation(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function disableLocation(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function disableLocation(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise<Array<GeoAddress>>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getAddressesFromLocationName(request: GeoCodeRequest): Promise<Array<GeoAddress>>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function isGeoServiceAvailable(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function isGeoServiceAvailable(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getCachedGnssLocationsSize(callback: AsyncCallback<number>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function getCachedGnssLocationsSize(): Promise<number>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function flushCachedGnssLocations(callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function flushCachedGnssLocations(): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function sendCommand(command: LocationCommand, callback: AsyncCallback<boolean>): void; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| method | function sendCommand(command: LocationCommand): Promise<boolean>; | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | SatelliteStatusInfo | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | CachedGnssLocationsRequest | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | GeofenceRequest | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | Geofence | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | ReverseGeoCodeRequest | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | GeoCodeRequest | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | GeoAddress | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | LocationRequest | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | CurrentLocationRequest | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| interface | Location | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| enum | LocationRequestPriority | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| enum | LocationRequestScenario | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| enum | GeoLocationErrorCode | Deprecated.|
|geolocation| enum | LocationPrivacyType | Migrated to **@ohos.geoLocationManager.d.ts**.|
|geolocation| enum | LocationCommand | Migrated to **@ohos.geoLocationManager.d.ts**.|
**(Optional) Adaptation Guide**
The following sample code shows how to call **enableLocation** in the new version:
```ts
import geoLocationManager from '@ohos.geoLocationManager';
try {
geoLocationManager.enableLocation((err, data) => {
if (err) {
console.log('enableLocation: err=' + JSON.stringify(err));
}
});
} catch (err) {
console.error("errCode:" + err.code + ",errMessage:" + err.message);
}
```
# Upload and Download Subsystem Changelog # Upload and Download Subsystem Changelog
## cl.request.2 request API Change ## cl.request.2 Upload and Download API Change
Deleted the beta APIs in API version 9: - Deleted the beta APIs in API version 9:
1. function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void;
1. function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback\<DownloadTask>): void; 2. function download(context: BaseContext, config: DownloadConfig): Promise<DownloadTask>;
2. function download(context: BaseContext, config: DownloadConfig): Promise\<DownloadTask>; 3. function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback<UploadTask>): void;
3. function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback\<UploadTask>): void; 4. function upload(context: BaseContext, config: UploadConfig): Promise<UploadTask>;
4. function upload(context: BaseContext, config: UploadConfig): Promise\<UploadTask>;
**Change Impact** **Change Impact**
The application developed based on an earlier version in the stage model needs to be adapted to the new APIs. Otherwise, the original service logic will be affected. The application developed based on the Stage mode of earlier versions needs to be adapted. Otherwise, the service logic will be affected.
**Key API/Component Changes** **Key API/Component Changes**
| Module | Class | Method/Attribute/Enum/Constant | Change Type| | Module | Class | Method/Attribute/Enumeration/Constant | Change Type|
|--------------|--------------|-------------------------------------------------------------------------------------------------------------------|------| |--------------|--------------|-------------------------------------------------------------------------------------------------------------------|------|
| ohos.request | request | function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback\<DownloadTask>): void; | Deleted | | ohos.request | request | function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void; | Deleted. |
| ohos.request | request | function download(context: BaseContext, config: DownloadConfig): Promise\<DownloadTask>; | Deleted | | ohos.request | request | function download(context: BaseContext, config: DownloadConfig): Promise<DownloadTask>; | Deleted. |
| ohos.request | request | function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback\<UploadTask>): void; | Deleted | | ohos.request | request | function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback<UploadTask>): void; | Deleted. |
| ohos.request | request | function upload(context: BaseContext, config: UploadConfig): Promise\<UploadTask>; | Deleted | | ohos.request | request | function upload(context: BaseContext, config: UploadConfig): Promise<UploadTask>; | Deleted. |
**Adaptation Guide** **Adaptation Guide**
Call the new APIs. The following uses **downloadFile** as an example to show how it is called in the new version: The following sample code shows how to call **downloadFile** in the new version:
```ts ```ts
try { try {
......
# Resource Scheduler Subsystem ChangeLog # Resource Scheduler Subsystem Changelog
## cl.resourceschedule.backgroundTaskManager ## cl.resourceschedule.backgroundTaskManager
Rectified the original APIs of **backgroundTaskManager** of the resource scheduler subsystem. All APIs of API version 9 in the **@ohos.backgroundTaskManager.d.ts** file are deleted, and the APIs of API version 9 in the **@ohos.resourceschedule.backgroundTaskManager.d.ts** file are used. The new APIs in API version 9 comply with the error code specifications. Rectified the original APIs of **backgroundTaskManager** of the resource scheduler subsystem. All APIs of API version 9 in the **@ohos.backgroundTaskManager.d.ts** file are deleted, and the APIs of API version 9 in the **@ohos.resourceschedule.backgroundTaskManager.d.ts** file are used. The new APIs in API version 9 comply with the error code specifications.
......
# Security Subsystem ChangeLog # Security Subsystem Changelog
## cl.security.1 Change of the setSeed API of Random from Asynchronous to Synchronous ## cl.security.1 Change of setSeed() from Asynchronous to Synchronous
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
API prototype before the change: API before the change:
setSeed(seed : DataBlob, callback : AsyncCallback\<void>) : void; setSeed(seed : DataBlob, callback : AsyncCallback\<void>) : void;
setSeed(seed : DataBlob) : Promise\<void>; setSeed(seed : DataBlob) : Promise\<void>;
API prototype after the change: API after the change:
setSeed(seed : DataBlob) : void; setSeed(seed : DataBlob) : void;
**Adaptation Guide** **Adaptation Guide**
See the API adaptation guide of **setSeed** in the API reference: See **setSeed()** in the following:
[Crypto Framework - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cryptoFramework.md) [Crypto Framework](../../../application-dev/reference/apis/js-apis-cryptoFramework.md)
## cl.security.2 Migration of interface DataArray from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts ## cl.security.2 Move of DataArray from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
Migrated **interface DataArray** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. Moved **DataArray** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide** **Adaptation Guide**
Import and use the new .d.ts file: Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert'; import cryptoCert from '@ohos.security.cert';
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.3 Migration of interface EncodingFormat from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts ## cl.security.3 Move of EncodingFormat from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
Migrated **interface EncodingFormat** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. Moved **EncodingFormat** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide** **Adaptation Guide**
Import and use the new .d.ts file: Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert'; import cryptoCert from '@ohos.security.cert';
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.4 Migration of interface EncodingBlob from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts ## cl.security.4 Move of EncodingBlob from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
Migrated **interface EncodingBlob** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. Moved **EncodingBlob** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide** **Adaptation Guide**
Import and use the new .d.ts file: Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert'; import cryptoCert from '@ohos.security.cert';
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.5 Migration of interface CertChainData from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts ## cl.security.5 Move of CertChainData from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
Migrated **interface CertChainData** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. Moved **interface CertChainData** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide** **Adaptation Guide**
Import and use the new .d.ts file: Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert'; import cryptoCert from '@ohos.security.cert';
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.6 Migration of interface X509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts ## cl.security.6 Move of X509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
Migrated **interface X509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. Moved **X509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide** **Adaptation Guide**
Import and use the new .d.ts file: Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert'; import cryptoCert from '@ohos.security.cert';
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.7 Migration of function createX509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts ## cl.security.7 Move of createX509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
Migrated **function createX509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. Moved **createX509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide** **Adaptation Guide**
Import and use the new .d.ts file: Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert'; import cryptoCert from '@ohos.security.cert';
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.8 Migration of interface X509CrlEntry from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts. ## cl.security.8 Move of X509CrlEntry from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts.
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
Migrated **interface X509CrlEntry** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. Moved **X509CrlEntry** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide** **Adaptation Guide**
Import and use the new .d.ts file: Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert'; import cryptoCert from '@ohos.security.cert';
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.9 Migration of interface X509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts ## cl.security.9 Move of X509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
Migrated **interface X509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. Moved **X509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide** **Adaptation Guide**
Import and use the new .d.ts file: Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert'; import cryptoCert from '@ohos.security.cert';
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.10 Migration of function createX509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts ## cl.security.10 Move of createX509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
Migrated **function createX509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. Moved **createX509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide** **Adaptation Guide**
Import and use the new .d.ts file: Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert'; import cryptoCert from '@ohos.security.cert';
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.11 Migration of interface CertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts ## cl.security.11 Move of CertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
Migrated **interface CertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. Moved **CertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide** **Adaptation Guide**
Import and use the new .d.ts file: Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert'; import cryptoCert from '@ohos.security.cert';
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.12 Migration of function createCertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts ## cl.security.12 Move of createCertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
Migrated **function createCertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. Moved **createCertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**.
**Adaptation Guide** **Adaptation Guide**
Import and use the new .d.ts file: Import and use the new .d.ts file:
import cryptoCert from '@ohos.security.cert'; import cryptoCert from '@ohos.security.cert';
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.13 Change of the getPublicKey API of X509Cert from Asynchronous to Synchronous ## cl.security.13 Change of getPublicKey() of X509Cert from Asynchronous to Synchronous
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
API prototype before the change: API before the change:
getPublicKey(callback : AsyncCallback\<PubKey>) : void; getPublicKey(callback : AsyncCallback\<PubKey>) : void;
getPublicKey() : Promise\<PubKey>; getPublicKey() : Promise\<PubKey>;
API prototype after the change: API after the change:
getPublicKey() : cryptoFramework.PubKey; getPublicKey() : cryptoFramework.PubKey;
**Adaptation Guide** **Adaptation Guide**
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.14 Change of the checkValidityWithDate API of X509Cert from Asynchronous to Synchronous ## cl.security.14 Change of checkValidityWithDate of X509Cert from Asynchronous to Synchronous
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
API prototype before the change: API before the change:
checkValidityWithDate(date: string, callback : AsyncCallback\<void>) : void; checkValidityWithDate(date: string, callback : AsyncCallback\<void>) : void;
checkValidityWithDate(date: string) : Promise\<void>; checkValidityWithDate(date: string) : Promise\<void>;
API prototype after the change: API after the change:
checkValidityWithDate(date: string) : void; checkValidityWithDate(date: string) : void;
**Adaptation Guide** **Adaptation Guide**
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.15 Change of the getCertIssuer API of X509CrlEntry from Asynchronous to Synchronous ## cl.security.15 Change of getCertIssuer of X509CrlEntry from Asynchronous to Synchronous
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
API prototype before the change: API before the change:
getCertIssuer(callback : AsyncCallback\<DataBlob>) : void; getCertIssuer(callback : AsyncCallback\<DataBlob>) : void;
getCertIssuer() : Promise\<DataBlob>; getCertIssuer() : Promise\<DataBlob>;
API prototype after the change: API after the change:
getCertIssuer() : DataBlob; getCertIssuer() : DataBlob;
**Adaptation Guide** **Adaptation Guide**
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.16 Change of the getRevocationDate API of X509CrlEntry from Asynchronous to Synchronous ## cl.security.16 Change of getRevocationDate of X509CrlEntry from Asynchronous to Synchronous
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
API prototype before the change: API before the change:
getRevocationDate(callback : AsyncCallback\<string>) : void; getRevocationDate(callback : AsyncCallback\<string>) : void;
getRevocationDate() : Promise\<string>; getRevocationDate() : Promise\<string>;
API prototype after the change: API after the change:
getRevocationDate() : string; getRevocationDate() : string;
**Adaptation Guide** **Adaptation Guide**
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.17 Change of the isRevoked API of X509Crl from Asynchronous to Synchronous ## cl.security.17 Change of isRevoked of X509Crl from Asynchronous to Synchronous
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
API prototype before the change: API before the change:
isRevoked(cert : X509Cert, callback : AsyncCallback\<boolean>) : void; isRevoked(cert : X509Cert, callback : AsyncCallback\<boolean>) : void;
isRevoked(cert : X509Cert) : Promise\<boolean>; isRevoked(cert : X509Cert) : Promise\<boolean>;
API prototype after the change: API after the change:
isRevoked(cert : X509Cert) : boolean; isRevoked(cert : X509Cert) : boolean;
**Adaptation Guide** **Adaptation Guide**
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.18 Change of the getRevokedCert API of X509Crl from Asynchronous to Synchronous ## cl.security.18 Change of getRevokedCert of X509Crl from Asynchronous to Synchronous
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
API prototype before the change: API before the change:
getRevokedCert(serialNumber : number, callback : AsyncCallback\<X509CrlEntry>) : void; getRevokedCert(serialNumber : number, callback : AsyncCallback\<X509CrlEntry>) : void;
getRevokedCert(serialNumber : number) : Promise\<X509CrlEntry>; getRevokedCert(serialNumber : number) : Promise\<X509CrlEntry>;
API prototype after the change: API after the change:
getRevokedCert(serialNumber : number) : X509CrlEntry; getRevokedCert(serialNumber : number) : X509CrlEntry;
**Adaptation Guide** **Adaptation Guide**
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.19 Change of the getRevokedCertWithCert API of X509Crl from Asynchronous to Synchronous ## cl.security.19 Change of getRevokedCertWithCert of X509Crl from Asynchronous to Synchronous
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
API prototype before the change: API before the change:
getRevokedCertWithCert(cert : X509Cert, callback : AsyncCallback\<X509CrlEntry>) : void; getRevokedCertWithCert(cert : X509Cert, callback : AsyncCallback\<X509CrlEntry>) : void;
getRevokedCertWithCert(cert : X509Cert) : Promise\<X509CrlEntry>; getRevokedCertWithCert(cert : X509Cert) : Promise\<X509CrlEntry>;
API prototype after the change: API after the change:
getRevokedCertWithCert(cert : X509Cert) : X509CrlEntry; getRevokedCertWithCert(cert : X509Cert) : X509CrlEntry;
**Adaptation Guide** **Adaptation Guide**
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.20 Change of the getTbsInfo API of X509Crl from Asynchronous to Synchronous ## cl.security.20 Change of getTbsInfo of X509Crl from Asynchronous to Synchronous
**Change Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. 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** **Key API/Component Changes**
API prototype before the change: API before the change:
getTbsInfo(callback : AsyncCallback\<DataBlob>) : void; getTbsInfo(callback : AsyncCallback\<DataBlob>) : void;
getTbsInfo() : Promise\<DataBlob>; getTbsInfo() : Promise\<DataBlob>;
API prototype after the change: API after the change:
getTbsInfo() : DataBlob; getTbsInfo() : DataBlob;
**Adaptation Guide** **Adaptation Guide**
See the corresponding API adaptation guide in the API reference: See the following API reference:
[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) [Certificate](../../../application-dev/reference/apis/js-apis-cert.md)
## cl.security.21 Support of No-Hash Signing Mode for HUKS ## 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 perform digest processing by default. In this case, the service needs to perform the hash operation on the original data and then pass the hashed digest to HUKS for signing or signature verification. 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 Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. 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. The application needs to adapt these APIs so that the signing or signature verification result can be passed before and after the change.
...@@ -357,11 +357,11 @@ The application needs to adapt these APIs so that the signing or signature verif ...@@ -357,11 +357,11 @@ The application needs to adapt these APIs so that the signing or signature verif
Released JavaScript APIs remain unchanged, but parameter sets passed to the APIs are changed. Released JavaScript APIs remain unchanged, but parameter sets passed to the APIs are changed.
The service uses the No-Hash signing mode, and needs to hash the original data and then pass the 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**. 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** **Adaptation Guide**
Take signing as an example. The sample code is as follows: The following uses signing as an example.
```js ```js
import huks from '@ohos.security.huks'; import huks from '@ohos.security.huks';
...@@ -399,13 +399,13 @@ let signOptions = { ...@@ -399,13 +399,13 @@ let signOptions = {
huks.initSession(keyAlias, signOptions); huks.initSession(keyAlias, signOptions);
``` ```
For sample codes of other APIs, see [HUKS guidelines](../../../application-dev/security/huks-guidelines.md) and [HUKS APIs](../../../application-dev/reference/apis/js-apis-huks.md). For for information about the sample code, see [HUKS Development](../../../application-dev/security/huks-guidelines.md) and [HUKS](../../../application-dev/reference/apis/js-apis-huks.md).
## cl.security.22 Support of Key Calculation Parameter Specification for HUKS During Key Usage ## 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 specified when the key is used. The application can specify key calculation parameters more flexibly. 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 Impacts** **Change Impact**
Behavior of released JavaScript APIs will be changed. Behavior of released JavaScript APIs will be changed.
...@@ -413,7 +413,7 @@ The application can specify only mandatory parameters when creating a key and sp ...@@ -413,7 +413,7 @@ The application can specify only mandatory parameters when creating a key and sp
**Key API/Component Changes** **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 guidelines](../../../application-dev/security/huks-guidelines.md). 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.generateKeyItem
...@@ -429,7 +429,7 @@ huks.finishSession ...@@ -429,7 +429,7 @@ huks.finishSession
**Adaptation Guide** **Adaptation Guide**
Take key generation as an example. The sample code is as follows: The following uses the key generation process as an example.
```js ```js
let keyAlias = 'keyAlias'; let keyAlias = 'keyAlias';
...@@ -472,4 +472,4 @@ try { ...@@ -472,4 +472,4 @@ try {
} }
``` ```
For sample codes of other APIs, see [HUKS guidelines](../../../application-dev/security/huks-guidelines.md) and [HUKS APIs](../../../application-dev/reference/apis/js-apis-huks.md). For for information about the sample code, see [HUKS Development](../../../application-dev/security/huks-guidelines.md) and [HUKS](../../../application-dev/reference/apis/js-apis-huks.md).
# Location Subsystem ChangeLog # Location Subsystem Changelog
## cl.location.1 API Migration from @system.geolocation.d.ts to @ohos.geoLocationManager.d.ts ## cl.location.1 API Migration from @system.geolocation.d.ts to @ohos.geoLocationManager.d.ts
...@@ -9,7 +9,7 @@ To use APIs of the location subsystem, you need to import **@ohos.geoLocationMan ...@@ -9,7 +9,7 @@ To use APIs of the location subsystem, you need to import **@ohos.geoLocationMan
import geoLocationManager from '@ohos.geoLocationManager'; import geoLocationManager from '@ohos.geoLocationManager';
**Change Impacts** **Change Impact**
All APIs of the location subsystem are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**. All APIs of the location subsystem are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**.
...@@ -17,19 +17,19 @@ import geoLocationManager from '@ohos.geoLocationManager'; ...@@ -17,19 +17,19 @@ import geoLocationManager from '@ohos.geoLocationManager';
**Key API/Component Changes** **Key API/Component Changes**
| Class | API Type | Declaration | Change Type | | Class| API Type| Declaration| Change Type|
| ----------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ | | -- | -- | -- | -- |
| Geolocation | class | Geolocation | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager**.| |Geolocation| class | Geolocation | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager**.|
| Geolocation | interface | static getLocation(options?: GetLocationOption): void; | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.getCurrentLocation**.| |Geolocation| interface | static getLocation(options?: GetLocationOption): void; | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.getCurrentLocation**.|
| Geolocation | interface | static getLocationType(options?: GetLocationTypeOption): void; | Deprecated. | |Geolocation| interface | static getLocationType(options?: GetLocationTypeOption): void; | Deprecated.|
| Geolocation | interface | static subscribe(options: SubscribeLocationOption): void; | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.on#event:locationChange**.| |Geolocation| interface | static subscribe(options: SubscribeLocationOption): void; | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.on#event:locationChange**.|
| Geolocation | interface | static unsubscribe(): void; | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.off#event:locationChange**.| |Geolocation| interface | static unsubscribe(): void; | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.off#event:locationChange**.|
| Geolocation | interface | static getSupportedCoordTypes(): Array<string>; | Deprecated. | |Geolocation| interface | static getSupportedCoordTypes(): Array<string>; | Deprecated.|
| | interface | GeolocationResponse | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.Location**.| || interface | GeolocationResponse| Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.Location**.|
| | interface | GetLocationOption | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.CurrentLocationRequest**.| || interface | GetLocationOption | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.CurrentLocationRequest**.|
| | interface | GetLocationTypeResponse | Deprecated. | || interface | GetLocationTypeResponse | Deprecated.|
| | interface | GetLocationTypeOption | Deprecated. | || interface | GetLocationTypeOption | Deprecated.|
| | interface | SubscribeLocationOption | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.LocationRequest**.| || interface | SubscribeLocationOption | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.LocationRequest**.|
**(Optional) Adaptation Guide** **(Optional) Adaptation Guide**
......
...@@ -5,15 +5,15 @@ ...@@ -5,15 +5,15 @@
## cl.telephony.1 Radio Module API Change ## cl.telephony.1 Radio Module API Change
### Changed the `isNrSupported` API in the radio module of the telephone subsystem: ### Changed the `isNrSupported` API in the radio module of the telephony subsystem:
NR is a proper noun and must be capitalized. NR is a proper noun and must be capitalized.
You need to adapt your application. You need to adapt your application based on the following information.
**Change Impacts** **Change Impact**
The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected. The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
......
# Common Library Subsystem Changelog # Common Library Subsystem Changelog
Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(MR) has the following API changes in the URL module of the common library subsystem.
## cl.commonlibrary.1 URLParams Class Changes ## cl.commonlibrary.1 URLParams Class Changes
The constructor function of the **URLParams** class in the URL module of the common library subsystem is changed. The constructor function of the **URLParams** class in the URL module of the common library subsystem is changed.
Specifically, **constructor(init?: string[][] | Record<string, string> | string | URLSearchParams)** is changed to **constructor(init?: string[][] | Record<string, string> | string | URLParams)**, and the parameter type is changed from **URLSearchParams** to **URLParams**. Specifically, **constructor(init?: string[][] | Record<string, string> | string | URLSearchParams)** is changed to **constructor(init?: string[][] | Record<string, string> | string | URLParams)**, and the parameter type is changed from **URLSearchParams** to **URLParams**.
...@@ -19,7 +16,7 @@ JS APIs in API version 9 are affected. Your application needs to adapt these API ...@@ -19,7 +16,7 @@ JS APIs in API version 9 are affected. Your application needs to adapt these API
| Module | Class | Method/Attribute/Enum/Constant | Change Type| | Module | Class | Method/Attribute/Enum/Constant | Change Type|
| :------------------------ | ------------------- | ------------------------------------------------------------ | -------- | | :------------------------ | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.url | URLParams | constructor(string[][] \| Record&lt;string, string&gt; \| string \| URLSearchParams) | Deleted | | @ohos.url | URLParams | constructor(string[][] \| Record&lt;string, string&gt; \| string \| URLSearchParams) | Deleted |
| @ohos.url | URLParams | constructor(string[][] \| Record&lt;string, string&gt; \| string \| URLParams)| Changed | @ohos.url | URLParams | constructor(string[][] \| Record&lt;string, string&gt; \| string \| URLParams)| Changed |
**Adaptation Guide** **Adaptation Guide**
...@@ -39,14 +36,13 @@ try { ...@@ -39,14 +36,13 @@ try {
} }
``` ```
## cl.commonlibrary.2 URL Attribute Changes of URLParams Class APIs ## cl.commonlibrary.2 URL Attribute Changes of URLParams Class APIs
The URL attributes of the URL module in the common library subsystem are changed. The URL attributes of the URL module in the common library subsystem are changed.
Specifically, the **searchParams: URLSearchParams** attribute is deprecated, and the **params: URLParams** attribute is added. Specifically, the **searchParams: URLSearchParams** attribute is deprecated, and the **params: URLParams** attribute is added.
You need to adapt your application. You need to adapt your application.
**Change Impacts** **Change Impacts**
JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. 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.
......
# User IAM Subsystem ChangeLog # User IAM Subsystem Changelog
## cl.useriam.1 API9 Authentication Result Code Class Name Change ## cl.useriam.1 API9 Result Value Change
The name of the authentication result code class of user IAM API version 9 is changed from **ResultCode** to **UserAuthResultCode**. Changed the return value **ResultCodeV9** to **UserAuthResultCode** for API9.
**Change Impacts** **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. 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.
......
# Window Subsystem ChangeLog # Window Manager Subsystem Changelog
## cl.window.1 Change of Window Stage Lifecycle Listener Types ## cl.window.1 Change of Window Stage Lifecycle Listener Types
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册