diff --git a/en/application-dev/reference/apis/js-apis-continuation-continuationManager.md b/en/application-dev/reference/apis/js-apis-continuation-continuationManager.md index 05f490c454f7e7133bfc5977d1bdc2d180462a7c..5ffc47acf97498d254f58b5b4ea8d540631083d2 100644 --- a/en/application-dev/reference/apis/js-apis-continuation-continuationManager.md +++ b/en/application-dev/reference/apis/js-apis-continuation-continuationManager.md @@ -155,8 +155,6 @@ registerContinuation(callback: AsyncCallback\): void; Registers the continuation management service and obtains a token. This API does not involve any filter parameters and uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters** @@ -198,8 +196,6 @@ registerContinuation(options: ContinuationExtraParams, callback: AsyncCallback\< Registers the continuation management service and obtains a token. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters** @@ -245,8 +241,6 @@ registerContinuation(options?: ContinuationExtraParams): Promise\; Registers the continuation management service and obtains a token. This API uses a promise to return the result. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters** @@ -298,7 +292,7 @@ on(type: "deviceConnect", callback: Callback\): void; Subscribes to device connection events. This API uses an asynchronous callback to return the result. -> This API is deprecated since API version 9. You are advised to use [on](#continuationmanagerondeviceselected9) instead. +> This API is deprecated since API version 9. You are advised to use [on](#continuationmanagerondeviceconnect9) instead. **System capability**: SystemCapability.Ability.DistributedAbilityManager @@ -337,7 +331,7 @@ on(type: "deviceDisconnect", callback: Callback\): void; Subscribes to device disconnection events. This API uses an asynchronous callback to return the result. -> This API is deprecated since API version 9. You are advised to use [on](#continuationmanagerondeviceunselected9) instead. +> This API is deprecated since API version 9. You are advised to use [on](#continuationmanagerondevicedisconnect9) instead. **System capability**: SystemCapability.Ability.DistributedAbilityManager @@ -374,7 +368,7 @@ off(type: "deviceConnect", callback?: Callback\): void; Unsubscribes from device connection events. This API uses an asynchronous callback to return the result. -> This API is deprecated since API version 9. You are advised to use [off](#continuationmanageroffdeviceselected9) instead. +> This API is deprecated since API version 9. You are advised to use [off](#continuationmanageroffdeviceconnect9) instead. **System capability**: SystemCapability.Ability.DistributedAbilityManager @@ -413,7 +407,7 @@ off(type: "deviceDisconnect", callback?: Callback\): void; Unsubscribes from device disconnection events. This API uses an asynchronous callback to return the result. -> This API is deprecated since API version 9. You are advised to use [off](#continuationmanageroffdeviceunselected9) instead. +> This API is deprecated since API version 9. You are advised to use [off](#continuationmanageroffdevicedisconnect9) instead. **System capability**: SystemCapability.Ability.DistributedAbilityManager @@ -444,21 +438,19 @@ For details about the error codes, see [Distributed Scheduler Error Codes](../er }); ``` -## continuationManager.on("deviceSelected")9+ +## continuationManager.on("deviceConnect")9+ -on(type: "deviceSelected", token: number, callback: Callback\>): void; +on(type: "deviceConnect", token: number, callback: Callback\>): void; Subscribes to device connection events. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters** | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | - | type | string | Yes| Event type. The value is fixed at **deviceSelected**.| + | type | string | Yes| Event type. The value is fixed at **deviceConnect**.| | token | number | Yes| Token obtained after the registration of the continuation management service.| | callback | Callback\> | Yes| Callback invoked when a device is selected from the device list provided by the device selection module. This callback returns the device ID, type, and name.| @@ -477,12 +469,12 @@ For details about the error codes, see [Distributed Scheduler Error Codes](../er ```ts let token = 1; try { - continuationManager.on("deviceSelected", token, (data) => { - console.info('onDeviceSelected len: ' + data.length); + continuationManager.on("deviceConnect", token, (data) => { + console.info('onDeviceConnect len: ' + data.length); for (let i = 0; i < data.length; i++) { - console.info('onDeviceSelected deviceId: ' + JSON.stringify(data[i].id)); - console.info('onDeviceSelected deviceType: ' + JSON.stringify(data[i].type)); - console.info('onDeviceSelected deviceName: ' + JSON.stringify(data[i].name)); + console.info('onDeviceConnect deviceId: ' + JSON.stringify(data[i].id)); + console.info('onDeviceConnect deviceType: ' + JSON.stringify(data[i].type)); + console.info('onDeviceConnect deviceName: ' + JSON.stringify(data[i].name)); } }); } catch (err) { @@ -490,23 +482,21 @@ For details about the error codes, see [Distributed Scheduler Error Codes](../er } ``` -## continuationManager.on("deviceUnselected")9+ +## continuationManager.on("deviceDisconnect")9+ -on(type: "deviceUnselected", token: number, callback: Callback\>): void; +on(type: "deviceDisconnect", token: number, callback: Callback\>): void; Subscribes to device disconnection events. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters** | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | - | type | string | Yes| Event type. The value is fixed at **deviceUnselected**.| + | type | string | Yes| Event type. The value is fixed at **deviceDisconnect**.| | token | number | Yes| Token obtained after the registration of the continuation management service.| - | callback | Callback\> | Yes| Callback invoked when a device is unselected from the device list provided by the device selection module. This callback returns the device ID, type, and name.| + | callback | Callback\> | Yes| Callback invoked when a device is unselected from the device list provided by the device selection module. This callback returns the device ID, type, and name.| **Error codes** @@ -523,35 +513,31 @@ For details about the error codes, see [Distributed Scheduler Error Codes](../er ```ts let token = 1; try { - continuationManager.on("deviceUnselected", token, (data) => { - console.info('onDeviceUnselected len: ' + data.length); + continuationManager.on("deviceDisconnect", token, (data) => { + console.info('onDeviceDisconnect len: ' + data.length); for (let i = 0; i < data.length; i++) { - console.info('onDeviceUnselected deviceId: ' + JSON.stringify(data[i].id)); - console.info('onDeviceUnselected deviceType: ' + JSON.stringify(data[i].type)); - console.info('onDeviceUnselected deviceName: ' + JSON.stringify(data[i].name)); + console.info('onDeviceDisconnect deviceId: ' + JSON.stringify(data[i])); } - console.info('onDeviceUnselected finished.'); + console.info('onDeviceDisconnect finished.'); }); } catch (err) { console.error('on failed, cause: ' + JSON.stringify(err)); } ``` -## continuationManager.off("deviceSelected")9+ +## continuationManager.off("deviceConnect")9+ -off(type: "deviceSelected", token: number): void; +off(type: "deviceConnect", token: number): void; Unsubscribes from device connection events. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters** | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | - | type | string | Yes| Event type. The value is fixed at **deviceSelected**.| + | type | string | Yes| Event type. The value is fixed at **deviceConnect**.| | token | number | Yes| Token obtained after the registration of the continuation management service.| **Error codes** @@ -569,27 +555,25 @@ For details about the error codes, see [Distributed Scheduler Error Codes](../er ```ts let token = 1; try { - continuationManager.off("deviceSelected", token); + continuationManager.off("deviceConnect", token); } catch (err) { console.error('off failed, cause: ' + JSON.stringify(err)); } ``` -## continuationManager.off("deviceUnselected")9+ +## continuationManager.off("deviceDisconnect")9+ -off(type: "deviceUnselected", token: number): void; +off(type: "deviceDisconnect", token: number): void; Unsubscribes from device disconnection events. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters** | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | - | type | string | Yes| Event type. The value is fixed at **deviceUnselected**.| + | type | string | Yes| Event type. The value is fixed at **deviceDisconnect**.| | token | number | Yes| Token obtained after the registration of the continuation management service.| **Error codes** @@ -607,7 +591,7 @@ For details about the error codes, see [Distributed Scheduler Error Codes](../er ```ts let token = 1; try { - continuationManager.off("deviceUnselected", token); + continuationManager.off("deviceDisconnect", token); } catch (err) { console.error('off failed, cause: ' + JSON.stringify(err)); } @@ -761,8 +745,6 @@ startContinuationDeviceManager(token: number, callback: AsyncCallback\): v Starts the device selection module to show the list of available devices on the network. This API does not involve any filter parameters and uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters** @@ -804,8 +786,6 @@ startContinuationDeviceManager(token: number, options: ContinuationExtraParams, Starts the device selection module to show the list of available devices on the network. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters** @@ -851,8 +831,6 @@ startContinuationDeviceManager(token: number, options?: ContinuationExtraParams) Starts the device selection module to show the list of available devices on the network. This API uses a promise to return the result. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters** @@ -1000,8 +978,6 @@ updateContinuationState(token: number, deviceId: string, status: DeviceConnectSt Instructs the device selection module to update the device connection state. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters** @@ -1046,8 +1022,6 @@ updateContinuationState(token: number, deviceId: string, status: DeviceConnectSt Instructs the device selection module to update the device connection state. This API uses a promise to return the result. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters** @@ -1183,8 +1157,6 @@ unregisterContinuation(token: number, callback: AsyncCallback\): void; Deregisters the continuation management service. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters** @@ -1226,8 +1198,6 @@ unregisterContinuation(token: number): Promise\; Deregisters the continuation management service. This API uses a promise to return the result. -**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC - **System capability**: SystemCapability.Ability.DistributedAbilityManager **Parameters**