未验证 提交 981ebbbe 编写于 作者: O openharmony_ci 提交者: Gitee

!14044 ANS接口文档修改

Merge pull request !14044 from FangJinliang/pr_0130
...@@ -16,7 +16,7 @@ import WantAgent from '@ohos.app.ability.wantAgent'; ...@@ -16,7 +16,7 @@ import WantAgent from '@ohos.app.ability.wantAgent';
getWantAgent(info: WantAgentInfo, callback: AsyncCallback\<WantAgent\>): void getWantAgent(info: WantAgentInfo, callback: AsyncCallback\<WantAgent\>): void
创建WantAgent(callback形式)。 创建WantAgent(callback形式)。 创建失败返回的WantAgent为空值。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core **系统能力**:SystemCapability.Ability.AbilityRuntime.Core
...@@ -108,7 +108,7 @@ try { ...@@ -108,7 +108,7 @@ try {
getWantAgent(info: WantAgentInfo): Promise\<WantAgent\> getWantAgent(info: WantAgentInfo): Promise\<WantAgent\>
创建WantAgent(Promise形式)。 创建WantAgent(Promise形式)。 创建失败返回的WantAgent为空值。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core **系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......
...@@ -2486,9 +2486,9 @@ notificationManager.getDoNotDisturbDate(userId).then((data) => { ...@@ -2486,9 +2486,9 @@ notificationManager.getDoNotDisturbDate(userId).then((data) => {
``` ```
## notificationManager.supportDoNotDisturbMode ## notificationManager.isSupportDoNotDisturbMode
supportDoNotDisturbMode(callback: AsyncCallback\<boolean\>): void isSupportDoNotDisturbMode(callback: AsyncCallback\<boolean\>): void
查询是否支持免打扰功能(Callback形式)。 查询是否支持免打扰功能(Callback形式)。
...@@ -2515,20 +2515,20 @@ supportDoNotDisturbMode(callback: AsyncCallback\<boolean\>): void ...@@ -2515,20 +2515,20 @@ supportDoNotDisturbMode(callback: AsyncCallback\<boolean\>): void
**示例:** **示例:**
```ts ```ts
function supportDoNotDisturbModeCallback(err,data) { function isSupportDoNotDisturbModeCallback(err,data) {
if (err) { if (err) {
console.error(`supportDoNotDisturbMode failed, code is ${err.code}, message is ${err.message}`); console.error(`isSupportDoNotDisturbMode failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("supportDoNotDisturbMode success"); console.info("isSupportDoNotDisturbMode success");
} }
} }
notificationManager.supportDoNotDisturbMode(supportDoNotDisturbModeCallback); notificationManager.isSupportDoNotDisturbMode(isSupportDoNotDisturbModeCallback);
``` ```
## notificationManager.supportDoNotDisturbMode ## notificationManager.isSupportDoNotDisturbMode
supportDoNotDisturbMode(): Promise\<boolean\> isSupportDoNotDisturbMode(): Promise\<boolean\>
查询是否支持勿扰模式功能(Promise形式)。 查询是否支持勿扰模式功能(Promise形式)。
...@@ -2557,7 +2557,7 @@ supportDoNotDisturbMode(): Promise\<boolean\> ...@@ -2557,7 +2557,7 @@ supportDoNotDisturbMode(): Promise\<boolean\>
**示例:** **示例:**
```ts ```ts
notificationManager.supportDoNotDisturbMode().then((data) => { notificationManager.isSupportDoNotDisturbMode().then((data) => {
console.info("supportDoNotDisturbMode success, data: " + JSON.stringify(data)); console.info("supportDoNotDisturbMode success, data: " + JSON.stringify(data));
}); });
``` ```
......
...@@ -16,7 +16,7 @@ import WantAgent from '@ohos.wantAgent'; ...@@ -16,7 +16,7 @@ import WantAgent from '@ohos.wantAgent';
getWantAgent(info: WantAgentInfo, callback: AsyncCallback\<WantAgent\>): void getWantAgent(info: WantAgentInfo, callback: AsyncCallback\<WantAgent\>): void
创建WantAgent(callback形式)。 创建WantAgent(callback形式)。 创建失败返回的WantAgent为空值。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core **系统能力**:SystemCapability.Ability.AbilityRuntime.Core
...@@ -75,7 +75,7 @@ WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); ...@@ -75,7 +75,7 @@ WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
getWantAgent(info: WantAgentInfo): Promise\<WantAgent\> getWantAgent(info: WantAgentInfo): Promise\<WantAgent\>
创建WantAgent(Promise形式)。 创建WantAgent(Promise形式)。 创建失败返回的WantAgent为空值。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core **系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......
# ANS通知子系统ChangeLog
## cl.notificationManager.1 接口名变更
基于此前接口名定义不够规范,与其他功能类型的接口命名不一致,对此接口名进行变更。
**变更影响**
底层仍支持原接口功能,不影响4.0.2.3版本调用该接口的应用。
**关键接口/组件变更**
| 包名 | 旧接口 | 新接口 |
| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| ohos.notificationManager.d.ts | **function** supportDoNotDisturbMode(callback: AsyncCallback<boolean>): **void**; | **function** isSupportDoNotDisturbMode(callback: AsyncCallback<boolean>): **void**; |
| ohos.notificationManager.d.ts | **function** supportDoNotDisturbMode(): Promise<boolean>; | **function** isSupportDoNotDisturbMode(): Promise<boolean>; |
**适配指导**
按新的接口isSupportDoNotDisturbMode调用。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册