Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
c19ab5a2
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,发现更多精彩内容 >>
未验证
提交
c19ab5a2
编写于
5月 27, 2022
作者:
O
openharmony_ci
提交者:
Gitee
5月 27, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4443 Fix docunment error of ability
Merge pull request !4443 from yuyaozhi/master
上级
d3a38290
3e41566d
变更
21
显示空白变更内容
内联
并排
Showing
21 changed file
with
121 addition
and
38 deletion
+121
-38
zh-cn/application-dev/reference/apis/js-apis-Context.md
zh-cn/application-dev/reference/apis/js-apis-Context.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-DataUriUtils.md
zh-cn/application-dev/reference/apis/js-apis-DataUriUtils.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-ability-context.md
...application-dev/reference/apis/js-apis-ability-context.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
...plication-dev/reference/apis/js-apis-abilityAccessCtrl.md
+3
-1
zh-cn/application-dev/reference/apis/js-apis-abilityrunninginfo.md
...lication-dev/reference/apis/js-apis-abilityrunninginfo.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-abilitystagecontext.md
...ication-dev/reference/apis/js-apis-abilitystagecontext.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-application-MissionSnapshot.md
...dev/reference/apis/js-apis-application-MissionSnapshot.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md
...ev/reference/apis/js-apis-application-abilityDelegator.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegatorArgs.md
...eference/apis/js-apis-application-abilityDelegatorArgs.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-application-context.md
...ication-dev/reference/apis/js-apis-application-context.md
+0
-4
zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md
...-dev/reference/apis/js-apis-application-shellCmdResult.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-appmanager.md
zh-cn/application-dev/reference/apis/js-apis-appmanager.md
+3
-3
zh-cn/application-dev/reference/apis/js-apis-eventhub.md
zh-cn/application-dev/reference/apis/js-apis-eventhub.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-extension-context.md
...plication-dev/reference/apis/js-apis-extension-context.md
+4
-5
zh-cn/application-dev/reference/apis/js-apis-extensionrunninginfo.md
...cation-dev/reference/apis/js-apis-extensionrunninginfo.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-formextensioncontext.md
...cation-dev/reference/apis/js-apis-formextensioncontext.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-missionManager.md
.../application-dev/reference/apis/js-apis-missionManager.md
+5
-1
zh-cn/application-dev/reference/apis/js-apis-particleAbility.md
...application-dev/reference/apis/js-apis-particleAbility.md
+6
-6
zh-cn/application-dev/reference/apis/js-apis-permissionrequestresult.md
...ion-dev/reference/apis/js-apis-permissionrequestresult.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-uripermissionmanager.md
...cation-dev/reference/apis/js-apis-uripermissionmanager.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-wantAgent.md
zh-cn/application-dev/reference/apis/js-apis-wantAgent.md
+86
-4
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-Context.md
浏览文件 @
c19ab5a2
...
...
@@ -6,7 +6,7 @@
## 导入模块
```
js
import
Context
from
"
@ohos.app.context
"
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
```
## 使用说明
...
...
zh-cn/application-dev/reference/apis/js-apis-DataUriUtils.md
浏览文件 @
c19ab5a2
...
...
@@ -32,7 +32,7 @@ getId(uri: string): number
**示例:**
```
js
dataUriUtils
.
getId
Sync
(
"
com.example.dataUriUtils/1221
"
)
dataUriUtils
.
getId
(
"
com.example.dataUriUtils/1221
"
)
```
...
...
zh-cn/application-dev/reference/apis/js-apis-ability-context.md
浏览文件 @
c19ab5a2
...
...
@@ -8,7 +8,7 @@ Ability的上下文环境,继承自Context。
## 导入模块
```
js
import
Ability
Context
from
'
@ohos.application.abilityContext
'
import
Ability
from
'
@ohos.application.Ability
'
```
## 使用说明
...
...
zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
浏览文件 @
c19ab5a2
...
...
@@ -95,7 +95,8 @@ grantUserGrantedPermission(tokenID: number, permissionName: string, permissionFl
```
js
var
AtManager
=
abilityAccessCtrl
.
createAtManager
();
let
tokenID
=
0
;
let
promise
=
AtManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.GRANT_SENSITIVE_PERMISSIONS
"
);
let
permissionFlag
=
1
;
let
promise
=
AtManager
.
grantUserGrantedPermission
(
tokenID
,
"
ohos.permission.GRANT_SENSITIVE_PERMISSIONS
"
,
permissionFlag
);
promise
.
then
(
data
=>
{
console
.
log
(
`promise: data->
${
JSON
.
stringify
(
data
)}
`
);
});
...
...
@@ -193,6 +194,7 @@ revokeUserGrantedPermission(tokenID: number, permissionName: string, permissionF
```
js
var
AtManager
=
abilityAccessCtrl
.
createAtManager
();
let
tokenID
=
0
;
let
permissionFlag
=
1
;
AtManager
.
revokeUserGrantedPermission
(
tokenID
,
"
ohos.permission.GRANT_SENSITIVE_PERMISSIONS
"
,
permissionFlag
,
data
=>
{
console
.
log
(
`callback: data->
${
JSON
.
stringify
(
data
)}
`
);
});
...
...
zh-cn/application-dev/reference/apis/js-apis-abilityrunninginfo.md
浏览文件 @
c19ab5a2
...
...
@@ -9,7 +9,7 @@ Ability运行相关信息。
## 导入模块
```
js
import
AbilityRunningInfo
from
'
@ohos.application.abilityRunningInfo
'
;
import
abilitymanager
from
'
@ohos.application.abilityManager
'
;
```
## 使用说明
...
...
zh-cn/application-dev/reference/apis/js-apis-abilitystagecontext.md
浏览文件 @
c19ab5a2
...
...
@@ -9,7 +9,7 @@ AbilityStage的上下文环境,继承自[Context](js-apis-application-context.
## 导入模块
```
js
import
AbilityStage
Context
from
'
@ohos.application.abilityStageContext
'
;
import
AbilityStage
from
'
@ohos.application.AbilityStage
'
;
```
## 使用说明
...
...
zh-cn/application-dev/reference/apis/js-apis-application-MissionSnapshot.md
浏览文件 @
c19ab5a2
...
...
@@ -11,7 +11,7 @@
## 导入模块
```
import
MissionSnapshot from "@ohos.application.missionSnapshot"
;
import
abilitymanager from '@ohos.application.abilityManager'
;
```
## 使用说明
...
...
zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md
浏览文件 @
c19ab5a2
...
...
@@ -7,7 +7,7 @@
## 导入模块
```
js
import
AbilityDelegator
from
'
@ohos.application.abilityDelegator
'
import
AbilityDelegator
Registry
from
'
@ohos.application.abilityDelegatorRegistry
'
```
...
...
zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegatorArgs.md
浏览文件 @
c19ab5a2
...
...
@@ -7,7 +7,7 @@
## 导入模块
```
js
import
AbilityDelegator
Args
from
'
@ohos.application.abilityDelegatorArgs
'
import
AbilityDelegator
Registry
from
'
@ohos.application.abilityDelegatorRegistry
'
```
...
...
zh-cn/application-dev/reference/apis/js-apis-application-context.md
浏览文件 @
c19ab5a2
...
...
@@ -6,11 +6,7 @@
提供开发者运行代码的上下文环境,包括应用信息、ResourceManager等信息。
## 导入模块
```
js
import
Context
from
"
@ohos.application.context
"
;
```
## 使用说明
...
...
zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md
浏览文件 @
c19ab5a2
...
...
@@ -7,7 +7,7 @@
## 导入模块
```
js
import
ShellCmdResult
from
'
@ohos.application.shellCmdResult
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
```
...
...
zh-cn/application-dev/reference/apis/js-apis-appmanager.md
浏览文件 @
c19ab5a2
...
...
@@ -34,7 +34,7 @@ static isRunningInStabilityTest(callback: AsyncCallback<boolean>): void
```
js
import
app
from
'
@ohos.application.appManager
'
;
app
.
isRunningInStabilityTest
((
err
,
flag
)
=>
{
console
.
log
(
'
startAbility result:
'
+
JSON
.
stringfy
(
err
));
console
.
log
(
'
startAbility result:
'
+
JSON
.
string
i
fy
(
err
));
})
```
...
...
@@ -58,9 +58,9 @@ static isRunningInStabilityTest(): Promise<boolean>
```
js
import
app
from
'
@ohos.application.appManager
'
;
app
.
isRunningInStabilityTest
().
then
((
flag
)
=>
{
console
.
log
(
'
success:
'
+
JSON
.
stringfy
(
flag
));
console
.
log
(
'
success:
'
+
JSON
.
string
i
fy
(
flag
));
}).
catch
((
error
)
=>
{
console
.
log
(
'
failed:
'
+
JSON
.
stringfy
(
error
));
console
.
log
(
'
failed:
'
+
JSON
.
string
i
fy
(
error
));
});
```
...
...
zh-cn/application-dev/reference/apis/js-apis-eventhub.md
浏览文件 @
c19ab5a2
...
...
@@ -9,7 +9,7 @@
## 导入模块
```
js
import
EventHub
from
"
@ohos.application.eventHub
"
;
import
Ability
from
'
@ohos.application.Ability
'
```
## 使用说明
...
...
zh-cn/application-dev/reference/apis/js-apis-extension-context.md
浏览文件 @
c19ab5a2
...
...
@@ -3,14 +3,13 @@
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
```
js
import
DataShareExtensionAbility
from
'
@ohos.application.DataShareExtensionAbility
'
;
```
Extension的上下文环境,继承自Context。
## 导入模块
Extension的上下文环境,继承自Context。
```
js
import
ExtensionContext
from
"
@ohos.application.extensionContext
"
;
```
## 属性
...
...
zh-cn/application-dev/reference/apis/js-apis-extensionrunninginfo.md
浏览文件 @
c19ab5a2
...
...
@@ -9,7 +9,7 @@ Extension运行相关信息。
## 导入模块
```
js
import
ExtensionRunningInfo
from
"
@ohos.application.extensionRunningInfo
"
;
import
abilitymanager
from
'
@ohos.application.abilityManager
'
;
```
## 使用说明
...
...
zh-cn/application-dev/reference/apis/js-apis-formextensioncontext.md
浏览文件 @
c19ab5a2
...
...
@@ -8,7 +8,7 @@ FormExtension的上下文环境,提供FormExtension具有的能力和接口,
## 导入模块
```
js
import
FormExtension
Context
from
'
@ohos.application.formExtensionContext
'
;
import
FormExtension
from
'
@ohos.application.FormExtension
'
;
```
## FormExtensionContext.updateForm
...
...
zh-cn/application-dev/reference/apis/js-apis-missionManager.md
浏览文件 @
c19ab5a2
...
...
@@ -15,6 +15,9 @@ missionManager模块提供系统任务管理能力,开发者可以对系统任
import missionManager from '@ohos.application.missionManager'
```
## 权限列表
ohos.permission.MANAGE_MISSIONS
## missionManager.registerMissionListener
...
...
@@ -143,6 +146,7 @@ getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback<M
```
js
import
missionManager
from
'
@ohos.application.missionManager
'
var
allMissions
=
missionManager
.
getMissionInfos
(
""
,
10
).
catch
(
function
(
err
){
console
.
log
(
err
);});
missionManager
.
getMissionInfo
(
""
,
allMissions
[
0
].
missionId
,
(
error
,
mission
)
=>
{
console
.
log
(
"
getMissionInfo is called, error.code =
"
+
error
.
code
)
console
.
log
(
"
mission.missionId =
"
+
mission
.
missionId
);
...
...
@@ -181,7 +185,7 @@ getMissionInfo(deviceId: string, missionId: number): Promise<MissionInfo>;
```
js
import
missionManager
from
'
@ohos.application.missionManager
'
var
mission
=
missionManager
.
getMissionInfo
(
""
,
id
).
catch
(
function
(
err
){
var
mission
=
missionManager
.
getMissionInfo
(
""
,
10
).
catch
(
function
(
err
){
console
.
log
(
err
);
});
```
...
...
zh-cn/application-dev/reference/apis/js-apis-particleAbility.md
浏览文件 @
c19ab5a2
...
...
@@ -226,7 +226,7 @@ let wantAgentInfo = {
],
operationType
:
wantAgent
.
OperationType
.
START_ABILITY
,
requestCode
:
0
,
wantAgentFlags
:
[
wantAgent
.
WantAgentFlags
.
UPDATE_PRESET_FLAG
]
wantAgentFlags
:
[
wantAgent
.
WantAgentFlags
.
UPDATE_PRESE
N
T_FLAG
]
};
wantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
wantAgentObj
)
=>
{
...
...
@@ -235,11 +235,11 @@ wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => {
text
:
"
text
"
};
let
notificationContent
=
{
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_TEXT
,
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_
BASIC_
TEXT
,
normal
:
basicContent
};
let
request
=
{
content
:
notificatonContent
,
content
:
notificat
i
onContent
,
wantAgent
:
wantAgentObj
};
let
id
=
1
;
...
...
@@ -287,7 +287,7 @@ let wantAgentInfo = {
],
operationType
:
wantAgent
.
OperationType
.
START_ABILITY
,
requestCode
:
0
,
wantAgentFlags
:
[
wantAgent
.
WantAgentFlags
.
UPDATE_PRESET_FLAG
]
wantAgentFlags
:
[
wantAgent
.
WantAgentFlags
.
UPDATE_PRESE
N
T_FLAG
]
};
wantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
wantAgentObj
)
=>
{
...
...
@@ -296,11 +296,11 @@ wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => {
text
:
"
text
"
};
let
notificationContent
=
{
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_TEXT
,
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_
BASIC_
TEXT
,
normal
:
basicContent
};
let
request
=
{
content
:
notificatonContent
,
content
:
notificat
i
onContent
,
wantAgent
:
wantAgentObj
};
let
id
=
1
;
...
...
zh-cn/application-dev/reference/apis/js-apis-permissionrequestresult.md
浏览文件 @
c19ab5a2
...
...
@@ -9,7 +9,7 @@
## 导入模块
```
js
import
PermissionRequestResult
from
'
@ohos.application.permissionRequestResult
'
import
Ability
from
'
@ohos.application.Ability
'
```
## 属性
...
...
zh-cn/application-dev/reference/apis/js-apis-uripermissionmanager.md
浏览文件 @
c19ab5a2
...
...
@@ -11,7 +11,7 @@ Uri权限管理。
```
import
u
riPermissionManager from '@ohos.application.uriPermissionManager';
import
U
riPermissionManager from '@ohos.application.uriPermissionManager';
```
...
...
zh-cn/application-dev/reference/apis/js-apis-wantAgent.md
浏览文件 @
c19ab5a2
...
...
@@ -919,7 +919,7 @@ WantAgent.equal(wantAgent1, wantAgent2).then((data) => {
getOperationType(agent: WantAgent, callback: AsyncCallback
\<
number>): void;
获取
WantAgent的操作类型
(callback形式)。
获取
一个WantAgent的OperationType信息
(callback形式)。
**系统能力**
:SystemCapability.Ability.AbilityRuntime.Core
...
...
@@ -928,19 +928,59 @@ getOperationType(agent: WantAgent, callback: AsyncCallback\<number>): void;
| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 |
| ---------- | --- | ---- | ------------------------ | ---- | --------------------------------------- |
| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 |
| callback | 是 | 否 | AsyncCallback
\<
number> | 是 | 获取
WantAgent的操作类型
。 |
| callback | 是 | 否 | AsyncCallback
\<
number> | 是 | 获取
一个WantAgent的OperationType信息的回调方法
。 |
**示例:**
```
js
import
WantAgent
from
'
@ohos.wantAgent
'
;
//wantAgent对象
var
wantAgent
;
//WantAgentInfo对象
var
wantAgentInfo
=
{
wants
:
[
{
deviceId
:
"
deviceId
"
,
bundleName
:
"
com.neu.setResultOnAbilityResultTest1
"
,
abilityName
:
"
com.example.test.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
parameters
:
{
mykey0
:
2222
,
mykey1
:
[
1
,
2
,
3
],
mykey2
:
"
[1, 2, 3]
"
,
mykey3
:
"
ssssssssssssssssssssssssss
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
qqqqq
"
,
"
wwwwww
"
,
"
aaaaaaaaaaaaaaaaa
"
],
mykey6
:
true
,
}
}
],
operationType
:
OperationType
.
START_ABILITIES
,
requestCode
:
0
,
wantAgentFlags
:[
WantAgent
.
WantAgentFlags
.
UPDATE_PRESENT_FLAG
]
}
WantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
data
)
=>
{
console
.
info
(
"
==========================>getWantAgentCallback=======================>
"
);
wantAgent
=
data
;
});
WantAgent
.
getOperationType
(
wantAgent
,
(
OperationType
)
=>
{
console
.
log
(
'
----------- getOperationType ----------, OperationType:
'
+
OperationType
);
})
```
## WantAgent.getOperationType
getOperationType(agent: WantAgent): Promise
\<
number>;
获取
WantAgent的操作类型
(Promise形式)。
获取
一个WantAgent的OperationType信息
(Promise形式)。
**系统能力**
:SystemCapability.Ability.AbilityRuntime.Core
...
...
@@ -954,12 +994,54 @@ getOperationType(agent: WantAgent): Promise\<number>;
| 类型 | 说明 |
| ----------------------------------------------------------- | ------------------------------------------------------------ |
| Promise
\<
number> | 以Promise形式返回获取
WantAgent的操作类型
。 |
| Promise
\<
number> | 以Promise形式返回获取
optionType的结果
。 |
**示例:**
```
js
import
WantAgent
from
'
@ohos.wantAgent
'
;
//wantAgent对象
var
wantAgent
;
//WantAgentInfo对象
var
wantAgentInfo
=
{
wants
:
[
{
deviceId
:
"
deviceId
"
,
bundleName
:
"
com.neu.setResultOnAbilityResultTest1
"
,
abilityName
:
"
com.example.test.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
parameters
:
{
mykey0
:
2222
,
mykey1
:
[
1
,
2
,
3
],
mykey2
:
"
[1, 2, 3]
"
,
mykey3
:
"
ssssssssssssssssssssssssss
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
qqqqq
"
,
"
wwwwww
"
,
"
aaaaaaaaaaaaaaaaa
"
],
mykey6
:
true
,
}
}
],
operationType
:
OperationType
.
START_ABILITIES
,
requestCode
:
0
,
wantAgentFlags
:[
WantAgent
.
WantAgentFlags
.
UPDATE_PRESENT_FLAG
]
}
WantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
data
)
=>
{
console
.
info
(
"
==========================>getWantAgentCallback=======================>
"
);
wantAgent
=
data
;
});
WantAgent
.
getOperationType
(
wantAgent
).
then
((
OperationType
)
=>
{
console
.
log
(
'
getOperationType success, OperationType:
'
+
OperationType
);
}).
catch
((
err
)
=>
{
console
.
log
(
'
getOperationType fail, err:
'
+
err
);
})
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录