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

!3200 Delete Ability & Notification content of version 9plus

Merge pull request !3200 from xuzhihao/OpenHarmony-3.1-Release
......@@ -13,404 +13,6 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
## AbilityDelegator
### addAbilityMonitor<sup>9+</sup>
addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<void>): void
添加AbilityMonitor实例(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填说明 | 说明 |
| -------- | ------------------------------------------------------------ | -------- | ------------------------------------------------------------ |
| monitor | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor)实例 |
| callback | AsyncCallback\<void> | 是 | 表示指定的回调方法 |
**示例:**
```js
var abilityDelegator;
function onAbilityCreateCallback() {
console.info("onAbilityCreateCallback");
}
var monitor = {
abilityName: "abilityname",
onAbilityCreate: onAbilityCreateCallback
}
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.addAbilityMonitor(monitor, (err) => {
console.info("addAbilityMonitor callback");
});
```
### addAbilityMonitor<sup>9+</sup>
addAbilityMonitor(monitor: AbilityMonitor): Promise\<void>
添加AbilityMonitor实例(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor)实例 |
**返回值:**
| 类型 | 说明 |
| -------------- | ------------------- |
| Promise\<void> | 以Promise形式返回。 |
**示例:**
```js
var abilityDelegator;
function onAbilityCreateCallback() {
console.info("onAbilityCreateCallback");
}
var monitor = {
abilityName: "abilityname",
onAbilityCreate: onAbilityCreateCallback
}
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.addAbilityMonitor(monitor).then(() => {
console.info("addAbilityMonitor promise");
});
```
### removeAbilityMonitor<sup>9+</sup>
removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<void>): void
删除已经添加的AbilityMonitor实例(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor)实例 |
| callback | AsyncCallback\<void> | 是 | 表示指定的回调方法 |
**示例:**
```js
var abilityDelegator;
function onAbilityCreateCallback() {
console.info("onAbilityCreateCallback");
}
var monitor = {
abilityName: "abilityname",
onAbilityCreate: onAbilityCreateCallback
}
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.removeAbilityMonitor(monitor, (err) => {
console.info("removeAbilityMonitor callback");
});
```
### removeAbilityMonitor<sup>9+</sup>
removeAbilityMonitor(monitor: AbilityMonitor): Promise\<void>
删除已经添加的AbilityMonitor实例(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor)实例 |
**返回值:**
| 类型 | 说明 |
| -------------- | ------------------- |
| Promise\<void> | 以Promise形式返回。 |
- 示例
```js
var abilityDelegator;
function onAbilityCreateCallback() {
console.info("onAbilityCreateCallback");
}
var monitor = {
abilityName: "abilityname",
onAbilityCreate: onAbilityCreateCallback
}
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.removeAbilityMonitor(monitor).then(() => {
console.info("removeAbilityMonitor promise");
});
```
### waitAbilityMonitor<sup>9+</sup>
waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<Ability>): void
等待与AbilityMonitor实例匹配的ability到达OnCreate生命周期,并返回ability实例(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor)实例 |
| callback | AsyncCallback\<[Ability](js-apis-application-ability.md#Ability)> | 是 | 表示指定的回调方法 |
**示例:**
```js
var abilityDelegator;
function onAbilityCreateCallback() {
console.info("onAbilityCreateCallback");
}
var monitor = {
abilityName: "abilityname",
onAbilityCreate: onAbilityCreateCallback
}
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.waitAbilityMonitor(monitor, (err, data) => {
console.info("waitAbilityMonitor callback");
});
```
### waitAbilityMonitor<sup>9+</sup>
waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback\<Ability>): void
设置等待时间,等待与AbilityMonitor实例匹配的ability到达OnCreate生命周期,并返回ability实例(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor)实例 |
| timeout | number | 是 | 最大等待时间,单位毫秒(ms) |
| callback | AsyncCallback\<[Ability](js-apis-application-ability.md#Ability)> | 是 | 表示指定的回调方法 |
**示例:**
```js
var abilityDelegator;
var timeout = 100;
function onAbilityCreateCallback() {
console.info("onAbilityCreateCallback");
}
var monitor = {
abilityName: "abilityname",
onAbilityCreate: onAbilityCreateCallback
}
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.waitAbilityMonitor(monitor, timeout, (err, data) => {
console.info("waitAbilityMonitor callback");
});
```
### waitAbilityMonitor<sup>9+</sup>
waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise\<Ability>
设置等待时间,等待与AbilityMonitor实例匹配的ability到达OnCreate生命周期,并返回ability实例(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-application-abilityMonitor.md#AbilityMonitor)实例 |
| timeout | number | 否 | 最大等待时间,单位毫秒(ms) |
**返回值:**
| 类型 | 说明 |
| ----------------------------------------------------------- | -------------------------- |
| Promise\<[Ability](js-apis-application-ability.md#Ability)> | 以Promise形式返回Ability。 |
**示例:**
```js
var abilityDelegator;
function onAbilityCreateCallback() {
console.info("onAbilityCreateCallback");
}
var monitor = {
abilityName: "abilityname",
onAbilityCreate: onAbilityCreateCallback
}
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.waitAbilityMonitor(monitor).then((data : any) => {
console.info("waitAbilityMonitor promise");
});
```
### getAppContext<sup>9+</sup>
getAppContext(): Context
获取应用Context
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**返回值:**
| 类型 | 说明 |
| ------------------------------------- | ------------------------------------------- |
| [Context](js-apis-Context.md#Context) | 应用[Context](js-apis-Context.md#Context)。 |
**示例:**
```js
var abilityDelegator;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
var context = abilityDelegator.getAppContext();
```
### getAbilityState<sup>9+</sup>
getAbilityState(ability: Ability): number
获取指定ability的生命周期状态
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------------------------------------------------- | ---- | --------------- |
| ability | [Ability](js-apis-application-ability.md#Ability) | 是 | 指定Ability对象 |
**返回值:**
| 类型 | 说明 |
| ------ | ------------------------------------------------------------ |
| number | 指定ability的生命周期状态。状态枚举值使用[AbilityLifecycleState](js-apis-abilityDelegatorRegistry.md#AbilityLifecycleState)。 |
**示例:**
```js
var abilityDelegator;
var ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.getCurrentTopAbility((err, data) => {
console.info("getCurrentTopAbility callback");
ability = data;
var state = abilityDelegator.getAbilityState(ability);
console.info("getAbilityState" + state);
});
```
### getCurrentTopAbility<sup>9+</sup>
getCurrentTopAbility(callback: AsyncCallback\<Ability>): void
获取当前应用顶部ability(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------ |
| callback | AsyncCallback\<[Ability](js-apis-application-ability.md#Ability)> | 是 | 表示指定的回调方法 |
**示例:**
```js
var abilityDelegator;
var ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.getCurrentTopAbility((err, data) => {
console.info("getCurrentTopAbility callback");
ability = data;
});
```
### getCurrentTopAbility<sup>9+</sup>
getCurrentTopAbility(): Promise\<Ability>
获取当前应用顶部ability(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**返回值:**
| 类型 | 说明 |
| ----------------------------------------------------------- | -------------------------------------- |
| Promise\<[Ability](js-apis-application-ability.md#Ability)> | 以Promise形式返回当前应用顶部ability。 |
**示例:**
```js
var abilityDelegator;
var ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.getCurrentTopAbility().then((data : any) => {
console.info("getCurrentTopAbility promise");
ability = data;
});
```
### startAbility
startAbility(want: Want, callback: AsyncCallback\<void>): void
......@@ -480,148 +82,6 @@ abilityDelegator.startAbility(want).then((data: any) => {
### doAbilityForeground<sup>9+</sup>
doAbilityForeground(ability: Ability, callback: AsyncCallback\<boolean>): void
调度指定ability生命周期状态到Foreground状态(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | ------------------------------------------------------- |
| ability | Ability | 是 | 指定Ability对象 |
| callback | AsyncCallback\<boolean> | 是 | 表示指定的回调方法<br/>\- true:成功<br/>\- false:失败 |
**示例:**
```js
var abilityDelegator;
var ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.getCurrentTopAbility((err, data) => {
console.info("getCurrentTopAbility callback");
ability = data;
abilityDelegator.doAbilityForeground(ability, (err, data) => {
console.info("doAbilityForeground callback");
});
});
```
### doAbilityForeground<sup>9+</sup>
doAbilityForeground(ability: Ability): Promise\<boolean>
调度指定ability生命周期状态到Foreground状态(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------- | ---- | --------------- |
| ability | Ability | 是 | 指定Ability对象 |
**返回值:**
| 类型 | 说明 |
| ----------------- | ------------------------------------------------------------ |
| Promise\<boolean> | 以Promise形式返回执行结果。<br/>\- true:成功<br/>\- false:失败 |
**示例:**
```js
var abilityDelegator;
var ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.getCurrentTopAbility((err, data) => {
console.info("getCurrentTopAbility callback");
ability = data;
abilityDelegator.doAbilityForeground(ability).then((data : any) => {
console.info("doAbilityForeground promise");
});
});
```
### doAbilityBackground<sup>9+</sup>
doAbilityBackground(ability: Ability, callback: AsyncCallback\<boolean>): void
调度指定ability生命周期状态到Background状态(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | ------------------------------------------------------- |
| ability | Ability | 是 | 指定Ability对象 |
| callback | AsyncCallback\<boolean> | 是 | 表示指定的回调方法<br/>\- true:成功<br/>\- false:失败 |
**示例:**
```js
var abilityDelegator;
var ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.getCurrentTopAbility((err, data) => {
console.info("getCurrentTopAbility callback");
ability = data;
abilityDelegator.doAbilityBackground(ability, (err, data) => {
console.info("doAbilityBackground callback");
});
});
```
### doAbilityBackground<sup>9+</sup>
doAbilityBackground(ability: Ability): Promise\<boolean>
调度指定ability生命周期状态到Background状态(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------- | ---- | --------------- |
| ability | Ability | 是 | 指定Ability对象 |
**返回值:**
| 类型 | 说明 |
| ----------------- | ------------------------------------------------------------ |
| Promise\<boolean> | 以Promise形式返回执行结果。<br/>\- true:成功<br/>\- false:失败 |
**示例:**
```js
var abilityDelegator;
var ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.getCurrentTopAbility((err, data) => {
console.info("getCurrentTopAbility callback");
ability = data;
abilityDelegator.doAbilityBackground(ability).then((data) => {
console.info("doAbilityBackground promise");
});
});
```
### print
print(msg: string, callback: AsyncCallback\<void>): void
......
......@@ -22,7 +22,4 @@ import Configuration from '@ohos.application.Configuration';
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
| language | string | 是 | 是 | 表示应用程序的当前语言。 |
| colorMode | [ColorMode](js-apis-configurationconstant.md) | 是 | 是 | 表示深浅色模式,取值范围:浅色模式(COLOR_MODE_LIGHT),深色模式(COLOR_MODE_DARK)。默认为浅色。 |
| direction<sup>9+</sup> | Direction | 是 | 否 | 表示屏幕方向,取值范围:水平方向(DIRECTION_HORIZONTAL),垂直方向(DIRECTION_VERTICAL)。 |
| screenDensity<sup>9+</sup> | ScreenDensity | 是 | 否 | 表示屏幕分辨率,取值范围:SCREEN_DENSITY_SDPI(120)、SCREEN_DENSITY_MDPI(160)、SCREEN_DENSITY_LDPI(240)、SCREEN_DENSITY_XLDPI(320)、SCREEN_DENSITY_XXLDPI(480)、SCREEN_DENSITY_XXXLDPI(640)。 |
| displayId<sup>9+</sup> | number | 是 | 否 | 表示应用所在的displayId。 |
| colorMode | [ColorMode](js-apis-configurationconstant.md) | 是 | 是 | 表示深浅色模式,取值范围:浅色模式(COLOR_MODE_LIGHT),深色模式(COLOR_MODE_DARK)。默认为浅色。 |
\ No newline at end of file
......@@ -925,8 +925,6 @@ featureAbility.AbilityStartSetting.BOUNDS_KEY
| action | 只读 | string | 否 | 表示action选项描述。 |
| parameters | 只读 | {[key: string]: any} | 否 | 表示WantParams描述。 |
| entities | 只读 | Array\<string> | 否 | 表示entities相关描述。 |
| extensionAbilityName<sup>9+<sup> | 只读 | string | 否 | Want中扩展能力名称的描述。 |
| extensionAbilityType<sup>9+<sup> | 只读 | number | 否 | Want中扩展能力类型的描述。 |
## flags说明
......
......@@ -2900,7 +2900,6 @@ Notification.subscribe(subscriber, subscribeCallback);
| title | 是 | 是 | string | 是 | 按钮标题。 |
| wantAgent | 是 | 是 | WantAgent | 是 | 点击按钮时触发的WantAgent。 |
| extras | 是 | 是 | { [key: string]: any } | 否 | 按钮扩展信息。 |
| userInput<sup>9+</sup> | 是 | 是 | [NotificationUserInput](#notificationuserinput8) | 否 | 用户输入对象实例。 |
## NotificationBasicContent
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册