Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
18896d19
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
18896d19
编写于
1月 10, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 10, 2023
浏览文件
操作
浏览文件
下载
差异文件
!13415 统一打印格式
Merge pull request !13415 from 耿文广/monthly_20221018
上级
c8911e98
fc3301e7
变更
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
浏览文件 @
18896d19
...
...
@@ -216,11 +216,11 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try
{
bundleManager
.
getBundleInfoForSelf
(
bundleFlags
).
then
((
data
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf successfully. Data: %{public}s
'
,
JSON
.
stringify
(
data
));
}).
catch
(
err
or
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed. Cause: %{public}s
'
,
err
or
.
message
);
}).
catch
(
err
=>
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed. Cause: %{public}s
'
,
err
.
message
);
});
}
catch
(
err
or
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed: %{public}s
'
,
err
or
.
message
);
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed: %{public}s
'
,
err
.
message
);
}
```
...
...
@@ -249,13 +249,13 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try
{
bundleManager
.
getBundleInfoForSelf
(
bundleFlags
,
(
err
,
data
)
=>
{
if
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed: %{public}s
'
,
err
or
.
message
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf failed: %{public}s
'
,
err
.
message
);
}
else
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
getBundleInfoForSelf successfully: %{public}s
'
,
JSON
.
stringify
(
data
));
}
});
}
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;
try
{
bundleManager
.
getBundleInfo
(
bundleName
,
bundleFlags
,
userId
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -458,10 +458,10 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try
{
bundleManager
.
getBundleInfo
(
bundleName
,
bundleFlags
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
...
...
@@ -625,10 +625,10 @@ let userId = 100;
try
{
bundleManager
.
getApplicationInfo
(
bundleName
,
appFlags
,
userId
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getApplicationInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -772,10 +772,10 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try
{
bundleManager
.
getAllBundleInfo
(
bundleFlags
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAllBundleInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -919,10 +919,10 @@ let appFlags = bundleManager.ApplicationFlag.GET_APPLICATION_INFO_DEFAULT;
try
{
bundleManager
.
getAllApplicationInfo
(
appFlags
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAllApplicationInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
...
...
@@ -1095,10 +1095,10 @@ let want = {
try
{
bundleManager
.
queryAbilityInfo
(
want
,
abilityFlags
,
userId
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -1115,10 +1115,10 @@ let want = {
try
{
bundleManager
.
queryAbilityInfo
(
want
,
abilityFlags
).
then
((
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
);
})
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -1294,10 +1294,10 @@ let want = {
try
{
bundleManager
.
queryExtensionAbilityInfo
(
want
,
extensionAbilityType
,
extensionFlags
,
userId
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -1315,10 +1315,10 @@ let want = {
try
{
bundleManager
.
queryExtensionAbilityInfo
(
want
,
extensionAbilityType
,
extensionFlags
).
then
((
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
);
})
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryExtensionAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -1410,10 +1410,10 @@ let uid = 20010005;
try
{
bundleManager
.
getBundleNameByUid
(
uid
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleNameByUid failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -1511,10 +1511,10 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try
{
bundleManager
.
getBundleArchiveInfo
(
hapFilePath
,
bundleFlags
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getBundleArchiveInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -1771,10 +1771,10 @@ try {
hilog
.
info
(
0x0001
,
"
testTag
"
,
"
setAbilityEnabled successfully.
"
);
}
});
}).
catch
(
err
or
=>
{
}).
catch
(
err
=>
{
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
);
}
```
...
...
@@ -1836,10 +1836,10 @@ try {
}).
catch
(
err
=>
{
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -1929,10 +1929,10 @@ let bundleName = 'com.example.myapplication';
try
{
bundleManager
.
isApplicationEnabled
(
bundleName
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
isApplicationEnabled failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -1988,10 +1988,10 @@ try {
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -2050,10 +2050,10 @@ try {
}).
catch
(
err
=>
{
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
queryAbilityInfo failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -2204,10 +2204,10 @@ let userId = 100;
try
{
bundleManager
.
getLaunchWantForBundle
(
bundleName
,
userId
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getLaunchWantForBundle failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -2308,10 +2308,10 @@ let abilityName = 'MainAbility';
try
{
bundleManager
.
getProfileByAbility
(
moduleName
,
abilityName
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -2325,10 +2325,10 @@ let metadataName = 'com.example.myapplication.metadata';
try
{
bundleManager
.
getProfileByAbility
(
moduleName
,
abilityName
,
metadataName
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByAbility failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -2428,20 +2428,20 @@ let metadataName = 'com.example.myapplication.metadata';
try
{
bundleManager
.
getProfileByExtensionAbility
(
moduleName
,
extensionAbilityName
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility failed. Cause: %{public}s
'
+
err
.
message
);
}
try
{
bundleManager
.
getProfileByExtensionAbility
(
moduleName
,
extensionAbilityName
,
metadataName
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getProfileByExtensionAbility failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -2533,10 +2533,10 @@ let permissionName = "ohos.permission.GET_BUNDLE_INFO";
try
{
bundleManager
.
getPermissionDef
(
permissionName
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getPermissionDef failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -2646,10 +2646,10 @@ let abilityName = 'MainAbility';
try
{
bundleManager
.
getAbilityLabel
(
bundleName
,
moduleName
,
abilityName
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
getAbilityLabel failed. Cause: %{public}s
'
+
err
.
message
);
}
```
...
...
@@ -2759,10 +2759,10 @@ let abilityName = 'MainAbility';
try
{
bundleManager
.
getAbilityIcon
(
bundleName
,
moduleName
,
abilityName
).
then
((
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
);
});
}
catch
(
err
or
)
{
}
catch
(
err
)
{
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录