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

!18591 翻译完成:18216 FIx docs description of form

Merge pull request !18591 from wusongqing/TR18216
...@@ -7,6 +7,12 @@ This is the base class of [UIAbility](js-apis-app-ability-uiAbility.md) and [Ext ...@@ -7,6 +7,12 @@ This is the base class of [UIAbility](js-apis-app-ability-uiAbility.md) and [Ext
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The APIs of this module can be used only in the stage model. > The APIs of this module can be used only in the stage model.
## Modules to Import
```ts
import Ability from '@ohos.app.ability.Ability';
```
## Ability.onConfigurationUpdate ## Ability.onConfigurationUpdate
onConfigurationUpdate(newConfig: Configuration): void; onConfigurationUpdate(newConfig: Configuration): void;
......
...@@ -412,7 +412,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -412,7 +412,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
```ts ```ts
import abilityManager from '@ohos.app.ability.abilityManager'; import abilityManager from '@ohos.app.ability.abilityManager';
abilityManager.acquireShareData(1, (err, wantParam) => { abilityManager.acquireShareData(1, (err, data) => {
if (err) { if (err) {
console.error(`acquireShareData fail, err: ${JSON.stringify(err)}`); console.error(`acquireShareData fail, err: ${JSON.stringify(err)}`);
} else { } else {
...@@ -449,7 +449,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -449,7 +449,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
```ts ```ts
import abilityManager from '@ohos.app.ability.abilityManager'; import abilityManager from '@ohos.app.ability.abilityManager';
try { try {
abilityManager.acquireShareData(1).then((wantParam) => { abilityManager.acquireShareData(1).then((data) => {
console.log(`acquireShareData success, data: ${JSON.stringify(data)}`); console.log(`acquireShareData success, data: ${JSON.stringify(data)}`);
}).catch((err) => { }).catch((err) => {
console.error(`acquireShareData fail, err: ${JSON.stringify(err)}`); console.error(`acquireShareData fail, err: ${JSON.stringify(err)}`);
......
...@@ -22,9 +22,9 @@ Checks whether this application is undergoing a stability test. This API uses an ...@@ -22,9 +22,9 @@ Checks whether this application is undergoing a stability test. This API uses an
**Parameters** **Parameters**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
|AsyncCallback<boolean> |Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.| |AsyncCallback<boolean> |Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.|
**Error codes** **Error codes**
...@@ -59,9 +59,9 @@ Checks whether this application is undergoing a stability test. This API uses a ...@@ -59,9 +59,9 @@ Checks whether this application is undergoing a stability test. This API uses a
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.| | Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.|
**Error codes** **Error codes**
...@@ -94,9 +94,9 @@ Checks whether this application is running on a RAM constrained device. This API ...@@ -94,9 +94,9 @@ Checks whether this application is running on a RAM constrained device. This API
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.| | Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.|
**Error codes** **Error codes**
...@@ -128,9 +128,9 @@ Checks whether this application is running on a RAM constrained device. This API ...@@ -128,9 +128,9 @@ Checks whether this application is running on a RAM constrained device. This API
**Parameters** **Parameters**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| AsyncCallback<boolean> |Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.| | AsyncCallback<boolean> |Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.|
**Error codes** **Error codes**
...@@ -164,9 +164,9 @@ Obtains the memory size of this application. This API uses a promise to return t ...@@ -164,9 +164,9 @@ Obtains the memory size of this application. This API uses a promise to return t
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise<number> | Promise used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.| | Promise<number> | Promise used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.|
**Error codes** **Error codes**
...@@ -198,9 +198,9 @@ Obtains the memory size of this application. This API uses an asynchronous callb ...@@ -198,9 +198,9 @@ Obtains the memory size of this application. This API uses an asynchronous callb
**Parameters** **Parameters**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
|AsyncCallback<number> |Callback used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.| |AsyncCallback<number> |Callback used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.|
**Error codes** **Error codes**
...@@ -641,7 +641,7 @@ Obtains applications that are running in the foreground. This API uses a promise ...@@ -641,7 +641,7 @@ Obtains applications that are running in the foreground. This API uses a promise
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise\<Array\<[AppStateData](js-apis-inner-application-appStateData.md)>> | Promise used to return an array holding the application state data| | Promise\<Array\<[AppStateData](js-apis-inner-application-appStateData.md)>> | Promise used to return an array holding the application state data. |
**Error codes** **Error codes**
...@@ -669,7 +669,11 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\> ...@@ -669,7 +669,11 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\>
Kills a process by bundle name and account ID. This API uses a promise to return the result. Kills a process by bundle name and account ID. This API uses a promise to return the result.
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) and ohos.permission.CLEAN_BACKGROUND_PROCESSES > **NOTE**
>
> The **ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS** permission is not required when **accountId** specifies the current user.
**Required permissions**: ohos.permission.CLEAN_BACKGROUND_PROCESSES and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -715,19 +719,23 @@ killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCal ...@@ -715,19 +719,23 @@ killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCal
Kills a process by bundle name and account ID. This API uses an asynchronous callback to return the result. Kills a process by bundle name and account ID. This API uses an asynchronous callback to return the result.
> **NOTE**
>
> The **ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS** permission is not required when **accountId** specifies the current user.
**Required permissions**: ohos.permission.CLEAN_BACKGROUND_PROCESSES and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications. **System API**: This is a system API and cannot be called by third-party applications.
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) and ohos.permission.CLEAN_BACKGROUND_PROCESSES
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Bundle name.| | bundleName | string | Yes| Bundle name.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| | accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| callback | AsyncCallback\<void\> | Yes| Callback used to return the API call result. You can perform error handling or custom processing in this callback.| | callback | AsyncCallback\<void\> | Yes| Callback used to return the API call result. You can perform error handling or custom processing in this callback.|
**Error codes** **Error codes**
......
...@@ -6,6 +6,12 @@ The **Configuration** module defines environment change information. **Configura ...@@ -6,6 +6,12 @@ The **Configuration** module defines environment change information. **Configura
> >
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
```ts
import Configuration from '@ohos.app.ability.Configuration';
```
**System capability**: SystemCapability.Ability.AbilityBase **System capability**: SystemCapability.Ability.AbilityBase
| Name| Type| Readable| Writable| Description| | Name| Type| Readable| Writable| Description|
......
...@@ -41,32 +41,71 @@ Obtains the request information from Want. ...@@ -41,32 +41,71 @@ Obtains the request information from Want.
import rpc from '@ohos.rpc'; import rpc from '@ohos.rpc';
import dialogRequest from '@ohos.app.ability.dialogRequest'; import dialogRequest from '@ohos.app.ability.dialogRequest';
export default class ServiceExtAbility extends ServiceExtensionAbility { const REQUEST_VALUE = 1;
onCreate(want) {
console.info(TAG, `onCreate, want: ${want.abilityName}`); class StubTest extends rpc.RemoteObject {
} constructor(des) {
super(des);
onRequest(want, startId) { }
console.info(TAG, `onRequest, want: ${want.abilityName}`);
try { onRemoteRequest(code, data, reply, option) {
var requestInfo = dialogRequest.getRequestInfo(want); if (code === REQUEST_VALUE) {
} catch(err) { let optFir = data.readInt();
console.error('getRequestInfo err= ${JSON.stringify(err)}'); let optSec = data.readInt();
reply.writeInt(optFir + optSec);
} }
} return true;
}
queryLocallInterface(descriptor) {
return null;
}
getInterfaceDescriptor() {
return "";
}
getCallingPid() {
return REQUEST_VALUE;
}
getCallingUid() {
return REQUEST_VALUE;
}
attachLocalInterface(localInterface, descriptor) {
}
}
let TAG = "getRequestInfoTest";
export default class ServiceExtAbility extends ServiceExtensionAbility {
onCreate(want) {
console.info(TAG, `onCreate, want: ${want.abilityName}`);
}
onRequest(want, startId) {
console.info(TAG, `onRequest, want: ${want.abilityName}`);
try {
var requestInfo = dialogRequest.getRequestInfo(want);
} catch (err) {
console.error('getRequestInfo err= ${JSON.stringify(err)}');
}
}
onConnect(want) { onConnect(want) {
console.info(TAG, `onConnect, want: ${want.abilityName}`); console.info(TAG, `onConnect, want: ${want.abilityName}`);
} return new StubTest("test");
}
onDisconnect(want) { onDisconnect(want) {
console.info(TAG, `onDisconnect, want: ${want.abilityName}`); console.info(TAG, `onDisconnect, want: ${want.abilityName}`);
} }
onDestroy() { onDestroy() {
console.info(TAG, `onDestroy`); console.info(TAG, `onDestroy`);
} }
} }
``` ```
## dialogRequest.getRequestCallback ## dialogRequest.getRequestCallback
...@@ -95,6 +134,44 @@ Obtains the request callback from Want. ...@@ -95,6 +134,44 @@ Obtains the request callback from Want.
import ServiceExtensionAbility from '@ohos.app.ability.ServiceExtensionAbility'; import ServiceExtensionAbility from '@ohos.app.ability.ServiceExtensionAbility';
import rpc from '@ohos.rpc'; import rpc from '@ohos.rpc';
import dialogRequest from '@ohos.app.ability.dialogRequest'; import dialogRequest from '@ohos.app.ability.dialogRequest';
let TAG = "getRequestCallbackTest";
const REQUEST_VALUE = 1;
class StubTest extends rpc.RemoteObject {
constructor(des) {
super(des);
}
onRemoteRequest(code, data, reply, option) {
if (code === REQUEST_VALUE) {
let optFir = data.readInt();
let optSec = data.readInt();
reply.writeInt(optFir + optSec);
}
return true;
}
queryLocallInterface(descriptor) {
return null;
}
getInterfaceDescriptor() {
return "";
}
getCallingPid() {
return REQUEST_VALUE;
}
getCallingUid() {
return REQUEST_VALUE;
}
attachLocalInterface(localInterface, descriptor) {
}
}
export default class ServiceExtAbility extends ServiceExtensionAbility { export default class ServiceExtAbility extends ServiceExtensionAbility {
onCreate(want) { onCreate(want) {
...@@ -112,6 +189,7 @@ Obtains the request callback from Want. ...@@ -112,6 +189,7 @@ Obtains the request callback from Want.
onConnect(want) { onConnect(want) {
console.info(TAG, `onConnect, want: ${want.abilityName}`); console.info(TAG, `onConnect, want: ${want.abilityName}`);
return new StubTest("test");
} }
onDisconnect(want) { onDisconnect(want) {
...@@ -127,8 +205,7 @@ Obtains the request callback from Want. ...@@ -127,8 +205,7 @@ Obtains the request callback from Want.
## RequestInfo ## RequestInfo
Defines the request information, which is used as an input parameter for binding the modal dialog box. Defines the request information, which is used as an input parameter for binding the modal dialog box.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Example** **Example**
...@@ -137,6 +214,44 @@ Defines the request information, which is used as an input parameter for binding ...@@ -137,6 +214,44 @@ Defines the request information, which is used as an input parameter for binding
import rpc from '@ohos.rpc'; import rpc from '@ohos.rpc';
import dialogRequest from '@ohos.app.ability.dialogRequest'; import dialogRequest from '@ohos.app.ability.dialogRequest';
import window from '@ohos.window'; import window from '@ohos.window';
let TAG = "RequestInfoTest";
const REQUEST_VALUE = 1;
class StubTest extends rpc.RemoteObject {
constructor(des) {
super(des);
}
onRemoteRequest(code, data, reply, option) {
if (code === REQUEST_VALUE) {
let optFir = data.readInt();
let optSec = data.readInt();
reply.writeInt(optFir + optSec);
}
return true;
}
queryLocallInterface(descriptor) {
return null;
}
getInterfaceDescriptor() {
return "";
}
getCallingPid() {
return REQUEST_VALUE;
}
getCallingUid() {
return REQUEST_VALUE;
}
attachLocalInterface(localInterface, descriptor) {
}
}
export default class ServiceExtAbility extends ServiceExtensionAbility { export default class ServiceExtAbility extends ServiceExtensionAbility {
onCreate(want) { onCreate(want) {
...@@ -163,6 +278,8 @@ Defines the request information, which is used as an input parameter for binding ...@@ -163,6 +278,8 @@ Defines the request information, which is used as an input parameter for binding
onConnect(want) { onConnect(want) {
console.info(TAG, `onConnect, want: ${want.abilityName}`); console.info(TAG, `onConnect, want: ${want.abilityName}`);
return new StubTest("test");
} }
onDisconnect(want) { onDisconnect(want) {
...@@ -179,7 +296,7 @@ Defines the request information, which is used as an input parameter for binding ...@@ -179,7 +296,7 @@ Defines the request information, which is used as an input parameter for binding
Enumerates the result codes of the request for the modal dialog box. Enumerates the result codes of the request for the modal dialog box.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Value | Description | | Name | Value | Description |
| ------------ | ------------------ | ---------------------- | | ------------ | ------------------ | ---------------------- |
...@@ -191,7 +308,7 @@ Defines the result of the request for the modal dialog box. Only the result code ...@@ -191,7 +308,7 @@ Defines the result of the request for the modal dialog box. Only the result code
## Attributes ## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name| Type| Readable| Writable| Description| | Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
...@@ -207,7 +324,7 @@ setRequestResult(result: RequestResult): void; ...@@ -207,7 +324,7 @@ setRequestResult(result: RequestResult): void;
Sets the result of the request for the modal dialog box. Sets the result of the request for the modal dialog box.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore **System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters** **Parameters**
...@@ -229,6 +346,44 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -229,6 +346,44 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
import ServiceExtensionAbility from '@ohos.app.ability.ServiceExtensionAbility'; import ServiceExtensionAbility from '@ohos.app.ability.ServiceExtensionAbility';
import rpc from '@ohos.rpc'; import rpc from '@ohos.rpc';
import dialogRequest from '@ohos.app.ability.dialogRequest'; import dialogRequest from '@ohos.app.ability.dialogRequest';
let TAG = "setRequestResultTest";
const REQUEST_VALUE = 1;
class StubTest extends rpc.RemoteObject {
constructor(des) {
super(des);
}
onRemoteRequest(code, data, reply, option) {
if (code === REQUEST_VALUE) {
let optFir = data.readInt();
let optSec = data.readInt();
reply.writeInt(optFir + optSec);
}
return true;
}
queryLocallInterface(descriptor) {
return null;
}
getInterfaceDescriptor() {
return "";
}
getCallingPid() {
return REQUEST_VALUE;
}
getCallingUid() {
return REQUEST_VALUE;
}
attachLocalInterface(localInterface, descriptor) {
}
}
export default class ServiceExtAbility extends ServiceExtensionAbility { export default class ServiceExtAbility extends ServiceExtensionAbility {
onCreate(want) { onCreate(want) {
...@@ -250,6 +405,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -250,6 +405,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
onConnect(want) { onConnect(want) {
console.info(TAG, `onConnect, want: ${want.abilityName}`); console.info(TAG, `onConnect, want: ${want.abilityName}`);
return new StubTest("test");
} }
onDisconnect(want) { onDisconnect(want) {
......
...@@ -45,8 +45,7 @@ Called when the system memory level changes. ...@@ -45,8 +45,7 @@ Called when the system memory level changes.
**Example** **Example**
```ts
```ts
import UIAbility from '@ohos.app.ability.Ability'; import UIAbility from '@ohos.app.ability.Ability';
let callbackId; let callbackId;
...@@ -58,7 +57,7 @@ export default class MyAbility extends UIAbility { ...@@ -58,7 +57,7 @@ export default class MyAbility extends UIAbility {
let environmentCallback = { let environmentCallback = {
onConfigurationUpdated(config){ onConfigurationUpdated(config){
console.log('onConfigurationUpdated config: ${JSON.stringify(config)}'); console.log('onConfigurationUpdated config: ${JSON.stringify(config)}');
} },
onMemoryLevel(level){ onMemoryLevel(level){
console.log('onMemoryLevel level: ${JSON.stringify(level)}'); console.log('onMemoryLevel level: ${JSON.stringify(level)}');
...@@ -81,4 +80,4 @@ export default class MyAbility extends UIAbility { ...@@ -81,4 +80,4 @@ export default class MyAbility extends UIAbility {
}); });
} }
} }
``` ```
...@@ -311,33 +311,36 @@ Obtains the information about a given mission. This API uses an asynchronous cal ...@@ -311,33 +311,36 @@ Obtains the information about a given mission. This API uses an asynchronous cal
**Example** **Example**
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager'; import missionManager from '@ohos.app.ability.missionManager';
let testMissionId = 1; let testMissionId = 1;
try {
let allMissions=await missionManager.getMissionInfos('',10).catch(function(err){console.log(err);});
if (allMissions && allMissions.length > 0) {
testMissionId = allMissions[0].missionId;
}
missionManager.getMissionInfo('', testMissionId, (error, mission) => { missionManager.getMissionInfos('',10)
if (error) { .then((allMissions) => {
try {
if (allMissions && allMissions.length > 0) {
testMissionId = allMissions[0].missionId;
}
missionManager.getMissionInfo('', testMissionId, (error, mission) => {
if (error) {
console.error('getMissionInfo failed, error.code: ${error.code}, error.message: ${error.message}'); console.error('getMissionInfo failed, error.code: ${error.code}, error.message: ${error.message}');
} else { } else {
console.log('mission.missionId = ${mission.missionId}'); console.log('mission.missionId = ${mission.missionId}');
console.log('mission.runningState = ${mission.runningState}'); console.log('mission.runningState = ${mission.runningState}');
console.log('mission.lockedState = ${mission.lockedState}'); console.log('mission.lockedState = ${mission.lockedState}');
console.log('mission.timestamp = ${mission.timestamp}'); console.log('mission.timestamp = ${mission.timestamp}');
console.log('mission.label = ${mission.label}'); console.log('mission.label = ${mission.label}');
console.log('mission.iconPath = ${mission.iconPath}'); console.log('mission.iconPath = ${mission.iconPath}');
}
});
} catch (paramError) {
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
} }
}); })
} catch (paramError) { .catch(function(err){console.log(err);});
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
}
``` ```
## missionManager.getMissionInfo ## missionManager.getMissionInfo
getMissionInfo(deviceId: string, missionId: number): Promise&lt;MissionInfo&gt;; getMissionInfo(deviceId: string, missionId: number): Promise&lt;MissionInfo&gt;;
...@@ -943,8 +946,8 @@ Clears all unlocked missions. This API uses a promise to return the result. ...@@ -943,8 +946,8 @@ Clears all unlocked missions. This API uses a promise to return the result.
import missionManager from '@ohos.app.ability.missionManager'; import missionManager from '@ohos.app.ability.missionManager';
try { try {
missionManager.clearAllMissions(bundleName).then(() => { missionManager.clearAllMissions(bundleName).then((data) => {
console.info('clearAllMissions successfully.'); console.info('clearAllMissions successfully. Data: ${JSON.stringify(data)}');
}).catch(err => { }).catch(err => {
console.error('clearAllMissions failed: ${err.message}'); console.error('clearAllMissions failed: ${err.message}');
}); });
......
...@@ -66,7 +66,7 @@ Applies a quick fix patch. This API uses an asynchronous callback to return the ...@@ -66,7 +66,7 @@ Applies a quick fix patch. This API uses an asynchronous callback to return the
| ID| Error Message| | ID| Error Message|
| ------- | -------- | | ------- | -------- |
| 18500002 | Copy file failed, maybe not exist or inaccessible. | | 18500002 | The specified quick fix is invalid. It may not exist or inaccessible. |
| 18500008 | Internal error. | | 18500008 | Internal error. |
If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEvent-definitions.md#common_event_quick_fix_apply_result9). The table below lists the possible error codes and messages. If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEvent-definitions.md#common_event_quick_fix_apply_result9). The table below lists the possible error codes and messages.
...@@ -130,7 +130,7 @@ Applies a quick fix patch. This API uses a promise to return the result. ...@@ -130,7 +130,7 @@ Applies a quick fix patch. This API uses a promise to return the result.
| ID| Error Message| | ID| Error Message|
| ------- | -------- | | ------- | -------- |
| 18500002 | Copy file failed, maybe not exist or inaccessible. | | 18500002 | The specified quick fix is invalid. It may not exist or inaccessible. |
| 18500008 | Internal error. | | 18500008 | Internal error. |
If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEvent-definitions.md#common_event_quick_fix_apply_result9). The table below lists the possible error codes and messages. If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEvent-definitions.md#common_event_quick_fix_apply_result9). The table below lists the possible error codes and messages.
...@@ -183,7 +183,7 @@ Obtains the quick fix information of the application. This API uses an asynchron ...@@ -183,7 +183,7 @@ Obtains the quick fix information of the application. This API uses an asynchron
| ID| Error Message| | ID| Error Message|
| ------- | -------- | | ------- | -------- |
| 18500001 | The bundle is not exist. | | 18500001 | The specified bundleName is invalid. |
| 18500008 | Internal error. | | 18500008 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
...@@ -233,7 +233,7 @@ Obtains the quick fix information of the application. This API uses a promise to ...@@ -233,7 +233,7 @@ Obtains the quick fix information of the application. This API uses a promise to
| ID| Error Message| | ID| Error Message|
| ------- | -------- | | ------- | -------- |
| 18500001 | The bundle is not exist. | | 18500001 | The specified bundleName is invalid. |
| 18500008 | Internal error. | | 18500008 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
...@@ -252,3 +252,102 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -252,3 +252,102 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
console.error('error: ${paramError.code}, ${paramError.message}'); console.error('error: ${paramError.code}, ${paramError.message}');
} }
``` ```
## quickFixManager.revokeQuickFix<sup>10+<sup>
revokeQuickFix(bundleName: string, callback: AsyncCallback\<void>): void;
Revokes quick fix. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.INSTALL_BUNDLE and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
**System capability**: SystemCapability.Ability.AbilityRuntime.QuickFix
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Parameter| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Name of the bundle for which the patch needs to be revoked.|
| callback | AsyncCallback\<void> | Yes| Callback used to return the result.|
**Error codes**
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| ID| Error Message|
| ------- | -------- |
| 18500001 | The bundle is not exist or no patch has applied. |
| 18500009 | The application has a apply quick fix task that is being processed. |
If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_REVOKE_RESULT](./common_event/commonEvent-ability.md#common_event_quick_fix_revoke_result10). The table below lists the possible error codes and messages.
| ID| Error Message|
| ------- | -------- |
| 18500004 | Switch hqf failed. |
| 18500005 | Delete hqf failed. |
| 18500007 | Unload patch failed. |
**Example**
```ts
let bundleName = "com.example.myapplication";
quickFixManager.revokeQuickFix(bundleName, (err) => {
console.info("revokeQuickFix " + bundleName + " " + JSON.stringify(err));
});
```
## quickFixManager.revokeQuickFix<sup>10+<sup>
revokeQuickFix(bundleName: string): Promise\<void>;
Revokes quick fix. This API uses a promise to return the result.
**Required permissions**: ohos.permission.INSTALL_BUNDLE and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
**System capability**: SystemCapability.Ability.AbilityRuntime.QuickFix
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Parameter| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Name of the bundle for which the patch needs to be revoked.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise\<void> | Promise used to return the result.|
**Error codes**
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| ID| Error Message|
| ------- | -------- |
| 18500001 | The bundle is not exist or no patch has applied. |
| 18500009 | The application has a apply quick fix task that is being processed. |
If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_REVOKE_RESULT](./common_event/commonEvent-ability.md#common_event_quick_fix_revoke_result10). The table below lists the possible error codes and messages.
| ID| Error Message|
| ------- | -------- |
| 18500004 | Switch hqf failed. |
| 18500005 | Delete hqf failed. |
| 18500007 | Unload patch failed. |
**Example**
```ts
let bundleName = "com.example.myapplication";
quickFixManager.revokeQuickFix(bundleName).then(() => {
console.info("revokeQuickFix " + bundleName +" ok");
}).catch((err) => {
console.info("revokeQuickFix " + bundleName +" failed, error code is ", JSON.stringify((err)));
});
```
<!--no_check-->
\ No newline at end of file
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
The **ServiceExtensionAbility** module provides lifecycle callbacks when a ServiceExtensionAbility (background service) is created, destroyed, connected, or disconnected. The **ServiceExtensionAbility** module provides lifecycle callbacks when a ServiceExtensionAbility (background service) is created, destroyed, connected, or disconnected.
> **NOTE** > **NOTE**
> >
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> The APIs of this module can be used only in the stage model. > The APIs of this module can be used only in the stage model.
## Modules to Import ## Modules to Import
...@@ -145,6 +146,29 @@ Called following **onCreate()** when a ServiceExtensionAbility is started by cal ...@@ -145,6 +146,29 @@ Called following **onCreate()** when a ServiceExtensionAbility is started by cal
} }
``` ```
If the returned **RemoteObject** object depends on an asynchronous API, you can use the asynchronous lifecycle.
```ts
import rpc from '@ohos.rpc';
class StubTest extends rpc.RemoteObject{
constructor(des) {
super(des);
}
onConnect(code, data, reply, option) {
}
}
async function getDescriptor() {
// Call the asynchronous function.
return "asyncTest"
}
class ServiceExt extends ServiceExtension {
async onConnect(want) {
console.log(`onConnect , want: ${want.abilityName}`);
let descriptor = await getDescriptor();
return new StubTest(descriptor);
}
}
```
## ServiceExtensionAbility.onDisconnect ## ServiceExtensionAbility.onDisconnect
...@@ -172,6 +196,17 @@ Called when a client is disconnected from this ServiceExtensionAbility. ...@@ -172,6 +196,17 @@ Called when a client is disconnected from this ServiceExtensionAbility.
} }
``` ```
After the **onDisconnect** lifecycle callback is executed, the application may exit. As a result, the asynchronous function in **onDisconnect** may fail to be executed correctly, for example, asynchronously writing data to the database. The asynchronous lifecycle can be used to ensure that the subsequent lifecycle continues after the asynchronous **onDisconnect** is complete.
```ts
class ServiceExt extends ServiceExtension {
async onDisconnect(want) {
console.log('onDisconnect, want: ${want.abilityName}');
// Call the asynchronous function.
}
}
```
## ServiceExtensionAbility.onReconnect ## ServiceExtensionAbility.onReconnect
onReconnect(want: Want): void; onReconnect(want: Want): void;
......
...@@ -15,11 +15,8 @@ import StartOptions from '@ohos.app.ability.StartOptions'; ...@@ -15,11 +15,8 @@ import StartOptions from '@ohos.app.ability.StartOptions';
## Attributes ## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| [windowMode](js-apis-app-ability-abilityConstant.md#abilityconstantwindowmode) | number | No| Window mode.| | [windowMode](js-apis-app-ability-abilityConstant.md#abilityconstantwindowmode) | number | No| Window mode.|
......
...@@ -132,6 +132,7 @@ Called when this UIAbility is destroyed to clear resources. ...@@ -132,6 +132,7 @@ Called when this UIAbility is destroyed to clear resources.
**Example** **Example**
```ts ```ts
class MyUIAbility extends UIAbility { class MyUIAbility extends UIAbility {
onDestroy() { onDestroy() {
...@@ -140,6 +141,16 @@ Called when this UIAbility is destroyed to clear resources. ...@@ -140,6 +141,16 @@ Called when this UIAbility is destroyed to clear resources.
} }
``` ```
After the **onDestroy** lifecycle callback is executed, the application may exit. As a result, the asynchronous function in **onDestroy** may fail to be executed correctly, for example, asynchronously writing data to the database. The asynchronous lifecycle can be used to ensure that the subsequent lifecycle continues after the asynchronous **onDestroy** is complete.
```ts
class MyUIAbility extends UIAbility {
async onDestroy() {
console.log('onDestroy');
// Call the asynchronous function.
}
}
```
## UIAbility.onForeground ## UIAbility.onForeground
...@@ -360,7 +371,7 @@ Sends sequenceable data to the target ability. ...@@ -360,7 +371,7 @@ Sends sequenceable data to the target ability.
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 16200001 | Caller released. The caller has been released. | | 16200001 | Caller released. The caller has been released. |
| 16200002 | Callee invalid. The callee does not exist. | | 16200002 | Callee invalid. The callee does not exist. |
| 16000050 | Internal Error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
...@@ -441,7 +452,7 @@ Sends sequenceable data to the target ability and obtains the sequenceable data ...@@ -441,7 +452,7 @@ Sends sequenceable data to the target ability and obtains the sequenceable data
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 16200001 | Caller released. The caller has been released. | | 16200001 | Caller released. The caller has been released. |
| 16200002 | Callee invalid. The callee does not exist. | | 16200002 | Callee invalid. The callee does not exist. |
| 16000050 | Internal Error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
...@@ -586,9 +597,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -586,9 +597,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
} }
``` ```
## Caller.onRemoteStateChange ## Caller.onRemoteStateChange<sup>10+</sup>
onRemoteStateChange(callback: OnRemoteStateChangeCallback): void; onRemoteStateChange(callback: OnRemoteStateChangeCallback): void;
Registers a callback that is invoked when the remote ability state changes in the collaboration scenario. Registers a callback that is invoked when the remote ability state changes in the collaboration scenario.
...@@ -639,7 +650,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -639,7 +650,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
## Caller.on ## Caller.on
on(type: 'release', callback: OnReleaseCallback): void; on(type: 'release', callback: OnReleaseCallback): void;
Registers a callback that is invoked when the stub on the target ability is disconnected. Registers a callback that is invoked when the stub on the target ability is disconnected.
...@@ -656,6 +667,7 @@ Registers a callback that is invoked when the stub on the target ability is disc ...@@ -656,6 +667,7 @@ Registers a callback that is invoked when the stub on the target ability is disc
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
| 16200001 | Caller released. The caller has been released. | | 16200001 | Caller released. The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
...@@ -701,6 +713,12 @@ Deregisters a callback that is invoked when the stub on the target ability is di ...@@ -701,6 +713,12 @@ Deregisters a callback that is invoked when the stub on the target ability is di
| type | string | Yes| Event type. The value is fixed at **release**.| | type | string | Yes| Event type. The value is fixed at **release**.|
| callback | [OnReleaseCallback](#onreleasecallback) | Yes| Callback used to return the result.| | callback | [OnReleaseCallback](#onreleasecallback) | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
**Example** **Example**
```ts ```ts
...@@ -892,7 +910,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -892,7 +910,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| (msg: string) | Yes| No| function | Prototype of the listener function registered by the caller.| | (msg: string) | Yes| No| function | Prototype of the listener function registered by the caller.|
## OnRemoteStateChangeCallback ## OnRemoteStateChangeCallback<sup>10+</sup>
(msg: string): void; (msg: string): void;
......
...@@ -26,7 +26,7 @@ import Want from '@ohos.app.ability.Want'; ...@@ -26,7 +26,7 @@ import Want from '@ohos.app.ability.Want';
| entities | Array\<string> | No| Additional category information (such as browser and video player) of the ability. It is a supplement to the **action** field for implicit Want. and is used to filter ability types.| | entities | Array\<string> | No| Additional category information (such as browser and video player) of the ability. It is a supplement to the **action** field for implicit Want. and is used to filter ability types.|
| uri | string | No| Data carried. This field is used together with **type** to specify the data type. If **uri** is specified in a Want, the Want will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.| | uri | string | No| Data carried. This field is used together with **type** to specify the data type. If **uri** is specified in a Want, the Want will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.|
| type | string | No| MIME type, that is, the type of the file to open, for example, **'text/xml'** and **'image/*'**. For details about the MIME type definition, see https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com.| | type | string | No| MIME type, that is, the type of the file to open, for example, **'text/xml'** and **'image/*'**. For details about the MIME type definition, see https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com.|
| parameters | {[key: string]: any} | No | Want parameters in the form of custom key-value (KV) pairs. By default, the following keys are carried:<br>- **ohos.aafwk.callerPid**: PID of the caller.<br>- **ohos.aafwk.param.callerBundleName**: bundle name of the caller.<br>- **ohos.aafwk.param.callerToken**: token of the caller.<br>- **ohos.aafwk.param.callerUid**: UID in [BundleInfo](js-apis-bundleManager-bundleInfo.md#bundleinfo-1), that is, the application UID in the bundle information.<br>- **component.startup.newRules**: whether to enable the new control rule.<br>- **moduleName**: module name of the caller. No matter what this field is set to, the correct module name will be sent to the peer.<br>- **ohos.dlp.params.sandbox**: available only for DLP files.| | parameters | {[key: string]: any} | No | Want parameters in the form of custom key-value (KV) pairs. By default, the following keys are carried:<br>- **ohos.aafwk.callerPid**: PID of the caller.<br>- **ohos.aafwk.param.callerBundleName**: bundle name of the caller.<br>- **ohos.aafwk.param.callerToken**: token of the caller.<br>- **ohos.aafwk.param.callerUid**: UID in [BundleInfo](js-apis-bundleManager-bundleInfo.md#bundleinfo-1), that is, the application UID in the bundle information.<br>- **component.startup.newRules**: whether to enable the new control rule.<br>- **moduleName**: module name of the caller. No matter what this field is set to, the correct module name will be sent to the peer.<br>- **ohos.dlp.params.sandbox**: available only for DLP files.<br>- **ability.params.backToOtherMissionStack**: whether to support redirection back across mission stacks.|
| [flags](js-apis-ability-wantConstant.md#wantconstantflags) | number | No| How the **Want** object will be handled. By default, a number is passed in.<br>For example, **wantConstant.Flags.FLAG_ABILITY_CONTINUATION** specifies whether to start the ability in cross-device migration scenarios.| | [flags](js-apis-ability-wantConstant.md#wantconstantflags) | number | No| How the **Want** object will be handled. By default, a number is passed in.<br>For example, **wantConstant.Flags.FLAG_ABILITY_CONTINUATION** specifies whether to start the ability in cross-device migration scenarios.|
**Example** **Example**
...@@ -34,7 +34,8 @@ import Want from '@ohos.app.ability.Want'; ...@@ -34,7 +34,8 @@ import Want from '@ohos.app.ability.Want';
- Basic usage: called in a UIAbility object, as shown in the example below. For details about how to obtain the context, see [Obtaining the Context of UIAbility](../../application-models/uiability-usage.md#obtaining-the-context-of-uiability). - Basic usage: called in a UIAbility object, as shown in the example below. For details about how to obtain the context, see [Obtaining the Context of UIAbility](../../application-models/uiability-usage.md#obtaining-the-context-of-uiability).
```ts ```ts
let context = ...; // UIAbilityContext import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = { let want = {
'deviceId': '', // An empty deviceId indicates the local device. 'deviceId': '', // An empty deviceId indicates the local device.
'bundleName': 'com.example.myapplication', 'bundleName': 'com.example.myapplication',
...@@ -52,7 +53,8 @@ import Want from '@ohos.app.ability.Want'; ...@@ -52,7 +53,8 @@ import Want from '@ohos.app.ability.Want';
* String * String
```ts ```ts
let context = ...; // UIAbilityContext import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = { let want = {
bundleName: 'com.example.myapplication', bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility', abilityName: 'FuncAbility',
...@@ -67,7 +69,8 @@ import Want from '@ohos.app.ability.Want'; ...@@ -67,7 +69,8 @@ import Want from '@ohos.app.ability.Want';
``` ```
* Number * Number
```ts ```ts
let context = ...; // UIAbilityContext import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = { let want = {
bundleName: 'com.example.myapplication', bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility', abilityName: 'FuncAbility',
...@@ -83,7 +86,8 @@ import Want from '@ohos.app.ability.Want'; ...@@ -83,7 +86,8 @@ import Want from '@ohos.app.ability.Want';
``` ```
* Boolean * Boolean
```ts ```ts
let context = ...; // UIAbilityContext import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = { let want = {
bundleName: 'com.example.myapplication', bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility', abilityName: 'FuncAbility',
...@@ -98,7 +102,8 @@ import Want from '@ohos.app.ability.Want'; ...@@ -98,7 +102,8 @@ import Want from '@ohos.app.ability.Want';
``` ```
* Object * Object
```ts ```ts
let context = ...; // UIAbilityContext import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = { let want = {
bundleName: 'com.example.myapplication', bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility', abilityName: 'FuncAbility',
...@@ -118,7 +123,8 @@ import Want from '@ohos.app.ability.Want'; ...@@ -118,7 +123,8 @@ import Want from '@ohos.app.ability.Want';
``` ```
* Array * Array
```ts ```ts
let context = ...; // UIAbilityContext import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = { let want = {
bundleName: 'com.example.myapplication', bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility', abilityName: 'FuncAbility',
...@@ -138,7 +144,8 @@ import Want from '@ohos.app.ability.Want'; ...@@ -138,7 +144,8 @@ import Want from '@ohos.app.ability.Want';
```ts ```ts
import fs from '@ohos.file.fs'; import fs from '@ohos.file.fs';
let context = ...; // UIAbilityContext import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let fd; let fd;
try { try {
...@@ -160,3 +167,33 @@ import Want from '@ohos.app.ability.Want'; ...@@ -160,3 +167,33 @@ import Want from '@ohos.app.ability.Want';
console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`); console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
}); });
``` ```
- Usage of **parameters**: The following uses **ability.params.backToOtherMissionStack** as an example. When a ServiceExtensionAbility starts a UIAbility, redirection back across mission stacks is supported.
```ts
// (1) UIAbility1 starts a ServiceExtensionAbility.
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = {
bundleName: 'com.example.myapplication1',
abilityName: 'ServiceExtensionAbility',
};
context.startAbility(want, (err) => {
console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
});
// (2) The ServiceExtensionAbility starts UIAbility2, carrying **"ability.params.backToOtherMissionStack": true** during the startup.
let context = ...; // ServiceExtensionContext
let want = {
bundleName: 'com.example.myapplication2',
abilityName: 'MainAbility',
parameters: {
"ability.params.backToOtherMissionStack": true,
},
};
context.startAbility(want, (err) => {
console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
});
```
Note: In the preceding example, when the ServiceExtensionAbility starts UIAbility2, **"ability.params.backToOtherMissionStack": true** is carried, indicating that redirection back across mission stacks is supported. Therefore, when you press **Back** on the page of UIAbility 2, the page of UIAbility1 page is displayed. However, if **ability.params.backToOtherMissionStack** is not carried or if **"ability.params.backToOtherMissionStack": false** is carried, the page of UIAbility1 is not displayed when you press **Back** on the page of UIAbility 2.
...@@ -118,6 +118,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -118,6 +118,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
**Example** **Example**
```ts ```ts
let wantAgent;
// WantAgentInfo object // WantAgentInfo object
let wantAgentInfo = { let wantAgentInfo = {
wants: [ wants: [
...@@ -1181,7 +1182,7 @@ function getWantAgentCallback(err, data) { ...@@ -1181,7 +1182,7 @@ function getWantAgentCallback(err, data) {
} }
} }
try { try {
WantAgent.getOperationTypeCallback(wantAgent, getOperationTypeCallback); WantAgent.getOperationType(wantAgent, getOperationTypeCallback);
} catch(err) { } catch(err) {
console.error('getOperationTypeCallback failed! ${err.code} ${err.message}'); console.error('getOperationTypeCallback failed! ${err.code} ${err.message}');
} }
......
...@@ -16,6 +16,8 @@ import wantConstant from '@ohos.app.ability.wantConstant'; ...@@ -16,6 +16,8 @@ import wantConstant from '@ohos.app.ability.wantConstant';
Defines **Params** (specifying the action that can be performed) in the Want. Defines **Params** (specifying the action that can be performed) in the Want.
**System capability**: SystemCapability.Ability.AbilityBase
| Name | Value | Description | | Name | Value | Description |
| ----------------------- | ---------------------------------- | ------------------------------------------------------------------------------ | | ----------------------- | ---------------------------------- | ------------------------------------------------------------------------------ |
| DLP_PARAMS_SANDBOX | ohos.dlp.params.sandbox | Action of obtaining the sandbox flag.<br>**System API**: This is a system API and cannot be called by third-party applications.| | DLP_PARAMS_SANDBOX | ohos.dlp.params.sandbox | Action of obtaining the sandbox flag.<br>**System API**: This is a system API and cannot be called by third-party applications.|
...@@ -23,10 +25,11 @@ Defines **Params** (specifying the action that can be performed) in the Want. ...@@ -23,10 +25,11 @@ Defines **Params** (specifying the action that can be performed) in the Want.
| DLP_PARAMS_MODULE_NAME | ohos.dlp.params.moduleName | Action of obtaining the DLP module name.<br>**System API**: This is a system API and cannot be called by third-party applications.| | DLP_PARAMS_MODULE_NAME | ohos.dlp.params.moduleName | Action of obtaining the DLP module name.<br>**System API**: This is a system API and cannot be called by third-party applications.|
| DLP_PARAMS_ABILITY_NAME | ohos.dlp.params.abilityName | Action of obtaining the DLP ability name.<br>**System API**: This is a system API and cannot be called by third-party applications.| | DLP_PARAMS_ABILITY_NAME | ohos.dlp.params.abilityName | Action of obtaining the DLP ability name.<br>**System API**: This is a system API and cannot be called by third-party applications.|
| DLP_PARAMS_INDEX | ohos.dlp.params.index | Action of obtaining the DLP index.<br>**System API**: This is a system API and cannot be called by third-party applications.| | DLP_PARAMS_INDEX | ohos.dlp.params.index | Action of obtaining the DLP index.<br>**System API**: This is a system API and cannot be called by third-party applications.|
| ABILITY_RECOVERY_RESTART | ohos.ability.params.abilityRecoveryRestart | Action of recovering an ability from a fault and restarting it.| | ABILITY_BACK_TO_OTHER_MISSION_STACK | ability.params.backToOtherMissionStack | Whether to support redirection back across mission stacks.<br>**System API**: This is a system API and cannot be called by third-party applications.|
| CONTENT_TITLE_KEY | ohos.extra.param.key.contentTitle | Action of sharing the content title.<br>**System API**: This is a system API and cannot be called by third-party applications.| | ABILITY_RECOVERY_RESTART<sup>10+</sup> | ohos.ability.params.abilityRecoveryRestart | Action of recovering an ability from a fault and restarting it.|
| SHARE_ABSTRACT_KEY | ohos.extra.param.key.shareAbstract | Action of sharing the abstract.<br>**System API**: This is a system API and cannot be called by third-party applications.| | CONTENT_TITLE_KEY<sup>10+</sup> | ohos.extra.param.key.contentTitle | Action of sharing the content title. |
| SHARE_URL_KEY | ohos.extra.param.key.shareUrl | Action of sharing the URL.<br>**System API**: This is a system API and cannot be called by third-party applications.| | SHARE_ABSTRACT_KEY<sup>10+</sup> | ohos.extra.param.key.shareAbstract | Action of sharing the abstract. |
| SHARE_URL_KEY<sup>10+</sup> | ohos.extra.param.key.shareUrl | Action of sharing the URL. |
## wantConstant.Flags ## wantConstant.Flags
......
...@@ -18,6 +18,8 @@ Describes widget information. ...@@ -18,6 +18,8 @@ Describes widget information.
**System capability**: SystemCapability.Ability.Form **System capability**: SystemCapability.Ability.Form
**System API**: This is a system API and cannot be called by third-party applications.
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
| ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ | | ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ |
| bundleName | string | Yes | No | Name of the bundle to which the widget belongs. | | bundleName | string | Yes | No | Name of the bundle to which the widget belongs. |
...@@ -100,8 +102,10 @@ Enumerates the widget parameters. ...@@ -100,8 +102,10 @@ Enumerates the widget parameters.
| HEIGHT_KEY | 'ohos.extra.param.key.form_height' | Widget height. | | HEIGHT_KEY | 'ohos.extra.param.key.form_height' | Widget height. |
| TEMPORARY_KEY | 'ohos.extra.param.key.form_temporary' | Temporary widget. | | TEMPORARY_KEY | 'ohos.extra.param.key.form_temporary' | Temporary widget. |
| ABILITY_NAME_KEY | 'ohos.extra.param.key.ability_name' | Ability name. | | ABILITY_NAME_KEY | 'ohos.extra.param.key.ability_name' | Ability name. |
| DEVICE_ID_KEY | 'ohos.extra.param.key.device_id' | Device ID. | | DEVICE_ID_KEY | 'ohos.extra.param.key.device_id' <br>**System API**: This is a system API and cannot be called by third-party applications. | Device ID. |
| BUNDLE_NAME_KEY | 'ohos.extra.param.key.bundle_name' | Key that specifies the target bundle name.| | BUNDLE_NAME_KEY | 'ohos.extra.param.key.bundle_name' | Key that specifies the target bundle name.|
| LAUNCH_REASON_KEY<sup>10+</sup> | 'ohos.extra.param.key.form_launch_reason' | Reason for creating the widget. |
| PARAM_FORM_CUSTOMIZE_KEY<sup>10+</sup> | 'ohos.extra.param.key.form_customize' | Custom data. |
## FormDimension ## FormDimension
...@@ -136,5 +140,47 @@ Enumerates the visibility types of the widget. ...@@ -136,5 +140,47 @@ Enumerates the visibility types of the widget.
| Name | Value | Description | | Name | Value | Description |
| ----------- | ---- | ------------ | | ----------- | ---- | ------------ |
| UNKNOWN | 0 | The visibility type of the widget is unknown.|
| FORM_VISIBLE | 1 | The widget is visible.| | FORM_VISIBLE | 1 | The widget is visible.|
| FORM_INVISIBLE | 2 | The widget is invisible.| | FORM_INVISIBLE | 2 | The widget is invisible.|
## RunningFormInfo<sup>10+</sup>
Defines the information about the widget host.
**System capability**: SystemCapability.Ability.Form
| Name | Type | Readable | Writable | Description |
| ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ |
| formId | string | Yes | No | Widget ID. |
| bundleName | string | Yes | No | Name of the bundle to which the widget provider belongs. |
| hostBundleName | string | Yes | No | Name of the bundle to which the widget host belongs. |
| visibilityType | [VisibilityType](#visibilitytype) | Yes | No | Visibility types of the widget. |
| moduleName | string | Yes | No | Name of the module to which the widget belongs. |
| abilityName | string | Yes | No | Name of the ability to which the widget belongs. |
| formName | string | Yes | No | Widget name. |
| dimension | number | Yes | No | Widget specifications. |
## formProviderFilter<sup>10+</sup>
Defines the information about the widget provider.
**System capability**: SystemCapability.Ability.Form
| Name | Type | Readable | Writable | Description |
| ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ |
| bundleName | string | Yes | No | Name of the bundle to which the widget provider belongs. |
| formName | string | Yes | No | Widget name. |
| moduleName | string | Yes | No | Name of the module to which the widget belongs. |
| abilityName | string | Yes | No | Name of the ability to which the widget belongs. |
## LaunchReason<sup>10+</sup>
Enumerates the reasons for creating a widget.
**System capability**: SystemCapability.Ability.Form
| Name | Value | Description |
| ----------- | ---- | ------------ |
| FORM_DEFAULT | 1 | The widget is created by default.|
| FORM_SHARE | 2 | The widget is created for sharing.|
...@@ -39,13 +39,12 @@ Sets the next refresh time for a widget. This API uses an asynchronous callback ...@@ -39,13 +39,12 @@ Sets the next refresh time for a widget. This API uses an asynchronous callback
| 16501001 | The ID of the form to be operated does not exist. | | 16501001 | The ID of the form to be operated does not exist. |
| 16501002 | The number of forms exceeds upper bound. | | 16501002 | The number of forms exceeds upper bound. |
| 16501003 | The form can not be operated by the current application. | | 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example** **Example**
```ts ```ts
import formProvider from '@ohos.app.form.formProvider';
let formId = '12400633174999288'; let formId = '12400633174999288';
try { try {
formProvider.setFormNextRefreshTime(formId, 5, (error) => { formProvider.setFormNextRefreshTime(formId, 5, (error) => {
...@@ -93,13 +92,12 @@ Sets the next refresh time for a widget. This API uses a promise to return the r ...@@ -93,13 +92,12 @@ Sets the next refresh time for a widget. This API uses a promise to return the r
| 16501001 | The ID of the form to be operated does not exist. | | 16501001 | The ID of the form to be operated does not exist. |
| 16501002 | The number of forms exceeds upper bound. | | 16501002 | The number of forms exceeds upper bound. |
| 16501003 | The form can not be operated by the current application. | | 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example** **Example**
```ts ```ts
import formProvider from '@ohos.app.form.formProvider';
let formId = '12400633174999288'; let formId = '12400633174999288';
try { try {
formProvider.setFormNextRefreshTime(formId, 5).then(() => { formProvider.setFormNextRefreshTime(formId, 5).then(() => {
...@@ -139,13 +137,13 @@ Updates a widget. This API uses an asynchronous callback to return the result. ...@@ -139,13 +137,13 @@ Updates a widget. This API uses an asynchronous callback to return the result.
| 16501000 | An internal functional error occurred. | | 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. | | 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. | | 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example** **Example**
```ts ```ts
import formBindingData from '@ohos.app.form.formBindingData'; import formBindingData from '@ohos.app.form.formBindingData';
import formProvider from '@ohos.app.form.formProvider';
let formId = '12400633174999288'; let formId = '12400633174999288';
try { try {
...@@ -194,13 +192,13 @@ Updates a widget. This API uses a promise to return the result. ...@@ -194,13 +192,13 @@ Updates a widget. This API uses a promise to return the result.
| 16501000 | An internal functional error occurred. | | 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. | | 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. | | 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example** **Example**
```ts ```ts
import formBindingData from '@ohos.app.form.formBindingData'; import formBindingData from '@ohos.app.form.formBindingData';
import formProvider from '@ohos.app.form.formProvider';
let formId = '12400633174999288'; let formId = '12400633174999288';
let obj = formBindingData.createFormBindingData({ temperature: '22c', time: '22:00' }); let obj = formBindingData.createFormBindingData({ temperature: '22c', time: '22:00' });
...@@ -236,14 +234,13 @@ Obtains the application's widget information on the device. This API uses an asy ...@@ -236,14 +234,13 @@ Obtains the application's widget information on the device. This API uses an asy
| 16500050 | An IPC connection error happened. | | 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. | | 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. | | 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example** **Example**
```ts ```ts
import formProvider from '@ohos.app.form.formProvider';
try { try {
formProvider.getFormsInfo((error, data) => { formProvider.getFormsInfo((error, data) => {
if (error) { if (error) {
...@@ -279,13 +276,13 @@ Obtains the application's widget information that meets a filter criterion on th ...@@ -279,13 +276,13 @@ Obtains the application's widget information that meets a filter criterion on th
| 16500050 | An IPC connection error happened. | | 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. | | 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. | | 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example** **Example**
```ts ```ts
import formInfo from '@ohos.app.form.formInfo'; import formInfo from '@ohos.app.form.formInfo';
import formProvider from '@ohos.app.form.formProvider';
const filter: formInfo.FormInfoFilter = { const filter: formInfo.FormInfoFilter = {
// get info of forms belong to module entry. // get info of forms belong to module entry.
...@@ -332,13 +329,13 @@ Obtains the application's widget information on the device. This API uses a prom ...@@ -332,13 +329,13 @@ Obtains the application's widget information on the device. This API uses a prom
| 16500050 | An IPC connection error happened. | | 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. | | 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. | | 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example** **Example**
```ts ```ts
import formInfo from '@ohos.app.form.formInfo'; import formInfo from '@ohos.app.form.formInfo';
import formProvider from '@ohos.app.form.formProvider';
const filter: formInfo.FormInfoFilter = { const filter: formInfo.FormInfoFilter = {
// get info of forms belong to module entry. // get info of forms belong to module entry.
...@@ -382,13 +379,13 @@ Requests to publish a widget carrying data to the widget host. This API uses an ...@@ -382,13 +379,13 @@ Requests to publish a widget carrying data to the widget host. This API uses an
| 16500050 | An IPC connection error happened. | | 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. | | 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. | | 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example** **Example**
```ts ```ts
import formBindingData from '@ohos.app.form.formBindingData'; import formBindingData from '@ohos.app.form.formBindingData';
import formProvider from '@ohos.app.form.formProvider';
let want = { let want = {
abilityName: 'FormAbility', abilityName: 'FormAbility',
...@@ -438,13 +435,12 @@ Requests to publish a widget to the widget host. This API uses an asynchronous c ...@@ -438,13 +435,12 @@ Requests to publish a widget to the widget host. This API uses an asynchronous c
| 16500050 | An IPC connection error happened. | | 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. | | 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. | | 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example** **Example**
```ts ```ts
import formProvider from '@ohos.app.form.formProvider';
let want = { let want = {
abilityName: 'FormAbility', abilityName: 'FormAbility',
parameters: { parameters: {
...@@ -498,13 +494,12 @@ Requests to publish a widget to the widget host. This API uses a promise to retu ...@@ -498,13 +494,12 @@ Requests to publish a widget to the widget host. This API uses a promise to retu
| 16500050 | An IPC connection error happened. | | 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. | | 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. | | 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example** **Example**
```ts ```ts
import formProvider from '@ohos.app.form.formProvider';
let want = { let want = {
abilityName: 'FormAbility', abilityName: 'FormAbility',
parameters: { parameters: {
...@@ -548,13 +543,12 @@ Checks whether a widget can be published to the widget host. This API uses an as ...@@ -548,13 +543,12 @@ Checks whether a widget can be published to the widget host. This API uses an as
| 401 | If the input parameter is not valid parameter. | | 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. | | 16500050 | An IPC connection error happened. |
| 16501000 | An internal functional error occurred. | | 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example** **Example**
```ts ```ts
import formProvider from '@ohos.app.form.formProvider';
try { try {
formProvider.isRequestPublishFormSupported((error, isSupported) => { formProvider.isRequestPublishFormSupported((error, isSupported) => {
if (error) { if (error) {
...@@ -611,13 +605,12 @@ Checks whether a widget can be published to the widget host. This API uses a pro ...@@ -611,13 +605,12 @@ Checks whether a widget can be published to the widget host. This API uses a pro
| 202 | The application is not a system application. | | 202 | The application is not a system application. |
| 16500050 | An IPC connection error happened. | | 16500050 | An IPC connection error happened. |
| 16501000 | An internal functional error occurred. | | 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example** **Example**
```ts ```ts
import formProvider from '@ohos.app.form.formProvider';
try { try {
formProvider.isRequestPublishFormSupported().then((isSupported) => { formProvider.isRequestPublishFormSupported().then((isSupported) => {
if (isSupported) { if (isSupported) {
......
...@@ -400,7 +400,11 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\> ...@@ -400,7 +400,11 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\>
Kills a process by bundle name and account ID. This API uses a promise to return the result. Kills a process by bundle name and account ID. This API uses a promise to return the result.
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) and ohos.permission.CLEAN_BACKGROUND_PROCESSES > **NOTE**
>
> The **ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS** permission is not required when **accountId** specifies the current user.
**Required permissions**: ohos.permission.CLEAN_BACKGROUND_PROCESSES and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -434,11 +438,15 @@ killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCal ...@@ -434,11 +438,15 @@ killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCal
Kills a process by bundle name and account ID. This API uses an asynchronous callback to return the result. Kills a process by bundle name and account ID. This API uses an asynchronous callback to return the result.
> **NOTE**
>
> The **ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS** permission is not required when **accountId** specifies the current user.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications. **System API**: This is a system API and cannot be called by third-party applications.
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) and ohos.permission.CLEAN_BACKGROUND_PROCESSES **Required permissions**: ohos.permission.CLEAN_BACKGROUND_PROCESSES and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**Parameters** **Parameters**
......
...@@ -3,9 +3,16 @@ ...@@ -3,9 +3,16 @@
The **Configuration** module defines environment change information. **Configuration** is an interface definition and is used only for field declaration. The **Configuration** module defines environment change information. **Configuration** is an interface definition and is used only for field declaration.
> **NOTE** > **NOTE**
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> This module is deprecated since API version 9. You are advised to use [@ohos.app.ability.Configuration](js-apis-app-ability-configuration.md) instead. > This module is deprecated since API version 9. You are advised to use [@ohos.app.ability.Configuration](js-apis-app-ability-configuration.md) instead.
## Modules to Import
```ts
import Configuration from '@ohos.app.application.Configuration';
```
**System capability**: SystemCapability.Ability.AbilityBase **System capability**: SystemCapability.Ability.AbilityBase
| Name| Type| Readable| Writable| Description| | Name| Type| Readable| Writable| Description|
......
...@@ -39,7 +39,7 @@ Enumerates the types of business abilities. ...@@ -39,7 +39,7 @@ Enumerates the types of business abilities.
Describes the criteria for filtering business abilities. Describes the criteria for filtering business abilities.
**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall **System capability**: SystemCapability.BundleManager.BundleFramework.Core
**System API**: This is a system API. **System API**: This is a system API.
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
The **ContinueCallback** module defines the callback function that indicates the result of mission continuation. For details about mission continuation, see [continueMission](js-apis-distributedMissionManager.md#distributedmissionmanagercontinuemission). The **ContinueCallback** module defines the callback function that indicates the result of mission continuation. For details about mission continuation, see [continueMission](js-apis-distributedMissionManager.md#distributedmissionmanagercontinuemission).
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## ContinueCallback.onContinueDone ## ContinueCallback.onContinueDone
onContinueDone(result: number): void; onContinueDone(result: number): void;
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
The **ContinueDeviceInfo** module defines the parameters required for initiating mission continuation. For details about mission continuation, see [continueMission](js-apis-distributedMissionManager.md#distributedmissionmanagercontinuemission). The **ContinueDeviceInfo** module defines the parameters required for initiating mission continuation. For details about mission continuation, see [continueMission](js-apis-distributedMissionManager.md#distributedmissionmanagercontinuemission).
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission **System capability**: SystemCapability.Ability.AbilityRuntime.Mission
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
The **MissionCallback** module defines the callbacks invoked after synchronization starts. These callbacks can be used as input parameters in [registerMissionListener](js-apis-distributedMissionManager.md#distributedmissionmanagerregistermissionlistener). The **MissionCallback** module defines the callbacks invoked after synchronization starts. These callbacks can be used as input parameters in [registerMissionListener](js-apis-distributedMissionManager.md#distributedmissionmanagerregistermissionlistener).
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission **System capability**: SystemCapability.Ability.AbilityRuntime.Mission
| Name | Template | Readable| Writable| Description | | Name | Template | Readable| Writable| Description |
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
The **MissionParameter** module defines the parameters required for mission synchronization. It can be used an input parameter in [startSyncRemoteMissions](js-apis-distributedMissionManager.md#distributedmissionmanagerstartsyncremotemissions). The **MissionParameter** module defines the parameters required for mission synchronization. It can be used an input parameter in [startSyncRemoteMissions](js-apis-distributedMissionManager.md#distributedmissionmanagerstartsyncremotemissions).
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission **System capability**: SystemCapability.Ability.AbilityRuntime.Mission
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
......
...@@ -11,7 +11,7 @@ The **uriPermissionManager** module provides APIs for granting permissions on a ...@@ -11,7 +11,7 @@ The **uriPermissionManager** module provides APIs for granting permissions on a
```js ```js
import UriPermissionManager from '@ohos.application.uriPermissionManager'; import uriPermissionManager from '@ohos.application.uriPermissionManager';
``` ```
......
...@@ -20,6 +20,8 @@ Obtains the Want in a **WantAgent** object. This API uses an asynchronous callba ...@@ -20,6 +20,8 @@ Obtains the Want in a **WantAgent** object. This API uses an asynchronous callba
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -91,6 +93,8 @@ Obtains the Want in a **WantAgent** object. This API uses a promise to return th ...@@ -91,6 +93,8 @@ Obtains the Want in a **WantAgent** object. This API uses a promise to return th
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册