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

!12481 【元能力】js文档修改

Merge pull request !12481 from donglin/master
...@@ -30,7 +30,7 @@ onConfigurationUpdate(newConfig: Configuration): void; ...@@ -30,7 +30,7 @@ onConfigurationUpdate(newConfig: Configuration): void;
**示例:** **示例:**
```ts ```ts
class myAbility extends Ability { class MyAbility extends Ability {
onConfigurationUpdate(config) { onConfigurationUpdate(config) {
console.log('onConfigurationUpdate, config:' + JSON.stringify(config)); console.log('onConfigurationUpdate, config:' + JSON.stringify(config));
} }
...@@ -54,7 +54,7 @@ onMemoryLevel(level: AbilityConstant.MemoryLevel): void; ...@@ -54,7 +54,7 @@ onMemoryLevel(level: AbilityConstant.MemoryLevel): void;
**示例:** **示例:**
```ts ```ts
class myAbility extends Ability { class MyAbility extends Ability {
onMemoryLevel(level) { onMemoryLevel(level) {
console.log('onMemoryLevel, level:' + JSON.stringify(level)); console.log('onMemoryLevel, level:' + JSON.stringify(level));
} }
......
...@@ -27,7 +27,7 @@ onAbilityCreate(ability: UIAbility): void; ...@@ -27,7 +27,7 @@ onAbilityCreate(ability: UIAbility): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | | ability | [UIAbility](js-apis-app-ability-uiAbility.md#Ability) | 是 | 当前Ability对象 |
## AbilityLifecycleCallback.onWindowStageCreate ## AbilityLifecycleCallback.onWindowStageCreate
...@@ -42,7 +42,7 @@ onWindowStageCreate(ability: UIAbility, windowStage: window.WindowStage): void; ...@@ -42,7 +42,7 @@ onWindowStageCreate(ability: UIAbility, windowStage: window.WindowStage): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | | ability | [UIAbility](js-apis-app-ability-uiAbility.md#Ability) | 是 | 当前Ability对象 |
| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | 是 | 当前WindowStage对象 | | windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | 是 | 当前WindowStage对象 |
...@@ -58,7 +58,7 @@ onWindowStageActive(ability: UIAbility, windowStage: window.WindowStage): void; ...@@ -58,7 +58,7 @@ onWindowStageActive(ability: UIAbility, windowStage: window.WindowStage): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | | ability | [UIAbility](js-apis-app-ability-uiAbility.md#Ability) | 是 | 当前Ability对象 |
| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | 是 | 当前WindowStage对象 | | windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | 是 | 当前WindowStage对象 |
...@@ -74,7 +74,7 @@ onWindowStageInactive(ability: UIAbility, windowStage: window.WindowStage): void ...@@ -74,7 +74,7 @@ onWindowStageInactive(ability: UIAbility, windowStage: window.WindowStage): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | | ability | [UIAbility](js-apis-app-ability-uiAbility.md#Ability) | 是 | 当前Ability对象 |
| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | 是 | 当前WindowStage对象 | | windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | 是 | 当前WindowStage对象 |
...@@ -90,7 +90,7 @@ onWindowStageDestroy(ability: UIAbility, windowStage: window.WindowStage): void; ...@@ -90,7 +90,7 @@ onWindowStageDestroy(ability: UIAbility, windowStage: window.WindowStage): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | | ability | [UIAbility](js-apis-app-ability-uiAbility.md#Ability) | 是 | 当前Ability对象 |
| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | 是 | 当前WindowStage对象 | | windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | 是 | 当前WindowStage对象 |
...@@ -106,7 +106,7 @@ onAbilityDestroy(ability: UIAbility): void; ...@@ -106,7 +106,7 @@ onAbilityDestroy(ability: UIAbility): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | | ability | [UIAbility](js-apis-app-ability-uiAbility.md#Ability) | 是 | 当前Ability对象 |
## AbilityLifecycleCallback.onAbilityForeground ## AbilityLifecycleCallback.onAbilityForeground
...@@ -121,7 +121,7 @@ onAbilityForeground(ability: UIAbility): void; ...@@ -121,7 +121,7 @@ onAbilityForeground(ability: UIAbility): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | | ability | [UIAbility](js-apis-app-ability-uiAbility.md#Ability) | 是 | 当前Ability对象 |
## AbilityLifecycleCallback.onAbilityBackground ## AbilityLifecycleCallback.onAbilityBackground
...@@ -136,7 +136,7 @@ onAbilityBackground(ability: UIAbility): void; ...@@ -136,7 +136,7 @@ onAbilityBackground(ability: UIAbility): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | | ability | [UIAbility](js-apis-app-ability-uiAbility.md#Ability) | 是 | 当前Ability对象 |
## AbilityLifecycleCallback.onAbilityContinue ## AbilityLifecycleCallback.onAbilityContinue
...@@ -151,7 +151,7 @@ onAbilityContinue(ability: UIAbility): void; ...@@ -151,7 +151,7 @@ onAbilityContinue(ability: UIAbility): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | | ability | [UIAbility](js-apis-app-ability-uiAbility.md#Ability) | 是 | 当前Ability对象 |
**示例:** **示例:**
......
...@@ -10,7 +10,7 @@ AbilityManager模块提供对Ability相关信息和状态信息进行获取、 ...@@ -10,7 +10,7 @@ AbilityManager模块提供对Ability相关信息和状态信息进行获取、
## 导入模块 ## 导入模块
```ts ```ts
import AbilityManager from '@ohos.app.ability.abilityManager' import abilityManager from '@ohos.app.ability.abilityManager'
``` ```
## AbilityState ## AbilityState
...@@ -49,14 +49,12 @@ updateConfiguration(config: Configuration, callback: AsyncCallback\<void>): void ...@@ -49,14 +49,12 @@ updateConfiguration(config: Configuration, callback: AsyncCallback\<void>): void
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
var config = { var config = {
language: 'chinese' language: 'chinese'
} }
try { try {
abilitymanager.updateConfiguration(config, () => { abilityManager.updateConfiguration(config, () => {
console.log('------------ updateConfiguration -----------'); console.log('------------ updateConfiguration -----------');
}) })
} catch (paramError) { } catch (paramError) {
...@@ -90,14 +88,12 @@ updateConfiguration(config: Configuration): Promise\<void> ...@@ -90,14 +88,12 @@ updateConfiguration(config: Configuration): Promise\<void>
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
var config = { var config = {
language: 'chinese' language: 'chinese'
} }
try { try {
abilitymanager.updateConfiguration(config).then(() => { abilityManager.updateConfiguration(config).then(() => {
console.log('updateConfiguration success'); console.log('updateConfiguration success');
}).catch((err) => { }).catch((err) => {
console.log('updateConfiguration fail'); console.log('updateConfiguration fail');
...@@ -127,10 +123,8 @@ getAbilityRunningInfos(callback: AsyncCallback\<Array\<AbilityRunningInfo>>): vo ...@@ -127,10 +123,8 @@ getAbilityRunningInfos(callback: AsyncCallback\<Array\<AbilityRunningInfo>>): vo
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
try { try {
abilitymanager.getAbilityRunningInfos((err,data) => { abilityManager.getAbilityRunningInfos((err,data) => {
console.log("getAbilityRunningInfos err: " + err + " data: " + JSON.stringify(data)); console.log("getAbilityRunningInfos err: " + err + " data: " + JSON.stringify(data));
}); });
} catch (paramError) { } catch (paramError) {
...@@ -158,10 +152,8 @@ getAbilityRunningInfos(): Promise\<Array\<AbilityRunningInfo>> ...@@ -158,10 +152,8 @@ getAbilityRunningInfos(): Promise\<Array\<AbilityRunningInfo>>
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
try { try {
abilitymanager.getAbilityRunningInfos().then((data) => { abilityManager.getAbilityRunningInfos().then((data) => {
console.log("getAbilityRunningInfos data: " + JSON.stringify(data)) console.log("getAbilityRunningInfos data: " + JSON.stringify(data))
}).catch((err) => { }).catch((err) => {
console.log("getAbilityRunningInfos err: " + err) console.log("getAbilityRunningInfos err: " + err)
...@@ -192,12 +184,10 @@ getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback\<Array\<Ext ...@@ -192,12 +184,10 @@ getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback\<Array\<Ext
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
var upperLimit = 0; var upperLimit = 0;
try { try {
abilitymanager.getExtensionRunningInfos(upperLimit, (err,data) => { abilityManager.getExtensionRunningInfos(upperLimit, (err,data) => {
console.log("getExtensionRunningInfos err: " + err + " data: " + JSON.stringify(data)); console.log("getExtensionRunningInfos err: " + err + " data: " + JSON.stringify(data));
}); });
} catch (paramError) { } catch (paramError) {
...@@ -231,12 +221,10 @@ getExtensionRunningInfos(upperLimit: number): Promise\<Array\<ExtensionRunningIn ...@@ -231,12 +221,10 @@ getExtensionRunningInfos(upperLimit: number): Promise\<Array\<ExtensionRunningIn
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
var upperLimit = 0; var upperLimit = 0;
try { try {
abilitymanager.getExtensionRunningInfos(upperLimit).then((data) => { abilityManager.getExtensionRunningInfos(upperLimit).then((data) => {
console.log("getAbilityRunningInfos data: " + JSON.stringify(data)); console.log("getAbilityRunningInfos data: " + JSON.stringify(data));
}).catch((err) => { }).catch((err) => {
console.log("getAbilityRunningInfos err: " + err); console.log("getAbilityRunningInfos err: " + err);
...@@ -264,16 +252,9 @@ getTopAbility(callback: AsyncCallback\<ElementName>): void; ...@@ -264,16 +252,9 @@ getTopAbility(callback: AsyncCallback\<ElementName>): void;
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.app.ability.abilityManager'; abilityManager.getTopAbility((err,data) => {
try {
abilitymanager.getTopAbility((err,data) => {
console.log("getTopAbility err: " + err + " data: " + JSON.stringify(data)); console.log("getTopAbility err: " + err + " data: " + JSON.stringify(data));
}); });
} catch (paramError) {
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
``` ```
## getTopAbility ## getTopAbility
...@@ -293,16 +274,9 @@ getTopAbility(): Promise\<ElementName>; ...@@ -293,16 +274,9 @@ getTopAbility(): Promise\<ElementName>;
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.app.ability.abilityManager'; abilityManager.getTopAbility().then((data) => {
try {
abilitymanager.getTopAbility().then((data) => {
console.log("getTopAbility data: " + JSON.stringify(data)); console.log("getTopAbility data: " + JSON.stringify(data));
}).catch((err) => { }).catch((err) => {
console.log("getTopAbility err: " + err); console.log("getTopAbility err: " + err);
}) })
} catch (paramError) {
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
``` ```
\ No newline at end of file
...@@ -12,7 +12,7 @@ appManager模块提供App管理的能力,包括查询当前是否处于稳定 ...@@ -12,7 +12,7 @@ appManager模块提供App管理的能力,包括查询当前是否处于稳定
import appManager from '@ohos.app.ability.appManager'; import appManager from '@ohos.app.ability.appManager';
``` ```
## appManager.isRunningInStabilityTest<sup>9+</sup> ## appManager.isRunningInStabilityTest
static isRunningInStabilityTest(callback: AsyncCallback&lt;boolean&gt;): void static isRunningInStabilityTest(callback: AsyncCallback&lt;boolean&gt;): void
...@@ -29,14 +29,14 @@ static isRunningInStabilityTest(callback: AsyncCallback&lt;boolean&gt;): void ...@@ -29,14 +29,14 @@ static isRunningInStabilityTest(callback: AsyncCallback&lt;boolean&gt;): void
**示例:** **示例:**
```ts ```ts
import app from '@ohos.application.appManager'; appManager.isRunningInStabilityTest((err, flag) => {
app.isRunningInStabilityTest((err, flag) => { console.log('error:' + JSON.stringify(err));
console.log('startAbility result:' + JSON.stringify(err)); console.log('The result of isRunningInStabilityTest is:' + JSON.stringify(flag));
}) })
``` ```
## appManager.isRunningInStabilityTest<sup>9+</sup> ## appManager.isRunningInStabilityTest
static isRunningInStabilityTest(): Promise&lt;boolean&gt; static isRunningInStabilityTest(): Promise&lt;boolean&gt;
...@@ -53,11 +53,10 @@ static isRunningInStabilityTest(): Promise&lt;boolean&gt; ...@@ -53,11 +53,10 @@ static isRunningInStabilityTest(): Promise&lt;boolean&gt;
**示例:** **示例:**
```ts ```ts
import app from '@ohos.application.appManager'; appManager.isRunningInStabilityTest().then((flag) => {
app.isRunningInStabilityTest().then((flag) => { console.log('The result of isRunningInStabilityTest is:' + JSON.stringify(flag));
console.log('success:' + JSON.stringify(flag));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringify(error)); console.log('error:' + JSON.stringify(error));
}); });
``` ```
...@@ -79,10 +78,10 @@ isRamConstrainedDevice(): Promise\<boolean>; ...@@ -79,10 +78,10 @@ isRamConstrainedDevice(): Promise\<boolean>;
**示例:** **示例:**
```ts ```ts
app.isRamConstrainedDevice().then((data) => { appManager.isRamConstrainedDevice().then((data) => {
console.log('success:' + JSON.stringify(data)); console.log('The result of isRamConstrainedDevice is:' + JSON.stringify(data));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringify(error)); console.log('error:' + JSON.stringify(error));
}); });
``` ```
...@@ -103,9 +102,9 @@ isRamConstrainedDevice(callback: AsyncCallback\<boolean>): void; ...@@ -103,9 +102,9 @@ isRamConstrainedDevice(callback: AsyncCallback\<boolean>): void;
**示例:** **示例:**
```ts ```ts
app.isRamConstrainedDevice((err, data) => { appManager.isRamConstrainedDevice((err, data) => {
console.log('startAbility result failed:' + JSON.stringify(err)); console.log('error:' + JSON.stringify(err));
console.log('startAbility result success:' + JSON.stringify(data)); console.log('The result of isRamConstrainedDevice is:' + JSON.stringify(data));
}) })
``` ```
...@@ -126,10 +125,10 @@ getAppMemorySize(): Promise\<number>; ...@@ -126,10 +125,10 @@ getAppMemorySize(): Promise\<number>;
**示例:** **示例:**
```ts ```ts
app.getAppMemorySize().then((data) => { appManager.getAppMemorySize().then((data) => {
console.log('success:' + JSON.stringify(data)); console.log('The size of app memory is:' + JSON.stringify(data));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringify(error)); console.log('error:' + JSON.stringify(error));
}); });
``` ```
...@@ -150,9 +149,9 @@ getAppMemorySize(callback: AsyncCallback\<number>): void; ...@@ -150,9 +149,9 @@ getAppMemorySize(callback: AsyncCallback\<number>): void;
**示例:** **示例:**
```ts ```ts
app.getAppMemorySize((err, data) => { appManager.getAppMemorySize((err, data) => {
console.log('startAbility result failed :' + JSON.stringify(err)); console.log('error:' + JSON.stringify(err));
console.log('startAbility result success:' + JSON.stringify(data)); console.log('The size of app memory is:' + JSON.stringify(data));
}) })
``` ```
...@@ -177,10 +176,10 @@ getProcessRunningInformation(): Promise\<Array\<ProcessRunningInformation>>; ...@@ -177,10 +176,10 @@ getProcessRunningInformation(): Promise\<Array\<ProcessRunningInformation>>;
**示例:** **示例:**
```ts ```ts
app.getProcessRunningInformation().then((data) => { appManager.getProcessRunningInformation().then((data) => {
console.log('success:' + JSON.stringify(data)); console.log('The process running infomation is:' + JSON.stringify(data));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringify(error)); console.log('error:' + JSON.stringify(error));
}); });
``` ```
...@@ -205,9 +204,9 @@ getProcessRunningInformation(callback: AsyncCallback\<Array\<ProcessRunningInfor ...@@ -205,9 +204,9 @@ getProcessRunningInformation(callback: AsyncCallback\<Array\<ProcessRunningInfor
**示例:** **示例:**
```ts ```ts
app.getProcessRunningInformation((err, data) => { appManager.getProcessRunningInformation((err, data) => {
console.log('startAbility result failed :' + JSON.stringify(err)); console.log('error :' + JSON.stringify(err));
console.log('startAbility result success:' + JSON.stringify(data)); console.log('The process running information is:' + JSON.stringify(data));
}) })
``` ```
...@@ -251,7 +250,7 @@ on(type: "applicationState", observer: ApplicationStateObserver): number; ...@@ -251,7 +250,7 @@ on(type: "applicationState", observer: ApplicationStateObserver): number;
} }
} }
try { try {
const observerCode = app.on(applicationStateObserver); const observerCode = appManager.on(applicationStateObserver);
console.log('-------- observerCode: ---------', observerCode); console.log('-------- observerCode: ---------', observerCode);
} catch (paramError) { } catch (paramError) {
console.log('error: ' + paramError.code + ', ' + paramError.message); console.log('error: ' + paramError.code + ', ' + paramError.message);
...@@ -301,7 +300,7 @@ on(type: "applicationState", observer: ApplicationStateObserver, bundleNameList: ...@@ -301,7 +300,7 @@ on(type: "applicationState", observer: ApplicationStateObserver, bundleNameList:
} }
var bundleNameList = ['bundleName1', 'bundleName2']; var bundleNameList = ['bundleName1', 'bundleName2'];
try { try {
const observerCode = app.on("applicationState", applicationStateObserver, bundleNameList); const observerCode = appManager.on("applicationState", applicationStateObserver, bundleNameList);
console.log('-------- observerCode: ---------', observerCode); console.log('-------- observerCode: ---------', observerCode);
} catch (paramError) { } catch (paramError) {
console.log('error: ' + paramError.code + ', ' + paramError.message); console.log('error: ' + paramError.code + ', ' + paramError.message);
...@@ -339,7 +338,7 @@ off(type: "applicationState", observerId: number, callback: AsyncCallback\<void ...@@ -339,7 +338,7 @@ off(type: "applicationState", observerId: number, callback: AsyncCallback\<void
} }
} }
try { try {
app.off(observerId, unregisterApplicationStateObserverCallback); appManager.off(observerId, unregisterApplicationStateObserverCallback);
} catch (paramError) { } catch (paramError) {
console.log('error: ' + paramError.code + ', ' + paramError.message); console.log('error: ' + paramError.code + ', ' + paramError.message);
} }
...@@ -376,7 +375,7 @@ off(type: "applicationState", observerId: number): Promise\<void>; ...@@ -376,7 +375,7 @@ off(type: "applicationState", observerId: number): Promise\<void>;
var observerId = 100; var observerId = 100;
try { try {
app.off(observerId) appManager.off(observerId)
.then((data) => { .then((data) => {
console.log('----------- unregisterApplicationStateObserver success ----------', data); console.log('----------- unregisterApplicationStateObserver success ----------', data);
}) })
...@@ -409,14 +408,18 @@ getForegroundApplications(callback: AsyncCallback\<Array\<AppStateData>>): void; ...@@ -409,14 +408,18 @@ getForegroundApplications(callback: AsyncCallback\<Array\<AppStateData>>): void;
**示例:** **示例:**
```js ```js
function getForegroundApplicationsCallback(err, data) { function getForegroundApplicationsCallback(err, data) {
if (err) { if (err) {
console.log('--------- getForegroundApplicationsCallback fail ---------', err.code + ': ' + err.message); console.log('--------- getForegroundApplicationsCallback fail ---------', err.code + ': ' + err.message);
} else { } else {
console.log('--------- getForegroundApplicationsCallback success ---------', data) console.log('--------- getForegroundApplicationsCallback success ---------', data)
}
} }
app.getForegroundApplications(getForegroundApplicationsCallback); }
try {
appManager.getForegroundApplications(getForegroundApplicationsCallback);
} catch (paramError) {
console.log("error: " + paramError.code + ", " + paramError.message);
}
``` ```
unregisterApplicationStateObserver(observerId: number): Promise\<void>; unregisterApplicationStateObserver(observerId: number): Promise\<void>;
...@@ -445,16 +448,20 @@ unregisterApplicationStateObserver(observerId: number): Promise\<void>; ...@@ -445,16 +448,20 @@ unregisterApplicationStateObserver(observerId: number): Promise\<void>;
```ts ```ts
var observerId = 100; var observerId = 100;
app.unregisterApplicationStateObserver(observerId) try {
.then((data) => { appManager.unregisterApplicationStateObserver(observerId)
.then((data) => {
console.log('----------- unregisterApplicationStateObserver success ----------', data); console.log('----------- unregisterApplicationStateObserver success ----------', data);
}) })
.catch((err) => { .catch((err) => {
console.log('----------- unregisterApplicationStateObserver fail ----------', err); console.log('----------- unregisterApplicationStateObserver fail ----------', err);
}) })
} catch (paramError) {
console.log("error: " + paramError.code + ", " + paramError.message);
}
``` ```
## appManager.getForegroundApplications<sup>9+</sup> ## appManager.getForegroundApplications
getForegroundApplications(callback: AsyncCallback\<Array\<AppStateData>>): void; getForegroundApplications(callback: AsyncCallback\<Array\<AppStateData>>): void;
...@@ -482,10 +489,14 @@ getForegroundApplications(callback: AsyncCallback\<Array\<AppStateData>>): void; ...@@ -482,10 +489,14 @@ getForegroundApplications(callback: AsyncCallback\<Array\<AppStateData>>): void;
console.log('--------- getForegroundApplicationsCallback success ---------', data) console.log('--------- getForegroundApplicationsCallback success ---------', data)
} }
} }
app.getForegroundApplications(getForegroundApplicationsCallback); try {
appManager.getForegroundApplications(getForegroundApplicationsCallback);
} catch (paramError) {
console.log("error: " + paramError.code + ", " + paramError.message);
}
``` ```
## appManager.getForegroundApplications<sup>9+</sup> ## appManager.getForegroundApplications
getForegroundApplications(): Promise\<Array\<AppStateData>>; getForegroundApplications(): Promise\<Array\<AppStateData>>;
...@@ -506,7 +517,7 @@ getForegroundApplications(): Promise\<Array\<AppStateData>>; ...@@ -506,7 +517,7 @@ getForegroundApplications(): Promise\<Array\<AppStateData>>;
**示例:** **示例:**
```ts ```ts
app.getForegroundApplications() appManager.getForegroundApplications()
.then((data) => { .then((data) => {
console.log('--------- getForegroundApplications success -------', data); console.log('--------- getForegroundApplications success -------', data);
}) })
...@@ -515,7 +526,7 @@ getForegroundApplications(): Promise\<Array\<AppStateData>>; ...@@ -515,7 +526,7 @@ getForegroundApplications(): Promise\<Array\<AppStateData>>;
}) })
``` ```
## appManager.killProcessWithAccount<sup>9+</sup> ## appManager.killProcessWithAccount
killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\> killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\>
...@@ -539,17 +550,21 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\> ...@@ -539,17 +550,21 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\>
```ts ```ts
var bundleName = 'bundleName'; var bundleName = 'bundleName';
var accountId = 0; var accountId = 0;
app.killProcessWithAccount(bundleName, accountId) try {
appManager.killProcessWithAccount(bundleName, accountId)
.then((data) => { .then((data) => {
console.log('------------ killProcessWithAccount success ------------', data); console.log('------------ killProcessWithAccount success ------------', data);
}) })
.catch((err) => { .catch((err) => {
console.log('------------ killProcessWithAccount fail ------------', err); console.log('------------ killProcessWithAccount fail ------------', err);
}) })
} catch (paramError) {
console.log("error: " + paramError.code + ", " + paramError.message);
}
``` ```
## appManager.killProcessWithAccount<sup>9+</sup> ## appManager.killProcessWithAccount
killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback\<void\>): void killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback\<void\>): void
...@@ -581,10 +596,10 @@ function killProcessWithAccountCallback(err, data) { ...@@ -581,10 +596,10 @@ function killProcessWithAccountCallback(err, data) {
console.log('------------- killProcessWithAccountCallback success, data: --------------', data); console.log('------------- killProcessWithAccountCallback success, data: --------------', data);
} }
} }
app.killProcessWithAccount(bundleName, accountId, killProcessWithAccountCallback); appManager.killProcessWithAccount(bundleName, accountId, killProcessWithAccountCallback);
``` ```
## appManager.killProcessesByBundleName<sup>9+</sup> ## appManager.killProcessesByBundleName
killProcessesByBundleName(bundleName: string, callback: AsyncCallback\<void>); killProcessesByBundleName(bundleName: string, callback: AsyncCallback\<void>);
...@@ -614,10 +629,14 @@ killProcessesByBundleName(bundleName: string, callback: AsyncCallback\<void>); ...@@ -614,10 +629,14 @@ killProcessesByBundleName(bundleName: string, callback: AsyncCallback\<void>);
console.log('------------- killProcessesByBundleNameCallback success, data: --------------', data); console.log('------------- killProcessesByBundleNameCallback success, data: --------------', data);
} }
} }
app.killProcessesByBundleName(bundleName, killProcessesByBundleNameCallback); try {
appManager.killProcessesByBundleName(bundleName, killProcessesByBundleNameCallback);
} catch (paramError) {
console.log("error: " + paramError.code + ", " + paramError.message);
}
``` ```
## appManager.killProcessesByBundleName<sup>9+</sup> ## appManager.killProcessesByBundleName
killProcessesByBundleName(bundleName: string): Promise\<void>; killProcessesByBundleName(bundleName: string): Promise\<void>;
...@@ -644,17 +663,21 @@ killProcessesByBundleName(bundleName: string): Promise\<void>; ...@@ -644,17 +663,21 @@ killProcessesByBundleName(bundleName: string): Promise\<void>;
**示例:** **示例:**
```ts ```ts
var bundleName = 'bundleName'; var bundleName = 'bundleName';
app.killProcessesByBundleName(bundleName) try {
.then((data) => { appManager.killProcessesByBundleName(bundleName)
console.log('------------ killProcessesByBundleName success ------------', data); .then((data) => {
}) console.log('------------ killProcessesByBundleName success ------------', data);
.catch((err) => { })
console.log('------------ killProcessesByBundleName fail ------------', err); .catch((err) => {
}) console.log('------------ killProcessesByBundleName fail ------------', err);
})
} catch (paramError) {
console.log("error: " + paramError.code + ", " + paramError.message);
}
``` ```
## appManager.clearUpApplicationData<sup>9+</sup> ## appManager.clearUpApplicationData
clearUpApplicationData(bundleName: string, callback: AsyncCallback\<void>); clearUpApplicationData(bundleName: string, callback: AsyncCallback\<void>);
...@@ -684,10 +707,14 @@ clearUpApplicationData(bundleName: string, callback: AsyncCallback\<void>); ...@@ -684,10 +707,14 @@ clearUpApplicationData(bundleName: string, callback: AsyncCallback\<void>);
console.log('------------- clearUpApplicationDataCallback success, data: --------------', data); console.log('------------- clearUpApplicationDataCallback success, data: --------------', data);
} }
} }
app.clearUpApplicationData(bundleName, clearUpApplicationDataCallback); try {
appManager.clearUpApplicationData(bundleName, clearUpApplicationDataCallback);
} catch (paramError) {
console.log("error: " + paramError.code + ", " + paramError.message);
}
``` ```
## appManager.clearUpApplicationData<sup>9+</sup> ## appManager.clearUpApplicationData
clearUpApplicationData(bundleName: string): Promise\<void>; clearUpApplicationData(bundleName: string): Promise\<void>;
...@@ -715,16 +742,20 @@ clearUpApplicationData(bundleName: string): Promise\<void>; ...@@ -715,16 +742,20 @@ clearUpApplicationData(bundleName: string): Promise\<void>;
```ts ```ts
var bundleName = 'bundleName'; var bundleName = 'bundleName';
app.clearUpApplicationData(bundleName) try {
.then((data) => { appManager.clearUpApplicationData(bundleName)
.then((data) => {
console.log('------------ clearUpApplicationData success ------------', data); console.log('------------ clearUpApplicationData success ------------', data);
}) })
.catch((err) => { .catch((err) => {
console.log('------------ clearUpApplicationData fail ------------', err); console.log('------------ clearUpApplicationData fail ------------', err);
}) })
} catch (paramError) {
console.log("error: " + paramError.code + ", " + paramError.message);
}
``` ```
## ApplicationState<sup>9+</sup> ## ApplicationState
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core **系统能力**:SystemCapability.Ability.AbilityRuntime.Core
...@@ -738,7 +769,7 @@ clearUpApplicationData(bundleName: string): Promise\<void>; ...@@ -738,7 +769,7 @@ clearUpApplicationData(bundleName: string): Promise\<void>;
| STATE_BACKGROUND | 4 | 当应用处于后台不可见时处于的状态。 | | STATE_BACKGROUND | 4 | 当应用处于后台不可见时处于的状态。 |
| STATE_DESTROY | 5 | 当应用在销毁的时候处于的状态。 | | STATE_DESTROY | 5 | 当应用在销毁的时候处于的状态。 |
## ProcessState<sup>9+</sup> ## ProcessState
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core **系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......
...@@ -67,6 +67,7 @@ enableAppRecovery(restart?: RestartFlag, saveOccasion?: SaveOccasionFlag, saveMo ...@@ -67,6 +67,7 @@ enableAppRecovery(restart?: RestartFlag, saveOccasion?: SaveOccasionFlag, saveMo
**示例:** **示例:**
```ts ```ts
import AbilityStage from '@ohos.app.ability.AbilityStage';
export default class MyAbilityStage extends AbilityStage { export default class MyAbilityStage extends AbilityStage {
onCreate() { onCreate() {
appRecovery.enableAppRecovery(RestartFlag::ALWAYS_RESTART, SaveOccasionFlag::SAVE_WHEN_ERROR, SaveModeFlag::SAVE_WITH_FILE); appRecovery.enableAppRecovery(RestartFlag::ALWAYS_RESTART, SaveOccasionFlag::SAVE_WHEN_ERROR, SaveModeFlag::SAVE_WITH_FILE);
...@@ -86,6 +87,7 @@ restartApp(): void; ...@@ -86,6 +87,7 @@ restartApp(): void;
**示例:** **示例:**
```ts ```ts
import errorManager from '@ohos.app.ability.errorManager';
var observer = { var observer = {
onUnhandledException(errorMsg) { onUnhandledException(errorMsg) {
console.log('onUnhandledException, errorMsg: ', errorMsg) console.log('onUnhandledException, errorMsg: ', errorMsg)
...@@ -112,6 +114,7 @@ saveAppState(): boolean; ...@@ -112,6 +114,7 @@ saveAppState(): boolean;
**示例:** **示例:**
```ts ```ts
import errorManager from '@ohos.app.ability.errorManager';
var observer = { var observer = {
onUnhandledException(errorMsg) { onUnhandledException(errorMsg) {
console.log('onUnhandledException, errorMsg: ', errorMsg) console.log('onUnhandledException, errorMsg: ', errorMsg)
......
...@@ -25,7 +25,7 @@ import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; ...@@ -25,7 +25,7 @@ import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant';
| COLOR_MODE_LIGHT | 1 | 浅色模式。 | | COLOR_MODE_LIGHT | 1 | 浅色模式。 |
## ConfigurationConstant.Direction<sup>9+</sup> ## ConfigurationConstant.Direction
使用时通过ConfigurationConstant.Direction获取。 使用时通过ConfigurationConstant.Direction获取。
...@@ -38,7 +38,7 @@ import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; ...@@ -38,7 +38,7 @@ import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant';
| DIRECTION_HORIZONTAL | 1 | 水平方向。 | | DIRECTION_HORIZONTAL | 1 | 水平方向。 |
## ConfigurationConstant.ScreenDensity<sup>9+</sup> ## ConfigurationConstant.ScreenDensity
使用时通过ConfigurationConstant.ScreenDensity获取。 使用时通过ConfigurationConstant.ScreenDensity获取。
......
...@@ -33,11 +33,11 @@ onConfigurationUpdated(config: Configuration): void; ...@@ -33,11 +33,11 @@ onConfigurationUpdated(config: Configuration): void;
```ts ```ts
import Ability from "@ohos.application.Ability"; import UIAbility from "@ohos.app.ability.Ability";
var callbackId; var callbackId;
export default class MyAbility extends Ability { export default class MyAbility extends UIAbility {
onCreate() { onCreate() {
console.log("MyAbility onCreate") console.log("MyAbility onCreate")
globalThis.applicationContext = this.context.getApplicationContext(); globalThis.applicationContext = this.context.getApplicationContext();
......
...@@ -7,7 +7,7 @@ ErrorManager模块提供对错误观察器的注册和注销的能力。 ...@@ -7,7 +7,7 @@ ErrorManager模块提供对错误观察器的注册和注销的能力。
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块 ## 导入模块
``` ```ts
import errorManager from '@ohos.app.ability.errorManager' import errorManager from '@ohos.app.ability.errorManager'
``` ```
...@@ -28,7 +28,7 @@ on(type: "error", observer: ErrorObserver): number; ...@@ -28,7 +28,7 @@ on(type: "error", observer: ErrorObserver): number;
**示例:** **示例:**
```js ```ts
var observer = { var observer = {
onUnhandledException(errorMsg) { onUnhandledException(errorMsg) {
console.log('onUnhandledException, errorMsg: ', errorMsg) console.log('onUnhandledException, errorMsg: ', errorMsg)
...@@ -59,7 +59,7 @@ off(type: "error", observerId: number, callback: AsyncCallback\<void>): void; ...@@ -59,7 +59,7 @@ off(type: "error", observerId: number, callback: AsyncCallback\<void>): void;
**示例:** **示例:**
```js ```ts
var observerId = 100; var observerId = 100;
function unregisterErrorObserverCallback(err) { function unregisterErrorObserverCallback(err) {
...@@ -97,7 +97,7 @@ off(type: "error", observerId: number): Promise\<void>; ...@@ -97,7 +97,7 @@ off(type: "error", observerId: number): Promise\<void>;
**示例:** **示例:**
```js ```ts
var observerId = 100; var observerId = 100;
try { try {
errorManager.off("error", observerId) errorManager.off("error", observerId)
......
...@@ -43,8 +43,7 @@ on(type:"mission", listener: MissionListener): number; ...@@ -43,8 +43,7 @@ on(type:"mission", listener: MissionListener): number;
**示例:** **示例:**
```ts ```ts
import Ability from '@ohos.application.Ability' import UIAbility from '@ohos.app.ability.UIAbility';
import missionManager from '@ohos.app.ability.missionManager';
var listener = { var listener = {
onMissionCreated: function (mission) {console.log("--------onMissionCreated-------")}, onMissionCreated: function (mission) {console.log("--------onMissionCreated-------")},
...@@ -57,7 +56,7 @@ var listener = { ...@@ -57,7 +56,7 @@ var listener = {
var listenerId = -1; var listenerId = -1;
export default class MainAbility extends Ability { export default class MainAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility onCreate") console.log("[Demo] MainAbility onCreate")
globalThis.abilityWant = want; globalThis.abilityWant = want;
...@@ -124,8 +123,7 @@ off(type: "mission", listenerId: number, callback: AsyncCallback&lt;void&gt;): v ...@@ -124,8 +123,7 @@ off(type: "mission", listenerId: number, callback: AsyncCallback&lt;void&gt;): v
**示例:** **示例:**
```ts ```ts
import Ability from '@ohos.application.Ability' import UIAbility from '@ohos.app.ability.UIAbility';
import missionManager from '@ohos.app.ability.missionManager';
var listener = { var listener = {
onMissionCreated: function (mission) {console.log("--------onMissionCreated-------")}, onMissionCreated: function (mission) {console.log("--------onMissionCreated-------")},
...@@ -138,7 +136,7 @@ var listener = { ...@@ -138,7 +136,7 @@ var listener = {
var listenerId = -1; var listenerId = -1;
export default class MainAbility extends Ability { export default class MainAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility onCreate") console.log("[Demo] MainAbility onCreate")
globalThis.abilityWant = want; globalThis.abilityWant = want;
...@@ -210,8 +208,7 @@ off(type: "mission", listenerId: number): Promise&lt;void&gt;; ...@@ -210,8 +208,7 @@ off(type: "mission", listenerId: number): Promise&lt;void&gt;;
**示例:** **示例:**
```ts ```ts
import Ability from '@ohos.application.Ability' import UIAbility from '@ohos.app.ability.UIAbility';
import missionManager from '@ohos.app.ability.missionManager';
var listener = { var listener = {
onMissionCreated: function (mission) {console.log("--------onMissionCreated-------")}, onMissionCreated: function (mission) {console.log("--------onMissionCreated-------")},
...@@ -224,7 +221,7 @@ var listener = { ...@@ -224,7 +221,7 @@ var listener = {
var listenerId = -1; var listenerId = -1;
export default class MainAbility extends Ability { export default class MainAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility onCreate") console.log("[Demo] MainAbility onCreate")
globalThis.abilityWant = want; globalThis.abilityWant = want;
...@@ -292,8 +289,6 @@ getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback&lt;M ...@@ -292,8 +289,6 @@ getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback&lt;M
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
var allMissions=missionManager.getMissionInfos("",10).catch(function(err){console.log(err);}); var allMissions=missionManager.getMissionInfos("",10).catch(function(err){console.log(err);});
missionManager.getMissionInfo("", allMissions[0].missionId, (error, mission) => { missionManager.getMissionInfo("", allMissions[0].missionId, (error, mission) => {
...@@ -339,8 +334,6 @@ getMissionInfo(deviceId: string, missionId: number): Promise&lt;MissionInfo&gt;; ...@@ -339,8 +334,6 @@ getMissionInfo(deviceId: string, missionId: number): Promise&lt;MissionInfo&gt;;
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
var mission = missionManager.getMissionInfo("", 10).catch(function (err){ var mission = missionManager.getMissionInfo("", 10).catch(function (err){
console.log(err); console.log(err);
...@@ -374,8 +367,6 @@ getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback&lt;Arr ...@@ -374,8 +367,6 @@ getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback&lt;Arr
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
missionManager.getMissionInfos("", 10, (error, missions) => { missionManager.getMissionInfos("", 10, (error, missions) => {
console.log("getMissionInfos is called, error.code = " + error.code); console.log("getMissionInfos is called, error.code = " + error.code);
...@@ -416,8 +407,6 @@ getMissionInfos(deviceId: string, numMax: number): Promise&lt;Array&lt;MissionIn ...@@ -416,8 +407,6 @@ getMissionInfos(deviceId: string, numMax: number): Promise&lt;Array&lt;MissionIn
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
var allMissions = missionManager.getMissionInfos("", 10).catch(function (err){ var allMissions = missionManager.getMissionInfos("", 10).catch(function (err){
console.log(err); console.log(err);
...@@ -451,8 +440,6 @@ getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback& ...@@ -451,8 +440,6 @@ getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback&
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
missionManager.getMissionInfos("", 10, (error, missions) => { missionManager.getMissionInfos("", 10, (error, missions) => {
console.log("getMissionInfos is called, error.code = " + error.code); console.log("getMissionInfos is called, error.code = " + error.code);
...@@ -499,8 +486,6 @@ getMissionSnapShot(deviceId: string, missionId: number): Promise&lt;MissionSnaps ...@@ -499,8 +486,6 @@ getMissionSnapShot(deviceId: string, missionId: number): Promise&lt;MissionSnaps
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
var allMissions; var allMissions;
missionManager.getMissionInfos("",10).then(function(res){ missionManager.getMissionInfos("",10).then(function(res){
...@@ -541,8 +526,6 @@ getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: A ...@@ -541,8 +526,6 @@ getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: A
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
missionManager.getMissionInfos("", 10, (error, missions) => { missionManager.getMissionInfos("", 10, (error, missions) => {
console.log("getMissionInfos is called, error.code = " + error.code); console.log("getMissionInfos is called, error.code = " + error.code);
...@@ -589,8 +572,6 @@ getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise\<M ...@@ -589,8 +572,6 @@ getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise\<M
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
var allMissions; var allMissions;
missionManager.getMissionInfos("",10).then(function(res){ missionManager.getMissionInfos("",10).then(function(res){
...@@ -631,8 +612,6 @@ lockMission(missionId: number, callback: AsyncCallback&lt;void&gt;): void; ...@@ -631,8 +612,6 @@ lockMission(missionId: number, callback: AsyncCallback&lt;void&gt;): void;
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
missionManager.getMissionInfos("", 10, (error, missions) => { missionManager.getMissionInfos("", 10, (error, missions) => {
console.log("getMissionInfos is called, error.code = " + error.code); console.log("getMissionInfos is called, error.code = " + error.code);
...@@ -677,8 +656,6 @@ lockMission(missionId: number): Promise&lt;void&gt;; ...@@ -677,8 +656,6 @@ lockMission(missionId: number): Promise&lt;void&gt;;
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
var allMissions; var allMissions;
missionManager.getMissionInfos("",10).then(function(res){ missionManager.getMissionInfos("",10).then(function(res){
...@@ -719,8 +696,6 @@ unlockMission(missionId: number, callback: AsyncCallback&lt;void&gt;): void; ...@@ -719,8 +696,6 @@ unlockMission(missionId: number, callback: AsyncCallback&lt;void&gt;): void;
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
missionManager.getMissionInfos("", 10, (error, missions) => { missionManager.getMissionInfos("", 10, (error, missions) => {
console.log("getMissionInfos is called, error.code = " + error.code); console.log("getMissionInfos is called, error.code = " + error.code);
...@@ -765,8 +740,6 @@ unlockMission(missionId: number): Promise&lt;void&gt;; ...@@ -765,8 +740,6 @@ unlockMission(missionId: number): Promise&lt;void&gt;;
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
var allMissions; var allMissions;
missionManager.getMissionInfos("",10).then(function(res){ missionManager.getMissionInfos("",10).then(function(res){
...@@ -810,8 +783,6 @@ clearMission(missionId: number, callback: AsyncCallback&lt;void&gt;): void; ...@@ -810,8 +783,6 @@ clearMission(missionId: number, callback: AsyncCallback&lt;void&gt;): void;
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
missionManager.getMissionInfos("", 10, (error, missions) => { missionManager.getMissionInfos("", 10, (error, missions) => {
console.log("getMissionInfos is called, error.code = " + error.code); console.log("getMissionInfos is called, error.code = " + error.code);
...@@ -856,8 +827,6 @@ clearMission(missionId: number): Promise&lt;void&gt;; ...@@ -856,8 +827,6 @@ clearMission(missionId: number): Promise&lt;void&gt;;
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
var allMissions; var allMissions;
missionManager.getMissionInfos("",10).then(function(res){ missionManager.getMissionInfos("",10).then(function(res){
...@@ -891,8 +860,6 @@ clearAllMissions(callback: AsyncCallback&lt;void&gt;): void; ...@@ -891,8 +860,6 @@ clearAllMissions(callback: AsyncCallback&lt;void&gt;): void;
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
missionManager.clearAllMissions().then(() => { missionManager.clearAllMissions().then(() => {
console.log("clearAllMissions is called "); console.log("clearAllMissions is called ");
}); });
...@@ -920,7 +887,6 @@ clearAllMissions(): Promise&lt;void&gt;; ...@@ -920,7 +887,6 @@ clearAllMissions(): Promise&lt;void&gt;;
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
missionManager.clearAllMissions().catch(function (err){ missionManager.clearAllMissions().catch(function (err){
console.log(err); console.log(err);
}); });
...@@ -949,8 +915,6 @@ moveMissionToFront(missionId: number, callback: AsyncCallback&lt;void&gt;): void ...@@ -949,8 +915,6 @@ moveMissionToFront(missionId: number, callback: AsyncCallback&lt;void&gt;): void
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
missionManager.getMissionInfos("", 10, (error, missions) => { missionManager.getMissionInfos("", 10, (error, missions) => {
console.log("getMissionInfos is called, error.code = " + error.code); console.log("getMissionInfos is called, error.code = " + error.code);
...@@ -991,8 +955,6 @@ moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCall ...@@ -991,8 +955,6 @@ moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCall
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
missionManager.getMissionInfos("", 10, (error, missions) => { missionManager.getMissionInfos("", 10, (error, missions) => {
console.log("getMissionInfos is called, error.code = " + error.code); console.log("getMissionInfos is called, error.code = " + error.code);
...@@ -1038,8 +1000,6 @@ moveMissionToFront(missionId: number, options?: StartOptions): Promise&lt;void&g ...@@ -1038,8 +1000,6 @@ moveMissionToFront(missionId: number, options?: StartOptions): Promise&lt;void&g
**示例:** **示例:**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'
try { try {
var allMissions; var allMissions;
missionManager.getMissionInfos("",10).then(function(res){ missionManager.getMissionInfos("",10).then(function(res){
......
...@@ -65,8 +65,6 @@ applyQuickFix(hapModuleQuickFixFiles: Array\<string>, callback: AsyncCallback\<v ...@@ -65,8 +65,6 @@ applyQuickFix(hapModuleQuickFixFiles: Array\<string>, callback: AsyncCallback\<v
**示例:** **示例:**
```ts ```ts
import quickFixManager from '@ohos.app.ability.quickFixManager'
try { try {
let hapModuleQuickFixFiles = ["/data/storage/el2/base/entry.hqf"] let hapModuleQuickFixFiles = ["/data/storage/el2/base/entry.hqf"]
quickFixManager.applyQuickFix(hapModuleQuickFixFiles, (error) => { quickFixManager.applyQuickFix(hapModuleQuickFixFiles, (error) => {
...@@ -108,8 +106,6 @@ applyQuickFix(hapModuleQuickFixFiles: Array\<string>): Promise\<void>; ...@@ -108,8 +106,6 @@ applyQuickFix(hapModuleQuickFixFiles: Array\<string>): Promise\<void>;
**示例:** **示例:**
```ts ```ts
import quickFixManager from '@ohos.app.ability.quickFixManager'
let hapModuleQuickFixFiles = ["/data/storage/el2/base/entry.hqf"] let hapModuleQuickFixFiles = ["/data/storage/el2/base/entry.hqf"]
try { try {
quickFixManager.applyQuickFix(hapModuleQuickFixFiles).then(() => { quickFixManager.applyQuickFix(hapModuleQuickFixFiles).then(() => {
...@@ -144,8 +140,6 @@ getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback\<Applicat ...@@ -144,8 +140,6 @@ getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback\<Applicat
**示例:** **示例:**
```ts ```ts
import quickFixManager from '@ohos.app.ability.quickFixManager'
try { try {
let bundleName = "bundleName" let bundleName = "bundleName"
quickFixManager.getApplicationQuickFixInfo(bundleName, (error, data) => { quickFixManager.getApplicationQuickFixInfo(bundleName, (error, data) => {
...@@ -187,8 +181,6 @@ getApplicationQuickFixInfo(bundleName: string): Promise\<ApplicationQuickFixInfo ...@@ -187,8 +181,6 @@ getApplicationQuickFixInfo(bundleName: string): Promise\<ApplicationQuickFixInfo
**示例:** **示例:**
```ts ```ts
import quickFixManager from '@ohos.app.ability.quickFixManager'
try { try {
let bundleName = "bundleName" let bundleName = "bundleName"
quickFixManager.getApplicationQuickFixInfo(bundleName).then((data) => { quickFixManager.getApplicationQuickFixInfo(bundleName).then((data) => {
......
...@@ -4,7 +4,7 @@ ServiceExtensionAbility模块提供ServiceExtension服务扩展相关接口的 ...@@ -4,7 +4,7 @@ ServiceExtensionAbility模块提供ServiceExtension服务扩展相关接口的
> **说明:** > **说明:**
> >
> 本模块首批接口从API version 9开始支持,从API version 9废弃,替换模块为[@ohos.app.ability.ServiceExtensionAbility](js-apis-app-ability-serviceExtensionAbility.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。 > 本模块接口仅可在Stage模型下使用。
## 导入模块 ## 导入模块
......
...@@ -15,7 +15,7 @@ Ability模块提供对Ability生命周期、上下文环境等调用管理的能 ...@@ -15,7 +15,7 @@ Ability模块提供对Ability生命周期、上下文环境等调用管理的能
## 导入模块 ## 导入模块
```ts ```ts
import Ability from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
``` ```
## 属性 ## 属性
...@@ -47,7 +47,7 @@ Ability创建时回调,执行初始化业务逻辑操作。 ...@@ -47,7 +47,7 @@ Ability创建时回调,执行初始化业务逻辑操作。
**示例:** **示例:**
```ts ```ts
class myAbility extends Ability { class MyAbility extends UIAbility {
onCreate(want, param) { onCreate(want, param) {
console.log('onCreate, want:' + want.abilityName); console.log('onCreate, want:' + want.abilityName);
} }
...@@ -72,7 +72,7 @@ onWindowStageCreate(windowStage: window.WindowStage): void ...@@ -72,7 +72,7 @@ onWindowStageCreate(windowStage: window.WindowStage): void
**示例:** **示例:**
```ts ```ts
class myAbility extends Ability { class MyAbility extends UIAbility {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
} }
...@@ -91,7 +91,7 @@ onWindowStageDestroy(): void ...@@ -91,7 +91,7 @@ onWindowStageDestroy(): void
**示例:** **示例:**
```ts ```ts
class myAbility extends Ability { class MyAbility extends UIAbility {
onWindowStageDestroy() { onWindowStageDestroy() {
console.log('onWindowStageDestroy'); console.log('onWindowStageDestroy');
} }
...@@ -116,7 +116,7 @@ onWindowStageRestore(windowStage: window.WindowStage): void ...@@ -116,7 +116,7 @@ onWindowStageRestore(windowStage: window.WindowStage): void
**示例:** **示例:**
```ts ```ts
class myAbility extends Ability { class MyAbility extends UIAbility {
onWindowStageRestore(windowStage) { onWindowStageRestore(windowStage) {
console.log('onWindowStageRestore'); console.log('onWindowStageRestore');
} }
...@@ -135,7 +135,7 @@ Ability生命周期回调,在销毁时回调,执行资源清理等操作。 ...@@ -135,7 +135,7 @@ Ability生命周期回调,在销毁时回调,执行资源清理等操作。
**示例:** **示例:**
```ts ```ts
class myAbility extends Ability { class MyAbility extends UIAbility {
onDestroy() { onDestroy() {
console.log('onDestroy'); console.log('onDestroy');
} }
...@@ -154,7 +154,7 @@ Ability生命周期回调,当应用从后台转到前台时触发。 ...@@ -154,7 +154,7 @@ Ability生命周期回调,当应用从后台转到前台时触发。
**示例:** **示例:**
```ts ```ts
class myAbility extends Ability { class MyAbility extends UIAbility {
onForeground() { onForeground() {
console.log('onForeground'); console.log('onForeground');
} }
...@@ -173,7 +173,7 @@ Ability生命周期回调,当应用从前台转到后台时触发。 ...@@ -173,7 +173,7 @@ Ability生命周期回调,当应用从前台转到后台时触发。
**示例:** **示例:**
```ts ```ts
class myAbility extends Ability { class MyAbility extends UIAbility {
onBackground() { onBackground() {
console.log('onBackground'); console.log('onBackground');
} }
...@@ -204,8 +204,8 @@ onContinue(wantParam : {[key: string]: any}): AbilityConstant.OnContinueResult; ...@@ -204,8 +204,8 @@ onContinue(wantParam : {[key: string]: any}): AbilityConstant.OnContinueResult;
**示例:** **示例:**
```ts ```ts
import AbilityConstant from "@ohos.application.AbilityConstant" import AbilityConstant from "@ohos.app.ability.AbilityConstant"
class myAbility extends Ability { class MyAbility extends UIAbility {
onContinue(wantParams) { onContinue(wantParams) {
console.log('onContinue'); console.log('onContinue');
wantParams["myData"] = "my1234567"; wantParams["myData"] = "my1234567";
...@@ -227,13 +227,13 @@ onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void; ...@@ -227,13 +227,13 @@ onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | 是 | Want类型参数,如ability名称,包名等。 | | want | [Want](js-apis-app-ability-want.md) | 是 | Want类型参数,如ability名称,包名等。 |
| launchParams | AbilityConstant.LaunchParam | 是 | Ability启动的原因、上次异常退出的原因信息。 | | launchParams | AbilityConstant.LaunchParam | 是 | Ability启动的原因、上次异常退出的原因信息。 |
**示例:** **示例:**
```ts ```ts
class myAbility extends Ability { class MyAbility extends UIAbility {
onNewWant(want) { onNewWant(want) {
console.log('onNewWant, want:' + want.abilityName); console.log('onNewWant, want:' + want.abilityName);
} }
...@@ -257,7 +257,7 @@ onDump(params: Array\<string>): Array\<string>; ...@@ -257,7 +257,7 @@ onDump(params: Array\<string>): Array\<string>;
**示例:** **示例:**
```ts ```ts
class myAbility extends Ability { class MyAbility extends UIAbility {
onDump(params) { onDump(params) {
console.log('dump, params:' + JSON.stringify(params)); console.log('dump, params:' + JSON.stringify(params));
return ["params"] return ["params"]
...@@ -278,7 +278,7 @@ onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any}) ...@@ -278,7 +278,7 @@ onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any})
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| reason | [AbilityConstant.StateType](js-apis-application-abilityConstant.md#abilityconstantstatetype) | 是 | 回调保存状态的原因。 | | reason | [AbilityConstant.StateType](js-apis-app-ability-abilityConstant.md#abilityconstantstatetype) | 是 | 回调保存状态的原因。 |
| wantParam | {[key:&nbsp;string]:&nbsp;any} | 是 | want相关参数。 | | wantParam | {[key:&nbsp;string]:&nbsp;any} | 是 | want相关参数。 |
**返回值:** **返回值:**
...@@ -290,9 +290,9 @@ onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any}) ...@@ -290,9 +290,9 @@ onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any})
**示例:** **示例:**
```ts ```ts
import AbilityConstant from '@ohos.application.AbilityConstant' import AbilityConstant from '@ohos.app.ability.AbilityConstant'
class myAbility extends Ability { class MyAbility extends UIAbility {
onSaveState(reason, wantParam) { onSaveState(reason, wantParam) {
console.log('onSaveState'); console.log('onSaveState');
wantParam["myData"] = "my1234567"; wantParam["myData"] = "my1234567";
...@@ -338,7 +338,6 @@ call(method: string, data: rpc.Sequenceable): Promise&lt;void&gt;; ...@@ -338,7 +338,6 @@ call(method: string, data: rpc.Sequenceable): Promise&lt;void&gt;;
**示例:** **示例:**
```ts ```ts
import Ability from '@ohos.app.ability.UIAbility';
class MyMessageAble{ // 自定义的Sequenceable数据结构 class MyMessageAble{ // 自定义的Sequenceable数据结构
name:"" name:""
str:"" str:""
...@@ -362,7 +361,7 @@ call(method: string, data: rpc.Sequenceable): Promise&lt;void&gt;; ...@@ -362,7 +361,7 @@ call(method: string, data: rpc.Sequenceable): Promise&lt;void&gt;;
}; };
var method = 'call_Function'; // 约定的通知消息字符串 var method = 'call_Function'; // 约定的通知消息字符串
var caller; var caller;
export default class MainAbility extends Ability { export default class MainAbility extends UIAbility {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
this.context.startAbilityByCall({ this.context.startAbilityByCall({
bundleName: "com.example.myservice", bundleName: "com.example.myservice",
...@@ -419,7 +418,6 @@ callWithResult(method: string, data: rpc.Sequenceable): Promise&lt;rpc.MessagePa ...@@ -419,7 +418,6 @@ callWithResult(method: string, data: rpc.Sequenceable): Promise&lt;rpc.MessagePa
**示例:** **示例:**
```ts ```ts
import Ability from '@ohos.app.ability.UIAbility';
class MyMessageAble{ class MyMessageAble{
name:"" name:""
str:"" str:""
...@@ -443,7 +441,7 @@ callWithResult(method: string, data: rpc.Sequenceable): Promise&lt;rpc.MessagePa ...@@ -443,7 +441,7 @@ callWithResult(method: string, data: rpc.Sequenceable): Promise&lt;rpc.MessagePa
}; };
var method = 'call_Function'; var method = 'call_Function';
var caller; var caller;
export default class MainAbility extends Ability { export default class MainAbility extends UIAbility {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
this.context.startAbilityByCall({ this.context.startAbilityByCall({
bundleName: "com.example.myservice", bundleName: "com.example.myservice",
...@@ -491,9 +489,8 @@ release(): void; ...@@ -491,9 +489,8 @@ release(): void;
**示例:** **示例:**
```ts ```ts
import Ability from '@ohos.app.ability.UIAbility';
var caller; var caller;
export default class MainAbility extends Ability { export default class MainAbility extends UIAbility {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
this.context.startAbilityByCall({ this.context.startAbilityByCall({
bundleName: "com.example.myservice", bundleName: "com.example.myservice",
...@@ -532,9 +529,8 @@ release(): void; ...@@ -532,9 +529,8 @@ release(): void;
**示例:** **示例:**
```ts ```ts
import Ability from '@ohos.application.Ability';
var caller; var caller;
export default class MainAbility extends Ability { export default class MainAbility extends UIAbility {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
this.context.startAbilityByCall({ this.context.startAbilityByCall({
bundleName: "com.example.myservice", bundleName: "com.example.myservice",
...@@ -583,9 +579,8 @@ release(): void; ...@@ -583,9 +579,8 @@ release(): void;
**示例:** **示例:**
```ts ```ts
import Ability from '@ohos.app.ability.UIAbility';
var caller; var caller;
export default class MainAbility extends Ability { export default class MainAbility extends UIAbility {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
this.context.startAbilityByCall({ this.context.startAbilityByCall({
bundleName: "com.example.myservice", bundleName: "com.example.myservice",
...@@ -639,7 +634,6 @@ on(method: string, callback: CalleeCallback): void; ...@@ -639,7 +634,6 @@ on(method: string, callback: CalleeCallback): void;
**示例:** **示例:**
```ts ```ts
import Ability from '@ohos.app.ability.UIAbility';
class MyMessageAble{ class MyMessageAble{
name:"" name:""
str:"" str:""
...@@ -668,7 +662,7 @@ on(method: string, callback: CalleeCallback): void; ...@@ -668,7 +662,7 @@ on(method: string, callback: CalleeCallback): void;
pdata.readSequenceable(msg); pdata.readSequenceable(msg);
return new MyMessageAble("test1", "Callee test"); return new MyMessageAble("test1", "Callee test");
} }
export default class MainAbility extends Ability { export default class MainAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log('Callee onCreate is called'); console.log('Callee onCreate is called');
try { try {
...@@ -706,9 +700,8 @@ off(method: string): void; ...@@ -706,9 +700,8 @@ off(method: string): void;
**示例:** **示例:**
```ts ```ts
import Ability from '@ohos.app.ability.UIAbility';
var method = 'call_Function'; var method = 'call_Function';
export default class MainAbility extends Ability { export default class MainAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log('Callee onCreate is called'); console.log('Callee onCreate is called');
try { try {
......
...@@ -23,9 +23,9 @@ import Want from '@ohos.app.ability.Want'; ...@@ -23,9 +23,9 @@ import Want from '@ohos.app.ability.Want';
| abilityName | string | 否 | 表示待启动的Ability名称。如果在Want中该字段同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。AbilityName需要在一个应用的范围内保证唯一。 | | abilityName | string | 否 | 表示待启动的Ability名称。如果在Want中该字段同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。AbilityName需要在一个应用的范围内保证唯一。 |
| uri | string | 否 | 表示Uri描述。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。 | | uri | string | 否 | 表示Uri描述。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。 |
| type | string | 否 | 表示MIME type类型描述,打开文件的类型,主要用于文管打开文件。比如:"text/xml" 、 "image/*"等,MIME定义参考:https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com。 | | type | string | 否 | 表示MIME type类型描述,打开文件的类型,主要用于文管打开文件。比如:"text/xml" 、 "image/*"等,MIME定义参考:https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com。 |
| flags | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](js-apis-ability-wantConstant.md#wantConstant.Flags)。 | | flags | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](js-apis-app-ability-wantConstant.md#wantConstant.Flags)。 |
| action | string | 否 | 表示要执行的通用操作(如:查看、分享、应用详情)。在隐式Want中,您可以定义该字段,配合uri或parameters来表示对数据要执行的操作。 | | action | string | 否 | 表示要执行的通用操作(如:查看、分享、应用详情)。在隐式Want中,您可以定义该字段,配合uri或parameters来表示对数据要执行的操作。 |
| parameters | {[key: string]: any} | 否 | 表示WantParams描述,由开发者自行决定传入的键值对。默认会携带以下key值:<br>ohos.aafwk.callerPid 表示拉起方的pid。<br>ohos.aafwk.param.callerToken 表示拉起方的token。<br>ohos.aafwk.param.callerUid 表示[bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo-1)中的uid,应用包里应用程序的uid。 | | parameters | {[key: string]: any} | 否 | 表示WantParams描述,由开发者自行决定传入的键值对。默认会携带以下key值:<br>ohos.aafwk.callerPid 表示拉起方的pid。<br>ohos.aafwk.param.callerToken 表示拉起方的token。<br>ohos.aafwk.param.callerUid 表示[bundleInfo](js-apis-bundleManager-bundleInfo.md#bundleinfo-1)中的uid,应用包里应用程序的uid。 |
| entities | Array\<string> | 否 | 表示目标Ability额外的类别信息(如:浏览器、视频播放器),在隐式Want中是对action字段的补充。在隐式Want中,您可以定义该字段,来过滤匹配Ability类型。 | | entities | Array\<string> | 否 | 表示目标Ability额外的类别信息(如:浏览器、视频播放器),在隐式Want中是对action字段的补充。在隐式Want中,您可以定义该字段,来过滤匹配Ability类型。 |
| moduleName | string | 否 | 表示待启动的Ability所属的模块(module)。 | | moduleName | string | 否 | 表示待启动的Ability所属的模块(module)。 |
......
...@@ -28,7 +28,6 @@ getWantAgent(info: WantAgentInfo, callback: AsyncCallback\<WantAgent\>): void ...@@ -28,7 +28,6 @@ getWantAgent(info: WantAgentInfo, callback: AsyncCallback\<WantAgent\>): void
| callback | AsyncCallback\<WantAgent\> | 是 | 创建WantAgent的回调方法。 | | callback | AsyncCallback\<WantAgent\> | 是 | 创建WantAgent的回调方法。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
...@@ -53,13 +52,12 @@ getWantAgent(info: WantAgentInfo, callback: AsyncCallback\<WantAgent\>): void ...@@ -53,13 +52,12 @@ getWantAgent(info: WantAgentInfo, callback: AsyncCallback\<WantAgent\>): void
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
//WantAgentInfo对象 //WantAgentInfo对象
...@@ -128,7 +126,6 @@ getWantAgent(info: WantAgentInfo): Promise\<WantAgent\> ...@@ -128,7 +126,6 @@ getWantAgent(info: WantAgentInfo): Promise\<WantAgent\>
| Promise\<WantAgent\> | 以Promise形式返回WantAgent。 | | Promise\<WantAgent\> | 以Promise形式返回WantAgent。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
...@@ -153,13 +150,11 @@ getWantAgent(info: WantAgentInfo): Promise\<WantAgent\> ...@@ -153,13 +150,11 @@ getWantAgent(info: WantAgentInfo): Promise\<WantAgent\>
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent';
//WantAgentInfo对象 //WantAgentInfo对象
var wantAgentInfo = { var wantAgentInfo = {
wants: [ wants: [
...@@ -245,7 +240,6 @@ getBundleName(agent: WantAgent, callback: AsyncCallback\<string\>): void ...@@ -245,7 +240,6 @@ getBundleName(agent: WantAgent, callback: AsyncCallback\<string\>): void
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
//WantAgentInfo对象 //WantAgentInfo对象
...@@ -327,7 +321,6 @@ getBundleName(agent: WantAgent): Promise\<string\> ...@@ -327,7 +321,6 @@ getBundleName(agent: WantAgent): Promise\<string\>
| Promise\<string\> | 以Promise形式返回获取WantAgent实例的包名。 | | Promise\<string\> | 以Promise形式返回获取WantAgent实例的包名。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
...@@ -352,12 +345,11 @@ getBundleName(agent: WantAgent): Promise\<string\> ...@@ -352,12 +345,11 @@ getBundleName(agent: WantAgent): Promise\<string\>
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
//WantAgentInfo对象 //WantAgentInfo对象
...@@ -430,7 +422,6 @@ getUid(agent: WantAgent, callback: AsyncCallback\<number\>): void ...@@ -430,7 +422,6 @@ getUid(agent: WantAgent, callback: AsyncCallback\<number\>): void
| callback | AsyncCallback\<number\> | 是 | 获取WantAgent实例的用户ID的回调方法。 | | callback | AsyncCallback\<number\> | 是 | 获取WantAgent实例的用户ID的回调方法。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
...@@ -455,6 +446,7 @@ getUid(agent: WantAgent, callback: AsyncCallback\<number\>): void ...@@ -455,6 +446,7 @@ getUid(agent: WantAgent, callback: AsyncCallback\<number\>): void
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
...@@ -541,7 +533,6 @@ getUid(agent: WantAgent): Promise\<number\> ...@@ -541,7 +533,6 @@ getUid(agent: WantAgent): Promise\<number\>
| Promise\<number\> | 以Promise形式返回获取WantAgent实例的用户ID。 | | Promise\<number\> | 以Promise形式返回获取WantAgent实例的用户ID。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
...@@ -566,13 +557,12 @@ getUid(agent: WantAgent): Promise\<number\> ...@@ -566,13 +557,12 @@ getUid(agent: WantAgent): Promise\<number\>
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent'; //wantAgent对象
//wantAgent对象
var wantAgent; var wantAgent;
//WantAgentInfo对象 //WantAgentInfo对象
var wantAgentInfo = { var wantAgentInfo = {
...@@ -645,7 +635,6 @@ getWant(agent: WantAgent, callback: AsyncCallback\<Want\>): void ...@@ -645,7 +635,6 @@ getWant(agent: WantAgent, callback: AsyncCallback\<Want\>): void
| callback | AsyncCallback\<Want\> | 是 | 获取WantAgent对象want的回调方法。 | | callback | AsyncCallback\<Want\> | 是 | 获取WantAgent对象want的回调方法。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
|错误码ID |错误信息 | |错误码ID |错误信息 |
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
...@@ -671,11 +660,11 @@ getWant(agent: WantAgent, callback: AsyncCallback\<Want\>): void ...@@ -671,11 +660,11 @@ getWant(agent: WantAgent, callback: AsyncCallback\<Want\>): void
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
//WantAgentInfo对象 //WantAgentInfo对象
...@@ -759,7 +748,6 @@ getWant(agent: WantAgent): Promise\<Want\> ...@@ -759,7 +748,6 @@ getWant(agent: WantAgent): Promise\<Want\>
| Promise\<Want\> | 以Promise形式返回获取WantAgent对象的want。 | | Promise\<Want\> | 以Promise形式返回获取WantAgent对象的want。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
...@@ -784,13 +772,12 @@ getWant(agent: WantAgent): Promise\<Want\> ...@@ -784,13 +772,12 @@ getWant(agent: WantAgent): Promise\<Want\>
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent'; //wantAgent对象
//wantAgent对象
var wantAgent; var wantAgent;
//WantAgentInfo对象 //WantAgentInfo对象
var wantAgentInfo = { var wantAgentInfo = {
...@@ -862,7 +849,6 @@ cancel(agent: WantAgent, callback: AsyncCallback\<void\>): void ...@@ -862,7 +849,6 @@ cancel(agent: WantAgent, callback: AsyncCallback\<void\>): void
| callback | AsyncCallback\<void\> | 是 | 取消WantAgent实例的回调方法。 | | callback | AsyncCallback\<void\> | 是 | 取消WantAgent实例的回调方法。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
...@@ -887,11 +873,11 @@ cancel(agent: WantAgent, callback: AsyncCallback\<void\>): void ...@@ -887,11 +873,11 @@ cancel(agent: WantAgent, callback: AsyncCallback\<void\>): void
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
//WantAgentInfo对象 //WantAgentInfo对象
...@@ -973,7 +959,6 @@ cancel(agent: WantAgent): Promise\<void\> ...@@ -973,7 +959,6 @@ cancel(agent: WantAgent): Promise\<void\>
| Promise\<void\> | 以Promise形式获取异步返回结果。 | | Promise\<void\> | 以Promise形式获取异步返回结果。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
...@@ -998,12 +983,11 @@ cancel(agent: WantAgent): Promise\<void\> ...@@ -998,12 +983,11 @@ cancel(agent: WantAgent): Promise\<void\>
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
//WantAgentInfo对象 //WantAgentInfo对象
...@@ -1079,7 +1063,6 @@ trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback\<Co ...@@ -1079,7 +1063,6 @@ trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback\<Co
| callback | AsyncCallback\<CompleteData\> | 否 | 主动激发WantAgent实例的回调方法。 | | callback | AsyncCallback\<CompleteData\> | 否 | 主动激发WantAgent实例的回调方法。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
...@@ -1104,11 +1087,11 @@ trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback\<Co ...@@ -1104,11 +1087,11 @@ trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback\<Co
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
// triggerInfo // triggerInfo
...@@ -1190,7 +1173,6 @@ equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback\<boolean\ ...@@ -1190,7 +1173,6 @@ equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback\<boolean\
| callback | AsyncCallback\<boolean\> | 是 | 判断两个WantAgent实例是否相等的回调方法。 | | callback | AsyncCallback\<boolean\> | 是 | 判断两个WantAgent实例是否相等的回调方法。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
...@@ -1215,11 +1197,11 @@ equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback\<boolean\ ...@@ -1215,11 +1197,11 @@ equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback\<boolean\
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent';
//wantAgent对象 //wantAgent对象
var wantAgent1; var wantAgent1;
var wantAgent2; var wantAgent2;
...@@ -1304,7 +1286,6 @@ equal(agent: WantAgent, otherAgent: WantAgent): Promise\<boolean\> ...@@ -1304,7 +1286,6 @@ equal(agent: WantAgent, otherAgent: WantAgent): Promise\<boolean\>
| Promise\<boolean\> | 以Promise形式返回获取判断两个WantAgent实例是否相等的结果。 | | Promise\<boolean\> | 以Promise形式返回获取判断两个WantAgent实例是否相等的结果。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
...@@ -1329,13 +1310,12 @@ equal(agent: WantAgent, otherAgent: WantAgent): Promise\<boolean\> ...@@ -1329,13 +1310,12 @@ equal(agent: WantAgent, otherAgent: WantAgent): Promise\<boolean\>
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent'; //wantAgent对象
//wantAgent对象
var wantAgent1; var wantAgent1;
var wantAgent2; var wantAgent2;
//WantAgentInfo对象 //WantAgentInfo对象
...@@ -1407,7 +1387,6 @@ getOperationType(agent: WantAgent, callback: AsyncCallback\<number>): void; ...@@ -1407,7 +1387,6 @@ getOperationType(agent: WantAgent, callback: AsyncCallback\<number>): void;
| callback | AsyncCallback\<number> | 是 | 获取一个WantAgent的OperationType信息的回调方法。 | | callback | AsyncCallback\<number> | 是 | 获取一个WantAgent的OperationType信息的回调方法。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
...@@ -1432,11 +1411,11 @@ getOperationType(agent: WantAgent, callback: AsyncCallback\<number>): void; ...@@ -1432,11 +1411,11 @@ getOperationType(agent: WantAgent, callback: AsyncCallback\<number>): void;
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
//WantAgentInfo对象 //WantAgentInfo对象
...@@ -1516,7 +1495,6 @@ getOperationType(agent: WantAgent): Promise\<number>; ...@@ -1516,7 +1495,6 @@ getOperationType(agent: WantAgent): Promise\<number>;
| Promise\<number> | 以Promise形式返回获取operationType的结果。 | | Promise\<number> | 以Promise形式返回获取operationType的结果。 |
**错误码:** **错误码:**
以下错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
|-----------|--------------------| |-----------|--------------------|
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
...@@ -1541,13 +1519,12 @@ getOperationType(agent: WantAgent): Promise\<number>; ...@@ -1541,13 +1519,12 @@ getOperationType(agent: WantAgent): Promise\<number>;
| 16000151 | Invalid wantagent object.| | 16000151 | Invalid wantagent object.|
| 16000152 | wantAgent object not found.| | 16000152 | wantAgent object not found.|
| 16000153 | wangAgent object canceled.| | 16000153 | wangAgent object canceled.|
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:** **示例:**
```ts ```ts
import WantAgent from '@ohos.app.ability.wantAgent'; //wantAgent对象
//wantAgent对象
var wantAgent; var wantAgent;
//WantAgentInfo对象 //WantAgentInfo对象
var wantAgentInfo = { var wantAgentInfo = {
......
...@@ -6,7 +6,7 @@ AbilityConstant提供启动参数的接口的能力,包括设置初次开始 ...@@ -6,7 +6,7 @@ AbilityConstant提供启动参数的接口的能力,包括设置初次开始
> **说明:** > **说明:**
> >
> 本模块首批接口从API version 9开始支持,从API version 9废弃,替换模块为[@ohos.app.ability.AbilityConstant](js-apis-app-ability-abilityConstant.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9开始支持,从API version 9后续版本废弃,替换模块为[@ohos.app.ability.AbilityConstant](js-apis-app-ability-abilityConstant.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。 > 本模块接口仅可在Stage模型下使用。
## 导入模块 ## 导入模块
......
...@@ -4,7 +4,7 @@ AbilityDelegatorRegistry模块提供用于存储已注册的AbilityDelegator和A ...@@ -4,7 +4,7 @@ AbilityDelegatorRegistry模块提供用于存储已注册的AbilityDelegator和A
> **说明:** > **说明:**
> >
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8开始支持,从API version 9废弃,替换模块为[@ohos.app.ability.abilityDelegatorRegistry](js-apis-app-ability-abilityDelegatorRegistry.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块 ## 导入模块
......
...@@ -4,7 +4,7 @@ AbilityLifecycleCallback模块提供应用上下文ApplicationContext的生命 ...@@ -4,7 +4,7 @@ AbilityLifecycleCallback模块提供应用上下文ApplicationContext的生命
> **说明:** > **说明:**
> >
> 本模块首批接口从API version 9 开始支持,从API version 9废弃,替换模块为[@ohos.app.ability.AbilityLifecycleCallback](js-apis-app-ability-abilityLifecycleCallback.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9 开始支持,从API version 9后续版本废弃,替换模块为[@ohos.app.ability.AbilityLifecycleCallback](js-apis-app-ability-abilityLifecycleCallback.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。 > 本模块接口仅可在Stage模型下使用。
......
...@@ -4,13 +4,13 @@ AbilityManager模块提供对Ability相关信息和状态信息进行获取、 ...@@ -4,13 +4,13 @@ AbilityManager模块提供对Ability相关信息和状态信息进行获取、
> **说明:** > **说明:**
> >
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8开始支持,从API version 9废弃,替换模块为[@ohos.app.ability.abilityManager](js-apis-app-ability-abilityManager.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口均为系统接口,三方应用不支持调用。 > 本模块接口均为系统接口,三方应用不支持调用。
## 导入模块 ## 导入模块
```ts ```ts
import AbilityManager from '@ohos.application.abilityManager' import abilityManager from '@ohos.application.abilityManager'
``` ```
## AbilityState ## AbilityState
...@@ -49,13 +49,11 @@ updateConfiguration(config: Configuration, callback: AsyncCallback\<void>): void ...@@ -49,13 +49,11 @@ updateConfiguration(config: Configuration, callback: AsyncCallback\<void>): void
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.application.abilityManager';
var config = { var config = {
language: 'chinese' language: 'chinese'
} }
abilitymanager.updateConfiguration(config, () => { abilityManager.updateConfiguration(config, () => {
console.log('------------ updateConfiguration -----------'); console.log('------------ updateConfiguration -----------');
}) })
``` ```
...@@ -85,13 +83,11 @@ updateConfiguration(config: Configuration): Promise\<void> ...@@ -85,13 +83,11 @@ updateConfiguration(config: Configuration): Promise\<void>
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.application.abilityManager';
var config = { var config = {
language: 'chinese' language: 'chinese'
} }
abilitymanager.updateConfiguration(config).then(() => { abilityManager.updateConfiguration(config).then(() => {
console.log('updateConfiguration success'); console.log('updateConfiguration success');
}).catch((err) => { }).catch((err) => {
console.log('updateConfiguration fail'); console.log('updateConfiguration fail');
...@@ -117,9 +113,7 @@ getAbilityRunningInfos(callback: AsyncCallback\<Array\<AbilityRunningInfo>>): vo ...@@ -117,9 +113,7 @@ getAbilityRunningInfos(callback: AsyncCallback\<Array\<AbilityRunningInfo>>): vo
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.application.abilityManager'; abilityManager.getAbilityRunningInfos((err,data) => {
abilitymanager.getAbilityRunningInfos((err,data) => {
console.log("getAbilityRunningInfos err: " + err + " data: " + JSON.stringify(data)); console.log("getAbilityRunningInfos err: " + err + " data: " + JSON.stringify(data));
}); });
``` ```
...@@ -143,9 +137,7 @@ getAbilityRunningInfos(): Promise\<Array\<AbilityRunningInfo>> ...@@ -143,9 +137,7 @@ getAbilityRunningInfos(): Promise\<Array\<AbilityRunningInfo>>
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.application.abilityManager'; abilityManager.getAbilityRunningInfos().then((data) => {
abilitymanager.getAbilityRunningInfos().then((data) => {
console.log("getAbilityRunningInfos data: " + JSON.stringify(data)) console.log("getAbilityRunningInfos data: " + JSON.stringify(data))
}).catch((err) => { }).catch((err) => {
console.log("getAbilityRunningInfos err: " + err) console.log("getAbilityRunningInfos err: " + err)
...@@ -172,11 +164,9 @@ getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback\<Array\<Ext ...@@ -172,11 +164,9 @@ getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback\<Array\<Ext
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.application.abilityManager';
var upperLimit = 0; var upperLimit = 0;
abilitymanager.getExtensionRunningInfos(upperLimit, (err,data) => { abilityManager.getExtensionRunningInfos(upperLimit, (err,data) => {
console.log("getExtensionRunningInfos err: " + err + " data: " + JSON.stringify(data)); console.log("getExtensionRunningInfos err: " + err + " data: " + JSON.stringify(data));
}); });
``` ```
...@@ -206,11 +196,9 @@ getExtensionRunningInfos(upperLimit: number): Promise\<Array\<ExtensionRunningIn ...@@ -206,11 +196,9 @@ getExtensionRunningInfos(upperLimit: number): Promise\<Array\<ExtensionRunningIn
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.application.abilityManager';
var upperLimit = 0; var upperLimit = 0;
abilitymanager.getExtensionRunningInfos(upperLimit).then((data) => { abilityManager.getExtensionRunningInfos(upperLimit).then((data) => {
console.log("getAbilityRunningInfos data: " + JSON.stringify(data)); console.log("getAbilityRunningInfos data: " + JSON.stringify(data));
}).catch((err) => { }).catch((err) => {
console.log("getAbilityRunningInfos err: " + err); console.log("getAbilityRunningInfos err: " + err);
...@@ -234,9 +222,7 @@ getTopAbility(callback: AsyncCallback\<ElementName>): void; ...@@ -234,9 +222,7 @@ getTopAbility(callback: AsyncCallback\<ElementName>): void;
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.application.abilityManager'; abilityManager.getTopAbility((err,data) => {
abilitymanager.getTopAbility((err,data) => {
console.log("getTopAbility err: " + err + " data: " + JSON.stringify(data)); console.log("getTopAbility err: " + err + " data: " + JSON.stringify(data));
}); });
``` ```
...@@ -258,9 +244,7 @@ getTopAbility(): Promise\<ElementName>; ...@@ -258,9 +244,7 @@ getTopAbility(): Promise\<ElementName>;
**示例** **示例**
```ts ```ts
import abilitymanager from '@ohos.application.abilityManager'; abilityManager.getTopAbility().then((data) => {
abilitymanager.getTopAbility().then((data) => {
console.log("getTopAbility data: " + JSON.stringify(data)); console.log("getTopAbility data: " + JSON.stringify(data));
}).catch((err) => { }).catch((err) => {
console.log("getTopAbility err: " + err); console.log("getTopAbility err: " + err);
......
...@@ -9,7 +9,7 @@ appManager模块提供App管理的能力,包括查询当前是否处于稳定 ...@@ -9,7 +9,7 @@ appManager模块提供App管理的能力,包括查询当前是否处于稳定
## 导入模块 ## 导入模块
```ts ```ts
import app from '@ohos.application.appManager'; import appManager from '@ohos.application.appManager';
``` ```
## appManager.isRunningInStabilityTest<sup>8+</sup> ## appManager.isRunningInStabilityTest<sup>8+</sup>
...@@ -29,9 +29,9 @@ static isRunningInStabilityTest(callback: AsyncCallback&lt;boolean&gt;): void ...@@ -29,9 +29,9 @@ static isRunningInStabilityTest(callback: AsyncCallback&lt;boolean&gt;): void
**示例:** **示例:**
```ts ```ts
import app from '@ohos.application.appManager'; appManager.isRunningInStabilityTest((err, flag) => {
app.isRunningInStabilityTest((err, flag) => { console.log('error:' + JSON.stringfy(err));
console.log('startAbility result:' + JSON.stringify(err)); console.log('The result of isRunningInStabilityTest is:' + JSON.stringify(flag));
}) })
``` ```
...@@ -53,11 +53,10 @@ static isRunningInStabilityTest(): Promise&lt;boolean&gt; ...@@ -53,11 +53,10 @@ static isRunningInStabilityTest(): Promise&lt;boolean&gt;
**示例:** **示例:**
```ts ```ts
import app from '@ohos.application.appManager'; appManager.isRunningInStabilityTest().then((flag) => {
app.isRunningInStabilityTest().then((flag) => { console.log('The result of isRunningInStabilityTest is:' + JSON.stringify(flag));
console.log('success:' + JSON.stringify(flag));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringify(error)); console.log('error:' + JSON.stringify(error));
}); });
``` ```
...@@ -79,10 +78,10 @@ isRamConstrainedDevice(): Promise\<boolean>; ...@@ -79,10 +78,10 @@ isRamConstrainedDevice(): Promise\<boolean>;
**示例:** **示例:**
```ts ```ts
app.isRamConstrainedDevice().then((data) => { appManager.isRamConstrainedDevice().then((data) => {
console.log('success:' + JSON.stringify(data)); console.log('The result of isRamConstrainedDevice is:' + JSON.stringify(data));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringify(error)); console.log('error:' + JSON.stringify(error));
}); });
``` ```
...@@ -103,9 +102,9 @@ isRamConstrainedDevice(callback: AsyncCallback\<boolean>): void; ...@@ -103,9 +102,9 @@ isRamConstrainedDevice(callback: AsyncCallback\<boolean>): void;
**示例:** **示例:**
```ts ```ts
app.isRamConstrainedDevice((err, data) => { appManager.isRamConstrainedDevice((err, data) => {
console.log('startAbility result failed:' + JSON.stringify(err)); console.log('error:' + JSON.stringify(err));
console.log('startAbility result success:' + JSON.stringify(data)); console.log('The result of isRamConstrainedDevice is:' + JSON.stringify(data));
}) })
``` ```
...@@ -126,10 +125,10 @@ getAppMemorySize(): Promise\<number>; ...@@ -126,10 +125,10 @@ getAppMemorySize(): Promise\<number>;
**示例:** **示例:**
```ts ```ts
app.getAppMemorySize().then((data) => { appManager.getAppMemorySize().then((data) => {
console.log('success:' + JSON.stringify(data)); console.log('The size of app memory is:' + JSON.stringify(data));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringify(error)); console.log('error:' + JSON.stringify(error));
}); });
``` ```
...@@ -150,9 +149,9 @@ getAppMemorySize(callback: AsyncCallback\<number>): void; ...@@ -150,9 +149,9 @@ getAppMemorySize(callback: AsyncCallback\<number>): void;
**示例:** **示例:**
```ts ```ts
app.getAppMemorySize((err, data) => { appManager.getAppMemorySize((err, data) => {
console.log('startAbility result failed :' + JSON.stringify(err)); console.log('error:' + JSON.stringify(err));
console.log('startAbility result success:' + JSON.stringify(data)); console.log('The size of app memory is:' + JSON.stringify(data));
}) })
``` ```
## appManager.getProcessRunningInfos<sup>(deprecated)</sup> ## appManager.getProcessRunningInfos<sup>(deprecated)</sup>
...@@ -176,10 +175,10 @@ getProcessRunningInfos(): Promise\<Array\<ProcessRunningInfo>>; ...@@ -176,10 +175,10 @@ getProcessRunningInfos(): Promise\<Array\<ProcessRunningInfo>>;
**示例:** **示例:**
```ts ```ts
app.getProcessRunningInfos().then((data) => { appManager.getProcessRunningInfos().then((data) => {
console.log('success:' + JSON.stringify(data)); console.log('The process running infos is:' + JSON.stringify(data));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringify(error)); console.log('error:' + JSON.stringify(error));
}); });
``` ```
...@@ -204,9 +203,9 @@ getProcessRunningInfos(callback: AsyncCallback\<Array\<ProcessRunningInfo>>): vo ...@@ -204,9 +203,9 @@ getProcessRunningInfos(callback: AsyncCallback\<Array\<ProcessRunningInfo>>): vo
**示例:** **示例:**
```ts ```ts
app.getProcessRunningInfos((err, data) => { appManager.getProcessRunningInfos((err, data) => {
console.log('startAbility result failed :' + JSON.stringify(err)); console.log('error:' + JSON.stringify(err));
console.log('startAbility result success:' + JSON.stringify(data)); console.log('The process running infos is:' + JSON.stringify(data));
}) })
``` ```
...@@ -229,10 +228,10 @@ getProcessRunningInformation(): Promise\<Array\<ProcessRunningInformation>>; ...@@ -229,10 +228,10 @@ getProcessRunningInformation(): Promise\<Array\<ProcessRunningInformation>>;
**示例:** **示例:**
```ts ```ts
app.getProcessRunningInformation().then((data) => { appManager.getProcessRunningInformation().then((data) => {
console.log('success:' + JSON.stringify(data)); console.log('The process running info is:' + JSON.stringify(data));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringify(error)); console.log('error:' + JSON.stringify(error));
}); });
``` ```
...@@ -255,9 +254,9 @@ getProcessRunningInformation(callback: AsyncCallback\<Array\<ProcessRunningInfor ...@@ -255,9 +254,9 @@ getProcessRunningInformation(callback: AsyncCallback\<Array\<ProcessRunningInfor
**示例:** **示例:**
```ts ```ts
app.getProcessRunningInformation((err, data) => { appManager.getProcessRunningInformation((err, data) => {
console.log('startAbility result failed :' + JSON.stringify(err)); console.log('error:' + JSON.stringify(err));
console.log('startAbility result success:' + JSON.stringify(data)); console.log('The process running info is:' + JSON.stringify(data));
}) })
``` ```
...@@ -299,7 +298,7 @@ registerApplicationStateObserver(observer: ApplicationStateObserver): number; ...@@ -299,7 +298,7 @@ registerApplicationStateObserver(observer: ApplicationStateObserver): number;
console.log('------------ onProcessStateChanged -----------', processData); console.log('------------ onProcessStateChanged -----------', processData);
} }
} }
const observerCode = app.registerApplicationStateObserver(applicationStateObserver); const observerCode = appManager.registerApplicationStateObserver(applicationStateObserver);
console.log('-------- observerCode: ---------', observerCode); console.log('-------- observerCode: ---------', observerCode);
``` ```
...@@ -343,7 +342,7 @@ registerApplicationStateObserver(observer: ApplicationStateObserver, bundleNameL ...@@ -343,7 +342,7 @@ registerApplicationStateObserver(observer: ApplicationStateObserver, bundleNameL
} }
} }
var bundleNameList = ['bundleName1', 'bundleName2']; var bundleNameList = ['bundleName1', 'bundleName2'];
const observerCode = app.registerApplicationStateObserver(applicationStateObserver, bundleNameList); const observerCode = appManager.registerApplicationStateObserver(applicationStateObserver, bundleNameList);
console.log('-------- observerCode: ---------', observerCode); console.log('-------- observerCode: ---------', observerCode);
``` ```
## appManager.unregisterApplicationStateObserver<sup>8+</sup> ## appManager.unregisterApplicationStateObserver<sup>8+</sup>
...@@ -375,7 +374,7 @@ unregisterApplicationStateObserver(observerId: number, callback: AsyncCallback\ ...@@ -375,7 +374,7 @@ unregisterApplicationStateObserver(observerId: number, callback: AsyncCallback\
console.log('------------ unregisterApplicationStateObserverCallback ------------', err); console.log('------------ unregisterApplicationStateObserverCallback ------------', err);
} }
} }
app.unregisterApplicationStateObserver(observerId, unregisterApplicationStateObserverCallback); appManager.unregisterApplicationStateObserver(observerId, unregisterApplicationStateObserverCallback);
``` ```
## appManager.unregisterApplicationStateObserver<sup>8+</sup> ## appManager.unregisterApplicationStateObserver<sup>8+</sup>
...@@ -407,7 +406,7 @@ unregisterApplicationStateObserver(observerId: number): Promise\<void>; ...@@ -407,7 +406,7 @@ unregisterApplicationStateObserver(observerId: number): Promise\<void>;
```ts ```ts
var observerId = 100; var observerId = 100;
app.unregisterApplicationStateObserver(observerId) appManager.unregisterApplicationStateObserver(observerId)
.then((data) => { .then((data) => {
console.log('----------- unregisterApplicationStateObserver success ----------', data); console.log('----------- unregisterApplicationStateObserver success ----------', data);
}) })
...@@ -444,7 +443,7 @@ getForegroundApplications(callback: AsyncCallback\<Array\<AppStateData>>): void; ...@@ -444,7 +443,7 @@ getForegroundApplications(callback: AsyncCallback\<Array\<AppStateData>>): void;
console.log('--------- getForegroundApplicationsCallback success ---------', data) console.log('--------- getForegroundApplicationsCallback success ---------', data)
} }
} }
app.getForegroundApplications(getForegroundApplicationsCallback); appManager.getForegroundApplications(getForegroundApplicationsCallback);
``` ```
## appManager.getForegroundApplications<sup>8+</sup> ## appManager.getForegroundApplications<sup>8+</sup>
...@@ -468,7 +467,7 @@ getForegroundApplications(): Promise\<Array\<AppStateData>>; ...@@ -468,7 +467,7 @@ getForegroundApplications(): Promise\<Array\<AppStateData>>;
**示例:** **示例:**
```ts ```ts
app.getForegroundApplications() appManager.getForegroundApplications()
.then((data) => { .then((data) => {
console.log('--------- getForegroundApplications success -------', data); console.log('--------- getForegroundApplications success -------', data);
}) })
...@@ -501,7 +500,7 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\> ...@@ -501,7 +500,7 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\>
```ts ```ts
var bundleName = 'bundleName'; var bundleName = 'bundleName';
var accountId = 0; var accountId = 0;
app.killProcessWithAccount(bundleName, accountId) appManager.killProcessWithAccount(bundleName, accountId)
.then((data) => { .then((data) => {
console.log('------------ killProcessWithAccount success ------------', data); console.log('------------ killProcessWithAccount success ------------', data);
}) })
...@@ -543,7 +542,7 @@ function killProcessWithAccountCallback(err, data) { ...@@ -543,7 +542,7 @@ function killProcessWithAccountCallback(err, data) {
console.log('------------- killProcessWithAccountCallback success, data: --------------', data); console.log('------------- killProcessWithAccountCallback success, data: --------------', data);
} }
} }
app.killProcessWithAccount(bundleName, accountId, killProcessWithAccountCallback); appManager.killProcessWithAccount(bundleName, accountId, killProcessWithAccountCallback);
``` ```
## appManager.killProcessesByBundleName<sup>8+</sup> ## appManager.killProcessesByBundleName<sup>8+</sup>
...@@ -576,7 +575,7 @@ killProcessesByBundleName(bundleName: string, callback: AsyncCallback\<void>); ...@@ -576,7 +575,7 @@ killProcessesByBundleName(bundleName: string, callback: AsyncCallback\<void>);
console.log('------------- killProcessesByBundleNameCallback success, data: --------------', data); console.log('------------- killProcessesByBundleNameCallback success, data: --------------', data);
} }
} }
app.killProcessesByBundleName(bundleName, killProcessesByBundleNameCallback); appManager.killProcessesByBundleName(bundleName, killProcessesByBundleNameCallback);
``` ```
## appManager.killProcessesByBundleName<sup>8+</sup> ## appManager.killProcessesByBundleName<sup>8+</sup>
...@@ -607,7 +606,7 @@ killProcessesByBundleName(bundleName: string): Promise\<void>; ...@@ -607,7 +606,7 @@ killProcessesByBundleName(bundleName: string): Promise\<void>;
```ts ```ts
var bundleName = 'bundleName'; var bundleName = 'bundleName';
app.killProcessesByBundleName(bundleName) appManager.killProcessesByBundleName(bundleName)
.then((data) => { .then((data) => {
console.log('------------ killProcessesByBundleName success ------------', data); console.log('------------ killProcessesByBundleName success ------------', data);
}) })
...@@ -646,7 +645,7 @@ clearUpApplicationData(bundleName: string, callback: AsyncCallback\<void>); ...@@ -646,7 +645,7 @@ clearUpApplicationData(bundleName: string, callback: AsyncCallback\<void>);
console.log('------------- clearUpApplicationDataCallback success, data: --------------', data); console.log('------------- clearUpApplicationDataCallback success, data: --------------', data);
} }
} }
app.clearUpApplicationData(bundleName, clearUpApplicationDataCallback); appManager.clearUpApplicationData(bundleName, clearUpApplicationDataCallback);
``` ```
## appManager.clearUpApplicationData<sup>8+</sup> ## appManager.clearUpApplicationData<sup>8+</sup>
...@@ -677,7 +676,7 @@ clearUpApplicationData(bundleName: string): Promise\<void>; ...@@ -677,7 +676,7 @@ clearUpApplicationData(bundleName: string): Promise\<void>;
```ts ```ts
var bundleName = 'bundleName'; var bundleName = 'bundleName';
app.clearUpApplicationData(bundleName) appManager.clearUpApplicationData(bundleName)
.then((data) => { .then((data) => {
console.log('------------ clearUpApplicationData success ------------', data); console.log('------------ clearUpApplicationData success ------------', data);
}) })
......
...@@ -4,7 +4,7 @@ EnvironmentCallback模块提供应用上下文ApplicationContext对系统环境 ...@@ -4,7 +4,7 @@ EnvironmentCallback模块提供应用上下文ApplicationContext对系统环境
> **说明:** > **说明:**
> >
> 本模块首批接口从API version 9 开始支持,从API version 9废弃,替换模块为[@ohos.app.ability.EnvironmentCallback](js-apis-app-ability-environmentCallback.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9 开始支持,从API version 9后续版本废弃,替换模块为[@ohos.app.ability.EnvironmentCallback](js-apis-app-ability-environmentCallback.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。 > 本模块接口仅可在Stage模型下使用。
......
...@@ -4,7 +4,7 @@ ErrorManager模块提供对错误观察器的注册和注销的能力。 ...@@ -4,7 +4,7 @@ ErrorManager模块提供对错误观察器的注册和注销的能力。
> **说明:** > **说明:**
> >
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9开始支持,从API version 9后续版本废弃,替换模块为[@ohos.app.ability.errorManager](js-apis-app-ability-errorManager.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块 ## 导入模块
```ts ```ts
......
...@@ -4,7 +4,7 @@ missionManager模块提供系统任务管理能力,包括对系统任务执行 ...@@ -4,7 +4,7 @@ missionManager模块提供系统任务管理能力,包括对系统任务执行
> **说明:** > **说明:**
> >
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8开始支持,从API version 9废弃,替换模块为[@ohos.app.ability.missionManager](js-apis-app-ability-missionManager.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块 ## 导入模块
......
...@@ -4,7 +4,7 @@ ServiceExtensionAbility模块提供ServiceExtension服务扩展相关接口的 ...@@ -4,7 +4,7 @@ ServiceExtensionAbility模块提供ServiceExtension服务扩展相关接口的
> **说明:** > **说明:**
> >
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9开始支持,从API version 9废弃,替换模块为[@ohos.app.ability.ServiceExtensionAbility](js-apis-app-ability-serviceExtensionAbility.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。 > 本模块接口仅可在Stage模型下使用。
## 导入模块 ## 导入模块
......
...@@ -4,7 +4,7 @@ StartOptions模块对系统的基本通信组件进行查询和设置的能力 ...@@ -4,7 +4,7 @@ StartOptions模块对系统的基本通信组件进行查询和设置的能力
> **说明:** > **说明:**
> >
> 本模块首批接口从API version 9 开始支持,从API version 9废弃,替换模块为[@ohos.app.ability.StartOptions](js-apis-app-ability-startOptions.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9 开始支持,从API version 9后续版本废弃,替换模块为[@ohos.app.ability.StartOptions](js-apis-app-ability-startOptions.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。 > 本模块接口仅可在Stage模型下使用。
## 导入模块 ## 导入模块
......
...@@ -4,7 +4,7 @@ Want是对象间信息传递的载体, 可以用于应用组件间的信息传 ...@@ -4,7 +4,7 @@ Want是对象间信息传递的载体, 可以用于应用组件间的信息传
> **说明:** > **说明:**
> >
> 本模块首批接口从API version 8 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8 开始支持,从API version 9废弃,替换模块为[Want](js-apis-app-ability-want.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块 ## 导入模块
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册