提交 dffa5328 编写于 作者: W wusongqing

updated docs

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 ec434260
...@@ -15,17 +15,17 @@ SystemCapability.BundleManager.BundleFramework ...@@ -15,17 +15,17 @@ SystemCapability.BundleManager.BundleFramework
## Required Permissions ## Required Permissions
| Required Permissions| Permission Level| Description| | Required Permissions | Permission Level | Description |
|-------| --------- | ---- | | ---------------------------------------- | ------------ | --------- |
| ohos.permission.GET_BUNDLE_INFO | normal | Permission to query information about the current application.| | ohos.permission.GET_BUNDLE_INFO | normal | Permission to query information about the current application.|
| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED| system_basic | Permission to query information about all applications.| | ohos.permission.GET_BUNDLE_INFO_PRIVILEGED| system_basic | Permission to query information about all applications.|
| ohos.permission.INSTALL_BUNDLE | system_core | Permission to install or uninstall applications.| | ohos.permission.INSTALL_BUNDLE | system_core | Permission to install or uninstall applications. |
## bundle.getApplicationInfo ## bundle.getApplicationInfo
getApplicationInfo(bundleName: string, bundleFlags: number, userId?: number): Promise\<ApplicationInfo> getApplicationInfo(bundleName: string, bundleFlags: number, userId?: number): Promise\<ApplicationInfo>
Obtains the application information based on a given bundle name. This method uses a promise to return the result. Obtains the application information based on a given bundle name. This API uses a promise to return the result.
**Required permissions** **Required permissions**
...@@ -37,16 +37,16 @@ SystemCapability.BundleManager.BundleFramework ...@@ -37,16 +37,16 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ------------------------------------------------------------ | | ----------- | ------ | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of the application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
**Return value** **Return value**
| Type | Description| | Type | Description |
| ----------- | -------- | | ------------------------- | ------------------ |
| Promise\<ApplicationInfo> | Promise used to return the application information.| | Promise\<ApplicationInfo> | Promise used to return the application information.|
**Example** **Example**
...@@ -69,7 +69,7 @@ bundle.getApplicationInfo(bundleName, bundleFlags, userId) ...@@ -69,7 +69,7 @@ bundle.getApplicationInfo(bundleName, bundleFlags, userId)
getApplicationInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback\<ApplicationInfo>): void getApplicationInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback\<ApplicationInfo>): void
Obtains the application information based on a given bundle name. This method uses an asynchronous callback to return the result. Obtains the application information based on a given bundle name. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -81,12 +81,12 @@ SystemCapability.BundleManager.BundleFramework ...@@ -81,12 +81,12 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------------------------------- | ---- | ------------------------------------------------------------ | | ----------- | ------------------------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of the application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback\<ApplicationInfo> | Yes | Callback used to return the application information. | | callback | AsyncCallback\<ApplicationInfo> | Yes | Callback used to return the application information. |
**Example** **Example**
...@@ -108,7 +108,7 @@ bundle.getApplicationInfo(bundleName, bundleFlags, userId, (err, data) => { ...@@ -108,7 +108,7 @@ bundle.getApplicationInfo(bundleName, bundleFlags, userId, (err, data) => {
getApplicationInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback\<ApplicationInfo>): void getApplicationInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback\<ApplicationInfo>): void
Obtains the application information based on a given bundle name. This method uses an asynchronous callback to return the result. Obtains the application information based on a given bundle name. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -120,11 +120,11 @@ SystemCapability.BundleManager.BundleFramework ...@@ -120,11 +120,11 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------------------------------- | ---- | ------------------------------------------------------------ | | ----------- | ------------------------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of the application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback\<ApplicationInfo> | Yes | Callback used to return the application information. | | callback | AsyncCallback\<ApplicationInfo> | Yes | Callback used to return the application information. |
**Example** **Example**
...@@ -145,7 +145,7 @@ bundle.getApplicationInfo(bundleName, bundleFlags, (err, data) => { ...@@ -145,7 +145,7 @@ bundle.getApplicationInfo(bundleName, bundleFlags, (err, data) => {
getAllBundleInfo(bundleFlag: BundleFlag, userId?: number): Promise<Array\<BundleInfo>> getAllBundleInfo(bundleFlag: BundleFlag, userId?: number): Promise<Array\<BundleInfo>>
Obtains the information of all available bundles of a specified user in the system. This method uses a promise to return the result. Obtains the information of all available bundles of a specified user in the system. This API uses a promise to return the result.
**Required permissions** **Required permissions**
...@@ -157,15 +157,15 @@ SystemCapability.BundleManager.BundleFramework ...@@ -157,15 +157,15 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ---------- | ---- | ----------------------------------------------------------- | | ---------- | ---------- | ---- | --------------------------------------- |
| bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------------- | ----------------------------------- | | --------------------------- | -------------------------- |
| Promise<Array\<BundleInfo>> | Promise used to return the information of all available bundles.| | Promise<Array\<BundleInfo>> | Promise used to return the information of all available bundles.|
**Example** **Example**
...@@ -187,7 +187,7 @@ bundle.getAllBundleInfo(bundleFlag, userId) ...@@ -187,7 +187,7 @@ bundle.getAllBundleInfo(bundleFlag, userId)
getAllBundleInfo(bundleFlag: BundleFlag, callback: AsyncCallback<Array\<BundleInfo>>): void getAllBundleInfo(bundleFlag: BundleFlag, callback: AsyncCallback<Array\<BundleInfo>>): void
Obtains the information of all available bundles in the system. This method uses an asynchronous callback to return the result. Obtains the information of all available bundles in the system. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -199,10 +199,10 @@ SystemCapability.BundleManager.BundleFramework ...@@ -199,10 +199,10 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | --------------------------------- | ---- | ------------------------------------------------------------ | | ---------- | --------------------------------- | ---- | --------------------------------------- |
| bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback<Array\<BundleInfo>> | Yes | Callback used to return the information of all available bundles. | | callback | AsyncCallback<Array\<BundleInfo>> | Yes | Callback used to return the information of all available bundles. |
**Example** **Example**
...@@ -222,7 +222,7 @@ bundle.getAllBundleInfo(bundleFlag, (err, data) => { ...@@ -222,7 +222,7 @@ bundle.getAllBundleInfo(bundleFlag, (err, data) => {
getAllBundleInfo(bundleFlag: BundleFlag, userId: number, callback: AsyncCallback<Array\<BundleInfo>>): void getAllBundleInfo(bundleFlag: BundleFlag, userId: number, callback: AsyncCallback<Array\<BundleInfo>>): void
Obtains the information of all available bundles in the system. This method uses an asynchronous callback to return the result. Obtains the information of all available bundles in the system. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -234,11 +234,11 @@ SystemCapability.BundleManager.BundleFramework ...@@ -234,11 +234,11 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | --------------------------------- | ---- | ------------------------------------------------------------ | | ---------- | --------------------------------- | ---- | --------------------------------------- |
| bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback<Array\<BundleInfo>> | Yes | Callback used to return the information of all available bundles. | | callback | AsyncCallback<Array\<BundleInfo>> | Yes | Callback used to return the information of all available bundles. |
**Example** **Example**
...@@ -260,7 +260,7 @@ bundle.getAllBundleInfo(bundleFlag, userId, (err, data) => { ...@@ -260,7 +260,7 @@ bundle.getAllBundleInfo(bundleFlag, userId, (err, data) => {
getBundleInfo(bundleName: string, bundleFlags: number, options?: BundleOptions): Promise\<BundleInfo> getBundleInfo(bundleName: string, bundleFlags: number, options?: BundleOptions): Promise\<BundleInfo>
Obtains the bundle information based on a given bundle name. This method uses a promise to return the result. Obtains the bundle information based on a given bundle name. This API uses a promise to return the result.
**Required permissions** **Required permissions**
...@@ -272,16 +272,16 @@ SystemCapability.BundleManager.BundleFramework ...@@ -272,16 +272,16 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ------------------------------------------------------------ | | ----------- | ------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| options | BundleOptions | No | Includes **userId**. | | options | BundleOptions | No | Includes **userId**. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| -------------------- | ------------------------------------------ | | -------------------- | ---------------------------- |
| Promise\<BundleInfo> | Promise used to return the bundle information.| | Promise\<BundleInfo> | Promise used to return the bundle information.|
**Example** **Example**
...@@ -306,7 +306,7 @@ bundle.getBundleInfo(bundleName, bundleFlags, options) ...@@ -306,7 +306,7 @@ bundle.getBundleInfo(bundleName, bundleFlags, options)
getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback\<BundleInfo>): void getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback\<BundleInfo>): void
Obtains the bundle information based on a given bundle name. This method uses an asynchronous callback to return the result. Obtains the bundle information based on a given bundle name. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -318,11 +318,11 @@ SystemCapability.BundleManager.BundleFramework ...@@ -318,11 +318,11 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | -------------------------- | ---- | ------------------------------------------------------------ | | ----------- | -------------------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback\<BundleInfo> | Yes | Callback used to return the bundle information. | | callback | AsyncCallback\<BundleInfo> | Yes | Callback used to return the bundle information. |
**Example** **Example**
...@@ -343,7 +343,7 @@ bundle.getBundleInfo(bundleName, bundleFlags, (err, data) => { ...@@ -343,7 +343,7 @@ bundle.getBundleInfo(bundleName, bundleFlags, (err, data) => {
getBundleInfo(bundleName: string, bundleFlags: number, options: BundleOptions, callback: AsyncCallback\<BundleInfo>): void getBundleInfo(bundleName: string, bundleFlags: number, options: BundleOptions, callback: AsyncCallback\<BundleInfo>): void
Obtains the bundle information based on a given bundle name. This method uses an asynchronous callback to return the result. Obtains the bundle information based on a given bundle name. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -355,12 +355,12 @@ SystemCapability.BundleManager.BundleFramework ...@@ -355,12 +355,12 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | -------------------------- | ---- | ------------------------------------------------------------ | | ----------- | -------------------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| options | BundleOptions | Yes | Includes **userId**. | | options | BundleOptions | Yes | Includes **userId**. |
| callback | AsyncCallback\<BundleInfo> | Yes | Callback used to return the bundle information. | | callback | AsyncCallback\<BundleInfo> | Yes | Callback used to return the bundle information. |
**Example** **Example**
...@@ -384,7 +384,7 @@ bundle.getBundleInfo(bundleName, bundleFlags, options, (err, data) => { ...@@ -384,7 +384,7 @@ bundle.getBundleInfo(bundleName, bundleFlags, options, (err, data) => {
getAllApplicationInfo(bundleFlags: number, userId?: number): Promise<Array\<ApplicationInfo>> getAllApplicationInfo(bundleFlags: number, userId?: number): Promise<Array\<ApplicationInfo>>
Obtains the information about all applications of the specified user. This method uses a promise to return the result. Obtains the information about all applications of the specified user. This API uses a promise to return the result.
**Required permissions** **Required permissions**
...@@ -396,15 +396,15 @@ SystemCapability.BundleManager.BundleFramework ...@@ -396,15 +396,15 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ------------------------------------------------------ | | ----------- | ------ | ---- | --------------------------------------- |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| -------------------------------- | ------------------------------------------------ | | -------------------------------- | ------------------------------- |
| Promise<Array\<ApplicationInfo>> | Promise used to return the application information.| | Promise<Array\<ApplicationInfo>> | Promise used to return the application information.|
**Example** **Example**
...@@ -426,7 +426,7 @@ bundle.getAllApplicationInfo(bundleFlags, userId) ...@@ -426,7 +426,7 @@ bundle.getAllApplicationInfo(bundleFlags, userId)
getAllApplicationInfo(bundleFlags: number, userId: number, callback: AsyncCallback<Array\<ApplicationInfo>>): void getAllApplicationInfo(bundleFlags: number, userId: number, callback: AsyncCallback<Array\<ApplicationInfo>>): void
Obtains the information about all applications of the specified user. This method uses an asynchronous callback to return the result. Obtains the information about all applications of the specified user. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -438,11 +438,11 @@ SystemCapability.BundleManager.BundleFramework ...@@ -438,11 +438,11 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | -------------------------------------- | ---- | ------------------------------------------------------ | | ----------- | -------------------------------------- | ---- | --------------------------------------- |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback<Array\<ApplicationInfo>> | Yes | Callback used to return the application information. | | callback | AsyncCallback<Array\<ApplicationInfo>> | Yes | Callback used to return the application information. |
**Example** **Example**
...@@ -461,9 +461,9 @@ bundle.getAllApplicationInfo(bundleFlags, userId, (err, data) => { ...@@ -461,9 +461,9 @@ bundle.getAllApplicationInfo(bundleFlags, userId, (err, data) => {
## bundle.getAllApplicationInfo ## bundle.getAllApplicationInfo
function getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback<Array\<ApplicationInfo>>) : void; getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback<Array\<ApplicationInfo>>) : void;
Obtains the information about all applications. This method uses an asynchronous callback to return the result. Obtains the information about all applications of the specified user. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -475,10 +475,10 @@ SystemCapability.BundleManager.BundleFramework ...@@ -475,10 +475,10 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | -------------------------------------- | ---- | ------------------------------------------------------ | | ----------- | -------------------------------------- | ---- | --------------------------------------- |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback<Array\<ApplicationInfo>> | Yes | Callback used to return the application information. | | callback | AsyncCallback<Array\<ApplicationInfo>> | Yes | Callback used to return the application information. |
**Example** **Example**
...@@ -497,7 +497,7 @@ bundle.getAllApplicationInfo(bundleFlags, (err, data) => { ...@@ -497,7 +497,7 @@ bundle.getAllApplicationInfo(bundleFlags, (err, data) => {
getAbilityInfo(bundleName: string, abilityName: string): Promise\<AbilityInfo> getAbilityInfo(bundleName: string, abilityName: string): Promise\<AbilityInfo>
Obtains the ability information based on a given want. This method uses a promise to return the result. Obtains the ability information based on a given bundle name and ability name. This API uses a promise to return the result.
**Required permissions** **Required permissions**
...@@ -509,15 +509,15 @@ SystemCapability.BundleManager.BundleFramework ...@@ -509,15 +509,15 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | -------------------------------------------------------- | | ----------- | ------ | ---- | ---------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of the application. |
| abilityName | string | Yes | Name of the ability.| | abilityName | string | Yes | Ability name.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------- | ---------------------------- | | --------------------- | --------------------- |
| Promise\<AbilityInfo> | Promise used to return the ability information.| | Promise\<AbilityInfo> | Promise used to return the ability information.|
**Example** **Example**
...@@ -535,10 +535,9 @@ bundle.getAbilityInfo(bundleName, abilityName) ...@@ -535,10 +535,9 @@ bundle.getAbilityInfo(bundleName, abilityName)
## bundle.getAbilityInfo ## bundle.getAbilityInfo
getAbilityInfo(bundleName: string, abilityName: string): callback : getAbilityInfo(bundleName: string, abilityName: string, callback: AsyncCallback\<AbilityInfo>): void;
AsyncCallback\<AbilityInfo>: void
Obtains the ability information based on a given want. This method uses an asynchronous callback to return the result. Obtains the ability information based on a given bundle name and ability name. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -550,11 +549,11 @@ SystemCapability.BundleManager.BundleFramework ...@@ -550,11 +549,11 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------------------------- | | ----------- | ------------ | ---- | ---------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of the application. |
| abilityName | string | Yes | Name of the ability.| | abilityName | string | Yes | Ability name.|
| callback | AsyncCallback\<AbilityInfo> | Yes| Callback used to return the ability information.| | callback | AsyncCallback\<AbilityInfo> | Yes | Callback used to return the ability information.|
**Example** **Example**
...@@ -574,7 +573,7 @@ bundle.getAbilityInfo(bundleName, abilityName, (err, data) => { ...@@ -574,7 +573,7 @@ bundle.getAbilityInfo(bundleName, abilityName, (err, data) => {
getAbilityLabel(bundleName: string, abilityName: string): Promise\<string> getAbilityLabel(bundleName: string, abilityName: string): Promise\<string>
Obtains the application name based on a given want. This method uses a promise to return the result. Obtains the application name based on a given bundle name and ability name. This API uses a promise to return the result.
**Required permissions** **Required permissions**
...@@ -586,15 +585,15 @@ SystemCapability.BundleManager.BundleFramework ...@@ -586,15 +585,15 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | -------------------------------------------------------- | | ----------- | ------ | ---- | ---------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of the application. |
| abilityName | string | Yes | Name of the ability.| | abilityName | string | Yes | Ability name.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------- | ---------------------------- | | ---------------- | ------------------ |
| Promise\<string> | Promise used to return the application name.| | Promise\<string> | Promise used to return the application name.|
**Example** **Example**
...@@ -614,7 +613,7 @@ bundle.getAbilityLabel(bundleName, abilityName) ...@@ -614,7 +613,7 @@ bundle.getAbilityLabel(bundleName, abilityName)
getAbilityLabel(bundleName: string, abilityName: string, callback : AsyncCallback\<string>): void getAbilityLabel(bundleName: string, abilityName: string, callback : AsyncCallback\<string>): void
Obtains the application name based on a given want. This method uses an asynchronous callback to return the result. Obtains the application name based on a given bundle name and ability name. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -626,11 +625,11 @@ SystemCapability.BundleManager.BundleFramework ...@@ -626,11 +625,11 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------------------------- | | ----------- | ---------------------- | ---- | ---------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of the application. |
| abilityName | string | Yes | Name of the ability.| | abilityName | string | Yes | Ability name.|
| callback | AsyncCallback\<string> | Yes| Callback used to return the application name.| | callback | AsyncCallback\<string> | Yes | Callback used to return the application name. |
**Example** **Example**
...@@ -650,7 +649,7 @@ bundle.getAbilityLabel(bundleName, abilityName, (err, data) => { ...@@ -650,7 +649,7 @@ bundle.getAbilityLabel(bundleName, abilityName, (err, data) => {
isAbilityEnabled(info: AbilityInfo): Promise\<boolean> isAbilityEnabled(info: AbilityInfo): Promise\<boolean>
Checks whether an ability is enabled based on a given want. This method uses a promise to return the result. Checks whether an ability is enabled based on a given want. This API uses a promise to return the result.
**Required permissions** **Required permissions**
...@@ -662,14 +661,14 @@ SystemCapability.BundleManager.BundleFramework ...@@ -662,14 +661,14 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ------------ | | ---- | ----------- | ---- | ------------ |
| info | AbilityInfo | Yes | Ability information. | | info | AbilityInfo | Yes | Ability information.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------- | ------------------------| | ----------------- | ------------------------- |
| Promise\<boolean> | Promise used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.| | Promise\<boolean> | Promise used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.|
**Example** **Example**
...@@ -691,7 +690,7 @@ bundle.isAbilityEnabled(Info) ...@@ -691,7 +690,7 @@ bundle.isAbilityEnabled(Info)
isAbilityEnabled(info : AbilityInfo, callback : AsyncCallback\<boolean>): void isAbilityEnabled(info : AbilityInfo, callback : AsyncCallback\<boolean>): void
Checks whether an ability is enabled based on a given want. This method uses an asynchronous callback to return the result. Checks whether an ability is enabled based on a given want. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -703,10 +702,10 @@ SystemCapability.BundleManager.BundleFramework ...@@ -703,10 +702,10 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------------------------- | | -------- | ----------------------- | ---- | --------------- |
| info | AbilityInfo | Yes | Ability information. | | info | AbilityInfo | Yes | Ability information. |
| callback | AsyncCallback\<boolean> | Yes| Callback used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.| | callback | AsyncCallback\<boolean> | Yes | Callback used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.|
**Example** **Example**
...@@ -728,7 +727,7 @@ bundle.isAbilityEnabled(Info, (err, data) => { ...@@ -728,7 +727,7 @@ bundle.isAbilityEnabled(Info, (err, data) => {
isApplicationEnabled(bundleName: string): Promise\<boolean> isApplicationEnabled(bundleName: string): Promise\<boolean>
Checks whether an application is enabled based on a given want. This method uses a promise to return the result. Checks whether an application is enabled based on a given want. This API uses a promise to return the result.
**Required permissions** **Required permissions**
...@@ -740,15 +739,15 @@ SystemCapability.BundleManager.BundleFramework ...@@ -740,15 +739,15 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | -------------------------------------------------------- | | ---------- | ------ | ---- | ------------ |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of the application.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------- | ------------------------| | ----------------- | ------------------------- |
| Promise\<boolean> | Promise used to return whether the application is enabled. If the application is enabled, **true** will be returned; otherwise, **false** will be returned.| | Promise\<boolean> | Promise used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.|
**Example** **Example**
...@@ -766,7 +765,7 @@ bundle.isApplicationEnabled(bundleName) ...@@ -766,7 +765,7 @@ bundle.isApplicationEnabled(bundleName)
isApplicationEnabled(bundleName: string, callback : AsyncCallback\<boolean>): void isApplicationEnabled(bundleName: string, callback : AsyncCallback\<boolean>): void
Checks whether an application is enabled based on a given want. This method uses an asynchronous callback to return the result. Checks whether an application is enabled based on a given want. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -778,15 +777,15 @@ SystemCapability.BundleManager.BundleFramework ...@@ -778,15 +777,15 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------------------------- | | ---------- | ----------------------- | ---- | --------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of the application. |
| callback | AsyncCallback\<boolean> | Yes| Callback used to return whether the application is enabled. If the application is enabled, **true** will be returned; otherwise, **false** will be returned.| | callback | AsyncCallback\<boolean> | Yes | Callback used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.|
**Example** **Example**
```js ```js
let bundleName : "com.example.myapplication"; let bundleName = "com.example.myapplication";
bundle.isApplicationEnabled(bundleName, (err, data) => { bundle.isApplicationEnabled(bundleName, (err, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
...@@ -800,7 +799,7 @@ bundle.isApplicationEnabled(bundleName, (err, data) => { ...@@ -800,7 +799,7 @@ bundle.isApplicationEnabled(bundleName, (err, data) => {
queryAbilityByWant(want: Want, bundleFlags: number, userId?: number): Promise<Array\<AbilityInfo>> queryAbilityByWant(want: Want, bundleFlags: number, userId?: number): Promise<Array\<AbilityInfo>>
Obtains the ability information based on a given want. This method uses a promise to return the result. Obtains the ability information based on a given want. This API uses a promise to return the result.
**Required permissions** **Required permissions**
...@@ -812,16 +811,16 @@ SystemCapability.BundleManager.BundleFramework ...@@ -812,16 +811,16 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ------------------------------------------------------------ | | ----------- | ------ | ---- | ------------------------------------- |
| want | Want | Yes | Want that contains the bundle name. | | want | Want | Yes | Want that contains the bundle name. |
| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------- | ---------------------------- | | ---------------------------- | --------------------- |
| Promise\<Array\<AbilityInfo>>| Promise used to return the ability information.| | Promise\<Array\<AbilityInfo>>| Promise used to return the ability information.|
**Example** **Example**
...@@ -847,7 +846,7 @@ bundle.queryAbilityByWant(want, bundleFlags, userId) ...@@ -847,7 +846,7 @@ bundle.queryAbilityByWant(want, bundleFlags, userId)
queryAbilityByWant(want: Want, bundleFlags: number, userId: number, callback: AsyncCallback\<Array\<AbilityInfo>>): void queryAbilityByWant(want: Want, bundleFlags: number, userId: number, callback: AsyncCallback\<Array\<AbilityInfo>>): void
Obtains the ability information based on a given want. This method uses an asynchronous callback to return the result. Obtains the ability information based on a given want. This API uses an asynchronous callback to return the result.
**System capability** **System capability**
...@@ -855,12 +854,12 @@ SystemCapability.BundleManager.BundleFramework ...@@ -855,12 +854,12 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ---------------------------------- | ---- | ------------------------------------------------------------ | | ----------- | ---------------------------------- | ---- | ------------------------------------- |
| want | Want | Yes | Want that contains the bundle name. | | want | Want | Yes | Want that contains the bundle name. |
| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback<Array\<AbilityInfo>> | Yes | Callback used to return the ability information. | | callback | AsyncCallback<Array\<AbilityInfo>> | Yes | Callback used to return the ability information. |
**Example** **Example**
...@@ -882,9 +881,9 @@ bundle.queryAbilityByWant(want, bundleFlags, userId, (err, data) => { ...@@ -882,9 +881,9 @@ bundle.queryAbilityByWant(want, bundleFlags, userId, (err, data) => {
## bundle.queryAbilityByWant ## bundle.queryAbilityByWant
queryAbilityByWant(want: Want, bundleFlags: number, callback: AsyncCallback<Array\<AbilityInfo>>): void queryAbilityByWant(want: Want, bundleFlags: number, callback: AsyncCallback<Array\<AbilityInfo>>): void;
Obtains the ability information based on a given want. This method uses an asynchronous callback to return the result. Obtains the ability information based on a given want. This API uses an asynchronous callback to return the result.
**System capability** **System capability**
...@@ -892,11 +891,11 @@ SystemCapability.BundleManager.BundleFramework ...@@ -892,11 +891,11 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ---------------------------------- | ---- | ------------------------------------------------------------ | | ----------- | ---------------------------------- | ---- | ------------------------------------- |
| want | Want | Yes | Want that contains the bundle name. | | want | Want | Yes | Want that contains the bundle name. |
| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback<Array\<AbilityInfo>> | Yes | Callback used to return the ability information. | | callback | AsyncCallback<Array\<AbilityInfo>> | Yes | Callback used to return the ability information. |
**Example** **Example**
...@@ -915,98 +914,13 @@ bundle.queryAbilityByWant(want, bundleFlags, (err, data) => { ...@@ -915,98 +914,13 @@ bundle.queryAbilityByWant(want, bundleFlags, (err, data) => {
}) })
``` ```
## bundle.getBundleInstaller
getBundleInstaller(): Promise\<BundleInstaller>
Obtains the bundle installer. This method uses a promise to return the result.
**Required permissions**
ohos.permission.INSTALL_BUNDLE
**System capability**
SystemCapability.BundleManager.BundleFramework
**Return value**
| Type | Description |
| ------------------------ | --------------------------------------------------- |
| Promise\<BundleInstaller> | Promise used to return the bundle installer.|
**Example**
```js
let bundleFilePaths = ['/data/test.hap'];
let param = {
userId : 100,
installFlag : 1,
isKeepData : false
};
bundle.getBundleInstaller()
.then((installerObject) => {
console.info('Operation successful. ');
installerObject.install(bundleFilePaths, param)
.then((data) => {
console.info('Operation successful. Data:' + JSON.stringify(data));
}).catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
})
}).catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
})
```
## bundle.getBundleInstaller
getBundleInstaller(callback: AsyncCallback\<BundleInstaller>): void;
Obtains the bundle installer. This method uses an asynchronous callback to return the result.
**Required permissions**
ohos.permission.INSTALL_BUNDLE
**System capability**
SystemCapability.BundleManager.BundleFramework
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------ | ---- | ------------------------------------------------- |
| callback | AsyncCallback\<BundleInstaller> | Yes | Callback used to return the bundle installer.|
**Example**
```js
let bundleFilePaths = ['/data/test.hap'];
let param = {
userId : 100,
installFlag : 1,
isKeepData : false
};
bundle.getBundleInstaller((err, installerObject) => {
if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err));
}
console.info('Operation successful. Data:' + JSON.stringify(installerObject));
installerObject.install(bundleFilePaths, param, (err, data) => {
if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err));
}
console.info('Operation successful. Data:' + JSON.stringify(data));
})
})
```
## bundle.getLaunchWantForBundle ## bundle.getLaunchWantForBundle
getLaunchWantForBundle(bundleName: string): Promise\<Want> getLaunchWantForBundle(bundleName: string): Promise\<Want>
Obtains the **Want** object that launches the specified application. This method uses a promise to return the result. Obtains the **Want** object that launches the specified application. This API uses a promise to return the result.
**Required permissions** **Required permissions**
...@@ -1018,13 +932,13 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1018,13 +932,13 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | -------- | | ---------- | ------ | ---- | ------------ |
| bundleName | string | Yes | Bundle name of the application.| | bundleName | string | Yes | Bundle name of the application.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------- | ------------------------------------------------------------ | | -------------- | -------------------------------------- |
| Promise\<Want> | Promise used to return the **Want** object.| | Promise\<Want> | Promise used to return the **Want** object.|
**Example** **Example**
...@@ -1043,7 +957,7 @@ bundle.getLaunchWantForBundle(bundleName) ...@@ -1043,7 +957,7 @@ bundle.getLaunchWantForBundle(bundleName)
getLaunchWantForBundle(bundleName: string, callback: AsyncCallback\<Want>): void; getLaunchWantForBundle(bundleName: string, callback: AsyncCallback\<Want>): void;
Obtains the **Want** object that launches the specified application. This method uses an asynchronous callback to return the result. Obtains the **Want** object that launches the specified application. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -1055,10 +969,10 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1055,10 +969,10 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | -------- | | ---------- | -------------------- | ---- | ------------------------------ |
| bundleName | string | Yes | Bundle name of the application.| | bundleName | string | Yes | Bundle name of the application. |
| callback | AsyncCallback\<Want> | Yes | Callback used to return the **Want** object.| | callback | AsyncCallback\<Want> | Yes | Callback used to return the **Want** object.|
**Example** **Example**
...@@ -1078,7 +992,7 @@ bundle.getLaunchWantForBundle(bundleName, (err, data) => { ...@@ -1078,7 +992,7 @@ bundle.getLaunchWantForBundle(bundleName, (err, data) => {
getNameForUid(uid: number): Promise\<string> getNameForUid(uid: number): Promise\<string>
Obtains the bundle name based on a UID. This method uses a promise to return the result. Obtains the bundle name based on a UID. This API uses a promise to return the result.
**System capability** **System capability**
...@@ -1086,13 +1000,13 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1086,13 +1000,13 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | -------- | | ---- | ------ | ---- | -------- |
| uid | number | Yes | UID based on which the bundle name is to obtain.| | uid | number | Yes | UID based on which the bundle name is to obtain.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------- | ------------------------------------------------------------ | | ---------------- | --------------------------------- |
| Promise\<string> | Promise used to return the bundle name.| | Promise\<string> | Promise used to return the bundle name.|
**Example** **Example**
...@@ -1109,9 +1023,9 @@ bundle.getNameForUid(uid) ...@@ -1109,9 +1023,9 @@ bundle.getNameForUid(uid)
## bundle.getNameForUid<sup>8+</sup> ## bundle.getNameForUid<sup>8+</sup>
getNameForUid(uid: number, callback: AsyncCallback\<string>): void; getNameForUid(uid: number, callback: AsyncCallback\<string>) : void
Obtains the bundle name based on a UID. This method uses an asynchronous callback to return the result. Obtains the bundle name based on a UID. This API uses an asynchronous callback to return the result.
**System capability** **System capability**
...@@ -1119,10 +1033,10 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1119,10 +1033,10 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | -------- | | -------- | ---------------------- | ---- | ------------------------- |
| uid | number | Yes | UID based on which the bundle name is to obtain.| | uid | number | Yes | UID based on which the bundle name is to obtain. |
| callback | AsyncCallback\<string> | Yes | Callback used to return the bundle name.| | callback | AsyncCallback\<string> | Yes | Callback used to return the bundle name.|
**Example** **Example**
...@@ -1140,9 +1054,9 @@ bundle.getNameForUid(uid, (err, data) => { ...@@ -1140,9 +1054,9 @@ bundle.getNameForUid(uid, (err, data) => {
## bundle.getAbilityIcon<sup>8+</sup> ## bundle.getAbilityIcon<sup>8+</sup>
getAbilityIcon(bundleName: string, abilityName: string): Promise\<[PixelMap](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md)>; getAbilityIcon(bundleName: string, abilityName: string): Promise\<image.PixelMap>;
Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the corresponding icon based on a given bundle name and ability name. This method uses a promise to return the result. Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the corresponding icon based on a given bundle name and ability name. This API uses a promise to return the result.
**Required permissions** **Required permissions**
...@@ -1154,15 +1068,15 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1154,15 +1068,15 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | -------- | | ----------- | ---------------------------------------- | ---- | ---------------------------------------- |
| bundleName | string | Yes | Bundle name based on which the pixel map is to obtain.| | bundleName | string | Yes | Bundle name based on which the pixel map is to obtain. |
| abilityName | string | Yes | Ability name based on which the pixel map is to obtain.| | abilityName | string | Yes | Ability name based on which the pixel map is to obtain. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------- | ------------------------------------------------------------ | | --------------------- | ------------------------------------------------------------ |
| Promise\<[PixelMap](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md)> | Promise used to return the <[PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md)>.| | Promise\<image.PixelMap> | Promise used to return the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md)>.|
**Example** **Example**
...@@ -1179,9 +1093,9 @@ bundle.getAbilityIcon(bundleName, abilityName) ...@@ -1179,9 +1093,9 @@ bundle.getAbilityIcon(bundleName, abilityName)
## bundle.getAbilityIcon<sup>8+</sup> ## bundle.getAbilityIcon<sup>8+</sup>
getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback\<[PixelMap](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md)>): void; getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback\<image.PixelMap>): void;
Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the corresponding icon based on a given bundle name and ability name. This method uses an asynchronous callback to return the result. Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the corresponding icon based on a given bundle name and ability name. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -1193,11 +1107,11 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1193,11 +1107,11 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | -------- | | ----------- | ---------------------------------------- | ---- | ---------------------------------------- |
| bundleName | string | Yes | Bundle name based on which the pixel map is to obtain.| | bundleName | string | Yes | Bundle name based on which the pixel map is to obtain. |
| abilityName | string | Yes | Ability name based on which the pixel map is to obtain.| | abilityName | string | Yes | Ability name based on which the pixel map is to obtain. |
| callback | AsyncCallback\<[PixelMap](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md)> | Yes | Callback used to return the <[PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md)>.| | callback | AsyncCallback\<image.PixelMap> | Yes | Callback used to return the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md)>.|
**Example** **Example**
...@@ -1218,7 +1132,7 @@ bundle.getAbilityIcon(bundleName, abilityName, (err, data) => { ...@@ -1218,7 +1132,7 @@ bundle.getAbilityIcon(bundleName, abilityName, (err, data) => {
queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId?: number): Promise<Array\<ExtensionAbilityInfo>> queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId?: number): Promise<Array\<ExtensionAbilityInfo>>
Obtains the extension ability information based on a given want. This method uses a promise to return the result. Obtains the Extension ability information based on a given want. This API uses a promise to return the result.
**Required permissions** **Required permissions**
...@@ -1230,17 +1144,17 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1230,17 +1144,17 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ------------------------------------------------------------ | | -------------- | ------ | ---- | ---------------------------------------- |
| want | Want | Yes | Want that contains the bundle name. | | want | Want | Yes | Want that contains the bundle name. |
| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| | extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------- | ---------------------------- | | ------------------------------------- | ------------------------------ |
| Promise<Array\<ExtensionAbilityInfo>> | Promise used to return the extension ability information.| | Promise<Array\<ExtensionAbilityInfo>> | Promise used to return the Extension ability information.|
**Example** **Example**
...@@ -1265,7 +1179,7 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, userId) ...@@ -1265,7 +1179,7 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, userId)
queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId: number, callback: AsyncCallback<Array\<ExtensionAbilityInfo>>): void queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId: number, callback: AsyncCallback<Array\<ExtensionAbilityInfo>>): void
Obtains the extension ability information based on a given want. This method uses an asynchronous callback to return the result. Obtains the Extension ability information based on a given want. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -1277,12 +1191,12 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1277,12 +1191,12 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ---------------------------------- | ---- | ------------------------------------------------------------ | | -------------- | ---------------------------------------- | ---- | ---------------------------------------- |
| want | Want | Yes | Want that contains the bundle name. | | want | Want | Yes | Want that contains the bundle name. |
| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| | extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback<Array\<ExtensionAbilityInfo>> | Yes | Callback used to return the extension ability information. | | callback | AsyncCallback<Array\<ExtensionAbilityInfo>> | Yes | Callback used to return the Extension ability information. |
**Example** **Example**
...@@ -1306,7 +1220,7 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, userId, (err, data ...@@ -1306,7 +1220,7 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, userId, (err, data
queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, callback: AsyncCallback<Array\<ExtensionAbilityInfo>>): void; queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, callback: AsyncCallback<Array\<ExtensionAbilityInfo>>): void;
Obtains the extension ability information based on a given want. This method uses an asynchronous callback to return the result. Obtains the Extension ability information based on a given want. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -1318,11 +1232,11 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1318,11 +1232,11 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ---------------------------------- | ---- | ------------------------------------------------------------ | | -------------- | ---------------------------------------- | ---- | ---------------------------------------- |
| want | Want | Yes | Want that contains the bundle name. | | want | Want | Yes | Want that contains the bundle name. |
| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| | extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback<Array\<ExtensionAbilityInfo>> | Yes | Callback used to return the extension ability information. | | callback | AsyncCallback<Array\<ExtensionAbilityInfo>> | Yes | Callback used to return the Extension ability information. |
**Example** **Example**
...@@ -1345,40 +1259,40 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, (err, data) => { ...@@ -1345,40 +1259,40 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, (err, data) => {
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Readable/Writable| Type | Mandatory| Description | | Name | Readable/Writable| Type | Mandatory | Description |
| ----------- | -------- | ------ | ---- | ------------------------------------------------------------ | | ----------- | ---- | ------ | ---- | ---------------------------------------- |
| deviceId | Read-only | string | No | ID of the device that runs the ability. | | deviceId | Read-only | string | No | ID of the device that runs the ability. |
| bundleName | Read-only | string | Yes | Bundle name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability.| | bundleName | Read-only | string | Yes | Bundle name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability.|
| abilityName | Read-only | string | Yes | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability.| | abilityName | Read-only | string | Yes | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability.|
| uri | Read-only | string | No | Resource ID.| | uri | Read-only | string | No | Resource ID. |
| shortName | Read-only | string | No | Short name of the **ElementName**.| | shortName | Read-only | string | No | Short name of the **ElementName**. |
## InstallErrorCode ## InstallErrorCode
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Default Value| Description | | Name | Default Value | Description |
| ------ | ------ | ------ | | ---------------------------------------- | ---- | ------------------------- |
| SUCCESS | 0 | Installation succeeded.| | SUCCESS | 0 | Installation succeeded. |
| STATUS_INSTALL_FAILURE | 1 | Installation failed. (The application to be installed does not exist.)| | STATUS_INSTALL_FAILURE | 1 | Installation failed. (The application to be installed does not exist.) |
| STATUS_INSTALL_FAILURE_ABORTED | 2 | Installation aborted.| | STATUS_INSTALL_FAILURE_ABORTED | 2 | Installation aborted. |
| STATUS_INSTALL_FAILURE_INVALID | 3 | Invalid installation parameter.| | STATUS_INSTALL_FAILURE_INVALID | 3 | Invalid installation parameter. |
| STATUS_INSTALL_FAILURE_CONFLICT | 4 | Installation conflict. (The basic information about the application to upgrade is inconsistent with that of the existing application.)| | STATUS_INSTALL_FAILURE_CONFLICT | 4 | Installation conflict. (The basic information about the application to upgrade is inconsistent with that of the existing application.) |
| STATUS_INSTALL_FAILURE_STORAGE | 5 | Failed to store the bundle information.| | STATUS_INSTALL_FAILURE_STORAGE | 5 | Failed to store the bundle information. |
| STATUS_INSTALL_FAILURE_INCOMPATIBLE | 6 | Installation incompatible. (A downgrade occurs or the signature information is incorrect.)| | STATUS_INSTALL_FAILURE_INCOMPATIBLE | 6 | Installation incompatible. (A downgrade occurs or the signature information is incorrect.) |
| STATUS_UNINSTALL_FAILURE | 7 | Uninstallation failed. (The application to be uninstalled does not exist.)| | STATUS_UNINSTALL_FAILURE | 7 | Uninstallation failed. (The application to be uninstalled does not exist.) |
| STATUS_UNINSTALL_FAILURE_BLOCKED | 8 | Uninstallation aborted. (This error code is not in use.)| | STATUS_UNINSTALL_FAILURE_BLOCKED | 8 | Uninstallation aborted. (This error code is not in use.) |
| STATUS_UNINSTALL_FAILURE_ABORTED | 9 | Uninstallation aborted. (Invalid parameters.)| | STATUS_UNINSTALL_FAILURE_ABORTED | 9 | Uninstallation aborted. (Invalid parameters.) |
| STATUS_UNINSTALL_FAILURE_CONFLICT | 10 | Uninstallation conflict. (Failed to uninstall a system application or end the application process.)| | STATUS_UNINSTALL_FAILURE_CONFLICT | 10 | Uninstallation conflict. (Failed to uninstall a system application or end the application process.)|
| STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT | 0x0B | Installation failed. (Download timed out.)| | STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT | 0x0B | Installation failed. (Download timed out.) |
| STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED | 0x0C | Installation failed. (Download failed.)| | STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED | 0x0C | Installation failed. (Download failed.) |
| STATUS_RECOVER_FAILURE_INVALID<sup>8+</sup> | 0x0D | Failed to restore the pre-installed application.| | STATUS_RECOVER_FAILURE_INVALID<sup>8+</sup> | 0x0D | Failed to restore the pre-installed application. |
| STATUS_ABILITY_NOT_FOUND | 0x40 | Ability not found.| | STATUS_ABILITY_NOT_FOUND | 0x40 | Ability not found. |
| STATUS_BMS_SERVICE_ERROR | 0x41 | BMS service error.| | STATUS_BMS_SERVICE_ERROR | 0x41 | BMS service error. |
| STATUS_FAILED_NO_SPACE_LEFT<sup>8+</sup> | 0x42 | Insufficient device space.| | STATUS_FAILED_NO_SPACE_LEFT<sup>8+</sup> | 0x42 | Insufficient device space. |
| STATUS_GRANT_REQUEST_PERMISSIONS_FAILED<sup>8+</sup> | 0x43 | Application authorization failed.| | STATUS_GRANT_REQUEST_PERMISSIONS_FAILED<sup>8+</sup> | 0x43 | Application authorization failed. |
| STATUS_INSTALL_PERMISSION_DENIED<sup>8+</sup> | 0x44 | Installation permission denied.| | STATUS_INSTALL_PERMISSION_DENIED<sup>8+</sup> | 0x44 | Installation permission denied. |
| STATUS_UNINSTALL_PERMISSION_DENIED<sup>8+</sup> | 0x45 | Uninstallation permission denied.| | STATUS_UNINSTALL_PERMISSION_DENIED<sup>8+</sup> | 0x45 | Uninstallation permission denied. |
## BundleFlag ## BundleFlag
...@@ -1386,21 +1300,21 @@ Enumerates bundle flags. ...@@ -1386,21 +1300,21 @@ Enumerates bundle flags.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Default Value| Description | | Name | Default Value | Description |
| ------ | ------ | ------ | | ---------------------------------------- | ---------- | ------------------- |
| GET_BUNDLE_DEFAULT | 0x00000000 | Obtains the default application information.| | GET_BUNDLE_DEFAULT | 0x00000000 | Obtains the default application information. |
| GET_BUNDLE_WITH_ABILITIES | 0x00000001 | Obtains the bundle information with the ability information.| | GET_BUNDLE_WITH_ABILITIES | 0x00000001 | Obtains the bundle information with the ability information. |
| GET_ABILITY_INFO_WITH_PERMISSION | 0x00000002 | Obtains the ability information with the permission information.| | GET_ABILITY_INFO_WITH_PERMISSION | 0x00000002 | Obtains the ability information with the permission information. |
| GET_ABILITY_INFO_WITH_APPLICATION | 0x00000004 | Obtains the ability information with the application information.| | GET_ABILITY_INFO_WITH_APPLICATION | 0x00000004 | Obtains the ability information with the application information. |
| GET_APPLICATION_INFO_WITH_PERMISSION | 0x00000008 | Obtains the application information with the permission information.| | GET_APPLICATION_INFO_WITH_PERMISSION | 0x00000008 | Obtains the application information with the permission information. |
| GET_BUNDLE_WITH_REQUESTED_PERMISSION | 0x00000010 | Obtains the bundle information with the information about the required permissions.| | GET_BUNDLE_WITH_REQUESTED_PERMISSION | 0x00000010 | Obtains the bundle information with the information about the required permissions. |
| GET_ABILITY_INFO_WITH_METADATA<sup>8+</sup> | 0x00000020 | Obtains the ability metadata information.| | GET_ABILITY_INFO_WITH_METADATA<sup>8+</sup> | 0x00000020 | Obtains the ability metadata information. |
| GET_BUNDLE_WITH_EXTENSION_ABILITY<sup>9+</sup> | 0x00000020 | Obtains the bundle information with the extension ability information.| | GET_BUNDLE_WITH_EXTENSION_ABILITY<sup>9+</sup> | 0x00000020 | Obtains the bundle information with the Extension ability information.|
| GET_APPLICATION_INFO_WITH_METADATA<sup>8+</sup> | 0x00000040 | Obtains the application metadata information.| | GET_APPLICATION_INFO_WITH_METADATA<sup>8+</sup> | 0x00000040 | Obtains the application metadata information. |
| GET_ABILITY_INFO_SYSTEMAPP_ONLY<sup>8+</sup> | 0x00000080 | Obtains the ability information with information about system applications.| | GET_ABILITY_INFO_SYSTEMAPP_ONLY<sup>8+</sup> | 0x00000080 | Obtains the ability information with information about system applications.|
| GET_ABILITY_INFO_WITH_DISABLE<sup>8+</sup> | 0x00000100 | Obtains information about disabled abilities.| | GET_ABILITY_INFO_WITH_DISABLE<sup>8+</sup> | 0x00000100 | Obtains information about disabled abilities. |
| GET_APPLICATION_INFO_WITH_DISABLE<sup>8+</sup> | 0x00000200 | Obtains information about disabled applications.| | GET_APPLICATION_INFO_WITH_DISABLE<sup>8+</sup> | 0x00000200 | Obtains information about disabled applications. |
| GET_ALL_APPLICATION_INFO | 0xFFFF0000 | Obtains all application information.| | GET_ALL_APPLICATION_INFO | 0xFFFF0000 | Obtains all application information. |
## BundleOptions ## BundleOptions
...@@ -1408,9 +1322,9 @@ Describes the bundle options. ...@@ -1408,9 +1322,9 @@ Describes the bundle options.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ---- | ---- | ---------------------------- |
| userId | number | Yes| Yes| User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0.| | userId | number | Yes | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0.|
## BundleInfo ## BundleInfo
...@@ -1418,32 +1332,32 @@ Describes the application bundle information. ...@@ -1418,32 +1332,32 @@ Describes the application bundle information.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| ------ | ------ | ------ | ------ | ------ | | --------------------------------- | ---------------------------- | ---- | ---- | --------------------- |
| name | string | Yes | No | Bundle name. | | name | string | Yes | No | Bundle name. |
| type | string | Yes | No | Bundle type. | | type | string | Yes | No | Bundle type. |
| appId | string | Yes | No | ID of the application to which the bundle belongs. | | appId | string | Yes | No | ID of the application to which the bundle belongs. |
| uid | number | Yes | No | UID of the application to which the bundle belongs. | | uid | number | Yes | No | UID of the application to which the bundle belongs. |
| installTime | number | Yes | No | Time when the HAP file was installed. | | installTime | number | Yes | No | Time when the HAP file was installed. |
| updateTime | number | Yes | No | Time when the HAP file was updated. | | updateTime | number | Yes | No | Time when the HAP file was updated. |
| appInfo | ApplicationInfo | Yes | No | Application configuration information. | | appInfo | ApplicationInfo | Yes | No | Application configuration information. |
| abilityInfos | Array\<AbilityInfo> | Yes | No | Ability configuration information. | | abilityInfos | Array\<AbilityInfo> | Yes | No | Ability configuration information. |
| reqPermissions | Array\<string> | Yes | No | Array of the permissions to request from the system. | | reqPermissions | Array\<string> | Yes | No | Array of the permissions to request from the system. |
| reqPermissionDetails | Array\<ReqPermissionDetail> | Yes | No | Detailed information of the permissions to request from the system.| | reqPermissionDetails | Array\<ReqPermissionDetail> | Yes | No | Detailed information of the permissions to request from the system.|
| vendor | string | Yes | No | Vendor of the bundle. | | vendor | string | Yes | No | Vendor of the bundle. |
| versionCode | number | Yes | No | Version number of the bundle. | | versionCode | number | Yes | No | Version number of the bundle. |
| versionName | string | Yes | No | Version description of the bundle. | | versionName | string | Yes | No | Version description of the bundle. |
| compatibleVersion | number | Yes | No | Earliest SDK version required for running the bundle. | | compatibleVersion | number | Yes | No | Earliest SDK version required for running the bundle. |
| targetVersion | number | Yes | No | Latest SDK version required for running the bundle. | | targetVersion | number | Yes | No | Latest SDK version required for running the bundle. |
| isCompressNativeLibs | boolean | Yes | No | Whether to compress the native library of the bundle. The default value is **true**. | | isCompressNativeLibs | boolean | Yes | No | Whether to compress the native library of the bundle. The default value is **true**. |
| hapModuleInfos | Array\<HapModuleInfo> | Yes | No | Module configuration information. | | hapModuleInfos | Array\<HapModuleInfo> | Yes | No | Module configuration information. |
| entryModuleName | string | Yes | No | Name of the entry module. | | entryModuleName | string | Yes | No | Name of the entry module. |
| cpuAbi | string | Yes | No | cpuAbi information of the bundle. | | cpuAbi | string | Yes | No | cpuAbi information of the bundle. |
| isSilentInstallation | string | Yes | No | Whether to install the bundle in silent mode. | | isSilentInstallation | string | Yes | No | Whether to install the bundle in silent mode. |
| minCompatibleVersionCode | number | Yes | No | Earliest version compatible with the bundle in the distributed scenario. | | minCompatibleVersionCode | number | Yes | No | Earliest version compatible with the bundle in the distributed scenario. |
| entryInstallationFree | boolean | Yes| No| Whether installation-free is supported for the entry.| | entryInstallationFree | boolean | Yes | No | Whether installation-free is supported for the entry. |
| reqPermissionStates<sup>8+</sup> | Array\<number> | Yes| No| Permission grant state.| | reqPermissionStates<sup>8+</sup> | Array\<number> | Yes | No | Permission grant state. |
| extensionAbilityInfo<sup>9+</sup> | Array\<ExtensionAbilityInfo> | Yes| No| Extended information of the ability.| | extensionAbilityInfo<sup>9+</sup> | Array\<ExtensionAbilityInfo> | Yes | No | Extended information of the ability. |
## ApplicationInfo ## ApplicationInfo
...@@ -1451,31 +1365,30 @@ Describes the application information. ...@@ -1451,31 +1365,30 @@ Describes the application information.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| ------ | ------ | ------ | ------ | ------ | | -------------------------- | ---------------------------------- | ---- | ---- | --------------------- |
| name | string | Yes | No | Application name. | | name | string | Yes | No | Application name. |
| description | string | Yes | No | Application description. | | description | string | Yes | No | Application description. |
| descriptionId | number | Yes | No | Application description ID. | | descriptionId | number | Yes | No | Application description ID. |
| systemApp | boolean | Yes | No | Whether the application is a system application. The default value is **false**. | | systemApp | boolean | Yes | No | Whether the application is a system application. The default value is **false**. |
| enabled | boolean | Yes | No | Whether the application is enabled. The default value is **true**. | | enabled | boolean | Yes | No | Whether the application is enabled. The default value is **true**. |
| label | string | Yes | No | Application label. | | label | string | Yes | No | Application label. |
| labelId | string | Yes | No | Application label ID. | | labelId | string | Yes | No | Application label ID. |
| icon | string | Yes | No | Application icon. | | icon | string | Yes | No | Application icon. |
| iconId | string | Yes | No | Application icon ID. | | iconId | string | Yes | No | Application icon ID. |
| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used by default.| | process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used by default.|
| supportedModes | number | Yes | No | Running modes supported by the application. | | supportedModes | number | Yes | No | Running modes supported by the application. |
| moduleSourceDirs | Array\<string> | Yes | No | Relative paths for storing application resources. | | moduleSourceDirs | Array\<string> | Yes | No | Relative paths for storing application resources. |
| permissions | Array\<string> | Yes | No | Permissions required for accessing the application. | | permissions | Array\<string> | Yes | No | Permissions required for accessing the application. |
| moduleInfos | Array\<ModuleInfo> | Yes | No | Application module information. | | moduleInfos | Array\<ModuleInfo> | Yes | No | Application module information. |
| entryDir | string | Yes | No | Path for storing application files. | | entryDir | string | Yes | No | Path for storing application files. |
| customizeData | Map<string, Array\<CustomizeData>> | Yes | Yes | Custom data of the application. | | codePath<sup>8+</sup> | string | Yes | No | Installation directory of the application. |
| codePath<sup>8+</sup> | string | Yes| No| Installation directory of the application.| | metaData<sup>8+</sup> | Map<string, Array\<CustomizeData>> | Yes | No | Custom metadata of the application. |
| metaData<sup>8+</sup> | Map<string, Array\<CustomizeData>> | Yes| No| Custom metadata of the application.| | metaData<sup>9+</sup> | Map<string, Array\<Metadata>> | Yes | No | Metadata of the application. |
| metaData<sup>9+</sup> | Map<string, Array\<Metadata>> | Yes| No| Metadata of the application.| | removable<sup>8+</sup> | boolean | Yes | No | Whether the application is removable. |
| removable<sup>8+</sup> | boolean | Yes| No| Whether the application is removable.| | accessTokenId<sup>8+</sup> | number | Yes | No | Access token ID of the application. |
| accessTokenId<sup>8+</sup> | number | Yes| No| Access token ID of the application.| | uid<sup>8+</sup> | number | Yes | No | UID of the application. |
| uid<sup>8+</sup> | number | Yes| No| UID of the application.| | entityType<sup>9+</sup> | string | Yes | No | Entity type of the application. |
| entityType<sup>9+</sup> | string | Yes| No| Entity type of the application.|
## ModuleInfo ## ModuleInfo
...@@ -1483,10 +1396,10 @@ Describes the module information of the application. ...@@ -1483,10 +1396,10 @@ Describes the module information of the application.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| ------ | ------ | ------ | ------ | ------ | | --------------- | ------ | ---- | ---- | ---- |
| moduleName | string | Yes | No | Module name.| | moduleName | string | Yes | No | Module name.|
| moduleSourceDir | string | Yes | No | Installation directory.| | moduleSourceDir | string | Yes | No | Installation directory.|
## CustomizeData ## CustomizeData
...@@ -1494,11 +1407,11 @@ Describes the custom metadata. ...@@ -1494,11 +1407,11 @@ Describes the custom metadata.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type | Readable| Writable| Description | | Name | Type | Readable | Writable | Description |
| ----- | ------ | ---- | ---- | ---------------- | | ------------------ | ------ | ---- | ---- | -------- |
| name | string | Yes | Yes | Custom metadata name.| | name | string | Yes | Yes | Custom metadata name.|
| value | string | Yes | Yes | Custom metadata value. | | value | string | Yes | Yes | Custom metadata value. |
| extra<sup>8+</sup> | string | Yes | Yes | Custom resources. | | extra<sup>8+</sup> | string | Yes | Yes | Custom resources. |
## HapModuleInfo ## HapModuleInfo
...@@ -1507,26 +1420,26 @@ Describes the HAP module information. ...@@ -1507,26 +1420,26 @@ Describes the HAP module information.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| ------ | ------ | ------ | ------ | ------ | | --------------------------------- | ---------------------------- | ---- | ---- | ------------------ |
| name | string | Yes | No | Module name. | | name | string | Yes | No | Module name. |
| description | string | Yes | No | Module description. | | description | string | Yes | No | Module description. |
| descriptionId | number | Yes | No | Module description ID. | | descriptionId | number | Yes | No | Module description ID. |
| icon | string | Yes | No | Module icon. | | icon | string | Yes | No | Module icon. |
| label | string | Yes | No | Module label. | | label | string | Yes | No | Module label. |
| labelId | number | Yes | No | Module label ID. | | labelId | number | Yes | No | Module label ID. |
| iconId | number | Yes | No | Module icon ID. | | iconId | number | Yes | No | Module icon ID. |
| backgroundImg | string | Yes | No | Module background image. | | backgroundImg | string | Yes | No | Module background image. |
| supportedModes | number | Yes | No | Modes supported by the module. | | supportedModes | number | Yes | No | Modes supported by the module. |
| reqCapabilities | Array\<string> | Yes | No | Capabilities required for module running.| | reqCapabilities | Array\<string> | Yes | No | Capabilities required for module running. |
| deviceTypes | Array\<string> | Yes | No | An array of supported device types.| | deviceTypes | Array\<string> | Yes | No | An array of supported device types. |
| abilityInfo | Array\<AbilityInfo> | Yes | No | Ability information. | | abilityInfo | Array\<AbilityInfo> | Yes | No | Ability information. |
| moduleName | string | Yes | No | Module name. | | moduleName | string | Yes | No | Module name. |
| mainAbilityName | string | Yes | No | Name of the entry ability. | | mainAbilityName | string | Yes | No | Name of the entry ability. |
| installationFree | boolean | Yes | No | Whether installation-free is supported. | | installationFree | boolean | Yes | No | Whether installation-free is supported. |
| mainElementName<sup>8+</sup> | string | Yes| No| Information about the entry ability.| | mainElementName<sup>9+</sup> | string | Yes | No | Information about the entry ability. |
| extensionAbilityInfo<sup>9+</sup> | Array\<ExtensionAbilityInfo> | Yes| No| Extension ability information.| | extensionAbilityInfo<sup>9+</sup> | Array\<ExtensionAbilityInfo> | Yes | No | Extension ability information.|
| metadata<sup>9+</sup> | Array\<Metadata> | Yes| No| Metadata of the ability.| | metadata<sup>9+</sup> | Array\<Metadata> | Yes | No | Metadata of the ability. |
## ReqPermissionDetail ## ReqPermissionDetail
...@@ -1534,11 +1447,11 @@ Describes the detailed information of the permissions to request from the system ...@@ -1534,11 +1447,11 @@ Describes the detailed information of the permissions to request from the system
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| ------ | ------ | ------ | ------ | ------ | | --------- | --------- | ---- | ---- | ---------- |
| name | string | Yes | Yes | Name of the permission to request. | | name | string | Yes | Yes | Name of the permission to request. |
| reason | string | Yes | Yes | Reason for requesting the permission. | | reason | string | Yes | Yes | Reason for requesting the permission. |
| usedScene | UsedScene | Yes| Yes| Application scenario and timing for using the permission.| | usedScene | UsedScene | Yes | Yes | Application scenario and timing for using the permission.|
## UsedScene ## UsedScene
...@@ -1546,10 +1459,10 @@ Describes the application scenario and timing for using the permission. ...@@ -1546,10 +1459,10 @@ Describes the application scenario and timing for using the permission.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| ------ | ------ | ------ | ------ | ------ | | --------- | -------------- | ---- | ---- | ---------------- |
| abilities | Array\<string> | Yes | Yes | Abilities that use the permission.| | abilities | Array\<string> | Yes | Yes | Abilities that use the permission.|
| when | string | Yes | Yes | Time when the permission is used. | | when | string | Yes | Yes | Time when the permission is used. |
## AbilityInfo ## AbilityInfo
...@@ -1558,36 +1471,36 @@ Describes the ability information. ...@@ -1558,36 +1471,36 @@ Describes the ability information.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| ------ | ------ | ------ | ------ | ------ | | --------------------- | --------------------- | ---- | ---- | ------------------------ |
| bundleName | string | Yes | No | Application bundle name. | | bundleName | string | Yes | No | Application bundle name. |
| name | string | Yes | No | Ability name. | | name | string | Yes | No | Ability name. |
| label | string | Yes | No | Ability name visible to users. | | label | string | Yes | No | Ability name visible to users. |
| description | string | Yes | No | Ability description. | | description | string | Yes | No | Ability description. |
| icon | string | Yes | No | Index of the ability icon resource file. | | icon | string | Yes | No | Index of the ability icon resource file. |
| descriptionId | number | Yes | No | Ability description ID. | | descriptionId | number | Yes | No | Ability description ID. |
| iconId | number | Yes | No | Ability icon ID. | | iconId | number | Yes | No | Ability icon ID. |
| moduleName | string | Yes | No | Name of the HAP file to which the ability belongs. | | moduleName | string | Yes | No | Name of the HAP file to which the ability belongs. |
| process | string | Yes | No | Process in which this ability runs. If this parameter is not set, the bundle name is used by default.| | process | string | Yes | No | Process in which this ability runs. If this parameter is not set, the bundle name is used by default.|
| targetAbility | string | Yes | No | Target ability that the ability alias points to. | | targetAbility | string | Yes | No | Target ability that the ability alias points to. |
| backgroundModes | number | Yes | No | Background service mode of the ability. | | backgroundModes | number | Yes | No | Background service mode of the ability. |
| isVisible | boolean | Yes | No | Whether the ability can be called by other applications. | | isVisible | boolean | Yes | No | Whether the ability can be called by other applications. |
| formEnabled | boolean | Yes | No | Whether the ability provides the service widget capability. | | formEnabled | boolean | Yes | No | Whether the ability provides the service widget capability. |
| type | AbilityType | Yes | No | Ability type. | | type | AbilityType | Yes | No | Ability type. |
| orientation | DisplayOrientation | Yes | No | Ability display orientation. | | orientation | DisplayOrientation | Yes | No | Ability display orientation. |
| launchMode | LaunchMode | Yes | No | Ability launch mode. | | launchMode | LaunchMode | Yes | No | Ability launch mode. |
| permissions | Array\<string> | Yes | No | Permissions required for other applications to call the ability.| | permissions | Array\<string> | Yes | No | Permissions required for other applications to call the ability.|
| deviceTypes | Array\<string> | Yes | No | Device types supported by the ability. | | deviceTypes | Array\<string> | Yes | No | Device types supported by the ability. |
| deviceCapabilities | Array\<string> | Yes | No | Device capabilities required for the ability. | | deviceCapabilities | Array\<string> | Yes | No | Device capabilities required for the ability. |
| readPermission | string | Yes | No | Permission required for reading the ability data. | | readPermission | string | Yes | No | Permission required for reading the ability data. |
| writePermission | string | Yes | No | Permission required for writing data to the ability. | | writePermission | string | Yes | No | Permission required for writing data to the ability. |
| applicationInfo | ApplicationInfo | Yes | No | Application configuration information. | | applicationInfo | ApplicationInfo | Yes | No | Application configuration information. |
| uri | string | Yes | No | URI of the ability. | | uri | string | Yes | No | URI of the ability. |
| labelId | number | Yes | No | Ability label ID. | | labelId | number | Yes | No | Ability label ID. |
| subType | AbilitySubType | Yes | No | Subtype of the template that can be used by the ability. | | subType | AbilitySubType | Yes | No | Subtype of the template that can be used by the ability. |
| metaData<sup>8+</sup> | Array\<CustomizeData> | Yes| No| Custom information of the ability.| | metaData<sup>8+</sup> | Array\<CustomizeData> | Yes | No | Custom information of the ability. |
| metaData<sup>9+</sup> | Array\<Metadata> | Yes| No| Metadata of the ability.| | metaData<sup>9+</sup> | Array\<Metadata> | Yes | No | Metadata of the ability. |
| enabled<sup>8+</sup> | boolean | Yes| No| Whether the ability is enabled.| | enabled<sup>8+</sup> | boolean | Yes | No | Whether the ability is enabled. |
## AbilityType ## AbilityType
...@@ -1595,12 +1508,12 @@ Enumerates ability types. ...@@ -1595,12 +1508,12 @@ Enumerates ability types.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Description | | Name | Type | Description |
| ------- | ---- | --------------------------- | | ------- | ---- | ----------------- |
| UNKNOWN | None | Unknown ability type. | | UNKNOWN | None | Unknown ability type. |
| PAGE | None | Ability that has a UI. | | PAGE | None | Ability that has a UI. |
| SERVICE | None | Ability that does not have a UI. | | SERVICE | None | Ability that does not have a UI. |
| DATA | None | Ability that is used to provide data access services.| | DATA | None | Ability that is used to provide data access services.|
## DisplayOrientation ## DisplayOrientation
...@@ -1608,12 +1521,12 @@ Enumerates display orientations. ...@@ -1608,12 +1521,12 @@ Enumerates display orientations.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Description | | Name | Type | Description |
| ------------- | ---- | ------------------------ | | ------------- | ---- | ------------- |
| UNSPECIFIED | None | The system automatically determines the display orientation. | | UNSPECIFIED | None | The system automatically determines the display orientation. |
| LANDSCAPE | None | Landscape orientation. | | LANDSCAPE | None | Landscape orientation. |
| PORTRAIT | None | Portrait orientation. | | PORTRAIT | None | Portrait orientation. |
| FOLLOW_RECENT | None | The page ability orientation is the same as that of the nearest ability in the stack.| | FOLLOW_RECENT | None | The page ability orientation is the same as that of the nearest ability in the stack.|
## LaunchMode ## LaunchMode
...@@ -1621,10 +1534,10 @@ Enumerates launch modes. ...@@ -1621,10 +1534,10 @@ Enumerates launch modes.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Description | | Name | Type | Description |
| ----------- | ---- | ------------------- | | --------- | ---- | ------------- |
| SINGLETON | 0 | The ability has only one instance.| | SINGLETON | 0 | The ability has only one instance.|
| STANDARD | 1 | The ability can have multiple instances. | | STANDARD | 1 | The ability can have multiple instances. |
## AbilitySubType ## AbilitySubType
...@@ -1632,43 +1545,43 @@ Enumerates ability subtypes. ...@@ -1632,43 +1545,43 @@ Enumerates ability subtypes.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Description | | Name | Type | Description |
| ----------- | ---- | ----------------------------- | | ----------- | ---- | -------------------- |
| UNSPECIFIED | 0 | Undefined ability subtype. | | UNSPECIFIED | 0 | Undefined ability subtype. |
| CA | 1 | Ability that has a UI.| | CA | 1 | Ability that has a UI.|
## ExtensionAbilityType<sup>9+</sup> ## ExtensionAbilityType<sup>9+</sup>
Enumerates extension ability types. Enumerates Extension ability types.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Description | | Name | Type | Description |
| -------------------- | ---- | ----------------------------- | | ------------------------------ | ---- | ------------------------- |
| FORM<sup>9+</sup> | 0 | Form included. | | FORM<sup>9+</sup> | 0 | Form included. |
| WORK_SCHEDULER<sup>9+</sup> | 1 | Work scheduler included.| | WORK_SCHEDULER<sup>9+</sup> | 1 | Work scheduler included.|
| INPUT_METHOD<sup>9+</sup> | 2 | Input method included. | | INPUT_METHOD<sup>9+</sup> | 2 | Input method included. |
| SERVICE<sup>9+</sup> | 3 | Service included. | | SERVICE<sup>9+</sup> | 3 | Service included. |
| ACCESSIBILITY<sup>9+</sup> | 4 | Accessibility included. | | ACCESSIBILITY<sup>9+</sup> | 4 | Accessibility included. |
| DATA_SHARE<sup>9+</sup> | 5 | Data sharing included.| | DATA_SHARE<sup>9+</sup> | 5 | Data sharing included.|
| FILE_SHARE<sup>9+</sup> | 6 | File sharing included.| | FILE_SHARE<sup>9+</sup> | 6 | File sharing included.|
| STATIC_SUBSCRIBER<sup>9+</sup> | 7 | Subscribers included. | | STATIC_SUBSCRIBER<sup>9+</sup> | 7 | Subscribers included. |
| WALLPAPER<sup>9+</sup> | 8 | Wallpaper included. | | WALLPAPER<sup>9+</sup> | 8 | Wallpaper included. |
| UNSPECIFIED<sup>9+</sup> | 9 | Unspecified type. | | UNSPECIFIED<sup>9+</sup> | 9 | Unspecified type. |
## ExtensionFlag<sup>9+</sup> ## ExtensionFlag<sup>9+</sup>
Enumerates extension flags. Enumerates Extension flags.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Default Value| Description | | Name | Default Value | Description |
| ------ | ------ | ------ | | ---------------------------------------- | ---------- | ------------------------------ |
| GET_EXTENSION_INFO_DEFAULT<sup>9+</sup> | 0x00000000 | Obtains the default extension ability information.| | GET_EXTENSION_INFO_DEFAULT<sup>9+</sup> | 0x00000000 | Obtains the default Extension ability information. |
| GET_EXTENSION_INFO_WITH_PERMISSION<sup>9+</sup> | 0x00000002 | Obtains the extension ability information that carries permission information.| | GET_EXTENSION_INFO_WITH_PERMISSION<sup>9+</sup> | 0x00000002 | Obtains the Extension ability information that carries permission information. |
| GET_EXTENSION_INFO_WITH_APPLICATION<sup>9+</sup> | 0x00000004 | Obtains the extension ability information that carries application information.| | GET_EXTENSION_INFO_WITH_APPLICATION<sup>9+</sup> | 0x00000004 | Obtains the Extension ability information that carries application information. |
| GET_EXTENSION_INFO_WITH_METADATA<sup>9+</sup> | 0x00000020 | Obtains the extension ability information that carries metadata information.| | GET_EXTENSION_INFO_WITH_METADATA<sup>9+</sup> | 0x00000020 | Obtains the Extension ability information that carries metadata information.|
## ColorMode ## ColorMode
...@@ -1677,11 +1590,11 @@ Enumerates color modes. ...@@ -1677,11 +1590,11 @@ Enumerates color modes.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Description | | Name | Type | Description |
| ----------- | ---- | ------------------- | | ---------- | ---- | ---- |
| AUTO_MODE | -1 | Automatic mode.| | AUTO_MODE | -1 | Automatic mode.|
| DARK_MODE | 0 | Dark mode. | | DARK_MODE | 0 | Dark mode.|
| LIGHT_MODE | 1 | Light mode. | | LIGHT_MODE | 1 | Light mode.|
## GrantStatus ## GrantStatus
...@@ -1690,34 +1603,34 @@ Enumerates permission grant statuses. ...@@ -1690,34 +1603,34 @@ Enumerates permission grant statuses.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Description | | Name | Type | Description |
| ----------- | ---- | ------------------- | | ------------------ | ---- | ---- |
| PERMISSION_DENIED | -1 | Permission denied.| | PERMISSION_DENIED | -1 | Permission denied.|
| PERMISSION_GRANTED | 0 | Permission granted. | | PERMISSION_GRANTED | 0 | Permission granted. |
## ExtensionAbilityInfo<sup>9+</sup> ## ExtensionAbilityInfo<sup>9+</sup>
Describes the extension ability information. Describes the Extension ability information.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| ------ | ------ | ------ | ------ | ------ | | --------------------------------- | --------------------------- | ---- | ---- | --------------------------------- |
| bundleName<sup>9+</sup> | string | Yes | No | Application bundle name. | | bundleName<sup>9+</sup> | string | Yes | No | Application bundle name. |
| moduleName<sup>9+</sup> | string | Yes | No | Name of the HAP file to which the extension ability belongs. | | moduleName<sup>9+</sup> | string | Yes | No | Name of the HAP file to which the Extension ability belongs. |
| name<sup>9+</sup> | string | Yes | No | Name of the extension ability. | | name<sup>9+</sup> | string | Yes | No | Name of the Extension ability. |
| labelId<sup>9+</sup> | number | Yes | No | Label ID of the extension ability. | | labelId<sup>9+</sup> | number | Yes | No | Label ID of the Extension ability. |
| descriptionId<sup>9+</sup> | number | Yes | No | Description ID of the extension ability. | | descriptionId<sup>9+</sup> | number | Yes | No | Description ID of the Extension ability. |
| iconId<sup>9+</sup> | number | Yes | No | Icon ID of the extension ability. | | iconId<sup>9+</sup> | number | Yes | No | Icon ID of the Extension ability. |
| isVisible<sup>9+</sup> | boolean | Yes | No | Whether the extension ability can be called by other applications. | | isVisible<sup>9+</sup> | boolean | Yes | No | Whether the Extension ability can be called by other applications. |
| extensionAbilityType<sup>9+</sup> | bundle.ExtensionAbilityType | Yes | No | Type of the extension ability. | | extensionAbilityType<sup>9+</sup> | bundle.ExtensionAbilityType | Yes | No | Type of the Extension ability. |
| permissions<sup>9+</sup> | Array\<string> | Yes | No | Permissions required for other applications to call the extension ability.| | permissions<sup>9+</sup> | Array\<string> | Yes | No | Permissions required for other applications to call the Extension ability.|
| applicationInfo<sup>9+</sup> | ApplicationInfo | Yes | No | Application configuration information. | | applicationInfo<sup>9+</sup> | ApplicationInfo | Yes | No | Application configuration information. |
| metaData<sup>9+</sup> | Array\<Metadata> | Yes| No| Metadata of the extension ability.| | metaData<sup>9+</sup> | Array\<Metadata> | Yes | No | Metadata of the Extension ability. |
| enabled<sup>9+</sup> | boolean | Yes| No| Whether the extension ability is enabled.| | enabled<sup>9+</sup> | boolean | Yes | No | Whether the Extension ability is enabled. |
| readPermission<sup>9+</sup> | string | Yes | No | Permission required for reading the extension ability data. | | readPermission<sup>9+</sup> | string | Yes | No | Permission required for reading the Extension ability data. |
| writePermission<sup>9+</sup> | string | Yes | No | Permission required for writing data to the extension ability. | | writePermission<sup>9+</sup> | string | Yes | No | Permission required for writing data to the Extension ability. |
## Metadata<sup>9+</sup> ## Metadata<sup>9+</sup>
...@@ -1726,8 +1639,8 @@ Describes the metadata information. ...@@ -1726,8 +1639,8 @@ Describes the metadata information.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type | Readable| Writable| Description | | Name | Type | Readable | Writable | Description |
| ----- | ------ | ---- | ---- | ---------------- | | --------------------- | ------ | ---- | ---- | ----- |
| name<sup>9+</sup> | string | Yes | Yes | Metadata name.| | name<sup>9+</sup> | string | Yes | Yes | Metadata name.|
| value<sup>9+</sup> | string | Yes | Yes | Metadata value. | | value<sup>9+</sup> | string | Yes | Yes | Metadata value. |
| resource<sup>9+</sup> | string | Yes | Yes | Metadata resource. | | resource<sup>9+</sup> | string | Yes | Yes | Metadata resource.|
...@@ -22,14 +22,14 @@ Subscribes to data changes of the acceleration sensor. If this API is called mul ...@@ -22,14 +22,14 @@ Subscribes to data changes of the acceleration sensor. If this API is called mul
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER**.|
| callback | Callback&lt;[AccelerometerResponse](#accelerometerresponse)&gt; | Yes| Callback used to return the acceleration sensor data. The reported data type in the callback is **AccelerometerResponse**.| | callback | Callback&lt;[AccelerometerResponse](#accelerometerresponse)&gt; | Yes | Callback used to return the acceleration sensor data. The reported data type in the callback is **AccelerometerResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER,function(data){
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -51,14 +51,14 @@ Subscribes to data changes of the linear acceleration sensor. If this API is cal ...@@ -51,14 +51,14 @@ Subscribes to data changes of the linear acceleration sensor. If this API is cal
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_LINEAR_ACCELERATION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_LINEAR_ACCELERATION**.|
| callback | Callback&lt;[LinearAccelerometerResponse](#linearaccelerometerresponse)&gt; | Yes| Callback used to return the linear acceleration sensor data. The reported data type in the callback is **LinearAccelerometerResponse**.| | callback | Callback&lt;[LinearAccelerometerResponse](#linearaccelerometerresponse)&gt; | Yes | Callback used to return the linear acceleration sensor data. The reported data type in the callback is **LinearAccelerometerResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,function(data){
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -80,14 +80,14 @@ Subscribes to data changes of the uncalibrated acceleration sensor. If this API ...@@ -80,14 +80,14 @@ Subscribes to data changes of the uncalibrated acceleration sensor. If this API
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED**.|
| callback | Callback&lt;[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)&gt; | Yes| Callback used to return the uncalibrated acceleration sensor data. The reported data type in the callback is **AccelerometerUncalibratedResponse**.| | callback | Callback&lt;[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)&gt; | Yes | Callback used to return the uncalibrated acceleration sensor data. The reported data type in the callback is **AccelerometerUncalibratedResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,function(data){
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -110,14 +110,14 @@ Subscribes to data changes of the gravity sensor. If this API is called multiple ...@@ -110,14 +110,14 @@ Subscribes to data changes of the gravity sensor. If this API is called multiple
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GRAVITY**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GRAVITY**. |
| callback | Callback&lt;[GravityResponse](#gravityresponse)&gt; | Yes| Callback used to return the gravity sensor data. The reported data type in the callback is **GravityResponse**.| | callback | Callback&lt;[GravityResponse](#gravityresponse)&gt; | Yes | Callback used to return the gravity sensor data. The reported data type in the callback is **GravityResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY,function(data){
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -139,14 +139,14 @@ Subscribes to data changes of the gyroscope sensor. If this API is called multip ...@@ -139,14 +139,14 @@ Subscribes to data changes of the gyroscope sensor. If this API is called multip
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE**. |
| callback | Callback&lt;[GyroscopeResponse](#gyroscoperesponse)&gt; | Yes| Callback used to return the gyroscope sensor data. The reported data type in the callback is **GyroscopeResponse**.| | callback | Callback&lt;[GyroscopeResponse](#gyroscoperesponse)&gt; | Yes | Callback used to return the gyroscope sensor data. The reported data type in the callback is **GyroscopeResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE,function(data){
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -168,14 +168,14 @@ Subscribes to data changes of the uncalibrated gyroscope sensor. If this API is ...@@ -168,14 +168,14 @@ Subscribes to data changes of the uncalibrated gyroscope sensor. If this API is
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED**.|
| callback | Callback&lt;[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)&gt; | Yes| Callback used to return the uncalibrated gyroscope sensor data. The reported data type in the callback is **GyroscopeUncalibratedResponse**.| | callback | Callback&lt;[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)&gt; | Yes | Callback used to return the uncalibrated gyroscope sensor data. The reported data type in the callback is **GyroscopeUncalibratedResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,function(data){
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -198,14 +198,14 @@ Subscribes to data changes of the significant motion sensor. If this API is call ...@@ -198,14 +198,14 @@ Subscribes to data changes of the significant motion sensor. If this API is call
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_SIGNIFICANT_MOTION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_SIGNIFICANT_MOTION**.|
| callback | Callback&lt;[SignificantMotionResponse](#significantmotionresponse)&gt; | Yes| Callback used to return the significant motion sensor data. The reported data type in the callback is **SignificantMotionResponse**.| | callback | Callback&lt;[SignificantMotionResponse](#significantmotionresponse)&gt; | Yes | Callback used to return the significant motion sensor data. The reported data type in the callback is **SignificantMotionResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION,function(data){
console.info('Scalar data: ' + data.scalar); console.info('Scalar data: ' + data.scalar);
...@@ -225,14 +225,14 @@ Subscribes to data changes of the pedometer detection sensor. If this API is cal ...@@ -225,14 +225,14 @@ Subscribes to data changes of the pedometer detection sensor. If this API is cal
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER_DETECTION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER_DETECTION**.|
| callback | Callback&lt;[PedometerDetectionResponse](#pedometerdetectionresponse)&gt; | Yes| Callback used to return the pedometer detection sensor data. The reported data type in the callback is **PedometerDetectionResponse**.| | callback | Callback&lt;[PedometerDetectionResponse](#pedometerdetectionresponse)&gt; | Yes | Callback used to return the pedometer detection sensor data. The reported data type in the callback is **PedometerDetectionResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,function(data){
console.info('Scalar data: ' + data.scalar); console.info('Scalar data: ' + data.scalar);
...@@ -252,14 +252,14 @@ Subscribes to data changes of the pedometer sensor. If this API is called multip ...@@ -252,14 +252,14 @@ Subscribes to data changes of the pedometer sensor. If this API is called multip
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | --------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER**. |
| callback | Callback&lt;[PedometerResponse](#pedometerresponse)&gt; | Yes| Callback used to return the pedometer sensor data. The reported data type in the callback is **PedometerResponse**.| | callback | Callback&lt;[PedometerResponse](#pedometerresponse)&gt; | Yes | Callback used to return the pedometer sensor data. The reported data type in the callback is **PedometerResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER,function(data){
console.info('Steps: ' + data.steps); console.info('Steps: ' + data.steps);
...@@ -277,14 +277,14 @@ Subscribes to data changes of the ambient temperature sensor. If this API is cal ...@@ -277,14 +277,14 @@ Subscribes to data changes of the ambient temperature sensor. If this API is cal
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_TEMPERATURE**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_TEMPERATURE**.|
| callback | Callback&lt;[AmbientTemperatureResponse](#ambienttemperatureresponse)&gt; | Yes| Callback used to return the ambient temperature sensor data. The reported data type in the callback is **AmbientTemperatureResponse**.| | callback | Callback&lt;[AmbientTemperatureResponse](#ambienttemperatureresponse)&gt; | Yes | Callback used to return the ambient temperature sensor data. The reported data type in the callback is **AmbientTemperatureResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,function(data){
console.info('Temperature: ' + data.temperature); console.info('Temperature: ' + data.temperature);
...@@ -302,14 +302,14 @@ Subscribes to data changes of the magnetic field sensor. If this API is called m ...@@ -302,14 +302,14 @@ Subscribes to data changes of the magnetic field sensor. If this API is called m
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD**.|
| callback | Callback&lt;[MagneticFieldResponse](#magneticfieldresponse)&gt; | Yes| Callback used to return the magnetic field sensor data. The reported data type in the callback is **MagneticFieldResponse**.| | callback | Callback&lt;[MagneticFieldResponse](#magneticfieldresponse)&gt; | Yes | Callback used to return the magnetic field sensor data. The reported data type in the callback is **MagneticFieldResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD,function(data){
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -323,20 +323,20 @@ Subscribes to data changes of the magnetic field sensor. If this API is called m ...@@ -323,20 +323,20 @@ Subscribes to data changes of the magnetic field sensor. If this API is called m
## sensor.on(SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED) ## sensor.on(SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED)
on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback: Callback&lt;MagneticFieldUncalibratedResponse&gt;, options: Options): void on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback: Callback&lt;MagneticFieldUncalibratedResponse&gt;, options?: Options): void
Subscribes to data changes of the uncalibrated magnetic field sensor. If this API is called multiple times for the same application, the last call takes effect. Subscribes to data changes of the uncalibrated magnetic field sensor. If this API is called multiple times for the same application, the last call takes effect.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED**.|
| callback | Callback&lt;[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)&gt; | Yes| Callback used to return the uncalibrated magnetic field sensor data. The reported data type in the callback is **MagneticFieldUncalibratedResponse**.| | callback | Callback&lt;[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)&gt; | Yes | Callback used to return the uncalibrated magnetic field sensor data. The reported data type in the callback is **MagneticFieldUncalibratedResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,function(data){
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -359,14 +359,14 @@ Subscribes to data changes of the proximity sensor. If this API is called multip ...@@ -359,14 +359,14 @@ Subscribes to data changes of the proximity sensor. If this API is called multip
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PROXIMITY**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PROXIMITY**. |
| callback | Callback&lt;[ProximityResponse](#proximityresponse)&gt; | Yes| Callback used to return the proximity sensor data. The reported data type in the callback is **ProximityResponse**.| | callback | Callback&lt;[ProximityResponse](#proximityresponse)&gt; | Yes | Callback used to return the proximity sensor data. The reported data type in the callback is **ProximityResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY,function(data){
console.info('Distance: ' + data.distance); console.info('Distance: ' + data.distance);
...@@ -384,14 +384,14 @@ Subscribes to data changes of the humidity sensor. If this API is called multipl ...@@ -384,14 +384,14 @@ Subscribes to data changes of the humidity sensor. If this API is called multipl
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | -------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HUMIDITY**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HUMIDITY**. |
| callback | Callback&lt;[HumidityResponse](#humidityresponse)&gt; | Yes| Callback used to return the humidity sensor data. The reported data type in the callback is **HumidityResponse**.| | callback | Callback&lt;[HumidityResponse](#humidityresponse)&gt; | Yes | Callback used to return the humidity sensor data. The reported data type in the callback is **HumidityResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY,function(data){
console.info('Humidity: ' + data.humidity); console.info('Humidity: ' + data.humidity);
...@@ -409,14 +409,14 @@ Subscribes to data changes of the barometer sensor. If this API is called multip ...@@ -409,14 +409,14 @@ Subscribes to data changes of the barometer sensor. If this API is called multip
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_BAROMETER**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_BAROMETER**. |
| callback | Callback&lt;[BarometerResponse](#barometerresponse)&gt; | Yes| Callback used to return the barometer sensor data. The reported data type in the callback is **BarometerResponse**.| | callback | Callback&lt;[BarometerResponse](#barometerresponse)&gt; | Yes | Callback used to return the barometer sensor data. The reported data type in the callback is **BarometerResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER,function(data){
console.info('Atmospheric pressure: ' + data.pressure); console.info('Atmospheric pressure: ' + data.pressure);
...@@ -434,14 +434,14 @@ Subscribes to data changes of the Hall effect sensor. If this API is called mult ...@@ -434,14 +434,14 @@ Subscribes to data changes of the Hall effect sensor. If this API is called mult
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HALL**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HALL**. |
| callback | Callback&lt;[HallResponse](#hallresponse)&gt; | Yes| Callback used to return the Hall effect sensor data. The reported data type in the callback is **HallResponse**.| | callback | Callback&lt;[HallResponse](#hallresponse)&gt; | Yes | Callback used to return the Hall effect sensor data. The reported data type in the callback is **HallResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HALL,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HALL,function(data){
console.info('Status: ' + data.status); console.info('Status: ' + data.status);
...@@ -459,14 +459,14 @@ Subscribes to data changes of the ambient light sensor. If this API is called mu ...@@ -459,14 +459,14 @@ Subscribes to data changes of the ambient light sensor. If this API is called mu
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_LIGHT**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_LIGHT**.|
| callback | Callback&lt;[LightResponse](#lightresponse)&gt; | Yes| Callback used to return the ambient light sensor data. The reported data type in the callback is **LightResponse**.| | callback | Callback&lt;[LightResponse](#lightresponse)&gt; | Yes | Callback used to return the ambient light sensor data. The reported data type in the callback is **LightResponse**. |
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT,function(data){
console.info(' Illumination: ' + data.intensity); console.info(' Illumination: ' + data.intensity);
...@@ -484,14 +484,14 @@ Subscribes to data changes of the orientation sensor. If this API is called mult ...@@ -484,14 +484,14 @@ Subscribes to data changes of the orientation sensor. If this API is called mult
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ORIENTATION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ORIENTATION**. |
| callback | Callback&lt;[OrientationResponse](#orientationresponse)&gt; | Yes| Callback used to return the orientation sensor data. The reported data type in the callback is **OrientationResponse**.| | callback | Callback&lt;[OrientationResponse](#orientationresponse)&gt; | Yes | Callback used to return the orientation sensor data. The reported data type in the callback is **OrientationResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION,function(data){
console.info('The device rotates at an angle around the X axis: ' + data.beta); console.info('The device rotates at an angle around the X axis: ' + data.beta);
...@@ -512,14 +512,14 @@ Subscribes to only one data change of the heart rate sensor. ...@@ -512,14 +512,14 @@ Subscribes to only one data change of the heart rate sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HEART_RATE**. | | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HEART_RATE**. |
| callback | Callback&lt;[HeartRateResponse](#heartrateresponse)&gt; | Yes | One-shot callback used to return the heart rate sensor data. The reported data type in the callback is **HeartRateResponse**.| | callback | Callback&lt;[HeartRateResponse](#heartrateresponse)&gt; | Yes | One-shot callback used to return the heart rate sensor data. The reported data type in the callback is **HeartRateResponse**.|
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE,function(data){
...@@ -537,14 +537,14 @@ Subscribes to data changes of the rotation vector sensor. If this API is called ...@@ -537,14 +537,14 @@ Subscribes to data changes of the rotation vector sensor. If this API is called
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ROTATION_VECTOR**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ROTATION_VECTOR**.|
| callback | Callback&lt;[RotationVectorResponse](#rotationvectorresponse)&gt; | Yes| Callback used to return the rotation vector sensor data. The reported data type in the callback is **RotationVectorResponse**.| | callback | Callback&lt;[RotationVectorResponse](#rotationvectorresponse)&gt; | Yes | Callback used to return the rotation vector sensor data. The reported data type in the callback is **RotationVectorResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,function(data){
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -565,14 +565,14 @@ Subscribes to data changes of the wear detection sensor. If this API is called m ...@@ -565,14 +565,14 @@ Subscribes to data changes of the wear detection sensor. If this API is called m
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_WEAR_DETECTION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_WEAR_DETECTION**.|
| callback | Callback&lt;[WearDetectionResponse](#weardetectionresponse)&gt; | Yes| Callback used to return the wear detection sensor data. The reported data type in the callback is **WearDetectionResponse**.| | callback | Callback&lt;[WearDetectionResponse](#weardetectionresponse)&gt; | Yes | Callback used to return the wear detection sensor data. The reported data type in the callback is **WearDetectionResponse**.|
| options | [Options](#options) | No| Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns.| | options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
- Example **Example**
``` ```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION,function(data){ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION,function(data){
console.info('Wear status: ' + data.value); console.info('Wear status: ' + data.value);
...@@ -592,13 +592,13 @@ Subscribes to only one data change of the acceleration sensor. ...@@ -592,13 +592,13 @@ Subscribes to only one data change of the acceleration sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER**. |
| callback | Callback&lt;[AccelerometerResponse](#accelerometerresponse)&gt; | Yes| One-shot callback used to return the acceleration sensor data. The reported data type in the callback is **AccelerometerResponse**.| | callback | Callback&lt;[AccelerometerResponse](#accelerometerresponse)&gt; | Yes | One-shot callback used to return the acceleration sensor data. The reported data type in the callback is **AccelerometerResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER,function(data){ sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER,function(data){
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -619,13 +619,13 @@ Subscribes to only one data change of the linear acceleration sensor. ...@@ -619,13 +619,13 @@ Subscribes to only one data change of the linear acceleration sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_LINEAR_ACCELERATION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_LINEAR_ACCELERATION**.|
| callback | Callback&lt;[LinearAccelerometerResponse](#linearaccelerometerresponse)&gt; | Yes| One-shot callback used to return the linear acceleration sensor data. The reported data type in the callback is **LinearAccelerometerResponse**.| | callback | Callback&lt;[LinearAccelerometerResponse](#linearaccelerometerresponse)&gt; | Yes | One-shot callback used to return the linear acceleration sensor data. The reported data type in the callback is **LinearAccelerometerResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, function(data) {
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -646,13 +646,13 @@ Subscribes to only one data change of the uncalibrated acceleration sensor. ...@@ -646,13 +646,13 @@ Subscribes to only one data change of the uncalibrated acceleration sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED**.|
| callback | Callback&lt;[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)&gt; | Yes| One-shot callback used to return the uncalibrated acceleration sensor data. The reported data type in the callback is **AccelerometerUncalibratedResponse**.| | callback | Callback&lt;[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)&gt; | Yes | One-shot callback used to return the uncalibrated acceleration sensor data. The reported data type in the callback is **AccelerometerUncalibratedResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, function(data) {
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -674,13 +674,13 @@ Subscribes to only one data change of the gravity sensor. ...@@ -674,13 +674,13 @@ Subscribes to only one data change of the gravity sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | --------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GRAVITY**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GRAVITY**. |
| callback | Callback&lt;[GravityResponse](#gravityresponse)&gt; | Yes| One-shot callback used to return the gravity sensor data. The reported data type in the callback is **GravityResponse**.| | callback | Callback&lt;[GravityResponse](#gravityresponse)&gt; | Yes | One-shot callback used to return the gravity sensor data. The reported data type in the callback is **GravityResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, function(data) {
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -701,13 +701,13 @@ Subscribes to only one data change of the gyroscope sensor. ...@@ -701,13 +701,13 @@ Subscribes to only one data change of the gyroscope sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE**. |
| callback | Callback&lt;[GyroscopeResponse](#gyroscoperesponse)&gt; | Yes| One-shot callback used to return the gyroscope sensor data. The reported data type in the callback is **GyroscopeResponse**.| | callback | Callback&lt;[GyroscopeResponse](#gyroscoperesponse)&gt; | Yes | One-shot callback used to return the gyroscope sensor data. The reported data type in the callback is **GyroscopeResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, function(data) {
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -728,13 +728,13 @@ Subscribes to only one data change of the uncalibrated gyroscope sensor. ...@@ -728,13 +728,13 @@ Subscribes to only one data change of the uncalibrated gyroscope sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED**.|
| callback | Callback&lt;[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)&gt; | Yes| One-shot callback used to return the uncalibrated gyroscope sensor data. The reported data type in the callback is **GyroscopeUncalibratedResponse**.| | callback | Callback&lt;[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)&gt; | Yes | One-shot callback used to return the uncalibrated gyroscope sensor data. The reported data type in the callback is **GyroscopeUncalibratedResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, function(data) {
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -756,13 +756,13 @@ Subscribes to only one data change of the significant motion sensor. ...@@ -756,13 +756,13 @@ Subscribes to only one data change of the significant motion sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_SIGNIFICANT_MOTION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_SIGNIFICANT_MOTION**.|
| callback | Callback&lt;[SignificantMotionResponse](#significantmotionresponse)&gt; | Yes| One-shot callback used to return the significant motion sensor data. The reported data type in the callback is **SignificantMotionResponse**.| | callback | Callback&lt;[SignificantMotionResponse](#significantmotionresponse)&gt; | Yes | One-shot callback used to return the significant motion sensor data. The reported data type in the callback is **SignificantMotionResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, function(data) {
console.info('Scalar data: ' + data.scalar); console.info('Scalar data: ' + data.scalar);
...@@ -781,13 +781,13 @@ Subscribes to only one data change of the pedometer detection sensor. ...@@ -781,13 +781,13 @@ Subscribes to only one data change of the pedometer detection sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER_DETECTION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER_DETECTION**.|
| callback | Callback&lt;[PedometerDetectionResponse](#pedometerdetectionresponse)&gt; | Yes| One-shot callback used to return the pedometer detection sensor data. The reported data type in the callback is **PedometerDetectionResponse**.| | callback | Callback&lt;[PedometerDetectionResponse](#pedometerdetectionresponse)&gt; | Yes | One-shot callback used to return the pedometer detection sensor data. The reported data type in the callback is **PedometerDetectionResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, function(data) {
console.info('Scalar data: ' + data.scalar); console.info('Scalar data: ' + data.scalar);
...@@ -806,13 +806,13 @@ Subscribes to only one data change of the pedometer sensor. ...@@ -806,13 +806,13 @@ Subscribes to only one data change of the pedometer sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER**. |
| callback | Callback&lt;[PedometerResponse](#pedometerresponse)&gt; | Yes| One-shot callback used to return the pedometer sensor data. The reported data type in the callback is **PedometerResponse**.| | callback | Callback&lt;[PedometerResponse](#pedometerresponse)&gt; | Yes | One-shot callback used to return the pedometer sensor data. The reported data type in the callback is **PedometerResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, function(data) {
console.info('Steps: ' + data.steps); console.info('Steps: ' + data.steps);
...@@ -829,13 +829,13 @@ Subscribes to only one data change of the ambient temperature sensor. ...@@ -829,13 +829,13 @@ Subscribes to only one data change of the ambient temperature sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_TEMPERATURE**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_TEMPERATURE**.|
| callback | Callback&lt;[AmbientTemperatureResponse](#ambienttemperatureresponse)&gt; | Yes| One-shot callback used to return the ambient temperature sensor data. The reported data type in the callback is **AmbientTemperatureResponse**.| | callback | Callback&lt;[AmbientTemperatureResponse](#ambienttemperatureresponse)&gt; | Yes | One-shot callback used to return the ambient temperature sensor data. The reported data type in the callback is **AmbientTemperatureResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, function(data) {
console.info('Temperature: ' + data.temperature); console.info('Temperature: ' + data.temperature);
...@@ -852,13 +852,13 @@ Subscribes to only one data change of the magnetic field sensor. ...@@ -852,13 +852,13 @@ Subscribes to only one data change of the magnetic field sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD**. |
| callback | Callback&lt;[MagneticFieldResponse](#magneticfieldresponse)&gt; | Yes| One-shot callback used to return the magnetic field sensor data. The reported data type in the callback is **MagneticFieldResponse**.| | callback | Callback&lt;[MagneticFieldResponse](#magneticfieldresponse)&gt; | Yes | One-shot callback used to return the magnetic field sensor data. The reported data type in the callback is **MagneticFieldResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, function(data) {
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -877,13 +877,13 @@ Subscribes to only one data change of the uncalibrated magnetic field sensor. ...@@ -877,13 +877,13 @@ Subscribes to only one data change of the uncalibrated magnetic field sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED**.|
| callback | Callback&lt;[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)&gt; | Yes| One-shot callback used to return the uncalibrated magnetic field sensor data. The reported data type in the callback is **MagneticFieldUncalibratedResponse**.| | callback | Callback&lt;[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)&gt; | Yes | One-shot callback used to return the uncalibrated magnetic field sensor data. The reported data type in the callback is **MagneticFieldUncalibratedResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, function(data) {
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -905,13 +905,13 @@ Subscribes to only one data change of the proximity sensor. ...@@ -905,13 +905,13 @@ Subscribes to only one data change of the proximity sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PROXIMITY**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PROXIMITY**. |
| callback | Callback&lt;[ProximityResponse](#proximityresponse)&gt; | Yes| One-shot callback used to return the proximity sensor data. The reported data type in the callback is **ProximityResponse**.| | callback | Callback&lt;[ProximityResponse](#proximityresponse)&gt; | Yes | One-shot callback used to return the proximity sensor data. The reported data type in the callback is **ProximityResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, function(error, data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, function(error, data) {
if (error) { if (error) {
...@@ -932,13 +932,13 @@ Subscribes to only one data change of the humidity sensor. ...@@ -932,13 +932,13 @@ Subscribes to only one data change of the humidity sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HUMIDITY**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HUMIDITY**. |
| callback | Callback&lt;[HumidityResponse](#humidityresponse)&gt; | Yes| One-shot callback used to return the humidity sensor data. The reported data type in the callback is **HumidityResponse**.| | callback | Callback&lt;[HumidityResponse](#humidityresponse)&gt; | Yes | One-shot callback used to return the humidity sensor data. The reported data type in the callback is **HumidityResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, function(data) {
console.info('Humidity: ' + data.humidity); console.info('Humidity: ' + data.humidity);
...@@ -955,13 +955,13 @@ Subscribes to only one data change of the barometer sensor. ...@@ -955,13 +955,13 @@ Subscribes to only one data change of the barometer sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_BAROMETER**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_BAROMETER**. |
| callback | Callback&lt;[BarometerResponse](#barometerresponse)&gt; | Yes| One-shot callback used to return the barometer sensor data. The reported data type in the callback is **BarometerResponse**.| | callback | Callback&lt;[BarometerResponse](#barometerresponse)&gt; | Yes | One-shot callback used to return the barometer sensor data. The reported data type in the callback is **BarometerResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, function(data) {
console.info('Atmospheric pressure: ' + data.pressure); console.info('Atmospheric pressure: ' + data.pressure);
...@@ -978,13 +978,13 @@ Subscribes to only one data change of the Hall effect sensor. ...@@ -978,13 +978,13 @@ Subscribes to only one data change of the Hall effect sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ------------------------------------ |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HALL**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HALL**. |
| callback | Callback&lt;[HallResponse](#hallresponse)&gt; | Yes| One-shot callback used to return the Hall effect sensor data. The reported data type in the callback is **HallResponse**.| | callback | Callback&lt;[HallResponse](#hallresponse)&gt; | Yes | One-shot callback used to return the Hall effect sensor data. The reported data type in the callback is **HallResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HALL, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HALL, function(data) {
console.info('Status: ' + data.status); console.info('Status: ' + data.status);
...@@ -1001,13 +1001,13 @@ Subscribes to only one data change of the ambient light sensor. ...@@ -1001,13 +1001,13 @@ Subscribes to only one data change of the ambient light sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | -------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_LIGHT**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_LIGHT**.|
| callback | Callback&lt;[LightResponse](#lightresponse)&gt; | Yes| One-shot callback used to return the ambient light sensor data. The reported data type in the callback is **LightResponse**.| | callback | Callback&lt;[LightResponse](#lightresponse)&gt; | Yes | One-shot callback used to return the ambient light sensor data. The reported data type in the callback is **LightResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, function(data) {
console.info(' Illumination: ' + data.intensity); console.info(' Illumination: ' + data.intensity);
...@@ -1024,13 +1024,13 @@ Subscribes to only one data change of the orientation sensor. ...@@ -1024,13 +1024,13 @@ Subscribes to only one data change of the orientation sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ORIENTATION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ORIENTATION**. |
| callback | Callback&lt;[OrientationResponse](#orientationresponse)&gt; | Yes| One-shot callback used to return the orientation sensor data. The reported data type in the callback is **OrientationResponse**.| | callback | Callback&lt;[OrientationResponse](#orientationresponse)&gt; | Yes | One-shot callback used to return the orientation sensor data. The reported data type in the callback is **OrientationResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, function(data) {
console.info('The device rotates at an angle around the X axis: ' + data.beta); console.info('The device rotates at an angle around the X axis: ' + data.beta);
...@@ -1049,13 +1049,13 @@ Subscribes to only one data change of the rotation vector sensor. ...@@ -1049,13 +1049,13 @@ Subscribes to only one data change of the rotation vector sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ROTATION_VECTOR**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ROTATION_VECTOR**.|
| callback | Callback&lt;[RotationVectorResponse](#rotationvectorresponse)&gt; | Yes| One-shot callback used to return the rotation vector sensor data. The reported data type in the callback is **RotationVectorResponse**.| | callback | Callback&lt;[RotationVectorResponse](#rotationvectorresponse)&gt; | Yes | One-shot callback used to return the rotation vector sensor data. The reported data type in the callback is **RotationVectorResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, function(data) {
console.info('X-coordinate component: ' + data.x); console.info('X-coordinate component: ' + data.x);
...@@ -1077,13 +1077,13 @@ Subscribes to only one data change of the heart rate sensor. ...@@ -1077,13 +1077,13 @@ Subscribes to only one data change of the heart rate sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HEART_RATE**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HEART_RATE**. |
| callback | Callback&lt;[HeartRateResponse](#heartrateresponse)&gt; | Yes| One-shot callback used to return the heart rate sensor data. The reported data type in the callback is **HeartRateResponse**.| | callback | Callback&lt;[HeartRateResponse](#heartrateresponse)&gt; | Yes | One-shot callback used to return the heart rate sensor data. The reported data type in the callback is **HeartRateResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, function(data) {
console.info("Heart rate: " + data.heartRate); console.info("Heart rate: " + data.heartRate);
...@@ -1100,13 +1100,13 @@ Subscribes to only one data change of the wear detection sensor. ...@@ -1100,13 +1100,13 @@ Subscribes to only one data change of the wear detection sensor.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes| Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_WEAR_DETECTION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_WEAR_DETECTION**.|
| callback | Callback&lt;[WearDetectionResponse](#weardetectionresponse)&gt; | Yes| One-shot callback used to return the wear detection sensor data. The reported data type in the callback is **WearDetectionResponse**.| | callback | Callback&lt;[WearDetectionResponse](#weardetectionresponse)&gt; | Yes | One-shot callback used to return the wear detection sensor data. The reported data type in the callback is **WearDetectionResponse**.|
- Example **Example**
``` ```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, function(data) { sensor.once(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, function(data) {
console.info("Wear status: "+ data.value); console.info("Wear status: "+ data.value);
...@@ -1124,14 +1124,14 @@ Unsubscribes from sensor data changes. ...@@ -1124,14 +1124,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ACCELEROMETER**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ACCELEROMETER**.|
| callback | Callback&lt;[AccelerometerResponse](#accelerometerresponse)&gt; | Yes | Callback used to return the acceleration sensor data. The reported data type in the callback is **AccelerometerResponse**.| | callback | Callback&lt;[AccelerometerResponse](#accelerometerresponse)&gt; | Yes | Callback used to return the acceleration sensor data. The reported data type in the callback is **AccelerometerResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1152,14 +1152,14 @@ Unsubscribes from sensor data changes. ...@@ -1152,14 +1152,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED**.|
| callback | Callback&lt;[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)&gt; | Yes | Callback used to return the uncalibrated acceleration sensor data. The reported data type in the callback is **AccelerometerUncalibratedResponse**.| | callback | Callback&lt;[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)&gt; | Yes | Callback used to return the uncalibrated acceleration sensor data. The reported data type in the callback is **AccelerometerUncalibratedResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1181,14 +1181,14 @@ Unsubscribes from sensor data changes. ...@@ -1181,14 +1181,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ----------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_AMBIENT_LIGHT**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_AMBIENT_LIGHT**.|
| callback | Callback&lt;[LightResponse](#lightresponse)&gt; | Yes | Callback used to return the ambient light sensor data. The reported data type in the callback is **LightResponse**.| | callback | Callback&lt;[LightResponse](#lightresponse)&gt; | Yes | Callback used to return the ambient light sensor data. The reported data type in the callback is **LightResponse**. |
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1205,14 +1205,14 @@ Unsubscribes from sensor data changes. ...@@ -1205,14 +1205,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_AMBIENT_TEMPERATURE**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_AMBIENT_TEMPERATURE**.|
| callback | Callback&lt;[AmbientTemperatureResponse](#ambienttemperatureresponse)&gt; | Yes | Callback used to return the ambient temperature sensor data. The reported data type in the callback is **AmbientTemperatureResponse**.| | callback | Callback&lt;[AmbientTemperatureResponse](#ambienttemperatureresponse)&gt; | Yes | Callback used to return the ambient temperature sensor data. The reported data type in the callback is **AmbientTemperatureResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1229,14 +1229,14 @@ Unsubscribes from sensor data changes. ...@@ -1229,14 +1229,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_BAROMETER**. | | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_BAROMETER**.|
| callback | Callback&lt;[BarometerResponse](#barometerresponse)&gt; | Yes | Callback used to return the barometer sensor data. The reported data type in the callback is **BarometerResponse**.| | callback | Callback&lt;[BarometerResponse](#barometerresponse)&gt; | Yes | Callback used to return the barometer sensor data. The reported data type in the callback is **BarometerResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1253,14 +1253,14 @@ Unsubscribes from sensor data changes. ...@@ -1253,14 +1253,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | --------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_GRAVITY**. | | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_GRAVITY**. |
| callback | Callback&lt;[GravityResponse](#gravityresponse)&gt; | Yes | Callback used to return the gravity sensor data. The reported data type in the callback is **GravityResponse**.| | callback | Callback&lt;[GravityResponse](#gravityresponse)&gt; | Yes | Callback used to return the gravity sensor data. The reported data type in the callback is **GravityResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1281,14 +1281,14 @@ Unsubscribes from sensor data changes. ...@@ -1281,14 +1281,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_GYROSCOPE**. | | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_GYROSCOPE**.|
| callback | Callback&lt;[GyroscopeResponse](#gyroscoperesponse)&gt; | Yes | Callback used to return the gyroscope sensor data. The reported data type in the callback is **GyroscopeResponse**.| | callback | Callback&lt;[GyroscopeResponse](#gyroscoperesponse)&gt; | Yes | Callback used to return the gyroscope sensor data. The reported data type in the callback is **GyroscopeResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1301,7 +1301,7 @@ sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback); ...@@ -1301,7 +1301,7 @@ sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback);
## sensor.off(SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED) ## sensor.off(SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED)
off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback?: Callback&lt;GyroscopeResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback?: Callback&lt;GyroscopeUncalibratedResponse&gt;): void
Unsubscribes from sensor data changes. Unsubscribes from sensor data changes.
...@@ -1309,14 +1309,14 @@ Unsubscribes from sensor data changes. ...@@ -1309,14 +1309,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED**.|
| callback | Callback&lt;[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)&gt; | Yes | Callback used to return the uncalibrated gyroscope sensor data. The reported data type in the callback is **GyroscopeUncalibratedResponse**.| | callback | Callback&lt;[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)&gt; | Yes | Callback used to return the uncalibrated gyroscope sensor data. The reported data type in the callback is **GyroscopeUncalibratedResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1335,14 +1335,14 @@ Unsubscribes from sensor data changes. ...@@ -1335,14 +1335,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | --------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_HALL**. | | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_HALL**. |
| callback | Callback&lt;[HallResponse](#hallresponse)&gt; | Yes | Callback used to return the Hall effect sensor data. The reported data type in the callback is **HallResponse**.| | callback | Callback&lt;[HallResponse](#hallresponse)&gt; | Yes | Callback used to return the Hall effect sensor data. The reported data type in the callback is **HallResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1361,14 +1361,14 @@ Unsubscribes from sensor data changes. ...@@ -1361,14 +1361,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype)[SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_HEART_RATE**. | | type | [SensorType](#sensortype)[SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_HEART_RATE**.|
| callback | Callback&lt;[HeartRateResponse](#heartrateresponse)&gt; | Yes | One-shot callback used to return the heart rate sensor data. The reported data type in the callback is **HeartRateResponse**.| | callback | Callback&lt;[HeartRateResponse](#heartrateresponse)&gt; | Yes | One-shot callback used to return the heart rate sensor data. The reported data type in the callback is **HeartRateResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1387,14 +1387,14 @@ Unsubscribes from sensor data changes. ...@@ -1387,14 +1387,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ----------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_HUMIDITY**. | | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_HUMIDITY**. |
| callback | Callback&lt;[HumidityResponse](#humidityresponse)&gt; | Yes | Callback used to return the humidity sensor data. The reported data type in the callback is **HumidityResponse**.| | callback | Callback&lt;[HumidityResponse](#humidityresponse)&gt; | Yes | Callback used to return the humidity sensor data. The reported data type in the callback is **HumidityResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1413,14 +1413,14 @@ Unsubscribes from sensor data changes. ...@@ -1413,14 +1413,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_LINEAR_ACCELERATION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_LINEAR_ACCELERATION**.|
| callback | Callback&lt;[LinearAccelerometerResponse](#linearaccelerometerresponse)&gt; | Yes | Callback used to return the acceleration sensor data. The reported data type in the callback is **LinearAccelerometerResponse**.| | callback | Callback&lt;[LinearAccelerometerResponse](#linearaccelerometerresponse)&gt; | Yes | Callback used to return the acceleration sensor data. The reported data type in the callback is **LinearAccelerometerResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1441,14 +1441,14 @@ Unsubscribes from sensor data changes. ...@@ -1441,14 +1441,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | ---------------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD**. | | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD**.|
| callbackcallback | Callback&lt;[MagneticFieldResponse](#magneticfieldresponse)&gt; | Yes | Callback used to return the magnetic field sensor data. The reported data type in the callback is **MagneticFieldResponse**.| | callbackcallback | Callback&lt;[MagneticFieldResponse](#magneticfieldresponse)&gt; | Yes | Callback used to return the magnetic field sensor data. The reported data type in the callback is **MagneticFieldResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1467,14 +1467,14 @@ Unsubscribes from sensor data changes. ...@@ -1467,14 +1467,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED**.|
| callback | Callback&lt;[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)&gt; | Yes | Callback used to return the uncalibrated magnetic field sensor data. The reported data type in the callback is **MagneticFieldUncalibratedResponse**.| | callback | Callback&lt;[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)&gt; | Yes | Callback used to return the uncalibrated magnetic field sensor data. The reported data type in the callback is **MagneticFieldUncalibratedResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1496,14 +1496,14 @@ Unsubscribes from sensor data changes. ...@@ -1496,14 +1496,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ORIENTATION**. | | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ORIENTATION**.|
| callback | Callback&lt;[OrientationResponse](#orientationresponse)&gt; | Yes | Callback used to return the orientation sensor data. The reported data type in the callback is **OrientationResponse**.| | callback | Callback&lt;[OrientationResponse](#orientationresponse)&gt; | Yes | Callback used to return the orientation sensor data. The reported data type in the callback is **OrientationResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1522,14 +1522,14 @@ Unsubscribes from sensor data changes. ...@@ -1522,14 +1522,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_PEDOMETER**. | | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_PEDOMETER**. |
| callback | Callback&lt;[PedometerResponse](#pedometerresponse)&gt; | Yes | Callback used to return the pedometer sensor data. The reported data type in the callback is **PedometerResponse**.| | callback | Callback&lt;[PedometerResponse](#pedometerresponse)&gt; | Yes | Callback used to return the pedometer sensor data. The reported data type in the callback is **PedometerResponse**.|
- Example **Return value**
``` ```
function callback(data) { function callback(data) {
...@@ -1548,14 +1548,14 @@ Unsubscribes from sensor data changes. ...@@ -1548,14 +1548,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_PEDOMETER_DETECTION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_PEDOMETER_DETECTION**.|
| callback | Callback&lt;[PedometerDetectionResponse](#pedometerdetectionresponse)&gt; | Yes | Callback used to return the pedometer detection sensor data. The reported data type in the callback is **PedometerDetectionResponse**.| | callback | Callback&lt;[PedometerDetectionResponse](#pedometerdetectionresponse)&gt; | Yes | Callback used to return the pedometer detection sensor data. The reported data type in the callback is **PedometerDetectionResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1572,14 +1572,14 @@ Unsubscribes from sensor data changes. ...@@ -1572,14 +1572,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_PROXIMITY**. | | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_PROXIMITY**.|
| callback | Callback&lt;[ProximityResponse](#proximityresponse)&gt; | Yes | Callback used to return the proximity sensor data. The reported data type in the callback is **ProximityResponse**.| | callback | Callback&lt;[ProximityResponse](#proximityresponse)&gt; | Yes | Callback used to return the proximity sensor data. The reported data type in the callback is **ProximityResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1596,14 +1596,14 @@ Unsubscribes from sensor data changes. ...@@ -1596,14 +1596,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ROTATION_VECTOR**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ROTATION_VECTOR**.|
| callback | Callback&lt;[RotationVectorResponse](#rotationvectorresponse)&gt; | Yes | Callback used to return the rotation vector sensor data. The reported data type in the callback is **RotationVectorResponse**.| | callback | Callback&lt;[RotationVectorResponse](#rotationvectorresponse)&gt; | Yes | Callback used to return the rotation vector sensor data. The reported data type in the callback is **RotationVectorResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1623,14 +1623,14 @@ Unsubscribes from sensor data changes. ...@@ -1623,14 +1623,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_SIGNIFICANT_MOTION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_SIGNIFICANT_MOTION**.|
| callback | Callback&lt;[SignificantMotionResponse](#significantmotionresponse)&gt; | Yes | Callback used to return the significant motion sensor data. The reported data type in the callback is **SignificantMotionResponse**.| | callback | Callback&lt;[SignificantMotionResponse](#significantmotionresponse)&gt; | Yes | Callback used to return the significant motion sensor data. The reported data type in the callback is **SignificantMotionResponse**.|
- Example **Example**
``` ```
function callback(data) { function callback(data) {
...@@ -1647,14 +1647,14 @@ Unsubscribes from sensor data changes. ...@@ -1647,14 +1647,14 @@ Unsubscribes from sensor data changes.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_WEAR_DETECTION**.| | type | [SensorType](#sensortype) | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_WEAR_DETECTION**.|
| callback | Callback&lt;[WearDetectionResponse](#weardetectionresponse)&gt; | Yes | Callback used to return the wear detection sensor data. The reported data type in the callback is **WearDetectionResponse**.| | callback | Callback&lt;[WearDetectionResponse](#weardetectionresponse)&gt; | Yes | Callback used to return the wear detection sensor data. The reported data type in the callback is **WearDetectionResponse**.|
- Example **Example**
``` ```
function accCallback(data) { function accCallback(data) {
...@@ -1671,29 +1671,28 @@ Rotates a rotation vector so that it can represent the coordinate system in diff ...@@ -1671,29 +1671,28 @@ Rotates a rotation vector so that it can represent the coordinate system in diff
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------------- | ----------------------------------------- | ---- | ---------------------- | | ---------------- | ---------------------------------------- | ---- | ----------- |
| inRotationVector | Array&lt;number&gt; | Yes | Rotation vector to rotate. | | inRotationVector | Array&lt;number&gt; | Yes | Rotation vector to rotate. |
| coordinates | [CoordinatesOptions](#coordinatesoptions) | Yes | Direction of the coordinate system. | | coordinates | [CoordinatesOptions](#coordinatesoptions) | Yes | Direction of the coordinate system. |
| callback | AsyncCallback&lt;Array&lt;number&gt;&gt; | Yes | Callback used to return the rotation vector after being rotated.| | callback | AsyncCallback&lt;Array&lt;number&gt;&gt; | Yes | Callback used to return the rotation vector after being rotated.|
- Example **Example**
```
sensor.transformCoordinateSystem([1, 0, 0, 0, 1, 0, 0, 0, 1], {'axisX':2, 'axisY':3}, function(err, data) {
if (err) {
console.error("Operation failed. Error code: " + err.code + ", message: " + err.message);
return;
}
console.info("Operation successed. Data obtained: " + data.x);
for (var i=0; i < data.length; i++) {
console.info("transformCoordinateSystem data[ " + i + "] = " + data[i]);
}
})
```
```
sensor.transformCoordinateSystem([1, 0, 0, 0, 1, 0, 0, 0, 1], {'axisX':2, 'axisY':3}, function(err, data) {
if (err) {
console.error("Operation failed. Error code: " + err.code + ", message: " + err.message);
return;
}
console.info("Operation successed. Data obtained: " + data.x);
for (var i=0; i < data.length; i++) {
console.info("transformCoordinateSystem data[ " + i + "] = " + data[i]);
}
})
```
## sensor.transformCoordinateSystem ## sensor.transformCoordinateSystem
transformCoordinateSystem(inRotationVector: Array&lt;number&gt;, coordinates: CoordinatesOptions): Promise&lt;Array&lt;number&gt;&gt; transformCoordinateSystem(inRotationVector: Array&lt;number&gt;, coordinates: CoordinatesOptions): Promise&lt;Array&lt;number&gt;&gt;
...@@ -1702,35 +1701,32 @@ Rotates a rotation vector so that it can represent the coordinate system in diff ...@@ -1702,35 +1701,32 @@ Rotates a rotation vector so that it can represent the coordinate system in diff
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description |
| ---------------- | ----------------------------------------- | ---- | ---------------- |
| inRotationVector | Array&lt;number&gt; | Yes | Rotation vector to rotate. |
| coordinates | [CoordinatesOptions](#coordinatesoptions) | Yes | Direction of the coordinate system.|
- Return value
| Type | Description | | Name | Type | Mandatory | Description |
| ---------------------------------- | ---------------------- | | ---------------- | ---------------------------------------- | ---- | -------- |
| Promise&lt;Array&lt;number&gt;&gt; | Promise used to return the rotation vector after being converted.| | inRotationVector | Array&lt;number&gt; | Yes | Rotation vector to rotate. |
| coordinates | [CoordinatesOptions](#coordinatesoptions) | Yes | Direction of the coordinate system.|
- Example **Return value**
``` | Type | Description |
const promise = sensor.transformCoordinateSystem([1, 0, 0, 0, 1, 0, 0, 0, 1], {'axisX':2, 'axisY':3}); | ---------------------------------- | ----------- |
promise.then((data) => { | Promise&lt;Array&lt;number&gt;&gt; | Promise used to return the rotation vector after being rotated.|
console.info("Operation successed.");
for (var i=0; i < data.length; i++) {
console.info("transformCoordinateSystem data[ " + i + "] = " + data[i]);
}
}).catch((err) => {
console.info("Operation failed");
})
```
**Example**
```
const promise = sensor.transformCoordinateSystem([1, 0, 0, 0, 1, 0, 0, 0, 1], {'axisX':2, 'axisY':3});
promise.then((data) => {
console.info("Operation successed.");
for (var i=0; i < data.length; i++) {
console.info("transformCoordinateSystem data[ " + i + "] = " + data[i]);
}
}).catch((err) => {
console.info("Operation failed");
})
```
## sensor.getGeomagneticField ## sensor.getGeomagneticField
...@@ -1740,27 +1736,25 @@ Obtains the geomagnetic field of a geographic location. This API uses a callback ...@@ -1740,27 +1736,25 @@ Obtains the geomagnetic field of a geographic location. This API uses a callback
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | --------------- | ---------------------------------------- | ---- | ----------------- |
| locationOptions | [LocationOptions](#locationoptions) | Yes| Geographic location.| | locationOptions | [LocationOptions](#locationoptions) | Yes | Geographic location. |
| timeMillis | number | Yes| Time for obtaining the magnetic declination, in milliseconds.| | timeMillis | number | Yes | Time for obtaining the magnetic declination, in milliseconds.|
| callback | AsyncCallback&lt;[GeomagneticResponse](#geomagneticresponse)&gt; | Yes| Callback used to return the geomagnetic field.| | callback | AsyncCallback&lt;[GeomagneticResponse](#geomagneticresponse)&gt; | Yes | Callback used to return the geomagnetic field. |
- Example
```
sensor.getGeomagneticField([80, 0, 0], {'timeMillis':1580486400000}, function(err, data) {
if (err) {
console.error('Operation failed. Error code: ' + err.code + '; message: ' + err.message);
return;
}
console.info('sensor_getGeomagneticField_promise x: ' + data.x + ',y: ' + data.y + ',z: ' +
data.z + ',geomagneticDip: ' + data.geomagneticDip + ',deflectionAngle: ' + data.deflectionAngle +
',levelIntensity: ' + data.levelIntensity + ',totalIntensity: ' + data.totalIntensity);
});
```
**Example**
```
sensor.getGeomagneticField([80, 0, 0], 1580486400000, function(err, data) {
if (err) {
console.error('Operation failed. Error code: ' + err.code + '; message: ' + err.message);
return;
}
console.info('sensor_getGeomagneticField_promise x: ' + data.x + ',y: ' + data.y + ',z: ' +
data.z + ',geomagneticDip: ' + data.geomagneticDip + ',deflectionAngle: ' + data.deflectionAngle +
',levelIntensity: ' + data.levelIntensity + ',totalIntensity: ' + data.totalIntensity);
});
```
## sensor.getGeomagneticField ## sensor.getGeomagneticField
getGeomagneticField(locationOptions: LocationOptions, timeMillis: number): Promise&lt;GeomagneticResponse&gt; getGeomagneticField(locationOptions: LocationOptions, timeMillis: number): Promise&lt;GeomagneticResponse&gt;
...@@ -1769,20 +1763,20 @@ Obtains the geomagnetic field of a geographic location. This API uses a promise ...@@ -1769,20 +1763,20 @@ Obtains the geomagnetic field of a geographic location. This API uses a promise
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | --------------- | ----------------------------------- | ---- | ----------------- |
| locationOptions | [LocationOptions](#locationoptions) | Yes| Geographic location.| | locationOptions | [LocationOptions](#locationoptions) | Yes | Geographic location. |
| timeMillis | number | Yes| Time for obtaining the magnetic declination, in milliseconds.| | timeMillis | number | Yes | Time for obtaining the magnetic declination, in milliseconds.|
- Return value **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ---------------------------------------- | ------- |
| Promise&lt;[GeomagneticResponse](#geomagneticresponse)&gt; | Promise used to return the geomagnetic field.| | Promise&lt;[GeomagneticResponse](#geomagneticresponse)&gt; | Promise used to return the geomagnetic field.|
- Example **Return value**
``` ```
const promise = sensor.getGeomagneticField([80, 0, 0], {'timeMillis':1580486400000}); const promise = sensor.getGeomagneticField([80, 0, 0], 1580486400000);
promise.then((data) => { promise.then((data) => {
console.info('sensor_getGeomagneticField_promise x: ' + data.x + ',y: ' + data.y + ',z: ' + console.info('sensor_getGeomagneticField_promise x: ' + data.x + ',y: ' + data.y + ',z: ' +
data.z + ',geomagneticDip: ' + data.geomagneticDip + ',deflectionAngle: ' + data.deflectionAngle + data.z + ',geomagneticDip: ' + data.geomagneticDip + ',deflectionAngle: ' + data.deflectionAngle +
...@@ -1800,15 +1794,15 @@ Obtains the altitude at which the device is located based on the sea-level atmos ...@@ -1800,15 +1794,15 @@ Obtains the altitude at which the device is located based on the sea-level atmos
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------------- | --------------------------- | ---- | ------------------------------------- | | --------------- | --------------------------- | ---- | -------------------- |
| seaPressure | number | Yes | Sea-level atmospheric pressure, in hPa. | | seaPressure | number | Yes | Sea-level atmospheric pressure, in hPa. |
| currentPressure | number | Yes | Current atmospheric pressure at the altitude where the device is located, in hPa.| | currentPressure | number | Yes | Atmospheric pressure at the altitude where the device is located, in hPa.|
| callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the altitude, in meters. | | callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the altitude, in meters. |
- Example **Return value**
``` ```
sensor.getAltitude(0, 200, function(err, data) { sensor.getAltitude(0, 200, function(err, data) {
...@@ -1829,20 +1823,20 @@ Obtains the altitude at which the device is located based on the sea-level atmos ...@@ -1829,20 +1823,20 @@ Obtains the altitude at which the device is located based on the sea-level atmos
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------------- | ------ | ---- | ------------------------------------- | | --------------- | ------ | ---- | -------------------- |
| seaPressure | number | Yes | Sea-level atmospheric pressure, in hPa. | | seaPressure | number | Yes | Sea-level atmospheric pressure, in hPa. |
| currentPressure | number | Yes | Atmospheric pressure at the altitude where the device is located, in hPa.| | currentPressure | number | Yes | Atmospheric pressure at the altitude where the device is located, in hPa.|
- Return value **Return value**
| Type | Description | | Type | Description |
| --------------------- | ------------------------------------ | | --------------------- | ------------------ |
| Promise&lt;number&gt; | Promise used to return the altitude, in meters.| | Promise&lt;number&gt; | Promise used to return the altitude, in meters.|
- Example **Return value**
``` ```
const promise = sensor.getAltitude(0, 200); const promise = sensor.getAltitude(0, 200);
...@@ -1862,14 +1856,14 @@ Obtains the magnetic dip based on the inclination matrix. This API uses a callba ...@@ -1862,14 +1856,14 @@ Obtains the magnetic dip based on the inclination matrix. This API uses a callba
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------------- | --------------------------- | ---- | ---------------------------- | | ----------------- | --------------------------- | ---- | -------------- |
| inclinationMatrix | Array&lt;number&gt; | Yes | Inclination matrix. | | inclinationMatrix | Array&lt;number&gt; | Yes | Inclination matrix. |
| callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the magnetic dip, in radians.| | callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the magnetic dip, in radians.|
- Example **Return value**
``` ```
sensor.getGeomagneticDip([1, 0, 0, 0, 1, 0, 0, 0, 1], function(err, data) { sensor.getGeomagneticDip([1, 0, 0, 0, 1, 0, 0, 0, 1], function(err, data) {
...@@ -1878,7 +1872,7 @@ Obtains the magnetic dip based on the inclination matrix. This API uses a callba ...@@ -1878,7 +1872,7 @@ Obtains the magnetic dip based on the inclination matrix. This API uses a callba
err.message); err.message);
return; return;
} }
console.info(Successed to get getGeomagneticDip interface get data: " + data); console.info("Successed to get getGeomagneticDip interface get data: " + data);
}) })
``` ```
...@@ -1890,19 +1884,19 @@ Obtains the magnetic dip based on the inclination matrix. This API uses a promis ...@@ -1890,19 +1884,19 @@ Obtains the magnetic dip based on the inclination matrix. This API uses a promis
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------------- | ------------------- | ---- | -------------- | | ----------------- | ------------------- | ---- | ------- |
| inclinationMatrix | Array&lt;number&gt; | Yes | Inclination matrix.| | inclinationMatrix | Array&lt;number&gt; | Yes | Inclination matrix.|
- Return value **Return value**
| Type | Description | | Type | Description |
| --------------------- | ---------------------------- | | --------------------- | -------------- |
| Promise&lt;number&gt; | Promise used to return the magnetic dip, in radians.| | Promise&lt;number&gt; | Promise used to return the magnetic dip, in radians.|
- Example **Return value**
``` ```
const promise = sensor.getGeomagneticDip([1, 0, 0, 0, 1, 0, 0, 0, 1]); const promise = sensor.getGeomagneticDip([1, 0, 0, 0, 1, 0, 0, 0, 1]);
...@@ -1921,15 +1915,15 @@ Obtains the angle change between two rotation matrices. This API uses a callback ...@@ -1921,15 +1915,15 @@ Obtains the angle change between two rotation matrices. This API uses a callback
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------------------- | ---------------------------------------- | ---- | --------------------------------- | | --------------------- | ---------------------------------------- | ---- | ------------------ |
| currentRotationMatrix | Array&lt;number&gt; | Yes | Current rotation matrix. | | currentRotationMatrix | Array&lt;number&gt; | Yes | Current rotation matrix. |
| preRotationMatrix | Array&lt;number&gt; | Yes | The other rotation matrix. | | preRotationMatrix | Array&lt;number&gt; | Yes | The other rotation matrix. |
| callback | AsyncCallback&lt;Array&lt;number&gt;&gt; | Yes | Callback used to return the angle change around the z, x, and y axes.| | callback | AsyncCallback&lt;Array&lt;number&gt;&gt; | Yes | Callback used to return the angle change around the z, x, and y axes.|
- Example **Return value**
``` ```
sensor. getAngleModify([1,0,0,0,1,0,0,0,1], [1, 0, 0, 0, 0.87, -0.50, 0, 0.50, 0.87], function(err, data) { sensor. getAngleModify([1,0,0,0,1,0,0,0,1], [1, 0, 0, 0, 0.87, -0.50, 0, 0.50, 0.87], function(err, data) {
...@@ -1954,20 +1948,20 @@ Obtains the angle change between two rotation matrices. This API uses a promise ...@@ -1954,20 +1948,20 @@ Obtains the angle change between two rotation matrices. This API uses a promise
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------------------- | ------------------- | ---- | ------------------ | | --------------------- | ------------------- | ---- | --------- |
| currentRotationMatrix | Array&lt;number&gt; | Yes | Current rotation matrix.| | currentRotationMatrix | Array&lt;number&gt; | Yes | Current rotation matrix.|
| preRotationMatrix | Array&lt;number&gt; | Yes | Rotation matrix.| | preRotationMatrix | Array&lt;number&gt; | Yes | Rotation matrix. |
- Return value **Return value**
| Type | Description | | Type | Description |
| ---------------------------------- | --------------------------------- | | ---------------------------------- | ------------------ |
| Promise&lt;Array&lt;number&gt;&gt; | Promise used to return the angle change around the z, x, and y axes.| | Promise&lt;Array&lt;number&gt;&gt; | Promise used to return the angle change around the z, x, and y axes.|
- Example **Return value**
``` ```
const promise = sensor.getAngleModify([1,0,0,0,1,0,0,0,1], [1,0,0,0,0.87,-0.50,0,0.50,0.87]); const promise = sensor.getAngleModify([1,0,0,0,1,0,0,0,1], [1,0,0,0,0.87,-0.50,0,0.50,0.87]);
...@@ -1990,14 +1984,14 @@ Converts a rotation vector into a rotation matrix. This API uses a callback to r ...@@ -1990,14 +1984,14 @@ Converts a rotation vector into a rotation matrix. This API uses a callback to r
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------------- | ---------------------------------------- | ---- | -------------- | | -------------- | ---------------------------------------- | ---- | ------- |
| rotationVector | Array&lt;number&gt; | Yes | Rotation vector to convert.| | rotationVector | Array&lt;number&gt; | Yes | Rotation vector to convert.|
| callback | AsyncCallback&lt;Array&lt;number&gt;&gt; | Yes | Callback used to return the rotation matrix.| | callback | AsyncCallback&lt;Array&lt;number&gt;&gt; | Yes | Callback used to return the rotation matrix.|
- Example **Return value**
``` ```
sensor.createRotationMatrix([0.20046076, 0.21907, 0.73978853, 0.60376877], function(err, data) { sensor.createRotationMatrix([0.20046076, 0.21907, 0.73978853, 0.60376877], function(err, data) {
...@@ -2022,19 +2016,19 @@ Converts a rotation vector into a rotation matrix. This API uses a promise to re ...@@ -2022,19 +2016,19 @@ Converts a rotation vector into a rotation matrix. This API uses a promise to re
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------------- | ------------------- | ---- | -------------- | | -------------- | ------------------- | ---- | ------- |
| rotationVector | Array&lt;number&gt; | Yes | Rotation vector to convert.| | rotationVector | Array&lt;number&gt; | Yes | Rotation vector to convert.|
- Return value **Return value**
| Type | Description | | Type | Description |
| ---------------------------------- | -------------- | | ---------------------------------- | ------- |
| Promise&lt;Array&lt;number&gt;&gt; | Promise used to return the rotation matrix.| | Promise&lt;Array&lt;number&gt;&gt; | Promise used to return the rotation matrix.|
- Example **Return value**
``` ```
const promise = sensor.createRotationMatrix([0.20046076, 0.21907, 0.73978853, 0.60376877]); const promise = sensor.createRotationMatrix([0.20046076, 0.21907, 0.73978853, 0.60376877]);
...@@ -2057,14 +2051,14 @@ Converts a rotation vector into a quaternion. This API uses a callback to return ...@@ -2057,14 +2051,14 @@ Converts a rotation vector into a quaternion. This API uses a callback to return
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------------- | ---------------------------------------- | ---- | -------------- | | -------------- | ---------------------------------------- | ---- | ------- |
| rotationVector | Array&lt;number&gt; | Yes | Rotation vector to convert.| | rotationVector | Array&lt;number&gt; | Yes | Rotation vector to convert.|
| callback | AsyncCallback&lt;Array&lt;number&gt;&gt; | Yes | Callback used to return the quaternion. | | callback | AsyncCallback&lt;Array&lt;number&gt;&gt; | Yes | Callback used to return the quaternion. |
- Example **Return value**
``` ```
sensor.createQuaternion([0.20046076, 0.21907, 0.73978853, 0.60376877], function(err, data) { sensor.createQuaternion([0.20046076, 0.21907, 0.73978853, 0.60376877], function(err, data) {
...@@ -2089,19 +2083,19 @@ Converts a rotation vector into a quaternion. This API uses a promise to return ...@@ -2089,19 +2083,19 @@ Converts a rotation vector into a quaternion. This API uses a promise to return
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------------- | ------------------- | ---- | -------------- | | -------------- | ------------------- | ---- | ------- |
| rotationVector | Array&lt;number&gt; | Yes | Rotation vector to convert.| | rotationVector | Array&lt;number&gt; | Yes | Rotation vector to convert.|
- Return value **Return value**
| Type | Description | | Type | Description |
| ---------------------------------- | ------------ | | ---------------------------------- | ------ |
| Promise&lt;Array&lt;number&gt;&gt; | Promise used to return the quaternion.| | Promise&lt;Array&lt;number&gt;&gt; | Promise used to return the quaternion.|
- Example **Return value**
``` ```
const promise = sensor.createQuaternion([0.20046076, 0.21907, 0.73978853, 0.60376877]); const promise = sensor.createQuaternion([0.20046076, 0.21907, 0.73978853, 0.60376877]);
...@@ -2124,14 +2118,14 @@ Obtains the device direction based on the rotation matrix. This API uses a callb ...@@ -2124,14 +2118,14 @@ Obtains the device direction based on the rotation matrix. This API uses a callb
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------------- | ---------------------------------------- | ---- | --------------------------------- | | -------------- | ---------------------------------------- | ---- | ------------------ |
| rotationMatrix | Array&lt;number&gt; | Yes | Rotation matrix. | | rotationMatrix | Array&lt;number&gt; | Yes | Rotation matrix. |
| callback | AsyncCallback&lt;Array&lt;number&gt;&gt; | Yes | Callback used to return the rotation angle around the z, x, and y axes.| | callback | AsyncCallback&lt;Array&lt;number&gt;&gt; | Yes | Callback used to return the rotation angle around the z, x, and y axes.|
- Example **Return value**
``` ```
sensor.getDirection([1, 0, 0, 0, 1, 0, 0, 0, 1], function(err, data) { sensor.getDirection([1, 0, 0, 0, 1, 0, 0, 0, 1], function(err, data) {
...@@ -2156,19 +2150,19 @@ Obtains the device direction based on the rotation matrix. This API uses a promi ...@@ -2156,19 +2150,19 @@ Obtains the device direction based on the rotation matrix. This API uses a promi
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------------- | ------------------- | ---- | -------------- | | -------------- | ------------------- | ---- | ------- |
| rotationMatrix | Array&lt;number&gt; | Yes | Rotation matrix.| | rotationMatrix | Array&lt;number&gt; | Yes | Rotation matrix.|
- Return value **Return value**
| Type | Description | | Type | Description |
| ---------------------------------- | --------------------------------- | | ---------------------------------- | ------------------ |
| Promise&lt;Array&lt;number&gt;&gt; | Promise used to return the rotation angle around the z, x, and y axes.| | Promise&lt;Array&lt;number&gt;&gt; | Promise used to return the rotation angle around the z, x, and y axes.|
- Example **Return value**
``` ```
const promise = sensor.getDirection([1, 0, 0, 0, 1, 0, 0, 0, 1]); const promise = sensor.getDirection([1, 0, 0, 0, 1, 0, 0, 0, 1]);
...@@ -2191,15 +2185,15 @@ Creates a rotation matrix based on the gravity vector and geomagnetic vector. Th ...@@ -2191,15 +2185,15 @@ Creates a rotation matrix based on the gravity vector and geomagnetic vector. Th
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------------------------------------------------------------ | ---- | -------------- | | ----------- | ---------------------------------------- | ---- | ------- |
| gravity | Array&lt;number&gt; | Yes | Gravity vector.| | gravity | Array&lt;number&gt; | Yes | Gravity vector.|
| geomagnetic | Array&lt;number&gt; | Yes | Geomagnetic vector.| | geomagnetic | Array&lt;number&gt; | Yes | Geomagnetic vector.|
| callback | AsyncCallback&lt;[RotationMatrixResponse](#rotationmatrixresponse)&gt; | Yes | Callback used to return the rotation matrix.| | callback | AsyncCallback&lt;[RotationMatrixResponse](#rotationmatrixresponse)&gt; | Yes | Callback used to return the rotation matrix.|
- Example **Return value**
``` ```
sensor.createRotationMatrix([-0.27775216, 0.5351276, 9.788099], [210.87253, -78.6096, -111.44444], function(err, data) { sensor.createRotationMatrix([-0.27775216, 0.5351276, 9.788099], [210.87253, -78.6096, -111.44444], function(err, data) {
...@@ -2224,20 +2218,20 @@ Creates a rotation matrix based on the gravity vector and geomagnetic vector. Th ...@@ -2224,20 +2218,20 @@ Creates a rotation matrix based on the gravity vector and geomagnetic vector. Th
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------------------- | ---- | -------------- | | ----------- | ------------------- | ---- | ------- |
| gravity | Array&lt;number&gt; | Yes | Gravity vector.| | gravity | Array&lt;number&gt; | Yes | Gravity vector.|
| geomagnetic | Array&lt;number&gt; | Yes | Geomagnetic vector.| | geomagnetic | Array&lt;number&gt; | Yes | Geomagnetic vector.|
- Return value **Return value**
| Type | Description | | Type | Description |
| ------------------------------------------------------------ | -------------- | | ---------------------------------------- | ------- |
| Promise&lt;[RotationMatrixResponse](#rotationmatrixresponse)&gt; | Promise used to return the rotation matrix.| | Promise&lt;[RotationMatrixResponse](#rotationmatrixresponse)&gt; | Promise used to return the rotation matrix.|
- Example **Return value**
``` ```
const promise = sensor.createRotationMatrix([-0.27775216, 0.5351276, 9.788099], [210.87253, -78.6096, -111.44444]); const promise = sensor.createRotationMatrix([-0.27775216, 0.5351276, 9.788099], [210.87253, -78.6096, -111.44444]);
...@@ -2259,29 +2253,29 @@ Enumerates the sensor types. ...@@ -2259,29 +2253,29 @@ Enumerates the sensor types.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | ---------------------------------------- | ---- | ----------- |
| SENSOR_TYPE_ID_ACCELEROMETER | 1 | Acceleration sensor.| | SENSOR_TYPE_ID_ACCELEROMETER | 1 | Acceleration sensor. |
| SENSOR_TYPE_ID_GYROSCOPE | 2 | Gyroscope sensor.| | SENSOR_TYPE_ID_GYROSCOPE | 2 | Gyroscope sensor. |
| SENSOR_TYPE_ID_AMBIENT_LIGHT | 5 | Ambient light sensor.| | SENSOR_TYPE_ID_AMBIENT_LIGHT | 5 | Ambient light sensor. |
| SENSOR_TYPE_ID_MAGNETIC_FIELD | 6 | Magnetic field sensor.| | SENSOR_TYPE_ID_MAGNETIC_FIELD | 6 | Magnetic field sensor. |
| SENSOR_TYPE_ID_BAROMETER | 8 | Barometer sensor.| | SENSOR_TYPE_ID_BAROMETER | 8 | Barometer sensor. |
| SENSOR_TYPE_ID_HALL | 10 | Hall effect sensor.| | SENSOR_TYPE_ID_HALL | 10 | Hall effect sensor. |
| SENSOR_TYPE_ID_PROXIMITY | 12 | Proximity sensor.| | SENSOR_TYPE_ID_PROXIMITY | 12 | Proximity sensor. |
| SENSOR_TYPE_ID_HUMIDITY | 13 | Humidity sensor.| | SENSOR_TYPE_ID_HUMIDITY | 13 | Humidity sensor. |
| SENSOR_TYPE_ID_ORIENTATION | 256 | Orientation sensor.| | SENSOR_TYPE_ID_ORIENTATION | 256 | Orientation sensor. |
| SENSOR_TYPE_ID_GRAVITY | 257 | Gravity sensor.| | SENSOR_TYPE_ID_GRAVITY | 257 | Gravity sensor. |
| SENSOR_TYPE_ID_LINEAR_ACCELERATION | 258 | Linear acceleration sensor.| | SENSOR_TYPE_ID_LINEAR_ACCELERATION | 258 | Linear acceleration sensor. |
| SENSOR_TYPE_ID_ROTATION_VECTOR | 259 | Rotation vector sensor.| | SENSOR_TYPE_ID_ROTATION_VECTOR | 259 | Rotation vector sensor. |
| SENSOR_TYPE_ID_AMBIENT_TEMPERATURE | 260 | Ambient temperature sensor.| | SENSOR_TYPE_ID_AMBIENT_TEMPERATURE | 260 | Ambient temperature sensor. |
| SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED | 261 | Uncalibrated magnetic field sensor.| | SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED | 261 | Uncalibrated magnetic field sensor. |
| SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED | 263 | Uncalibrated gyroscope sensor.| | SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED | 263 | Uncalibrated gyroscope sensor. |
| SENSOR_TYPE_ID_SIGNIFICANT_MOTION | 264 | Significant motion sensor.| | SENSOR_TYPE_ID_SIGNIFICANT_MOTION | 264 | Significant motion sensor. |
| SENSOR_TYPE_ID_PEDOMETER_DETECTION | 265 | Pedometer detection sensor.| | SENSOR_TYPE_ID_PEDOMETER_DETECTION | 265 | Pedometer detection sensor. |
| SENSOR_TYPE_ID_PEDOMETER | 266 | Pedometer sensor.| | SENSOR_TYPE_ID_PEDOMETER | 266 | Pedometer sensor. |
| SENSOR_TYPE_ID_HEART_RATE | 278 | Heart rate sensor.| | SENSOR_TYPE_ID_HEART_RATE | 278 | Heart rate sensor. |
| SENSOR_TYPE_ID_WEAR_DETECTION | 280 | Wear detection sensor.| | SENSOR_TYPE_ID_WEAR_DETECTION | 280 | Wear detection sensor. |
| SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED | 281 | Uncalibrated acceleration sensor.| | SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED | 281 | Uncalibrated acceleration sensor.|
## Response ## Response
...@@ -2290,9 +2284,9 @@ Describes the timestamp of the sensor data. ...@@ -2290,9 +2284,9 @@ Describes the timestamp of the sensor data.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | --------- | ------ | ---- | ---- | ------------ |
| timestamp | number | Yes| Yes| Timestamp when the sensor reports data.| | timestamp | number | Yes | Yes | Timestamp when the sensor reports data.|
## AccelerometerResponse ## AccelerometerResponse
...@@ -2302,11 +2296,11 @@ Describes the acceleration sensor data. It extends from [Response](#response). ...@@ -2302,11 +2296,11 @@ Describes the acceleration sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ---- | ------ | ---- | ---- | ---------------------- |
| x | number | Yes| Yes| Acceleration along the x-axis of the device, in m/s2.| | x | number | Yes | Yes | Acceleration along the x-axis of the device, in m/s2.|
| y | number | Yes| Yes| Acceleration along the y-axis of the device, in m/s2.| | y | number | Yes | Yes | Acceleration along the y-axis of the device, in m/s2.|
| z | number | Yes| Yes| Acceleration along the z-axis of the device, in m/s2.| | z | number | Yes | Yes | Acceleration along the z-axis of the device, in m/s2.|
## LinearAccelerometerResponse ## LinearAccelerometerResponse
...@@ -2316,11 +2310,11 @@ Describes the linear acceleration sensor data. It extends from [Response](#respo ...@@ -2316,11 +2310,11 @@ Describes the linear acceleration sensor data. It extends from [Response](#respo
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ---- | ------ | ---- | ---- | ------------------------ |
| x | number | Yes| Yes| Linear acceleration along the x-axis of the device, in m/s2.| | x | number | Yes | Yes | Linear acceleration along the x-axis of the device, in m/s2.|
| y | number | Yes| Yes| Linear acceleration along the y-axis of the device, in m/s2.| | y | number | Yes | Yes | Linear acceleration along the y-axis of the device, in m/s2.|
| z | number | Yes| Yes| Linear acceleration along the z-axis of the device, in m/s2.| | z | number | Yes | Yes | Linear acceleration along the z-axis of the device, in m/s2.|
## AccelerometerUncalibratedResponse ## AccelerometerUncalibratedResponse
...@@ -2330,14 +2324,14 @@ Describes the uncalibrated acceleration sensor data. It extends from [Response]( ...@@ -2330,14 +2324,14 @@ Describes the uncalibrated acceleration sensor data. It extends from [Response](
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ----- | ------ | ---- | ---- | ---------------------------- |
| x | number | Yes| Yes| Uncalibrated acceleration along the x-axis of the device, in m/s2.| | x | number | Yes | Yes | Uncalibrated acceleration along the x-axis of the device, in m/s2. |
| y | number | Yes| Yes| Uncalibrated acceleration along the y-axis of the device, in m/s2.| | y | number | Yes | Yes | Uncalibrated acceleration along the y-axis of the device, in m/s2. |
| z | number | Yes| Yes| Uncalibrated acceleration along the z-axis of the device, in m/s2.| | z | number | Yes | Yes | Uncalibrated acceleration along the z-axis of the device, in m/s2. |
| biasX | number | Yes| Yes| Uncalibrated acceleration bias along the x-axis of the device, in m/s2.| | biasX | number | Yes | Yes | Uncalibrated acceleration bias along the x-axis of the device, in m/s2. |
| biasY | number | Yes| Yes| Uncalibrated acceleration bias along the y-axis of the device, in m/s2.| | biasY | number | Yes | Yes | Uncalibrated acceleration bias along the y-axis of the device, in m/s2.|
| biasZ | number | Yes| Yes| Uncalibrated acceleration bias along the z-axis of the device, in m/s2.| | biasZ | number | Yes | Yes | Uncalibrated acceleration bias along the z-axis of the device, in m/s2. |
## GravityResponse ## GravityResponse
...@@ -2347,11 +2341,11 @@ Describes the gravity sensor data. It extends from [Response](#response). ...@@ -2347,11 +2341,11 @@ Describes the gravity sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ---- | ------ | ---- | ---- | ------------------------ |
| x | number | Yes| Yes| Gravitational acceleration along the x-axis of the device, in m/s2.| | x | number | Yes | Yes | Gravitational acceleration along the x-axis of the device, in m/s2.|
| y | number | Yes| Yes| Gravitational acceleration along the y-axis of the device, in m/s2.| | y | number | Yes | Yes | Gravitational acceleration along the y-axis of the device, in m/s2.|
| z | number | Yes| Yes| Gravitational acceleration along the z-axis of the device, in m/s2.| | z | number | Yes | Yes | Gravitational acceleration along the z-axis of the device, in m/s2.|
## OrientationResponse ## OrientationResponse
...@@ -2361,11 +2355,11 @@ Describes the orientation sensor data. It extends from [Response](#response). ...@@ -2361,11 +2355,11 @@ Describes the orientation sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ----- | ------ | ---- | ---- | ------------------------ |
| alpha | number | Yes| Yes| Rotation angle of the device around the z-axis, in rad.| | alpha | number | Yes | Yes | Rotation angle of the device around the z-axis, in rad.|
| beta | number | Yes| Yes| Rotation angle of the device around the x-axis, in rad.| | beta | number | Yes | Yes | Rotation angle of the device around the x-axis, in rad. |
| gamma | number | Yes| Yes| Rotation angle of the device around the y-axis, in rad.| | gamma | number | Yes | Yes | Rotation angle of the device around the y-axis, in rad. |
## RotationVectorResponse ## RotationVectorResponse
...@@ -2375,12 +2369,12 @@ Describes the rotation vector sensor data. It extends from [Response](#response) ...@@ -2375,12 +2369,12 @@ Describes the rotation vector sensor data. It extends from [Response](#response)
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ---- | ------ | ---- | ---- | --------- |
| x | number | Yes| Yes| X-component of the rotation vector.| | x | number | Yes | Yes | X-component of the rotation vector.|
| y | number | Yes| Yes| Y-component of the rotation vector.| | y | number | Yes | Yes | Y-component of the rotation vector.|
| z | number | Yes| Yes| Z-component of the rotation vector.| | z | number | Yes | Yes | Z-component of the rotation vector.|
| w | number | Yes| Yes| Scalar.| | w | number | Yes | Yes | Scalar. |
## GyroscopeResponse ## GyroscopeResponse
...@@ -2390,11 +2384,11 @@ Describes the gyroscope sensor data. It extends from [Response](#response). ...@@ -2390,11 +2384,11 @@ Describes the gyroscope sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ---- | ------ | ---- | ---- | ------------------- |
| x | number | Yes| Yes| Angular velocity of rotation around the x-axis of the device, in rad/s.| | x | number | Yes | Yes | Angular velocity of rotation around the x-axis of the device, in rad/s.|
| y | number | Yes| Yes| Angular velocity of rotation around the y-axis of the device, in rad/s.| | y | number | Yes | Yes | Angular velocity of rotation around the y-axis of the device, in rad/s.|
| z | number | Yes| Yes| Angular velocity of rotation around the z-axis of the device, in rad/s.| | z | number | Yes | Yes | Angular velocity of rotation around the z-axis of the device, in rad/s.|
## GyroscopeUncalibratedResponse ## GyroscopeUncalibratedResponse
...@@ -2404,14 +2398,14 @@ Describes the uncalibrated gyroscope sensor data. It extends from [Response](#re ...@@ -2404,14 +2398,14 @@ Describes the uncalibrated gyroscope sensor data. It extends from [Response](#re
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ----- | ------ | ---- | ---- | ------------------------ |
| x | number | Yes| Yes| Uncalibrated angular velocity of rotation around the x-axis of the device, in rad/s.| | x | number | Yes | Yes | Uncalibrated angular velocity of rotation around the x-axis of the device, in rad/s. |
| y | number | Yes| Yes| Uncalibrated angular velocity of rotation around the y-axis of the device, in rad/s.| | y | number | Yes | Yes | Uncalibrated angular velocity of rotation around the y-axis of the device, in rad/s. |
| z | number | Yes| Yes| Uncalibrated angular velocity of rotation around the z-axis of the device, in rad/s.| | z | number | Yes | Yes | Uncalibrated angular velocity of rotation around the z-axis of the device, in rad/s. |
| biasX | number | Yes| Yes| Uncalibrated angular velocity bias of rotation around the x-axis of the device, in rad/s.| | biasX | number | Yes | Yes | Uncalibrated angular velocity bias of rotation around the x-axis of the device, in rad/s.|
| biasY | number | Yes| Yes| Uncalibrated angular velocity bias of rotation around the y-axis of the device, in rad/s.| | biasY | number | Yes | Yes | Uncalibrated angular velocity bias of rotation around the y-axis of the device, in rad/s.|
| biasZ | number | Yes| Yes| Uncalibrated angular velocity bias of rotation around the z-axis of the device, in rad/s.| | biasZ | number | Yes | Yes | Uncalibrated angular velocity bias of rotation around the z-axis of the device, in rad/s.|
## SignificantMotionResponse ## SignificantMotionResponse
...@@ -2421,9 +2415,9 @@ Describes the significant motion sensor data. It extends from [Response](#respon ...@@ -2421,9 +2415,9 @@ Describes the significant motion sensor data. It extends from [Response](#respon
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------ | ------ | ---- | ---- | ---------------------------------------- |
| scalar | number | Yes| Yes| Intensity of a motion. This parameter specifies whether a device has a significant motion on three physical axes (X, Y, and Z). The value **0** means that the device does not have a significant motion, and **1** means the opposite.| | scalar | number | Yes | Yes | Intensity of a motion. This parameter specifies whether a device has a significant motion on three physical axes (X, Y, and Z). The value **0** means that the device does not have a significant motion, and **1** means the opposite.|
## ProximityResponse ## ProximityResponse
...@@ -2433,9 +2427,9 @@ Describes the proximity sensor data. It extends from [Response](#response). ...@@ -2433,9 +2427,9 @@ Describes the proximity sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | ------ | ---- | ---- | ---------------------------- |
| distance | number | Yes| Yes| Proximity between the visible object and the device monitor. The value **0** means the two are close to each other, and **1** means that they are far away from each other.| | distance | number | Yes | Yes | Proximity between the visible object and the device monitor. The value **0** means the two are close to each other, and **1** means that they are far away from each other.|
## LightResponse ## LightResponse
...@@ -2445,9 +2439,9 @@ Describes the ambient light sensor data. It extends from [Response](#response). ...@@ -2445,9 +2439,9 @@ Describes the ambient light sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | --------- | ------ | ---- | ---- | ----------- |
| intensity | number | Yes| Yes| Illumination, in lux.| | intensity | number | Yes | Yes | Illumination, in lux.|
## HallResponse ## HallResponse
...@@ -2457,9 +2451,9 @@ Describes the Hall effect sensor data. It extends from [Response](#response). ...@@ -2457,9 +2451,9 @@ Describes the Hall effect sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------ | ------ | ---- | ---- | --------------------------------- |
| status | number | Yes| Yes| Hall effect sensor status. This parameter specifies whether a magnetic field exists around a device. The value **0** means that a magnetic field exists around the device, and **1** means the opposite.| | status | number | Yes | Yes | Hall effect sensor status. This parameter specifies whether a magnetic field exists around a device. The value **0** means that a magnetic field exists around the device, and **1** means the opposite.|
## MagneticFieldResponse ## MagneticFieldResponse
...@@ -2469,11 +2463,11 @@ Describes the magnetic field sensor data. It extends from [Response](#response). ...@@ -2469,11 +2463,11 @@ Describes the magnetic field sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ---- | ------ | ---- | ---- | ------------------ |
| x | number | Yes| Yes| Magnetic field strength on the x-axis, in μT.| | x | number | Yes | Yes | Magnetic field strength on the x-axis, in μT. |
| y | number | Yes| Yes| Magnetic field strength on the y-axis, in μT.| | y | number | Yes | Yes | Magnetic field strength on the y-axis, in μT. |
| z | number | Yes| Yes| Magnetic field strength on the z-axis, in μT.| | z | number | Yes | Yes | Magnetic field strength on the z-axis, in μT.|
## MagneticFieldUncalibratedResponse ## MagneticFieldUncalibratedResponse
...@@ -2483,14 +2477,14 @@ Describes the uncalibrated magnetic field sensor data. It extends from [Response ...@@ -2483,14 +2477,14 @@ Describes the uncalibrated magnetic field sensor data. It extends from [Response
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ----- | ------ | ---- | ---- | ---------------------- |
| x | number | Yes| Yes| Uncalibrated magnetic field strength on the x-axis, in μT.| | x | number | Yes | Yes | Uncalibrated magnetic field strength on the x-axis, in μT. |
| y | number | Yes| Yes| Uncalibrated magnetic field strength on the y-axis, in μT.| | y | number | Yes | Yes | Uncalibrated magnetic field strength on the y-axis, in μT. |
| z | number | Yes| Yes| Uncalibrated magnetic field strength on the z-axis, in μT.| | z | number | Yes | Yes | Uncalibrated magnetic field strength on the z-axis, in μT. |
| biasX | number | Yes| Yes| Bias of the uncalibrated magnetic field strength on the x-axis, in μT.| | biasX | number | Yes | Yes | Bias of the uncalibrated magnetic field strength on the x-axis, in μT.|
| biasY | number | Yes| Yes| Bias of the uncalibrated magnetic field strength on the y-axis, in μT.| | biasY | number | Yes | Yes | Bias of the uncalibrated magnetic field strength on the y-axis, in μT.|
| biasZ | number | Yes| Yes| Bias of the uncalibrated magnetic field strength on the z-axis, in μT.| | biasZ | number | Yes | Yes | Bias of the uncalibrated magnetic field strength on the z-axis, in μT.|
## PedometerResponse ## PedometerResponse
...@@ -2500,9 +2494,9 @@ Describes the pedometer sensor data. It extends from [Response](#response). ...@@ -2500,9 +2494,9 @@ Describes the pedometer sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ----- | ------ | ---- | ---- | -------- |
| steps | number | Yes| Yes| Number of steps a user has walked.| | steps | number | Yes | Yes | Number of steps a user has walked.|
## HumidityResponse ## HumidityResponse
...@@ -2512,9 +2506,9 @@ Describes the humidity sensor data. It extends from [Response](#response). ...@@ -2512,9 +2506,9 @@ Describes the humidity sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | ------ | ---- | ---- | ------------------------------------ |
| humidity | number | Yes| Yes| Ambient relative humidity, in a percentage (%).| | humidity | number | Yes | Yes | Ambient relative humidity, in a percentage (%).|
## PedometerDetectionResponse ## PedometerDetectionResponse
...@@ -2524,9 +2518,9 @@ Describes the pedometer detection sensor data. It extends from [Response](#respo ...@@ -2524,9 +2518,9 @@ Describes the pedometer detection sensor data. It extends from [Response](#respo
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------ | ------ | ---- | ---- | ---------------------------------------- |
| scalar | number | Yes| Yes| Pedometer detection. This parameter specifies whether a user takes a step. The value **0** means that the user does not take a step, and **1** means that the user takes a step.| | scalar | number | Yes | Yes | Pedometer detection. This parameter specifies whether a user takes a step. The value **0** means that the user does not take a step, and **1** means that the user takes a step.|
## AmbientTemperatureResponse ## AmbientTemperatureResponse
...@@ -2536,9 +2530,9 @@ Describes the ambient temperature sensor data. It extends from [Response](#respo ...@@ -2536,9 +2530,9 @@ Describes the ambient temperature sensor data. It extends from [Response](#respo
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ----------- | ------ | ---- | ---- | ------------- |
| temperature | number | Yes| Yes| Ambient temperature, in degree Celsius.| | temperature | number | Yes | Yes | Ambient temperature, in degree Celsius.|
## BarometerResponse ## BarometerResponse
...@@ -2548,9 +2542,9 @@ Describes the barometer sensor data. It extends from [Response](#response). ...@@ -2548,9 +2542,9 @@ Describes the barometer sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | ------ | ---- | ---- | ------------ |
| pressure | number | Yes| Yes| Atmospheric pressure, in pascal.| | pressure | number | Yes | Yes | Atmospheric pressure, in pascal.|
## HeartRateResponse ## HeartRateResponse
...@@ -2560,9 +2554,9 @@ Describes the heart rate sensor data. It extends from [Response](#response). ...@@ -2560,9 +2554,9 @@ Describes the heart rate sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | --------- | ------ | ---- | ---- | --------------------- |
| heartRate | number | Yes| Yes| Heart rate, in beats per minute (bpm).| | heartRate | number | Yes | Yes | Heart rate, in beats per minute (bpm).|
## WearDetectionResponse ## WearDetectionResponse
...@@ -2572,9 +2566,9 @@ Describes the wear detection sensor data. It extends from [Response](#response). ...@@ -2572,9 +2566,9 @@ Describes the wear detection sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ----- | ------ | ---- | ---- | ------------------------- |
| value | number | Yes| Yes| Whether the device is being worn. The value **1** means that the device is being worn, and **0** means the opposite.| | value | number | Yes | Yes | Whether the device is being worn. The value **1** means that the device is being worn, and **0** means the opposite.|
## Options ## Options
...@@ -2583,8 +2577,8 @@ Describes the sensor data reporting frequency. ...@@ -2583,8 +2577,8 @@ Describes the sensor data reporting frequency.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Description| | Name | Type | Description |
| -------- | -------- | -------- | | -------- | ------ | --------------------------- |
| interval | number | Frequency at which a sensor reports data. The default value is 200,000,000 ns.| | interval | number | Frequency at which a sensor reports data. The default value is 200,000,000 ns.|
## RotationMatrixResponse ## RotationMatrixResponse
...@@ -2593,10 +2587,10 @@ Describes the response for setting the rotation matrix. ...@@ -2593,10 +2587,10 @@ Describes the response for setting the rotation matrix.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name | Type | Readable| Writable| Description | | Name | Type | Readable | Writable | Description |
| ----------- | ------------------- | ---- | ---- | ---------- | | ----------- | ------------------- | ---- | ---- | ----- |
| rotation | Array&lt;number&gt; | Yes | Yes | Rotation matrix.| | rotation | Array&lt;number&gt; | Yes | Yes | Rotation matrix.|
| inclination | Array&lt;number&gt; | Yes | Yes | Inclination matrix.| | inclination | Array&lt;number&gt; | Yes | Yes | Inclination matrix.|
## CoordinatesOptions ## CoordinatesOptions
...@@ -2605,10 +2599,10 @@ Describes the coordinate options. ...@@ -2605,10 +2599,10 @@ Describes the coordinate options.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description | | Name | Type | Readable | Writable | Description |
| ---- | -------- | ---- | ---- | ----------- | | ---- | ------ | ---- | ---- | ------ |
| x | number | Yes | Yes | X coordinate direction.| | x | number | Yes | Yes | X coordinate direction.|
| y | number | Yes | Yes | Y coordinate direction.| | y | number | Yes | Yes | Y coordinate direction.|
## GeomagneticResponse ## GeomagneticResponse
...@@ -2617,15 +2611,15 @@ Describes a geomagnetic response object. It extends from [Response](#response). ...@@ -2617,15 +2611,15 @@ Describes a geomagnetic response object. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | --------------- | ------ | ---- | ---- | ------------------------- |
| x | number | Yes| Yes| North component of the geomagnetic field.| | x | number | Yes | Yes | North component of the geomagnetic field. |
| y | number | Yes| Yes| East component of the geomagnetic field.| | y | number | Yes | Yes | East component of the geomagnetic field. |
| z | number | Yes| Yes| Vertical component of the geomagnetic field.| | z | number | Yes | Yes | Vertical component of the geomagnetic field. |
| geomagneticDip | number | Yes| Yes| Magnetic dip, also called magnetic inclination, which is the angle measured from the horizontal plane to the magnetic field vector.| | geomagneticDip | number | Yes | Yes | Magnetic dip, also called magnetic inclination, which is the angle measured from the horizontal plane to the magnetic field vector. |
| deflectionAngle | number | Yes| Yes| Magnetic declination, which is the angle between true north (geographic north) and the magnetic north (the horizontal component of the field).| | deflectionAngle | number | Yes | Yes | Magnetic declination, which is the angle between true north (geographic north) and the magnetic north (the horizontal component of the field).|
| levelIntensity | number | Yes| Yes| Horizontal intensity of the magnetic field vector field.| | levelIntensity | number | Yes | Yes | Horizontal intensity of the magnetic field vector field. |
| totalIntensity | number | Yes| Yes| Total intensity of the magnetic field vector.| | totalIntensity | number | Yes | Yes | Total intensity of the magnetic field vector. |
## LocationOptions ## LocationOptions
...@@ -2633,8 +2627,8 @@ Describes the geographical location. ...@@ -2633,8 +2627,8 @@ Describes the geographical location.
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | --------- | ------ | ---- | ---- | ----- |
| latitude | number | Yes| Yes| Latitude.| | latitude | number | Yes | Yes | Latitude. |
| longitude | number | Yes| Yes| Longitude.| | longitude | number | Yes | Yes | Longitude. |
| altitude | number | Yes| Yes| Altitude.| | altitude | number | Yes | Yes | Altitude.|
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册