Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
1c81597c
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1c81597c
编写于
10月 24, 2022
作者:
Y
yupeng74@huawei.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
error对象的属性名更改
Signed-off-by:
N
yupeng74@huawei.com
<
yupeng74@huawei.com
>
上级
ecc6e33f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
56 addition
and
56 deletion
+56
-56
zh-cn/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md
...ice-usage-statistics/device-usage-statistics-use-guide.md
+28
-28
zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md
...ce/apis/js-apis-resourceschedule-deviceUsageStatistics.md
+28
-28
未找到文件。
zh-cn/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md
浏览文件 @
1c81597c
...
...
@@ -65,7 +65,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
console.log('BUNDLE_ACTIVE queryBundleEvents promise result ' + JSON.stringify(res[i]));
}
}).catch( err => {
console.log('BUNDLE_ACTIVE queryBundleEvents promise failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryBundleEvents promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE queryBundleEvents throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -75,7 +75,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.queryBundleEvents(0, 20000000000000, (err, res) => {
if (err) {
console.log('BUNDLE_ACTIVE queryBundleEvents callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryBundleEvents callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE queryBundleEvents callback success.');
for (let i = 0; i < res.length; i++) {
...
...
@@ -105,7 +105,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
i++;
}
}).catch( err => {
console.log('BUNDLE_ACTIVE queryBundleStatsInfos promise failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryBundleStatsInfos promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE queryBundleStatsInfos throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -115,7 +115,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.queryBundleStatsInfos(0, 20000000000000, (err, res) => {
if (err) {
console.log('BUNDLE_ACTIVE queryBundleStatsInfos callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryBundleStatsInfos callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE queryBundleStatsInfos callback success.');
let i = 1;
...
...
@@ -145,7 +145,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
console.log('BUNDLE_ACTIVE queryCurrentBundleEvents promise result ' + JSON.stringify(res[i]));
}
}).catch( err => {
console.log('BUNDLE_ACTIVE queryCurrentBundleEvents promise failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryCurrentBundleEvents promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE queryCurrentBundleEvents throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -155,7 +155,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.queryCurrentBundleEvents(0, 20000000000000, (err, res) => {
if (err) {
console.log('BUNDLE_ACTIVE queryCurrentBundleEvents callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryCurrentBundleEvents callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE queryCurrentBundleEvents callback success.');
for (let i = 0; i < res.length; i++) {
...
...
@@ -183,7 +183,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
console.log('BUNDLE_ACTIVE queryBundleStatsInfoByInterval promise result ' + JSON.stringify(res[i]));
}
}).catch( err => {
console.log('BUNDLE_ACTIVE queryBundleStatsInfoByInterval promise failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryBundleStatsInfoByInterval promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE queryBundleStatsInfoByInterval throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -193,7 +193,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.queryBundleStatsInfoByInterval(0, 0, 20000000000000, (err, res) => {
if (err) {
console.log('BUNDLE_ACTIVE queryBundleStatsInfoByInterval callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryBundleStatsInfoByInterval callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE queryBundleStatsInfoByInterval callback success.');
for (let i = 0; i < res.length; i++) {
...
...
@@ -217,7 +217,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
usageStatistics.queryAppGroup().then( res => {
console.log('BUNDLE_ACTIVE queryAppGroup promise succeeded. result: ' + JSON.stringify(res));
}).catch( err => {
console.log('BUNDLE_ACTIVE queryAppGroup promise failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryAppGroup promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE queryAppGroup throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -227,7 +227,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.queryAppGroup((err, res) => {
if(err) {
console.log('BUNDLE_ACTIVE queryAppGroup callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryAppGroup callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE queryAppGroup callback succeeded. result: ' + JSON.stringify(res));
}
...
...
@@ -247,7 +247,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
usageStatistics.isIdleState("com.ohos.camera").then( res => {
console.log('BUNDLE_ACTIVE isIdleState promise succeeded, result: ' + JSON.stringify(res));
}).catch( err => {
console.log('BUNDLE_ACTIVE isIdleState promise failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE isIdleState promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE isIdleState throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -257,7 +257,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.isIdleState("com.ohos.camera", (err, res) => {
if (err) {
console.log('BUNDLE_ACTIVE isIdleState callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE isIdleState callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE isIdleState callback succeeded, result: ' + JSON.stringify(res));
}
...
...
@@ -281,7 +281,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
console.log('BUNDLE_ACTIVE queryModuleUsageRecords promise result ' + JSON.stringify(res[i]));
}
}).catch( err=> {
console.log('BUNDLE_ACTIVE queryModuleUsageRecords promise failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryModuleUsageRecords promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE queryModuleUsageRecords throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -296,7 +296,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
console.log('BUNDLE_ACTIVE queryModuleUsageRecords promise result ' + JSON.stringify(res[i]));
}
}).catch( err=> {
console.log('BUNDLE_ACTIVE queryModuleUsageRecords promise failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryModuleUsageRecords promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE queryModuleUsageRecords throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -306,7 +306,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.queryModuleUsageRecords(1000, (err, res) => {
if(err) {
console.log('BUNDLE_ACTIVE queryModuleUsageRecords callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryModuleUsageRecords callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE queryModuleUsageRecords callback succeeded.');
for (let i = 0; i < res.length; i++) {
...
...
@@ -323,7 +323,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.queryModuleUsageRecords((err, res) => {
if(err) {
console.log('BUNDLE_ACTIVE queryModuleUsageRecords callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryModuleUsageRecords callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE queryModuleUsageRecords callback succeeded.');
for (let i = 0; i < res.length; i++) {
...
...
@@ -348,7 +348,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
console.log('BUNDLE_ACTIVE queryNotificationEventStats promise success.');
console.log('BUNDLE_ACTIVE queryNotificationEventStats promise result ' + JSON.stringify(res));
}).catch( err=> {
console.log('BUNDLE_ACTIVE queryNotificationEventStats promise failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryNotificationEventStats promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE queryNotificationEventStats throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -358,7 +358,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.queryNotificationEventStats(0, 20000000000000, (err, res) => {
if(err) {
console.log('BUNDLE_ACTIVE queryNotificationEventStats callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryNotificationEventStats callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE queryNotificationEventStats callback success.');
console.log('BUNDLE_ACTIVE queryNotificationEventStats callback result ' + JSON.stringify(res));
...
...
@@ -380,7 +380,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
console.log('BUNDLE_ACTIVE queryDeviceEventStates promise success.');
console.log('BUNDLE_ACTIVE queryDeviceEventStates promise result ' + JSON.stringify(res));
}).catch( err=> {
console.log('BUNDLE_ACTIVE queryDeviceEventStats promise failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryDeviceEventStats promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE queryDeviceEventStats throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -390,7 +390,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.queryDeviceEventStats(0, 20000000000000, (err, res) => {
if(err) {
console.log('BUNDLE_ACTIVE queryDeviceEventStats callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryDeviceEventStats callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE queryDeviceEventStats callback success.');
console.log('BUNDLE_ACTIVE queryDeviceEventStats callback result ' + JSON.stringify(res));
...
...
@@ -412,7 +412,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
usageStatistics.queryAppGroup(bundleName).then( res => {
console.log('BUNDLE_ACTIVE queryAppGroup promise succeeded. result: ' + JSON.stringify(res));
}).catch( err => {
console.log('BUNDLE_ACTIVE queryAppGroup promise failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryAppGroup promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE queryAppGroup throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -423,7 +423,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.queryAppGroup(bundleName, (err, res) => {
if(err) {
console.log('BUNDLE_ACTIVE queryAppGroup callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE queryAppGroup callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE queryAppGroup callback succeeded. result: ' + JSON.stringify(res));
}
...
...
@@ -446,7 +446,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
usageStatistics.setAppGroup(bundleName, newGroup).then( () => {
console.log('BUNDLE_ACTIVE setAppGroup promise succeeded.');
}).catch( err => {
console.log('BUNDLE_ACTIVE setAppGroup promise failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE setAppGroup promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE setAppGroup throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -459,7 +459,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.setAppGroup(bundleName, newGroup, (err) => {
if(err) {
console.log('BUNDLE_ACTIVE setAppGroup callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE setAppGroup callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE setAppGroup callback succeeded.');
}
...
...
@@ -487,7 +487,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
usageStatistics.registerAppGroupCallBack(onBundleGroupChanged).then( () => {
console.log('BUNDLE_ACTIVE registerAppGroupCallBack promise succeeded.');
}).catch( err => {
console.log('BUNDLE_ACTIVE registerAppGroupCallBack promise failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE registerAppGroupCallBack promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE registerAppGroupCallBack throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -505,7 +505,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.registerAppGroupCallBack(onBundleGroupChanged, error => {
if(error) {
console.log('BUNDLE_ACTIVE registerAppGroupCallBack callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE registerAppGroupCallBack callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE registerAppGroupCallBack callback success.');
}
...
...
@@ -525,7 +525,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
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.errM
essage);
console.log('BUNDLE_ACTIVE unRegisterAppGroupCallBack promise failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
});
} catch (error) {
console.log('BUNDLE_ACTIVE unRegisterAppGroupCallBack throw error, code is: ' + error.code + ',message is: ' + error.message);
...
...
@@ -535,7 +535,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
try{
usageStatistics.unRegisterAppGroupCallBack(error => {
if(error) {
console.log('BUNDLE_ACTIVE unRegisterAppGroupCallBack callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE unRegisterAppGroupCallBack callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE unRegisterAppGroupCallBack callback success.');
}
...
...
zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md
浏览文件 @
1c81597c
...
...
@@ -61,7 +61,7 @@ isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void
try{
usageStatistics.isIdleState("com.ohos.camera", (err, res) => {
if (err) {
console.log('BUNDLE_ACTIVE isIdleState callback failed.
errCode is: ' + err.errCode + ',message is: ' + err.errM
essage);
console.log('BUNDLE_ACTIVE isIdleState callback failed.
code is: ' + err.code + ',message is: ' + err.m
essage);
} else {
console.log('BUNDLE_ACTIVE isIdleState callback succeeded, result: ' + JSON.stringify(res));
}
...
...
@@ -110,7 +110,7 @@ isIdleState(bundleName: string): Promise<boolean>
usageStatistics
.
isIdleState
(
"
com.ohos.camera
"
).
then
(
res
=>
{
console
.
log
(
'
BUNDLE_ACTIVE isIdleState promise succeeded, result:
'
+
JSON
.
stringify
(
res
));
}).
catch
(
err
=>
{
console
.
log
(
'
BUNDLE_ACTIVE isIdleState promise failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE isIdleState promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE isIdleState throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -152,7 +152,7 @@ queryAppGroup(): Promise<number>
usageStatistics
.
queryAppGroup
().
then
(
res
=>
{
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup promise succeeded. result:
'
+
JSON
.
stringify
(
res
));
}).
catch
(
err
=>
{
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup promise failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -193,7 +193,7 @@ queryAppGroup(callback: AsyncCallback<number>): void
try
{
usageStatistics
.
queryAppGroup
((
err
,
res
)
=>
{
if
(
err
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup callback failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup callback failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
}
else
{
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup callback succeeded. result:
'
+
JSON
.
stringify
(
res
));
}
...
...
@@ -242,7 +242,7 @@ queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback<Bun
try
{
usageStatistics
.
queryBundleStatsInfos
(
0
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryBundleStatsInfos callback failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryBundleStatsInfos callback failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
}
else
{
console
.
log
(
'
BUNDLE_ACTIVE queryBundleStatsInfos callback success.
'
);
let
i
=
1
;
...
...
@@ -309,7 +309,7 @@ queryBundleStatsInfos(begin: number, end: number): Promise<BundleStatsMap>
i
++
;
}
}).
catch
(
err
=>
{
console
.
log
(
'
BUNDLE_ACTIVE queryBundleStatsInfos promise failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryBundleStatsInfos promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryBundleStatsInfos throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -356,7 +356,7 @@ queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: num
try
{
usageStatistics
.
queryBundleStatsInfoByInterval
(
0
,
0
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryBundleStatsInfoByInterval callback failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryBundleStatsInfoByInterval callback failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
}
else
{
console
.
log
(
'
BUNDLE_ACTIVE queryBundleStatsInfoByInterval callback success.
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
...
...
@@ -420,7 +420,7 @@ queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: num
console
.
log
(
'
BUNDLE_ACTIVE queryBundleStatsInfoByInterval promise result
'
+
JSON
.
stringify
(
res
[
i
]));
}
}).
catch
(
err
=>
{
console
.
log
(
'
BUNDLE_ACTIVE queryBundleStatsInfoByInterval promise failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryBundleStatsInfoByInterval promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryBundleStatsInfoByInterval throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -466,7 +466,7 @@ queryBundleEvents(begin: number, end: number, callback: AsyncCallback<Array&l
try
{
usageStatistics
.
queryBundleEvents
(
0
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryBundleEvents callback failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryBundleEvents callback failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
}
else
{
console
.
log
(
'
BUNDLE_ACTIVE queryBundleEvents callback success.
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
...
...
@@ -529,7 +529,7 @@ queryBundleEvents(begin: number, end: number): Promise<Array<BundleEvents&
console
.
log
(
'
BUNDLE_ACTIVE queryBundleEvents promise result
'
+
JSON
.
stringify
(
res
[
i
]));
}
}).
catch
(
err
=>
{
console
.
log
(
'
BUNDLE_ACTIVE queryBundleEvents promise failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryBundleEvents promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryBundleEvents throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -571,7 +571,7 @@ queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback<
try
{
usageStatistics
.
queryCurrentBundleEvents
(
0
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryCurrentBundleEvents callback failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryCurrentBundleEvents callback failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
}
else
{
console
.
log
(
'
BUNDLE_ACTIVE queryCurrentBundleEvents callback success.
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
...
...
@@ -630,7 +630,7 @@ queryCurrentBundleEvents(begin: number, end: number): Promise<Array<Bundle
console
.
log
(
'
BUNDLE_ACTIVE queryCurrentBundleEvents promise result
'
+
JSON
.
stringify
(
res
[
i
]));
}
}).
catch
(
err
=>
{
console
.
log
(
'
BUNDLE_ACTIVE queryCurrentBundleEvents promise failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryCurrentBundleEvents promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryCurrentBundleEvents throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -680,7 +680,7 @@ queryModuleUsageRecords(): Promise<Array<HapModuleInfo>>
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords promise result
'
+
JSON
.
stringify
(
res
[
i
]));
}
}).
catch
(
err
=>
{
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords promise failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -724,7 +724,7 @@ queryModuleUsageRecords(callback: AsyncCallback<Array<HapModuleInfo>>
try
{
usageStatistics
.
queryModuleUsageRecords
((
err
,
res
)
=>
{
if
(
err
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords callback failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords callback failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
}
else
{
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords callback succeeded.
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
...
...
@@ -786,7 +786,7 @@ queryModuleUsageRecords(maxNum: number): Promise<Array<HapModuleInfo>&g
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords promise result
'
+
JSON
.
stringify
(
res
[
i
]));
}
}).
catch
(
err
=>
{
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords promise failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -831,7 +831,7 @@ queryModuleUsageRecords(maxNum: number, callback: AsyncCallback<Array<HapM
try
{
usageStatistics
.
queryModuleUsageRecords
(
1000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords callback failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords callback failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
}
else
{
console
.
log
(
'
BUNDLE_ACTIVE queryModuleUsageRecords callback succeeded.
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
...
...
@@ -892,7 +892,7 @@ queryAppGroup(bundleName : string): Promise<number>
usageStatistics
.
queryAppGroup
(
bundleName
).
then
(
res
=>
{
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup promise succeeded. result:
'
+
JSON
.
stringify
(
res
));
}).
catch
(
err
=>
{
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup promise failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -939,7 +939,7 @@ queryAppGroup(bundleName : string, callback: AsyncCallback<number>): void
try
{
usageStatistics
.
queryAppGroup
(
bundleName
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup callback failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup callback failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
}
else
{
console
.
log
(
'
BUNDLE_ACTIVE queryAppGroup callback succeeded. result:
'
+
JSON
.
stringify
(
res
));
}
...
...
@@ -998,7 +998,7 @@ setAppGroup(bundleName: string, newGroup: GroupType): Promise<void>
usageStatistics
.
setAppGroup
(
bundleName
,
newGroup
).
then
(
()
=>
{
console
.
log
(
'
BUNDLE_ACTIVE setAppGroup promise succeeded.
'
);
}).
catch
(
err
=>
{
console
.
log
(
'
BUNDLE_ACTIVE setAppGroup promise failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE setAppGroup promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE setAppGroup throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -1047,7 +1047,7 @@ setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback<
try
{
usageStatistics
.
setAppGroup
(
bundleName
,
newGroup
,
(
err
)
=>
{
if
(
err
)
{
console
.
log
(
'
BUNDLE_ACTIVE setAppGroup callback failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE setAppGroup callback failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
}
else
{
console
.
log
(
'
BUNDLE_ACTIVE setAppGroup callback succeeded.
'
);
}
...
...
@@ -1108,7 +1108,7 @@ registerAppGroupCallBack(groupCallback: Callback<AppGroupCallbackInfo>): P
usageStatistics
.
registerAppGroupCallBack
(
onBundleGroupChanged
).
then
(
()
=>
{
console
.
log
(
'
BUNDLE_ACTIVE registerAppGroupCallBack promise succeeded.
'
);
}).
catch
(
err
=>
{
console
.
log
(
'
BUNDLE_ACTIVE registerAppGroupCallBack promise failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE registerAppGroupCallBack promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE registerAppGroupCallBack throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -1161,7 +1161,7 @@ registerAppGroupCallBack(groupCallback: Callback<AppGroupCallbackInfo>, ca
try
{
usageStatistics
.
registerAppGroupCallBack
(
onBundleGroupChanged
,
error
=>
{
if
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE registerAppGroupCallBack callback failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE registerAppGroupCallBack callback failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
}
else
{
console
.
log
(
'
BUNDLE_ACTIVE registerAppGroupCallBack callback success.
'
);
}
...
...
@@ -1210,7 +1210,7 @@ unregisterAppGroupCallBack(): Promise<void>
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
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE unregisterAppGroupCallBack promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE unregisterAppGroupCallBack throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -1253,7 +1253,7 @@ unregisterAppGroupCallBack(callback: AsyncCallback<void>): void;
try
{
usageStatistics
.
unregisterAppGroupCallBack
(
error
=>
{
if
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE unregisterAppGroupCallBack callback failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE unregisterAppGroupCallBack callback failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
}
else
{
console
.
log
(
'
BUNDLE_ACTIVE unregisterAppGroupCallBack callback success.
'
);
}
...
...
@@ -1309,7 +1309,7 @@ queryDeviceEventStats(begin: number, end: number): Promise<Array<DeviceEve
console
.
log
(
'
BUNDLE_ACTIVE queryDeviceEventStates promise success.
'
);
console
.
log
(
'
BUNDLE_ACTIVE queryDeviceEventStates promise result
'
+
JSON
.
stringify
(
res
));
}).
catch
(
err
=>
{
console
.
log
(
'
BUNDLE_ACTIVE queryDeviceEventStats promise failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryDeviceEventStats promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryDeviceEventStats throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -1355,7 +1355,7 @@ queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback<Arr
try
{
usageStatistics
.
queryDeviceEventStats
(
0
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryDeviceEventStats callback failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryDeviceEventStats callback failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
}
else
{
console
.
log
(
'
BUNDLE_ACTIVE queryDeviceEventStats callback success.
'
);
console
.
log
(
'
BUNDLE_ACTIVE queryDeviceEventStats callback result
'
+
JSON
.
stringify
(
res
));
...
...
@@ -1412,7 +1412,7 @@ queryNotificationEventStats(begin: number, end: number): Promise<Array<Dev
console
.
log
(
'
BUNDLE_ACTIVE queryNotificationEventStats promise success.
'
);
console
.
log
(
'
BUNDLE_ACTIVE queryNotificationEventStats promise result
'
+
JSON
.
stringify
(
res
));
}).
catch
(
err
=>
{
console
.
log
(
'
BUNDLE_ACTIVE queryNotificationEventStats promise failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryNotificationEventStats promise failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
});
}
catch
(
error
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryNotificationEventStats throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
...
...
@@ -1458,7 +1458,7 @@ queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback&
try
{
usageStatistics
.
queryNotificationEventStats
(
0
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
log
(
'
BUNDLE_ACTIVE queryNotificationEventStats callback failed.
errCode is:
'
+
err
.
errCode
+
'
,message is:
'
+
err
.
errM
essage
);
console
.
log
(
'
BUNDLE_ACTIVE queryNotificationEventStats callback failed.
code is:
'
+
err
.
code
+
'
,message is:
'
+
err
.
m
essage
);
}
else
{
console
.
log
(
'
BUNDLE_ACTIVE queryNotificationEventStats callback success.
'
);
console
.
log
(
'
BUNDLE_ACTIVE queryNotificationEventStats callback result
'
+
JSON
.
stringify
(
res
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录