Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
7119feaa
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看板
提交
7119feaa
编写于
1月 10, 2023
作者:
G
geng-wenguang
提交者:
耿文广
1月 10, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed
fc3301e7
from
https://gitee.com/geng-wenguang/docs/pulls/13415
同一打印格式 Signed-off-by:
N
geng-wenguang
<
gengwenguang@huawei.com
>
上级
299b725a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
54 addition
and
54 deletion
+54
-54
zh-cn/application-dev/reference/apis/js-apis-bundleManager.md
...n/application-dev/reference/apis/js-apis-bundleManager.md
+54
-54
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-bundleManager.md
浏览文件 @
7119feaa
...
@@ -216,11 +216,11 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
...
@@ -216,11 +216,11 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try
{
try
{
bundleManager
.
getBundleInfoForSelf
(
bundleFlags
).
then
((
data
)
=>
{
bundleManager
.
getBundleInfoForSelf
(
bundleFlags
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf successfully. Data: %{public}s
'
,
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf successfully. Data: %{public}s
'
,
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed. Cause: %{public}s
'
,
err
or
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed. Cause: %{public}s
'
,
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed: %{public}s
'
,
err
or
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed: %{public}s
'
,
err
.
message
);
}
}
```
```
...
@@ -249,13 +249,13 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
...
@@ -249,13 +249,13 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try
{
try
{
bundleManager
.
getBundleInfoForSelf
(
bundleFlags
,
(
err
,
data
)
=>
{
bundleManager
.
getBundleInfoForSelf
(
bundleFlags
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed: %{public}s
'
,
err
or
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed: %{public}s
'
,
err
.
message
);
}
else
{
}
else
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf successfully: %{public}s
'
,
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf successfully: %{public}s
'
,
JSON
.
stringify
(
data
));
}
}
});
});
}
catch
(
err
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed: %{public}s
'
,
err
or
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed: %{public}s
'
,
err
.
message
);
}
}
```
```
...
@@ -441,10 +441,10 @@ let userId = 100;
...
@@ -441,10 +441,10 @@ let userId = 100;
try
{
try
{
bundleManager
.
getBundleInfo
(
bundleName
,
bundleFlags
,
userId
).
then
((
data
)
=>
{
bundleManager
.
getBundleInfo
(
bundleName
,
bundleFlags
,
userId
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -458,10 +458,10 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
...
@@ -458,10 +458,10 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try
{
try
{
bundleManager
.
getBundleInfo
(
bundleName
,
bundleFlags
).
then
((
data
)
=>
{
bundleManager
.
getBundleInfo
(
bundleName
,
bundleFlags
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
...
@@ -625,10 +625,10 @@ let userId = 100;
...
@@ -625,10 +625,10 @@ let userId = 100;
try
{
try
{
bundleManager
.
getApplicationInfo
(
bundleName
,
appFlags
,
userId
).
then
((
data
)
=>
{
bundleManager
.
getApplicationInfo
(
bundleName
,
appFlags
,
userId
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getApplicationInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getApplicationInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getApplicationInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getApplicationInfo failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getApplicationInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getApplicationInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -772,10 +772,10 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
...
@@ -772,10 +772,10 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try
{
try
{
bundleManager
.
getAllBundleInfo
(
bundleFlags
).
then
((
data
)
=>
{
bundleManager
.
getAllBundleInfo
(
bundleFlags
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getAllBundleInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getAllBundleInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAllBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAllBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAllBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAllBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -919,10 +919,10 @@ let appFlags = bundleManager.ApplicationFlag.GET_APPLICATION_INFO_DEFAULT;
...
@@ -919,10 +919,10 @@ let appFlags = bundleManager.ApplicationFlag.GET_APPLICATION_INFO_DEFAULT;
try
{
try
{
bundleManager
.
getAllApplicationInfo
(
appFlags
).
then
((
data
)
=>
{
bundleManager
.
getAllApplicationInfo
(
appFlags
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getAllApplicationInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getAllApplicationInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAllApplicationInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAllApplicationInfo failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAllApplicationInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAllApplicationInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
...
@@ -1095,10 +1095,10 @@ let want = {
...
@@ -1095,10 +1095,10 @@ let want = {
try
{
try
{
bundleManager
.
queryAbilityInfo
(
want
,
abilityFlags
,
userId
).
then
((
data
)
=>
{
bundleManager
.
queryAbilityInfo
(
want
,
abilityFlags
,
userId
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -1115,10 +1115,10 @@ let want = {
...
@@ -1115,10 +1115,10 @@ let want = {
try
{
try
{
bundleManager
.
queryAbilityInfo
(
want
,
abilityFlags
).
then
((
data
)
=>
{
bundleManager
.
queryAbilityInfo
(
want
,
abilityFlags
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
})
})
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -1294,10 +1294,10 @@ let want = {
...
@@ -1294,10 +1294,10 @@ let want = {
try
{
try
{
bundleManager
.
queryExtensionAbilityInfo
(
want
,
extensionAbilityType
,
extensionFlags
,
userId
).
then
((
data
)
=>
{
bundleManager
.
queryExtensionAbilityInfo
(
want
,
extensionAbilityType
,
extensionFlags
,
userId
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -1315,10 +1315,10 @@ let want = {
...
@@ -1315,10 +1315,10 @@ let want = {
try
{
try
{
bundleManager
.
queryExtensionAbilityInfo
(
want
,
extensionAbilityType
,
extensionFlags
).
then
((
data
)
=>
{
bundleManager
.
queryExtensionAbilityInfo
(
want
,
extensionAbilityType
,
extensionFlags
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
})
})
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -1410,10 +1410,10 @@ let uid = 20010005;
...
@@ -1410,10 +1410,10 @@ let uid = 20010005;
try
{
try
{
bundleManager
.
getBundleNameByUid
(
uid
).
then
((
data
)
=>
{
bundleManager
.
getBundleNameByUid
(
uid
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleNameByUid successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleNameByUid successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleNameByUid failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleNameByUid failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleNameByUid failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleNameByUid failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -1511,10 +1511,10 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
...
@@ -1511,10 +1511,10 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try
{
try
{
bundleManager
.
getBundleArchiveInfo
(
hapFilePath
,
bundleFlags
).
then
((
data
)
=>
{
bundleManager
.
getBundleArchiveInfo
(
hapFilePath
,
bundleFlags
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleArchiveInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleArchiveInfo successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleArchiveInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleArchiveInfo failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleArchiveInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleArchiveInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -1771,10 +1771,10 @@ try {
...
@@ -1771,10 +1771,10 @@ try {
hilog
.
info
(
0x0001
,
"
testTag
"
,
"
setAbilityEnabled successfully.
"
);
hilog
.
info
(
0x0001
,
"
testTag
"
,
"
setAbilityEnabled successfully.
"
);
}
}
});
});
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -1836,10 +1836,10 @@ try {
...
@@ -1836,10 +1836,10 @@ try {
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
setAbilityEnabled failed: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
setAbilityEnabled failed: %{public}s
'
+
err
.
message
);
});
});
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -1929,10 +1929,10 @@ let bundleName = 'com.example.myapplication';
...
@@ -1929,10 +1929,10 @@ let bundleName = 'com.example.myapplication';
try
{
try
{
bundleManager
.
isApplicationEnabled
(
bundleName
).
then
((
data
)
=>
{
bundleManager
.
isApplicationEnabled
(
bundleName
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
isApplicationEnabled successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
isApplicationEnabled successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
isApplicationEnabled failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
isApplicationEnabled failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
isApplicationEnabled failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
isApplicationEnabled failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -1988,10 +1988,10 @@ try {
...
@@ -1988,10 +1988,10 @@ try {
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
isAbilityEnabled successfully: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
isAbilityEnabled successfully: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}
}
});
});
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -2050,10 +2050,10 @@ try {
...
@@ -2050,10 +2050,10 @@ try {
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
isAbilityEnabled failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
isAbilityEnabled failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -2204,10 +2204,10 @@ let userId = 100;
...
@@ -2204,10 +2204,10 @@ let userId = 100;
try
{
try
{
bundleManager
.
getLaunchWantForBundle
(
bundleName
,
userId
).
then
((
data
)
=>
{
bundleManager
.
getLaunchWantForBundle
(
bundleName
,
userId
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getLaunchWantForBundle successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getLaunchWantForBundle successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getLaunchWantForBundle failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getLaunchWantForBundle failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getLaunchWantForBundle failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getLaunchWantForBundle failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -2308,10 +2308,10 @@ let abilityName = 'MainAbility';
...
@@ -2308,10 +2308,10 @@ let abilityName = 'MainAbility';
try
{
try
{
bundleManager
.
getProfileByAbility
(
moduleName
,
abilityName
).
then
((
data
)
=>
{
bundleManager
.
getProfileByAbility
(
moduleName
,
abilityName
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -2325,10 +2325,10 @@ let metadataName = 'com.example.myapplication.metadata';
...
@@ -2325,10 +2325,10 @@ let metadataName = 'com.example.myapplication.metadata';
try
{
try
{
bundleManager
.
getProfileByAbility
(
moduleName
,
abilityName
,
metadataName
).
then
((
data
)
=>
{
bundleManager
.
getProfileByAbility
(
moduleName
,
abilityName
,
metadataName
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -2428,20 +2428,20 @@ let metadataName = 'com.example.myapplication.metadata';
...
@@ -2428,20 +2428,20 @@ let metadataName = 'com.example.myapplication.metadata';
try
{
try
{
bundleManager
.
getProfileByExtensionAbility
(
moduleName
,
extensionAbilityName
).
then
((
data
)
=>
{
bundleManager
.
getProfileByExtensionAbility
(
moduleName
,
extensionAbilityName
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility failed. Cause: %{public}s
'
+
err
.
message
);
}
}
try
{
try
{
bundleManager
.
getProfileByExtensionAbility
(
moduleName
,
extensionAbilityName
,
metadataName
).
then
((
data
)
=>
{
bundleManager
.
getProfileByExtensionAbility
(
moduleName
,
extensionAbilityName
,
metadataName
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -2533,10 +2533,10 @@ let permissionName = "ohos.permission.GET_BUNDLE_INFO";
...
@@ -2533,10 +2533,10 @@ let permissionName = "ohos.permission.GET_BUNDLE_INFO";
try
{
try
{
bundleManager
.
getPermissionDef
(
permissionName
).
then
((
data
)
=>
{
bundleManager
.
getPermissionDef
(
permissionName
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getPermissionDef successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getPermissionDef successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getPermissionDef failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getPermissionDef failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getPermissionDef failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getPermissionDef failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -2646,10 +2646,10 @@ let abilityName = 'MainAbility';
...
@@ -2646,10 +2646,10 @@ let abilityName = 'MainAbility';
try
{
try
{
bundleManager
.
getAbilityLabel
(
bundleName
,
moduleName
,
abilityName
).
then
((
data
)
=>
{
bundleManager
.
getAbilityLabel
(
bundleName
,
moduleName
,
abilityName
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getAbilityLabel successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getAbilityLabel successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAbilityLabel failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAbilityLabel failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAbilityLabel failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAbilityLabel failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
@@ -2759,10 +2759,10 @@ let abilityName = 'MainAbility';
...
@@ -2759,10 +2759,10 @@ let abilityName = 'MainAbility';
try
{
try
{
bundleManager
.
getAbilityIcon
(
bundleName
,
moduleName
,
abilityName
).
then
((
data
)
=>
{
bundleManager
.
getAbilityIcon
(
bundleName
,
moduleName
,
abilityName
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getAbilityIcon successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getAbilityIcon successfully. Data: %{public}s
'
,
+
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAbilityIcon failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAbilityIcon failed. Cause: %{public}s
'
+
err
.
message
);
});
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAbilityIcon failed. Cause: %{public}s
'
+
err
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAbilityIcon failed. Cause: %{public}s
'
+
err
.
message
);
}
}
```
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录