提交 ce46fe6e 编写于 作者: Y yuyaozhi

Fix sample code and document error of ability

Signed-off-by: Nyuyaozhi <yuyaozhi@huawei.com>
上级 4834da60
......@@ -362,10 +362,11 @@ setDisplayOrientation(orientation: bundle.DisplayOrientation, callback: AsyncCal
```js
import featureAbility from '@ohos.ability.featureAbility'
import bundle from '@ohos.bundle'
var context = featureAbility.getContext();
var orientation="UNSPECIFIED"
var orientation=bundle.DisplayOrientation.UNSPECIFIED
context.setDisplayOrientation(orientation, (err) => {
console.log('---------- setDisplayOrientation fail, err: -----------', err);
console.log('---------- setDisplayOrientation fail, err: -----------', err);
});
```
......@@ -388,8 +389,10 @@ setDisplayOrientation(orientation: bundle.DisplayOrientation): Promise\<void>;
```js
import featureAbility from '@ohos.ability.featureAbility'
import bundle from '@ohos.bundle'
var context = featureAbility.getContext();
context.setDisplayOrientation().then((data) => {
var orientation=bundle.DisplayOrientation.UNSPECIFIED
context.setDisplayOrientation(orientation).then((data) => {
console.info("=======================>setDisplayOrientationCallback====================>");
console.info("====>data====>" + JSON.stringify(data));
});
......@@ -446,7 +449,8 @@ setShowOnLockScreen(show: boolean): Promise\<void>;
```js
import featureAbility from '@ohos.ability.featureAbility'
var context = featureAbility.getContext();
context.setShowOnLockScreen().then((data) => {
var show=true
context.setShowOnLockScreen(show).then((data) => {
console.info("=======================>setShowOnLockScreenCallback====================>");
console.info("====>data====>" + JSON.stringify(data));
});
......@@ -473,7 +477,7 @@ setWakeUpScreen(wakeUp: boolean, callback: AsyncCallback\<void>): void
import featureAbility from '@ohos.ability.featureAbility'
var context = featureAbility.getContext();
var wakeUp=true
context.setWakeUpScreen(show, (err) => {
context.setWakeUpScreen(wakeUp, (err) => {
console.log('---------- setWakeUpScreen fail, err: -----------', err);
});
```
......@@ -503,7 +507,8 @@ setWakeUpScreen(wakeUp: boolean): Promise\<void>;
```js
import featureAbility from '@ohos.ability.featureAbility'
var context = featureAbility.getContext();
context.setWakeUpScreen().then((data) => {
var wakeUp=true
context.setWakeUpScreen(wakeUp).then((data) => {
console.info("=======================>setWakeUpScreenCallback====================>");
console.info("====>data====>" + JSON.stringify(data));
});
......@@ -1214,7 +1219,7 @@ context.printDrawnCompleted().then((data) => {
## PermissionOptions<sup>7+</sup>
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统能力**以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
| ---- | -------- | ------ | ---- | ------ |
......@@ -1223,7 +1228,7 @@ context.printDrawnCompleted().then((data) => {
## PermissionRequestResult<sup>7+</sup>
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统能力**以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
| ----------- | -------- | -------------- | ---- | ------------------ |
......@@ -1233,6 +1238,8 @@ context.printDrawnCompleted().then((data) => {
## AppVersionInfo<sup>7+</sup>
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ------ | ------ | ------| ------ | ------ |
| appName | string | 是 | 否 | 模块名称。 |
......
......@@ -7,7 +7,7 @@ AbilityManager模块提供对Ability相关信息和状态信息进行获取、
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口均为系统接口,三方应用不支持调用。
# 导入模块
## 导入模块
```js
import AbilityManager from '@ohos.application.abilityManager'
......
......@@ -714,7 +714,7 @@ console.log('-------- processDiedInfo: ---------', processDiedInfo);
## ProcessData
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission
**系统API**:该接口为系统接口,三方应用不支持调用。
......
......@@ -4,7 +4,7 @@ ProcessRunningInfo模块提供对进程运行信息进行设置和查询的能
> **说明:**
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 使用说明
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册