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

!5746 修改getRecentlyUsedModules可选参数接口,修复formName字段类型错误问题,删除文档行末空格

Merge pull request !5746 from Houdisheng/master
......@@ -22,7 +22,7 @@ import stats from '@ohos.bundleState';
| function queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void | 查询当前应用的使用优先级群组。callback形式。 |
| function queryAppUsagePriorityGroup(): Promise<number>; | 查询当前应用的使用优先级群组。promise形式。 |
| function isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void | 判断指定Bundle Name的应用当前是否是空闲状态。 |
| function getRecentlyUsedModules(maxNum: number, callback: AsyncCallback<BundleActiveModuleInfo>): void | 根据maxNum,查询FA使用记录,返回不超过maxNum条FA使用记录。 |
| function getRecentlyUsedModules(maxNum? : number, callback: AsyncCallback<BundleActiveModuleInfo>): void | 根据maxNum,查询FA使用记录,返回不超过maxNum条FA使用记录,若不填写maxNum参数,则默认maxNum值为1000。 |
| function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void | 通过指定起始和结束时间查询所有应用的通知次数。 |
| function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void | 通过指定起始和结束时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息。 |
| function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback<number>): void | 查询当前调用者应用或者指定应用的使用优先级群组。callback形式。 |
......@@ -178,14 +178,14 @@ import stats from '@ohos.bundleState';
```js
import stats from '@ohos.bundleState'
// promise方式
stats.queryAppUsagePriorityGroup().then( res => {
console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup promise succeeded. result: ' + JSON.stringify(res));
}).catch( err => {
console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup promise failed. because: ' + err.code);
});
// callback方式
stats.queryAppUsagePriorityGroup((err, res) => {
if (err) {
......@@ -195,7 +195,7 @@ import stats from '@ohos.bundleState';
}
});
```
7. 判断指定Bundle Name的应用当前是否是空闲状态,config.json中不需要配置权限,三方应用只能查询自身的空闲状态。
```js
......@@ -300,7 +300,7 @@ import stats from '@ohos.bundleState';
```js
import stats from '@ohos.bundleState'
// 异步方法promise方式
stats.queryBundleActiveEventStates(0, 20000000000000).then( res => {
console.log('BUNDLE_ACTIVE queryBundleActiveEventStates promise success.');
......@@ -308,7 +308,7 @@ import stats from '@ohos.bundleState';
}).catch( err => {
console.log('BUNDLE_ACTIVE queryBundleActiveEventStates promise failed, because: ' + err.code);
});
// 异步方法callback方式
stats.queryBundleActiveEventStates(0, 20000000000000, (err, res) => {
if (err) {
......@@ -324,14 +324,14 @@ import stats from '@ohos.bundleState';
```js
import stats from '@ohos.bundleState'
// 无参异步方法promise方式
stats.queryAppUsagePriorityGroup().then( res => {
console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup promise succeeded. result: ' + JSON.stringify(res));
}).catch( err => {
console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup promise failed. because: ' + err.code);
});
// 无参异步方法callback方式
stats.queryAppUsagePriorityGroup((err, res) => {
if (err) {
......@@ -340,14 +340,14 @@ import stats from '@ohos.bundleState';
console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup callback succeeded. result: ' + JSON.stringify(res));
}
});
//有参异步promise方式
stats.queryAppUsagePriorityGroup(this.bundleName).then( res => {
console.log('BUNDLE_ACTIVE QueryPackageGroup promise succeeded. result: ' + JSON.stringify(res));
}).catch( err => {
console.log('BUNDLE_ACTIVE QueryPackageGroup promise failed. because: ' + err.code);
});
//有参异步方法callback方式
stats.queryAppUsagePriorityGroup(this.bundleName, (err, res) => {
if(err) {
......@@ -362,7 +362,7 @@ import stats from '@ohos.bundleState';
```javascript
import stats from '@ohos.bundleState'
//异步方法promise
stats.setBundleGroup(this.bundleName, this.newGroup).then( () => {
console.log('BUNDLE_ACTIVE SetBundleGroup promise succeeded.');
......@@ -383,7 +383,7 @@ import stats from '@ohos.bundleState';
```javascript
import stats from '@ohos.bundleState'
//异步方法promise形式
let onBundleGroupChanged = (err,res) =>{
console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack callback success.');
......@@ -415,12 +415,12 @@ import stats from '@ohos.bundleState';
}
});
```
13. 解除应用分组监听回调
```javascript
import stats from '@ohos.bundleState'
//promise
stats.unRegisterGroupCallBack().then( () => {
console.log('BUNDLE_ACTIVE UnRegisterGroupCallBack promise succeeded.');
......
......@@ -982,7 +982,7 @@ FA卡片的使用信息的属性集合。
| 参数名 | 类型 | 必填 | 说明 |
| ---------------- | ------ | ---- | ----------- |
| formName | number | 是 | 卡片名称。 |
| formName | string | 是 | 卡片名称。 |
| formDimension | number | 是 | 卡片尺寸。 |
| formId | number | 是 | 卡片Id。 |
| formLastUsedTime | number | 是 | 卡片的上一次点击时间。 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册