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

!6719 修改设备使用信息统计master版本的api文档中this缺陷

Merge pull request !6719 from yp99ustc/master
...@@ -125,15 +125,6 @@ queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void ...@@ -125,15 +125,6 @@ queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void
**示例** **示例**
```javascript ```javascript
//有bundleName的callback
bundleState.queryAppUsagePriorityGroup(this.bundleName, (err, res) => {
if(err) {
console.log('BUNDLE_ACTIVE QueryPackageGroup callback failed. because: ' + err.code);
} else {
console.log('BUNDLE_ACTIVE QueryPackageGroup callback succeeded. result: ' + JSON.stringify(res));
}
});
//无bundleName的callback
bundleState.queryAppUsagePriorityGroup((err, res) => { bundleState.queryAppUsagePriorityGroup((err, res) => {
if(err) { if(err) {
console.log('BUNDLE_ACTIVE QueryPackageGroup callback failed. because: ' + err.code); console.log('BUNDLE_ACTIVE QueryPackageGroup callback failed. because: ' + err.code);
...@@ -566,7 +557,8 @@ queryAppUsagePriorityGroup(bundleName? : string): Promise<number> ...@@ -566,7 +557,8 @@ queryAppUsagePriorityGroup(bundleName? : string): Promise<number>
```javascript ```javascript
//有bundleName的promise //有bundleName的promise
bundleState.queryAppUsagePriorityGroup(this.bundleName).then( res => { let bundleName = "com.ohos.camera";
bundleState.queryAppUsagePriorityGroup(bundleName).then( res => {
console.log('BUNDLE_ACTIVE QueryPackageGroup promise succeeded. result: ' + JSON.stringify(res)); console.log('BUNDLE_ACTIVE QueryPackageGroup promise succeeded. result: ' + JSON.stringify(res));
}).catch( err => { }).catch( err => {
console.log('BUNDLE_ACTIVE QueryPackageGroup promise failed. because: ' + err.code); console.log('BUNDLE_ACTIVE QueryPackageGroup promise failed. because: ' + err.code);
...@@ -602,7 +594,8 @@ queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback<numb ...@@ -602,7 +594,8 @@ queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback<numb
```javascript ```javascript
//有bundleName的callback //有bundleName的callback
bundleState.queryAppUsagePriorityGroup(this.bundleName, (err, res) => { let bundleName = "com.ohos.camera";
bundleState.queryAppUsagePriorityGroup(bundleName, (err, res) => {
if(err) { if(err) {
console.log('BUNDLE_ACTIVE QueryPackageGroup callback failed. because: ' + err.code); console.log('BUNDLE_ACTIVE QueryPackageGroup callback failed. because: ' + err.code);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册