未验证 提交 d4d0eba9 编写于 作者: O openharmony_ci 提交者: Gitee

!15349 翻译完成:14042 三方API升级到系统API、错误码英文解释修改、接口一致性检查修改 (cherry-pick)

Merge pull request !15349 from wusongqing/cherry-pick-1677583694
......@@ -36,5 +36,5 @@ Currently you can have access to statistics on the application usage, and the no
Deregister the callback for application group changes.
## Required Permissions
- Before calling the following system APIs, you need to apply for the **ohos.permission.BUNDLE_ACTIVE_INFO** permission: **queryBundleActiveStates**, **queryBundleStateInfos**, **queryBundleStateInfoByInterval**, **queryBundleActiveEventStates**, **queryAppNotificationNumber**, **queryAppUsagePriorityGroup(bundleName?)**, **setBundleGroup**, **registerGroupCallBack**, and **unRegisterGroupCallBack**.
- This permission is not required for calling third-party APIs: **queryCurrentBundleActiveStates**, **queryAppUsagePriorityGroup()**, and **isIdleState**.
- Before calling the following system APIs, you must request the **ohos.permission.BUNDLE_ACTIVE_INFO** permission: **isIdleState**, **queryBundleEvents**, **queryBundleStatsInfos**, **queryBundleStatsInfoByInterval**, **queryDeviceEventStats**, **queryNotificationEventStats**, **queryAppGroup(bundleName)**, **setAppGroup**, **registerAppGroupCallBack**, **unregisterAppGroupCallBack**, **queryModuleUsageRecords**, and **queryModuleUsageRecords(maxnum)**.
- You do not need to request this permission before calling **queryCurrentBundleEvents** and **queryAppGroup()**, which are third-party APIs.
......@@ -225,7 +225,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
}
```
7. Check whether the application specified by **bundleName** is in the idle state. This requires no permission to be configured. A third-party application can only check the idle status of itself.
7. Check whether the application specified by **bundleName** is in the idle state. This requires the **ohos.permission.BUNDLE_ACTIVE_INFO** permission to be configured.
```js
import usageStatistics from '@ohos.resourceschedule.usageStatistics'
......@@ -531,4 +531,4 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
} catch (error) {
console.log('BUNDLE_ACTIVE unregisterAppGroupCallBack throw error, code is: ' + error.code + ',message is: ' + error.message);
}
```
\ No newline at end of file
```
......@@ -35,8 +35,12 @@ isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void
Checks whether the application specified by **bundleName** is in the idle state. This API uses an asynchronous callback to return the result. A third-party application can only check the idle status of itself.
**Required permissions**: ohos.permission.BUNDLE_ACTIVE_INFO
**System capability**: SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
**System API**: This is a system API.
**Parameters**
| Name | Type | Mandatory | Description |
......@@ -53,8 +57,8 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
**Example**
```js
......@@ -77,8 +81,12 @@ isIdleState(bundleName: string): Promise<boolean>
Checks whether the application specified by **bundleName** is in the idle state. This API uses a promise to return the result. A third-party application can only check the idle status of itself.
**Required permissions**: ohos.permission.BUNDLE_ACTIVE_INFO
**System capability**: SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
**System API**: This is a system API.
**Parameters**
| Name | Type | Mandatory | Description |
......@@ -100,8 +108,8 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000006 | Get application info failed. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
**Example**
......@@ -140,10 +148,10 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000005 | Application is not installed. |
| 10000006 | Failed to get the application information. |
| 10100002 | Failed to get the application group information. |
**Example**
......@@ -182,10 +190,10 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000005 | Application is not installed. |
| 10000006 | Failed to get the application information. |
| 10100002 | Failed to get the application group information. |
**Example**
......@@ -232,9 +240,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -292,9 +300,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -346,9 +354,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -405,9 +413,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -456,9 +464,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -514,9 +522,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -561,9 +569,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -615,9 +623,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -664,9 +672,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -714,9 +722,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -771,9 +779,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -821,9 +829,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -878,10 +886,10 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000004 | IPC failed. |
| 10000005 | Application is not installed. |
| 10000006 | Get application info failed. |
| 10100002 | Get Application group info failed. |
| 10000006 | Failed to get the application information. |
| 10100002 | Failed to get the application group information. |
**Example**
......@@ -927,10 +935,10 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10000004 | IPC failed. |
| 10000005 | Application is not installed. |
| 10000006 | Get application info failed. |
| 10100002 | Get Application group info failed. |
| 10000006 | Failed to get the application information. |
| 10100002 | Failed to get the application group information. |
**Example**
......@@ -977,9 +985,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10100001 | Repeated operation on the application group. |
**Return value**
......@@ -1033,9 +1041,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10100001 | Repeated operation on the application group. |
**Example**
......@@ -1083,8 +1091,8 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10100001 | Application group operation repeated. |
| 10000004 | IPC failed. |
| 10100001 | Repeated operation on the application group. |
**Return value**
......@@ -1142,13 +1150,14 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10100001 | Application group operation repeated. |
| 10000004 | IPC failed. |
| 10100001 | Repeated operation on the application group. |
**Example**
```javascript
// @ts-nocheck
let onBundleGroupChanged = (err, res) =>{
console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack callback success.');
console.log('BUNDLE_ACTIVE registerAppGroupCallBack result appOldGroup is : ' + res.appOldGroup);
......@@ -1197,8 +1206,8 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10100001 | Application group operation repeated. |
| 10000004 | IPC failed. |
| 10100001 | Repeated operation on the application group. |
**Example**
......@@ -1241,8 +1250,8 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC Communication failed. |
| 10100001 | Application group operation repeated. |
| 10000004 | IPC failed. |
| 10100001 | Repeated operation on the application group. |
**Example**
......@@ -1294,9 +1303,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -1342,9 +1351,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -1397,9 +1406,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......@@ -1445,9 +1454,9 @@ For details about the error codes, see [DeviceUsageStatistics Error Codes](../er
| 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. |
| 10000004 | IPC failed. |
| 10000006 | Failed to get the application information. |
| 10000007 | Failed to get the system time. |
**Example**
......
......@@ -58,7 +58,7 @@ Try again later or restart the device.
**Error Message**
IPC communication failed.
IPC failed.
**Description**
......@@ -94,7 +94,7 @@ Check whether the application exists.
**Error Message**
Get application info failed.
Failed to get the application information.
**Description**
......@@ -114,7 +114,7 @@ Check whether the input parameters are valid and whether the application exists.
**Error Message**
Get system or actual time operation failed.
Failed to get the system time.
**Description**
......@@ -132,7 +132,7 @@ Try again later or restart the device.
**Error Message**
Application group operation failed. The application group are the the same or do not need te be updated.
Repeated operation on the application group.
**Description**
......@@ -150,7 +150,7 @@ Do not repeatedly set application groups, or register or deregister a callback f
**Error Message**
Get application group info failed. The application group infomation cannot be found.
Failed to get the application group information.
**Description**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册