提交 28aa2bc9 编写于 作者: Y yupeng74@huawei.com

文档修改,支持错误码和变更说明和跳转

Signed-off-by: Nyupeng74@huawei.com <yupeng74@huawei.com>
上级 7aaa3738
# 设备使用信息统计
- [设备使用信息统计概述](device-usage-statistics-overview.md)
- [设备使用信息统计开发指导(待废弃)](device-usage-statistics-dev-guide.md)
- [设备使用信息统计开发指导(新版本)](device-usage-statistics-use-guide.md)
\ No newline at end of file
- [设备使用信息统计开发指导(API7)](device-usage-statistics-dev-guide.md)
- [设备使用信息统计开发指导(API9)](device-usage-statistics-use-guide.md)
\ No newline at end of file
......@@ -15,7 +15,8 @@
- 查询应用事件(仅限自身应用)。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。从API version 9开始,导入模块由@ohos.backgroundTaskManager迁移至@ohos.resourceschedule.backgroundTaskManager
> 设备使用信息统计错误码见[DeviceUsageStatistics错误码](../errorcodes/errcode-DeviceUsageStatistics.md)。
## 导入模块
......@@ -24,12 +25,16 @@
import bundleState from '@ohos.bundleState'
```
## bundleState.isIdleState
## bundleState.isIdleState<sup>(deprecated)</sup>
isIdleState(bundleName: string, callback: AsyncCallback&lt;boolean&gt;): void
判断指定bundleName的应用当前是否是空闲状态,三方应用只能查询自身的空闲状态,使用Callback形式返回。
> **说明** 从API version 9开始废弃,建议使用[usageStatistics.isIdleState](./js-apis-resourceschedule-deviceUsageStatistics.md/#usagestatisticsisidlestate)
>
> 从API7开始支持
**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
**参数**
......@@ -51,12 +56,16 @@ isIdleState(bundleName: string, callback: AsyncCallback&lt;boolean&gt;): void
});
```
## bundleState.isIdleState
## bundleState.isIdleState<sup>(deprecated)</sup>
isIdleState(bundleName: string): Promise&lt;boolean&gt;
判断指定bundleName的应用当前是否是空闲状态,三方应用只能查询自身的空闲状态,使用Promise形式返回。
> **说明** 从API version 9开始废弃,建议使用[usageStatistics.isIdleState](./js-apis-resourceschedule-deviceUsageStatistics.md/#usagestatisticsisidlestate)
>
> 从API7开始支持
**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
**参数**
......@@ -81,12 +90,16 @@ isIdleState(bundleName: string): Promise&lt;boolean&gt;
});
```
## bundleState.queryAppUsagePriorityGroup
## bundleState.queryAppUsagePriorityGroup<sup>(deprecated)</sup>
queryAppUsagePriorityGroup(): Promise&lt;number&gt;
查询当前应用的优先级分组。使用Promise形式返回其应用分组。
> **说明** 从API version 9开始废弃,建议使用[usageStatistics.queryAppGroup](./js-apis-resourceschedule-deviceUsageStatistics.md/#usagestatisticsqueryappgroup)
>
> 从API7开始支持
**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
**返回值**
......@@ -105,12 +118,16 @@ bundleState.queryAppUsagePriorityGroup().then( res => {
});
```
## bundleState.queryAppUsagePriorityGroup
## bundleState.queryAppUsagePriorityGroup<sup>(deprecated)</sup>
queryAppUsagePriorityGroup(callback: AsyncCallback&lt;number&gt;): void
查询当前应用的优先级分组。使用callback形式返回其应用分组。
> **说明** 从API version 9开始废弃,建议使用[usageStatistics.queryAppGroup](./js-apis-resourceschedule-deviceUsageStatistics.md/#usagestatisticsqueryappgroup)
>
> 从API7开始支持
**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
**参数**
......@@ -131,12 +148,16 @@ bundleState.queryAppUsagePriorityGroup((err, res) => {
});
```
## bundleState.queryBundleStateInfos
## bundleState.queryBundleStateInfos<sup>(deprecated)</sup>
queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback&lt;BundleActiveInfoResponse&gt;): void
通过指定起始和结束时间查询应用使用时长统计信息,使用Callback形式返回。
> **说明** 从API version 9开始废弃,建议使用[usageStatistics.queryBundleStatsInfos](./js-apis-resourceschedule-deviceUsageStatistics.md/#usagestatisticsquerybundlestatsinfos)
>
> 从API7开始支持
**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO
**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.App
......@@ -169,12 +190,16 @@ queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback&lt;Bun
});
```
## bundleState.queryBundleStateInfos
## bundleState.queryBundleStateInfos<sup>(deprecated)</sup>
queryBundleStateInfos(begin: number, end: number): Promise&lt;BundleActiveInfoResponse&gt;
通过指定起始和结束时间查询应用使用时长统计信息,使用Promise形式返回。
> **说明** 从API version 9开始废弃,建议使用[usageStatistics.queryBundleStatsInfos](./js-apis-resourceschedule-deviceUsageStatistics.md/#usagestatisticsquerybundlestatsinfos)
>
> 从API7开始支持
**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO
**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.App
......@@ -210,12 +235,16 @@ queryBundleStateInfos(begin: number, end: number): Promise&lt;BundleActiveInfoRe
});
```
## bundleState.queryBundleStateInfoByInterval
## bundleState.queryBundleStateInfoByInterval<sup>(deprecated)</sup>
queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback&lt;Array&lt;BundleStateInfo&gt;&gt;): void
通过指定时间段间隔(天、周、月、年)查询应用使用时长统计信息,使用Callback形式返回。
> **说明** 从API version 9开始废弃,建议使用[usageStatistics.queryBundleStatsInfoByInterval](./js-apis-resourceschedule-deviceUsageStatistics.md/#usagestatisticsquerybundlestatsinfobyinterval)
>
> 从API7开始支持
**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO
**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.App
......@@ -247,12 +276,16 @@ queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: num
});
```
## bundleState.queryBundleStateInfoByInterval
## bundleState.queryBundleStateInfoByInterval<sup>(deprecated)</sup>
queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise&lt;Array&lt;BundleStateInfo&gt;&gt;
通过指定时间段间隔(天、周、月、年)查询应用使用时长统计信息,使用Promise形式返回。
> **说明** 从API version 9开始废弃,建议使用[usageStatistics.queryBundleStatsInfoByInterval](./js-apis-resourceschedule-deviceUsageStatistics.md/#usagestatisticsquerybundlestatsinfobyinterval)
>
> 从API7开始支持
**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO
**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.App
......@@ -287,12 +320,16 @@ queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: num
});
```
## bundleState.queryBundleActiveStates
## bundleState.queryBundleActiveStates<sup>(deprecated)</sup>
queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback&lt;Array&lt;BundleActiveState&gt;&gt;): void
通过指定起始和结束时间查询所有应用的事件集合,使用Callback形式返回。
> **说明** 从API version 9开始废弃,建议使用[usageStatistics.queryBundleEvents](./js-apis-resourceschedule-deviceUsageStatistics.md/#usagestatisticsquerybundleevents)
>
> 从API7开始支持
**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO
**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.App
......@@ -323,12 +360,16 @@ queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback&lt;A
});
```
## bundleState.queryBundleActiveStates
## bundleState.queryBundleActiveStates<sup>(deprecated)</sup>
queryBundleActiveStates(begin: number, end: number): Promise&lt;Array&lt;BundleActiveState&gt;&gt;
通过指定起始和结束时间查询所有应用的事件集合,使用Promise形式返回。
> **说明** 从API version 9开始废弃,建议使用[usageStatistics.queryBundleEvents](./js-apis-resourceschedule-deviceUsageStatistics.md/#usagestatisticsquerybundleevents)
>
> 从API7开始支持
**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO
**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.App
......@@ -362,12 +403,16 @@ queryBundleActiveStates(begin: number, end: number): Promise&lt;Array&lt;BundleA
});
```
## bundleState.queryCurrentBundleActiveStates
## bundleState.queryCurrentBundleActiveStates<sup>(deprecated)</sup>
queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback&lt;Array&lt;BundleActiveState&gt;&gt;): void
通过指定起始和结束时间查询当前应用的事件集合,使用Callback形式返回。
> **说明** 从API version 9开始废弃,建议使用[usageStatistics.queryCurrentBundleEvents](./js-apis-resourceschedule-deviceUsageStatistics.md/#usagestatisticsquerycurrentbundleevents)
>
> 从API7开始支持
**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.App
**参数**
......@@ -394,12 +439,16 @@ queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallba
});
```
## bundleState.queryCurrentBundleActiveStates
## bundleState.queryCurrentBundleActiveStates<sup>(deprecated)</sup>
queryCurrentBundleActiveStates(begin: number, end: number): Promise&lt;Array&lt;BundleActiveState&gt;&gt;
通过指定起始和结束时间查询当前应用的事件集合,使用Promise形式返回。
> **说明** 从API version 9开始废弃,建议使用[usageStatistics.queryCurrentBundleEvents](./js-apis-resourceschedule-deviceUsageStatistics.md/#usagestatisticsquerycurrentbundleevents)
>
> 从API7开始支持
**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.App
**参数**
......@@ -429,10 +478,14 @@ queryCurrentBundleActiveStates(begin: number, end: number): Promise&lt;Array&lt;
});
```
## BundleStateInfo
## BundleStateInfo<sup>(deprecated)</sup>
提供应用使用时长的具体信息。
> **说明** 从API version 9开始废弃,建议使用[BundleStatsInfo](./js-apis-resourceschedule-deviceUsageStatistics.md/#bundlestatsinfo)
>
> 从API7开始支持
### 属性
**系统能力**:以下各项对应的系统能力均为SystemCapability.ResourceSchedule.UsageStatistics.App
......@@ -450,10 +503,16 @@ queryCurrentBundleActiveStates(begin: number, end: number): Promise&lt;Array&lt;
| infosBeginTime | number | 否 | BundleActiveInfo对象中第一条应用使用统计的记录时间。<br>本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 |
| infosEndTime | number | 否 | BundleActiveInfo对象中最后一条应用使用统计的记录时间。<br>本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 |
## BundleActiveState
## BundleActiveState<sup>(deprecated)</sup>
提供应用事件的具体信息。
提供应用使用时长的具体信息。
> **说明** 从API version 9开始废弃,建议使用[BundleEvents](./js-apis-resourceschedule-deviceUsageStatistics.md/#bundleevents)
>
> 从API7开始支持
**系统能力**:以下各项对应的系统能力均为SystemCapability.ResourceSchedule.UsageStatistics.App
| 参数名 | 类型 | 必填 | 说明 |
......@@ -465,20 +524,28 @@ queryCurrentBundleActiveStates(begin: number, end: number): Promise&lt;Array&lt;
| indexOfLink | string | 否 | 快捷方式id。<br>本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 |
| nameOfClass | string | 否 | 类名。<br>本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 |
## BundleActiveInfoResponse
## BundleActiveInfoResponse<sup>(deprecated)</sup>
提供应用使用时长的具体信息。
> **说明** 从API version 9开始废弃,建议使用[BundleStatsMap](./js-apis-resourceschedule-deviceUsageStatistics.md/#bundlestatsmap)
>
> 从API7开始支持
**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.App
| 参数名 | 类型 | 必填 | 说明 |
| ------------------------------ | ---------------------------------------- | ---- | -------------- |
| [key: string]: BundleStateInfo | [key: string]: [BundleStateInfo](#bundlestateinfo) | 是 | 不同应用的使用时长统计信息。 |
## IntervalType
## IntervalType<sup>(deprecated)</sup>
提供应用使用时长的查询类型。
> **说明** 从API version 9开始废弃,建议使用[IntervalType](./js-apis-resourceschedule-deviceUsageStatistics.md/#intervaltype)
>
> 从API7开始支持
**系统能力**:以下各项对应的系统能力均为SystemCapability.ResourceSchedule.UsageStatistics.App
| 名称 | 默认值 | 说明 |
......
......@@ -19,6 +19,7 @@
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 设备使用信息统计错误码见[DeviceUsageStatistics错误码](../errorcodes/errcode-DeviceUsageStatistics.md)。
## 导入模块
......@@ -42,6 +43,19 @@ isIdleState(bundleName: string, callback: AsyncCallback&lt;boolean&gt;): void
| bundleName | string | 是 | 应用的bundleName。 |
| callback | AsyncCallback&lt;boolean&gt; | 是 | 指定的callback回调方法。如果指定的bundleName有效,则返回指定bundleName的应用当前是否是空闲状态;否则返回null。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
**示例**
```
......@@ -78,6 +92,19 @@ isIdleState(bundleName: string): Promise&lt;boolean&gt;
| ---------------------- | ---------------------------------------- |
| Promise&lt;boolean&gt; | 指定的Promise回调方法。如果指定的bundleName有效,则返回指定bundleName的应用当前是否是空闲状态;否则返回null。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
**示例**
```js
......@@ -106,6 +133,21 @@ queryAppGroup(): Promise&lt;number&gt;
| --------------- | --------------------------- |
| Promise&lt;number&gt; | 指定的Promise回调方法。返回查询的应用分组结果。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000005 | Application is not installed. |
| 10000006 | Get application info failed. |
| 10100002 | Get Application group info failed. |
**示例**
```javascript
......@@ -134,6 +176,21 @@ queryAppGroup(callback: AsyncCallback&lt;number&gt;): void
| -------- | --------------------- | ---- | -------------------------- |
| callback | AsyncCallback&lt;number&gt; | 是 | 指定的CallBack回调方法。返回查询的应用分组。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000005 | Application is not installed. |
| 10000006 | Get application info failed. |
| 10100002 | Get Application group info failed. |
**示例**
```javascript
......@@ -170,6 +227,20 @@ queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback&lt;Bun
| end | number | 是 | 结束时间。 |
| callback | AsyncCallback&lt;[BundleStatsMap](#bundlestatsmap)&gt; | 是 | 指定的callback回调方法。返回指定起始和结束时间内应用使用时长统计信息。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -217,6 +288,20 @@ queryBundleStatsInfos(begin: number, end: number): Promise&lt;BundleStatsMap&gt;
| ---------------------------------------- | -------------------------------------- |
| Promise&lt;[BundleStatsMap](#bundlestatsmap)&gt; | 指定的Promise回调方法。返回指定起始和结束时间内应用使用时长统计信息。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -258,6 +343,20 @@ queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: num
| end | number | 是 | 结束时间。 |
| callback | AsyncCallback&lt;Array&lt;[BundleStatsInfo](#bundlestatsinfo)&gt;&gt; | 是 | 指定的callback回调方法。返回指定时间段间隔(天、周、月、年)查询应用使用时长统计信息。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -304,6 +403,20 @@ queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: num
| ---------------------------------------- | ---------------------------------------- |
| Promise&lt;Array&lt;[BundleStatsInfo](#bundlestatsinfo)&gt;&gt; | 指定的Promise回调方法。返回指定时间段间隔(天、周、月、年)查询应用使用时长统计信息。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -342,6 +455,20 @@ queryBundleEvents(begin: number, end: number, callback: AsyncCallback&lt;Array&l
| end | number | 是 | 结束时间。 |
| callback | AsyncCallback&lt;Array&lt;[BundleEvents](#bundleevents)&gt;&gt; | 是 | 指定的callback回调方法。返回指定起始和结束时间查询所有应用的事件集合。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -387,6 +514,20 @@ queryBundleEvents(begin: number, end: number): Promise&lt;Array&lt;BundleEvents&
| ---------------------------------------- | -------------------------------------- |
| Promise&lt;Array&lt;[BundleEvents](#bundleevents)&gt;&gt; | 指定的Promise回调方法。返回指定起始和结束时间查询所有应用的事件集合。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -421,6 +562,20 @@ queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback&lt;
| end | number | 是 | 结束时间。 |
| callback | AsyncCallback&lt;Array&lt;[BundleEvents](#bundleevents)&gt;&gt; | 是 | 指定的callback回调方法。返回指定起始和结束时间查询当前应用的事件集合。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -462,6 +617,20 @@ queryCurrentBundleEvents(begin: number, end: number): Promise&lt;Array&lt;Bundle
| ---------------------------------------- | -------------------------------------- |
| Promise&lt;Array&lt;[BundleEvents](#bundleevents)&gt;&gt; | 指定的Promise回调方法。返回指定起始和结束时间查询当前应用的事件集合。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -498,6 +667,20 @@ queryModuleUsageRecords(): Promise&lt;Array&lt;HapModuleInfo&gt;&gt;
| ---------------------------------------- | ---------------------------------- |
| Promise&lt;Array&lt;[HapModuleInfo](#hapmoduleinfo)&gt;&gt; | 指定的Promise回调方法。返回不超过1000条FA使用记录。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -535,6 +718,20 @@ queryModuleUsageRecords(callback: AsyncCallback&lt;Array&lt;HapModuleInfo&gt;&gt
| -------- | ---------------------------------------- | ---- | ----------------------------------- |
| callback | AsyncCallback&lt;Array&lt;[HapModuleInfo](#hapmoduleinfo)&gt;&gt; | 是 | 指定的CallBack回调方法。返回不超过maxNum条FA使用记录。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -579,6 +776,20 @@ queryModuleUsageRecords(maxNum: number): Promise&lt;Array&lt;HapModuleInfo&gt;&g
| ---------------------------------------- | ---------------------------------- |
| Promise&lt;Array&lt;[HapModuleInfo](#hapmoduleinfo)&gt;&gt; | 指定的Promise回调方法。返回不超过maxNum条FA使用记录。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -616,6 +827,20 @@ queryModuleUsageRecords(maxNum: number, callback: AsyncCallback&lt;Array&lt;HapM
| maxNum | number | 是 | 返回FA记录的最大数量,maxNum最大为1000。|
| callback | AsyncCallback&lt;Array&lt;[HapModuleInfo](#hapmoduleinfo)&gt;&gt; | 是 | 指定的CallBack回调方法。返回不超过maxNum条FA使用记录。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -660,6 +885,21 @@ queryAppGroup(bundleName : string): Promise&lt;number&gt;
| --------------- | --------------------------- |
| Promise&lt;number&gt; | 指定的Promise回调方法。返回查询的应用分组结果。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000005 | Application is not installed. |
| 10000006 | Get application info failed. |
| 10100002 | Get Application group info failed. |
**示例**
```javascript
......@@ -695,6 +935,21 @@ queryAppGroup(bundleName : string, callback: AsyncCallback&lt;number&gt;): void
| bundleName | string | 是 | 查询指定bundleName对应应用的分组。 |
| callback | AsyncCallback&lt;number&gt; | 是 | 指定的CallBack回调方法。返回制指定bundleName的应用分组。|
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000005 | Application is not installed. |
| 10000006 | Get application info failed. |
| 10100002 | Get Application group info failed. |
**示例**
```javascript
......@@ -732,6 +987,20 @@ setAppGroup(bundleName: string, newGroup: GroupType): Promise&lt;void&gt;
| bundleName | string | 是 | 应用名称 |
| newGroup | [GroupType](#grouptype) | 是 | 应用分组 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10100001 | Application group operation repeated. |
**返回值**
| 类型 | 说明 |
......@@ -775,6 +1044,20 @@ setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback&lt;
| newGroup | [GroupType](#grouptype) | 是 | 应用分组 |
| callback | AsyncCallback&lt;void&gt; | 是 | 指定的CallBack回调方法。返回设置是否成功。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10100001 | Application group operation repeated. |
**示例**
```javascript
......@@ -812,6 +1095,19 @@ registerAppGroupCallBack(groupCallback: Callback&lt;AppGroupCallbackInfo&gt;): P
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------ |
| callback | Callback&lt;[AppGroupCallbackInfo](#appgroupcallbackinfo)&gt; | 是 | 指定的callback函数,返回应用分组变化的信息 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10100001 | Application group operation repeated. |
**返回值**
| 类型 | 说明 |
......@@ -859,6 +1155,20 @@ registerAppGroupCallBack(groupCallback: Callback&lt;AppGroupCallbackInfo&gt;, ca
| groupCallback | Callback&lt;[AppGroupCallbackInfo](#appgroupcallbackinfo)&gt; | 是 | 指定的callback函数,返回应用分组变化的信息 |
| callback | AsyncCallback&lt;void&gt; | 是 | 指定的异步callback函数,返回注册监听是否成功 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10100001 | Application group operation repeated. |
**示例**
```javascript
......@@ -903,6 +1213,19 @@ unRegisterAppGroupCallBack(): Promise&lt;void&gt;
| ------------- | ------------------------ |
| Promise&lt;void&gt; | 指定的Promise回调方法。返回解除监听是否成功 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10100001 | Application group operation repeated. |
**示例**
```javascript
......@@ -935,6 +1258,19 @@ unRegisterAppGroupCallBack(callback: AsyncCallback&lt;void&gt;): void;
| -------- | ------------------- | ---- | -------------- |
| callback | AsyncCallback&lt;void&gt; | 是 | 解除监听是否成功的异步回调函数 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10100001 | Application group operation repeated. |
**示例**
```javascript
......@@ -976,6 +1312,20 @@ queryDeviceEventStats(begin: number, end: number): Promise&lt;Array&lt;DeviceEve
| ---------------------------------------- | ---------------------------------------- |
| Promise&lt;Array&lt;[DeviceEventStats](#deviceeventstats)&gt;&gt; | 指定的Promise回调方法。返回指定起始和结束时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -1011,6 +1361,20 @@ queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback&lt;Arr
| end | number | 是 | 结束时间。 |
| callback | AsyncCallback&lt;Array&lt;[DeviceEventStats](#deviceeventstats)&gt;&gt; | 是 | 指定的callback回调方法。返回指定起始和结束时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -1053,6 +1417,20 @@ queryNotificationEventStats(begin: number, end: number): Promise&lt;Array&lt;Dev
| ---------------------------------------- | ---------------------------------------- |
| Promise&lt;Array&lt;[DeviceEventStats](#deviceeventstats)&gt;&gt; | 指定的Promise回调方法。返回指定起始和结束时间查询所有应用的通知次数信息。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......@@ -1088,6 +1466,20 @@ queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback&
| end | number | 是 | 结束时间。 |
| callback | AsyncCallback&lt;Array&lt;[DeviceEventStats](#deviceeventstats)&gt;&gt; | 是 | 指定的callback回调方法。返回通过指定起始和结束时间查询所有应用的通知次数信息。 |
**错误码**
| 错误码ID | 错误信息 |
| ---------- | ---------------------------- |
| 201 | Parameter error. |
| 401 | Permission denied. |
| 801 | Capability not supported. |
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed |
| 10000007 | Get system or actual time failed. |
**示例**
```js
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册