From c183272697676b13e073fc60ee7390a11f64e486 Mon Sep 17 00:00:00 2001 From: "yupeng74@huawei.com" Date: Wed, 19 Oct 2022 14:46:10 +0800 Subject: [PATCH] =?UTF-8?q?unregisterAppGroupCallBack=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=90=8D=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yupeng74@huawei.com --- .../device-usage-statistics-use-guide.md | 4 ++-- ...-resourceschedule-deviceUsageStatistics.md | 24 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md b/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md index ef57c58ae7..6fad747aab 100644 --- a/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md +++ b/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md @@ -32,8 +32,8 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics'; | function setAppGroup(bundleName : string, newGroup : GroupType): Promise>boolean>; | 给应用名是bundleName的应用分组设置成newGroup,返回设置结果是否成功,以promise形式返回。 | | function registerAppGroupCallBack(groupCallback: Callback>AppGroupCallbackInfo>, callback: AsyncCallback>boolean>): void | 注册应用分组变化监听回调,返回注册是否成功,当应用分组发生变化时,会给所有已注册的监听者返回回调信息,以callback形式返回。 | | function registerAppGroupCallBack(groupCallback: Callback>AppGroupCallbackInfo>): Promise>boolean>; | 注册应用分组变化监听回调,返回注册是否成功,当应用分组发生变化时,会给所有已注册的监听者返回回调信息,以promise形式返回。 | -| function unRegisterAppGroupCallBack(callback: AsyncCallback>boolean>): void | 解除应用分组监听回调,以callback形式返回。 | -| function unRegisterAppGroupCallBack(): Promise>boolean>; | 解除应用分组监听回调,以promise形式返回。 | +| function unregisterAppGroupCallBack(callback: AsyncCallback>boolean>): void | 解除应用分组监听回调,以callback形式返回。 | +| function unregisterAppGroupCallBack(): Promise>boolean>; | 解除应用分组监听回调,以promise形式返回。 | ## 开发步骤 diff --git a/zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md b/zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md index 92d6c5aac1..cefe77ce8b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md +++ b/zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md @@ -1193,9 +1193,9 @@ registerAppGroupCallBack(groupCallback: Callback<AppGroupCallbackInfo>, ca } ``` -## usageStatistics.unRegisterAppGroupCallBack +## usageStatistics.unregisterAppGroupCallBack -unRegisterAppGroupCallBack(): Promise<void> +unregisterAppGroupCallBack(): Promise<void> 应用解除分组变化监听,解除通过调用注册接口生成的监听。使用Promise形式返回解除监听是否成功。 @@ -1230,19 +1230,19 @@ unRegisterAppGroupCallBack(): Promise<void> ```javascript try{ - usageStatistics.unRegisterAppGroupCallBack().then( () => { - console.log('BUNDLE_ACTIVE unRegisterAppGroupCallBack promise succeeded.'); + usageStatistics.unregisterAppGroupCallBack().then( () => { + console.log('BUNDLE_ACTIVE unregisterAppGroupCallBack promise succeeded.'); }).catch( err => { - console.log('BUNDLE_ACTIVE unRegisterAppGroupCallBack promise failed. errCode is: ' + err.errCode + ',message is: ' + err.errMessage); + console.log('BUNDLE_ACTIVE unregisterAppGroupCallBack promise failed. errCode is: ' + err.errCode + ',message is: ' + err.errMessage); }); } catch (error) { - console.log('BUNDLE_ACTIVE unRegisterAppGroupCallBack throw error, code is: ' + error.code + ',message is: ' + error.message); + console.log('BUNDLE_ACTIVE unregisterAppGroupCallBack throw error, code is: ' + error.code + ',message is: ' + error.message); } ``` -## usageStatistics.unRegisterAppGroupCallBack +## usageStatistics.unregisterAppGroupCallBack -unRegisterAppGroupCallBack(callback: AsyncCallback<void>): void; +unregisterAppGroupCallBack(callback: AsyncCallback<void>): void; 应用解除分组变化监听,解除通过调用注册接口生成的监听。使用异步callback形式返回解除监听是否成功。 @@ -1275,15 +1275,15 @@ unRegisterAppGroupCallBack(callback: AsyncCallback<void>): void; ```javascript try{ - usageStatistics.unRegisterAppGroupCallBack(error => { + usageStatistics.unregisterAppGroupCallBack(error => { if(error) { - console.log('BUNDLE_ACTIVE unRegisterAppGroupCallBack callback failed. errCode is: ' + err.errCode + ',message is: ' + err.errMessage); + console.log('BUNDLE_ACTIVE unregisterAppGroupCallBack callback failed. errCode is: ' + err.errCode + ',message is: ' + err.errMessage); } else { - console.log('BUNDLE_ACTIVE unRegisterAppGroupCallBack callback success.'); + console.log('BUNDLE_ACTIVE unregisterAppGroupCallBack callback success.'); } }); } catch (error) { - console.log('BUNDLE_ACTIVE unRegisterAppGroupCallBack throw error, code is: ' + error.code + ',message is: ' + error.message); + console.log('BUNDLE_ACTIVE unregisterAppGroupCallBack throw error, code is: ' + error.code + ',message is: ' + error.message); } ``` -- GitLab