161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2022-2023 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"), 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit AbilityKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { Callback } from './@ohos.base'; 2261847f8eSopenharmony_ciimport { AsyncCallback } from './@ohos.base'; 2361847f8eSopenharmony_ciimport type { ContinuationResult as _ContinuationResult } from './continuation/continuationResult'; 2461847f8eSopenharmony_ciimport type { ContinuationExtraParams as _ContinuationExtraParams } from './continuation/continuationExtraParams'; 2561847f8eSopenharmony_ci 2661847f8eSopenharmony_ci/** 2761847f8eSopenharmony_ci * Provides methods for interacting with the continuation manager service, including methods for registering and 2861847f8eSopenharmony_ci * Unregister the ability to hop, updating the device connection state, and showing the list of devices 2961847f8eSopenharmony_ci * that can be selected for hopping. 3061847f8eSopenharmony_ci * 3161847f8eSopenharmony_ci * @namespace continuationManager 3261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 3361847f8eSopenharmony_ci * @since 8 3461847f8eSopenharmony_ci */ 3561847f8eSopenharmony_ci/** 3661847f8eSopenharmony_ci * Provides methods for interacting with the continuation manager service, including methods for registering and 3761847f8eSopenharmony_ci * Unregister the ability to hop, updating the device connection state, and showing the list of devices 3861847f8eSopenharmony_ci * that can be selected for hopping. 3961847f8eSopenharmony_ci * 4061847f8eSopenharmony_ci * @namespace continuationManager 4161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 4261847f8eSopenharmony_ci * @atomicservice 4361847f8eSopenharmony_ci * @since 11 4461847f8eSopenharmony_ci */ 4561847f8eSopenharmony_cideclare namespace continuationManager { 4661847f8eSopenharmony_ci /** 4761847f8eSopenharmony_ci * Called when the user selects devices from the candidate device list. 4861847f8eSopenharmony_ci * You can implement your own processing logic in this callback to initiate the hop process. 4961847f8eSopenharmony_ci * 5061847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 5161847f8eSopenharmony_ci * @param { 'deviceSelected' } type - deviceSelected. 5261847f8eSopenharmony_ci * @param { number } token - Registered token. 5361847f8eSopenharmony_ci * @param { Callback<Array<ContinuationResult>> } callback - Called when the user selects a device from the device 5461847f8eSopenharmony_ci * selection module, returning the device ID,device type, 5561847f8eSopenharmony_ci * and device name for developers to use 5661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 5761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 5861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 5961847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 6061847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 6161847f8eSopenharmony_ci * @throws { BusinessError } 16600004 - The specified callback has been registered. 6261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 6361847f8eSopenharmony_ci * @since 9 6461847f8eSopenharmony_ci */ 6561847f8eSopenharmony_ci /** 6661847f8eSopenharmony_ci * Called when the user selects devices from the candidate device list. 6761847f8eSopenharmony_ci * You can implement your own processing logic in this callback to initiate the hop process. 6861847f8eSopenharmony_ci * 6961847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 7061847f8eSopenharmony_ci * @param { 'deviceSelected' } type - deviceSelected. 7161847f8eSopenharmony_ci * @param { number } token - Registered token. 7261847f8eSopenharmony_ci * @param { Callback<Array<ContinuationResult>> } callback - Called when the user selects a device from the device 7361847f8eSopenharmony_ci * selection module, returning the device ID,device type, 7461847f8eSopenharmony_ci * and device name for developers to use 7561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 7661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7761847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7861847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 7961847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 8061847f8eSopenharmony_ci * @throws { BusinessError } 16600004 - The specified callback has been registered. 8161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 8261847f8eSopenharmony_ci * @atomicservice 8361847f8eSopenharmony_ci * @since 11 8461847f8eSopenharmony_ci */ 8561847f8eSopenharmony_ci function on(type: 'deviceSelected', token: number, callback: Callback<Array<ContinuationResult>>): void; 8661847f8eSopenharmony_ci 8761847f8eSopenharmony_ci /** 8861847f8eSopenharmony_ci * Called when devices are disconnected from the continuation manager service. 8961847f8eSopenharmony_ci * You can implement your own processing logic in this callback, such as notifying the user of the disconnection. 9061847f8eSopenharmony_ci * 9161847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 9261847f8eSopenharmony_ci * @param { 'deviceSelected' } type - deviceSelected. 9361847f8eSopenharmony_ci * @param { number } token - Registered token. 9461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 9561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 9661847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 9761847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 9861847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 9961847f8eSopenharmony_ci * @throws { BusinessError } 16600004 - The specified callback has been registered. 10061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 10161847f8eSopenharmony_ci * @since 9 10261847f8eSopenharmony_ci */ 10361847f8eSopenharmony_ci /** 10461847f8eSopenharmony_ci * Called when devices are disconnected from the continuation manager service. 10561847f8eSopenharmony_ci * You can implement your own processing logic in this callback, such as notifying the user of the disconnection. 10661847f8eSopenharmony_ci * 10761847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 10861847f8eSopenharmony_ci * @param { 'deviceSelected' } type - deviceSelected. 10961847f8eSopenharmony_ci * @param { number } token - Registered token. 11061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 11161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 11261847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 11361847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 11461847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 11561847f8eSopenharmony_ci * @throws { BusinessError } 16600004 - The specified callback has been registered. 11661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 11761847f8eSopenharmony_ci * @atomicservice 11861847f8eSopenharmony_ci * @since 11 11961847f8eSopenharmony_ci */ 12061847f8eSopenharmony_ci function off(type: 'deviceSelected', token: number): void; 12161847f8eSopenharmony_ci 12261847f8eSopenharmony_ci /** 12361847f8eSopenharmony_ci * Called when devices are disconnected from the continuation manager service. 12461847f8eSopenharmony_ci * You can implement your own processing logic in this callback, such as notifying the user of the disconnection. 12561847f8eSopenharmony_ci * 12661847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 12761847f8eSopenharmony_ci * @param { 'deviceUnselected' } type - deviceUnselected. 12861847f8eSopenharmony_ci * @param { number } token - Registered token. 12961847f8eSopenharmony_ci * @param { Callback<Array<ContinuationResult>> } callback - Called when the user disconnects the device from the 13061847f8eSopenharmony_ci * device selection module, returning the device ID, 13161847f8eSopenharmony_ci * device type, and device name for developers to use 13261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 13361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 13461847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 13561847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 13661847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 13761847f8eSopenharmony_ci * @throws { BusinessError } 16600004 - The specified callback has been registered. 13861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 13961847f8eSopenharmony_ci * @since 9 14061847f8eSopenharmony_ci */ 14161847f8eSopenharmony_ci /** 14261847f8eSopenharmony_ci * Called when devices are disconnected from the continuation manager service. 14361847f8eSopenharmony_ci * You can implement your own processing logic in this callback, such as notifying the user of the disconnection. 14461847f8eSopenharmony_ci * 14561847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 14661847f8eSopenharmony_ci * @param { 'deviceUnselected' } type - deviceUnselected. 14761847f8eSopenharmony_ci * @param { number } token - Registered token. 14861847f8eSopenharmony_ci * @param { Callback<Array<ContinuationResult>> } callback - Called when the user disconnects the device from the 14961847f8eSopenharmony_ci * device selection module, returning the device ID, 15061847f8eSopenharmony_ci * device type, and device name for developers to use 15161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 15261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 15361847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 15461847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 15561847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 15661847f8eSopenharmony_ci * @throws { BusinessError } 16600004 - The specified callback has been registered. 15761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 15861847f8eSopenharmony_ci * @atomicservice 15961847f8eSopenharmony_ci * @since 11 16061847f8eSopenharmony_ci */ 16161847f8eSopenharmony_ci function on(type: 'deviceUnselected', token: number, callback: Callback<Array<ContinuationResult>>): void; 16261847f8eSopenharmony_ci 16361847f8eSopenharmony_ci /** 16461847f8eSopenharmony_ci * Called when devices are disconnected from the continuation manager service. 16561847f8eSopenharmony_ci * You can implement your own processing logic in this callback, such as notifying the user of the disconnection. 16661847f8eSopenharmony_ci * 16761847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 16861847f8eSopenharmony_ci * @param { 'deviceUnselected' } type - deviceUnselected. 16961847f8eSopenharmony_ci * @param { number } token - Registered token. 17061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 17161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 17261847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 17361847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 17461847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 17561847f8eSopenharmony_ci * @throws { BusinessError } 16600004 - The specified callback has been registered. 17661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 17761847f8eSopenharmony_ci * @since 9 17861847f8eSopenharmony_ci */ 17961847f8eSopenharmony_ci /** 18061847f8eSopenharmony_ci * Called when devices are disconnected from the continuation manager service. 18161847f8eSopenharmony_ci * You can implement your own processing logic in this callback, such as notifying the user of the disconnection. 18261847f8eSopenharmony_ci * 18361847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 18461847f8eSopenharmony_ci * @param { 'deviceUnselected' } type - deviceUnselected. 18561847f8eSopenharmony_ci * @param { number } token - Registered token. 18661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 18761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 18861847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 18961847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 19061847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 19161847f8eSopenharmony_ci * @throws { BusinessError } 16600004 - The specified callback has been registered. 19261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 19361847f8eSopenharmony_ci * @atomicservice 19461847f8eSopenharmony_ci * @since 11 19561847f8eSopenharmony_ci */ 19661847f8eSopenharmony_ci function off(type: 'deviceUnselected', token: number): void; 19761847f8eSopenharmony_ci 19861847f8eSopenharmony_ci /** 19961847f8eSopenharmony_ci * Called when the user selects a device from the candidate device list. 20061847f8eSopenharmony_ci * You can implement your own processing logic in this callback to initiate the hop process. 20161847f8eSopenharmony_ci * 20261847f8eSopenharmony_ci * @param { 'deviceConnect' } type - deviceConnect. 20361847f8eSopenharmony_ci * @param { Callback<ContinuationResult> } callback - Called when the user selects a device from the device selection 20461847f8eSopenharmony_ci * module, returning the device ID,device type, and device name for 20561847f8eSopenharmony_ci * developers to use. 20661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 20761847f8eSopenharmony_ci * @since 8 20861847f8eSopenharmony_ci * @deprecated since 9 20961847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#on 21061847f8eSopenharmony_ci */ 21161847f8eSopenharmony_ci function on(type: 'deviceConnect', callback: Callback<ContinuationResult>): void; 21261847f8eSopenharmony_ci 21361847f8eSopenharmony_ci /** 21461847f8eSopenharmony_ci * Called when the user selects a device from the candidate device list. 21561847f8eSopenharmony_ci * You can implement your own processing logic in this callback to initiate the hop process. 21661847f8eSopenharmony_ci * 21761847f8eSopenharmony_ci * @param { 'deviceConnect' } type - deviceConnect. 21861847f8eSopenharmony_ci * @param { Callback<ContinuationResult> } [callback] - Called when the user selects a device from the device 21961847f8eSopenharmony_ci * selection module, returning the device ID,device type, 22061847f8eSopenharmony_ci * and device name for developers to use. 22161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 22261847f8eSopenharmony_ci * @since 8 22361847f8eSopenharmony_ci * @deprecated since 9 22461847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#off 22561847f8eSopenharmony_ci */ 22661847f8eSopenharmony_ci function off(type: 'deviceConnect', callback?: Callback<ContinuationResult>): void; 22761847f8eSopenharmony_ci 22861847f8eSopenharmony_ci /** 22961847f8eSopenharmony_ci * Called when a device is disconnected from the continuation manager service. 23061847f8eSopenharmony_ci * You can implement your own processing logic in this callback, such as notifying the user of the disconnection. 23161847f8eSopenharmony_ci * 23261847f8eSopenharmony_ci * @param { 'deviceDisconnect' } type - deviceDisconnect. 23361847f8eSopenharmony_ci * @param { Callback<string> } callback - Called when the user disconnects the device from the device selection 23461847f8eSopenharmony_ci * module, returning the device ID for developers to use. 23561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 23661847f8eSopenharmony_ci * @since 8 23761847f8eSopenharmony_ci * @deprecated since 9 23861847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#on 23961847f8eSopenharmony_ci */ 24061847f8eSopenharmony_ci function on(type: 'deviceDisconnect', callback: Callback<string>): void; 24161847f8eSopenharmony_ci 24261847f8eSopenharmony_ci /** 24361847f8eSopenharmony_ci * Called when a device is disconnected from the continuation manager service. 24461847f8eSopenharmony_ci * You can implement your own processing logic in this callback, such as notifying the user of the disconnection. 24561847f8eSopenharmony_ci * 24661847f8eSopenharmony_ci * @param { 'deviceDisconnect' } type - deviceDisconnect. 24761847f8eSopenharmony_ci * @param { Callback<string> } [callback] - Called when the user selects a device from the device selection module, 24861847f8eSopenharmony_ci * returning the device ID,device type, and device name for developers to use. 24961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 25061847f8eSopenharmony_ci * @since 8 25161847f8eSopenharmony_ci * @deprecated since 9 25261847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#off 25361847f8eSopenharmony_ci */ 25461847f8eSopenharmony_ci function off(type: 'deviceDisconnect', callback?: Callback<string>): void; 25561847f8eSopenharmony_ci 25661847f8eSopenharmony_ci /** 25761847f8eSopenharmony_ci * Registers an ability to be hopped with the continuation manager service and obtains the registration token 25861847f8eSopenharmony_ci * assigned to the ability. 25961847f8eSopenharmony_ci * 26061847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The AsyncCallback form returns the token generated after connecting to 26161847f8eSopenharmony_ci * the flow management service. 26261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 26361847f8eSopenharmony_ci * @since 8 26461847f8eSopenharmony_ci * @deprecated since 9 26561847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#registerContinuation 26661847f8eSopenharmony_ci */ 26761847f8eSopenharmony_ci function register(callback: AsyncCallback<number>): void; 26861847f8eSopenharmony_ci 26961847f8eSopenharmony_ci /** 27061847f8eSopenharmony_ci * Registers an ability to be hopped with the continuation manager service and obtains the registration token 27161847f8eSopenharmony_ci * assigned to the ability. 27261847f8eSopenharmony_ci * 27361847f8eSopenharmony_ci * @param { ContinuationExtraParams } options - Indicates the {@link ExtraParams} object containing the extra 27461847f8eSopenharmony_ci * parameters used to filter the list of available devices. 27561847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The AsyncCallback form returns the token generated after 27661847f8eSopenharmony_ci * connecting to the flow management service. 27761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 27861847f8eSopenharmony_ci * @since 8 27961847f8eSopenharmony_ci * @deprecated since 9 28061847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#registerContinuation 28161847f8eSopenharmony_ci */ 28261847f8eSopenharmony_ci function register(options: ContinuationExtraParams, callback: AsyncCallback<number>): void; 28361847f8eSopenharmony_ci 28461847f8eSopenharmony_ci /** 28561847f8eSopenharmony_ci * Registers an ability to be hopped with the continuation manager service and obtains the registration token 28661847f8eSopenharmony_ci * assigned to the ability. 28761847f8eSopenharmony_ci * 28861847f8eSopenharmony_ci * @param { ContinuationExtraParams } [options] - Indicates the {@link ExtraParams} object containing the extra 28961847f8eSopenharmony_ci * parameters used to filter the list of available devices. 29061847f8eSopenharmony_ci * @returns { Promise<number> } callback Indicates the callback to be invoked when the continuation manager service 29161847f8eSopenharmony_ci * is connected. 29261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 29361847f8eSopenharmony_ci * @since 8 29461847f8eSopenharmony_ci * @deprecated since 9 29561847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#registerContinuation 29661847f8eSopenharmony_ci */ 29761847f8eSopenharmony_ci function register(options?: ContinuationExtraParams): Promise<number>; 29861847f8eSopenharmony_ci 29961847f8eSopenharmony_ci /** 30061847f8eSopenharmony_ci * Unregisters a specified ability from the continuation manager service based on the token obtained during ability 30161847f8eSopenharmony_ci * registration. 30261847f8eSopenharmony_ci * 30361847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 30461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result. 30561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 30661847f8eSopenharmony_ci * @since 8 30761847f8eSopenharmony_ci * @deprecated since 9 30861847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#unregisterContinuation 30961847f8eSopenharmony_ci */ 31061847f8eSopenharmony_ci function unregister(token: number, callback: AsyncCallback<void>): void; 31161847f8eSopenharmony_ci 31261847f8eSopenharmony_ci /** 31361847f8eSopenharmony_ci * Unregisters a specified ability from the continuation manager service based on the token obtained during ability 31461847f8eSopenharmony_ci * registration. 31561847f8eSopenharmony_ci * 31661847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 31761847f8eSopenharmony_ci * @returns { Promise<void> } callback Indicates the callback to be invoked when the continuation manager 31861847f8eSopenharmony_ci * service is connected. 31961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 32061847f8eSopenharmony_ci * @since 8 32161847f8eSopenharmony_ci * @deprecated since 9 32261847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#unregisterContinuation 32361847f8eSopenharmony_ci */ 32461847f8eSopenharmony_ci function unregister(token: number): Promise<void>; 32561847f8eSopenharmony_ci 32661847f8eSopenharmony_ci /** 32761847f8eSopenharmony_ci * Updates the connection state of the device where the specified ability is successfully hopped. 32861847f8eSopenharmony_ci * 32961847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 33061847f8eSopenharmony_ci * @param { string } deviceId - Indicates the ID of the device whose connection state is to be updated. 33161847f8eSopenharmony_ci * @param { DeviceConnectState } status - Indicates the connection state to update. 33261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result. 33361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 33461847f8eSopenharmony_ci * @since 8 33561847f8eSopenharmony_ci * @deprecated since 9 33661847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#updateContinuationState 33761847f8eSopenharmony_ci */ 33861847f8eSopenharmony_ci function updateConnectStatus( 33961847f8eSopenharmony_ci token: number, 34061847f8eSopenharmony_ci deviceId: string, 34161847f8eSopenharmony_ci status: DeviceConnectState, 34261847f8eSopenharmony_ci callback: AsyncCallback<void> 34361847f8eSopenharmony_ci ): void; 34461847f8eSopenharmony_ci 34561847f8eSopenharmony_ci /** 34661847f8eSopenharmony_ci * Updates the connection state of the device where the specified ability is successfully hopped. 34761847f8eSopenharmony_ci * 34861847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 34961847f8eSopenharmony_ci * @param { string } deviceId - Indicates the ID of the device whose connection state is to be updated. 35061847f8eSopenharmony_ci * @param { DeviceConnectState } status - Indicates the connection state to update. 35161847f8eSopenharmony_ci * @returns { Promise<void> } callback Indicates the callback to be invoked when the continuation 35261847f8eSopenharmony_ci * manager service is connected. 35361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 35461847f8eSopenharmony_ci * @since 8 35561847f8eSopenharmony_ci * @deprecated since 9 35661847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#updateContinuationState 35761847f8eSopenharmony_ci */ 35861847f8eSopenharmony_ci function updateConnectStatus(token: number, deviceId: string, status: DeviceConnectState): Promise<void>; 35961847f8eSopenharmony_ci 36061847f8eSopenharmony_ci /** 36161847f8eSopenharmony_ci * Start to manage the devices that can be selected for continuation. 36261847f8eSopenharmony_ci * 36361847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 36461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result. 36561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 36661847f8eSopenharmony_ci * @since 8 36761847f8eSopenharmony_ci * @deprecated since 9 36861847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#startContinuationDeviceManager 36961847f8eSopenharmony_ci */ 37061847f8eSopenharmony_ci function startDeviceManager(token: number, callback: AsyncCallback<void>): void; 37161847f8eSopenharmony_ci 37261847f8eSopenharmony_ci /** 37361847f8eSopenharmony_ci * Start to manage the devices that can be selected for continuation. 37461847f8eSopenharmony_ci * 37561847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 37661847f8eSopenharmony_ci * @param { ContinuationExtraParams } options - Indicates the extraParams object containing the extra parameters 37761847f8eSopenharmony_ci * used to filter the list of available devices. This parameter is null. 37861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result. 37961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 38061847f8eSopenharmony_ci * @since 8 38161847f8eSopenharmony_ci * @deprecated since 9 38261847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#startContinuationDeviceManager 38361847f8eSopenharmony_ci */ 38461847f8eSopenharmony_ci function startDeviceManager(token: number, options: ContinuationExtraParams, callback: AsyncCallback<void>): void; 38561847f8eSopenharmony_ci 38661847f8eSopenharmony_ci /** 38761847f8eSopenharmony_ci * Start to manage the devices that can be selected for continuation. 38861847f8eSopenharmony_ci * 38961847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 39061847f8eSopenharmony_ci * @param { ContinuationExtraParams } [options] - Indicates the extraParams object containing the extra parameters 39161847f8eSopenharmony_ci * used to filter the list of available devices. This parameter is null. 39261847f8eSopenharmony_ci * @returns { Promise<void> } callback Indicates the callback to be invoked when the continuation manager service 39361847f8eSopenharmony_ci * is connected. 39461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 39561847f8eSopenharmony_ci * @since 8 39661847f8eSopenharmony_ci * @deprecated since 9 39761847f8eSopenharmony_ci * @useinstead ohos.continuation.continuationManager/continuationManager#startContinuationDeviceManager 39861847f8eSopenharmony_ci */ 39961847f8eSopenharmony_ci function startDeviceManager(token: number, options?: ContinuationExtraParams): Promise<void>; 40061847f8eSopenharmony_ci 40161847f8eSopenharmony_ci /** 40261847f8eSopenharmony_ci * Registers an ability to be hopped with the continuation manager service and obtains the registration token 40361847f8eSopenharmony_ci * assigned to the ability. 40461847f8eSopenharmony_ci * 40561847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 40661847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The AsyncCallback form returns the token generated after connecting to 40761847f8eSopenharmony_ci * the flow management service. 40861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 40961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 41061847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 41161847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 41261847f8eSopenharmony_ci * @throws { BusinessError } 16600003 - The number of token registration times has reached the upper limit. 41361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 41461847f8eSopenharmony_ci * @since 9 41561847f8eSopenharmony_ci */ 41661847f8eSopenharmony_ci /** 41761847f8eSopenharmony_ci * Registers an ability to be hopped with the continuation manager service and obtains the registration token 41861847f8eSopenharmony_ci * assigned to the ability. 41961847f8eSopenharmony_ci * 42061847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 42161847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The AsyncCallback form returns the token generated after connecting to 42261847f8eSopenharmony_ci * the flow management service. 42361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 42461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 42561847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 42661847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 42761847f8eSopenharmony_ci * @throws { BusinessError } 16600003 - The number of token registration times has reached the upper limit. 42861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 42961847f8eSopenharmony_ci * @atomicservice 43061847f8eSopenharmony_ci * @since 11 43161847f8eSopenharmony_ci */ 43261847f8eSopenharmony_ci function registerContinuation(callback: AsyncCallback<number>): void; 43361847f8eSopenharmony_ci 43461847f8eSopenharmony_ci /** 43561847f8eSopenharmony_ci * Registers an ability to be hopped with the continuation manager service and obtains the registration token 43661847f8eSopenharmony_ci * assigned to the ability. 43761847f8eSopenharmony_ci * 43861847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 43961847f8eSopenharmony_ci * @param { ContinuationExtraParams } options - Indicates the {@link ExtraParams} object containing extra parameters 44061847f8eSopenharmony_ci * used to filter the list of available devices. 44161847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The AsyncCallback form returns the token generated after connecting to 44261847f8eSopenharmony_ci * flow management service. 44361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 44461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 44561847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 44661847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 44761847f8eSopenharmony_ci * @throws { BusinessError } 16600003 - The number of token registration times has reached the upper limit. 44861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 44961847f8eSopenharmony_ci * @since 9 45061847f8eSopenharmony_ci */ 45161847f8eSopenharmony_ci /** 45261847f8eSopenharmony_ci * Registers an ability to be hopped with the continuation manager service and obtains the registration token 45361847f8eSopenharmony_ci * assigned to the ability. 45461847f8eSopenharmony_ci * 45561847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 45661847f8eSopenharmony_ci * @param { ContinuationExtraParams } options - Indicates the {@link ExtraParams} object containing extra parameters 45761847f8eSopenharmony_ci * used to filter the list of available devices. 45861847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The AsyncCallback form returns the token generated after connecting to 45961847f8eSopenharmony_ci * flow management service. 46061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 46161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 46261847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 46361847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 46461847f8eSopenharmony_ci * @throws { BusinessError } 16600003 - The number of token registration times has reached the upper limit. 46561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 46661847f8eSopenharmony_ci * @atomicservice 46761847f8eSopenharmony_ci * @since 11 46861847f8eSopenharmony_ci */ 46961847f8eSopenharmony_ci function registerContinuation(options: ContinuationExtraParams, callback: AsyncCallback<number>): void; 47061847f8eSopenharmony_ci 47161847f8eSopenharmony_ci /** 47261847f8eSopenharmony_ci * Registers an ability to be hopped with the continuation manager service and obtains the registration token 47361847f8eSopenharmony_ci * assigned to the ability. 47461847f8eSopenharmony_ci * 47561847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 47661847f8eSopenharmony_ci * @param { ContinuationExtraParams } [options] - Indicates the {@link ExtraParams} object containing the extra 47761847f8eSopenharmony_ci * parameters used to filter the list of available devices. 47861847f8eSopenharmony_ci * @returns { Promise<number> } callback Indicates the callback to be invoked when the continuation manager 47961847f8eSopenharmony_ci * service is connected. 48061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 48161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types 48261847f8eSopenharmony_ci * <br>2. Parameter verification failed; 48361847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 48461847f8eSopenharmony_ci * @throws { BusinessError } 16600003 - The number of token registration times has reached the upper limit. 48561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 48661847f8eSopenharmony_ci * @since 9 48761847f8eSopenharmony_ci */ 48861847f8eSopenharmony_ci /** 48961847f8eSopenharmony_ci * Registers an ability to be hopped with the continuation manager service and obtains the registration token 49061847f8eSopenharmony_ci * assigned to the ability. 49161847f8eSopenharmony_ci * 49261847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 49361847f8eSopenharmony_ci * @param { ContinuationExtraParams } [options] - Indicates the {@link ExtraParams} object containing the extra 49461847f8eSopenharmony_ci * parameters used to filter the list of available devices. 49561847f8eSopenharmony_ci * @returns { Promise<number> } callback Indicates the callback to be invoked when the continuation manager 49661847f8eSopenharmony_ci * service is connected. 49761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 49861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 49961847f8eSopenharmony_ci * <br>2. Parameter verification failed; 50061847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 50161847f8eSopenharmony_ci * @throws { BusinessError } 16600003 - The number of token registration times has reached the upper limit. 50261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 50361847f8eSopenharmony_ci * @atomicservice 50461847f8eSopenharmony_ci * @since 11 50561847f8eSopenharmony_ci */ 50661847f8eSopenharmony_ci function registerContinuation(options?: ContinuationExtraParams): Promise<number>; 50761847f8eSopenharmony_ci 50861847f8eSopenharmony_ci /** 50961847f8eSopenharmony_ci * Unregisters a specified ability from the continuation manager service based on the token obtained during ability 51061847f8eSopenharmony_ci * registration. 51161847f8eSopenharmony_ci * 51261847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 51361847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 51461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The AsyncCallback form returns token generated after connecting to flow 51561847f8eSopenharmony_ci * management service. 51661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 51761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 51861847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 51961847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 52061847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 52161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 52261847f8eSopenharmony_ci * @since 9 52361847f8eSopenharmony_ci */ 52461847f8eSopenharmony_ci /** 52561847f8eSopenharmony_ci * Unregisters a specified ability from the continuation manager service based on the token obtained during ability 52661847f8eSopenharmony_ci * registration. 52761847f8eSopenharmony_ci * 52861847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 52961847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 53061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The AsyncCallback form returns token generated after connecting to flow 53161847f8eSopenharmony_ci * management service. 53261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 53361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 53461847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 53561847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 53661847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 53761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 53861847f8eSopenharmony_ci * @atomicservice 53961847f8eSopenharmony_ci * @since 11 54061847f8eSopenharmony_ci */ 54161847f8eSopenharmony_ci function unregisterContinuation(token: number, callback: AsyncCallback<void>): void; 54261847f8eSopenharmony_ci 54361847f8eSopenharmony_ci /** 54461847f8eSopenharmony_ci * Unregisters a specified ability from the continuation manager service based on the token obtained during ability 54561847f8eSopenharmony_ci * registration. 54661847f8eSopenharmony_ci * 54761847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 54861847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 54961847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 55061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 55161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 55261847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 55361847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 55461847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 55561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 55661847f8eSopenharmony_ci * @since 9 55761847f8eSopenharmony_ci */ 55861847f8eSopenharmony_ci /** 55961847f8eSopenharmony_ci * Unregisters a specified ability from the continuation manager service based on the token obtained during ability 56061847f8eSopenharmony_ci * registration. 56161847f8eSopenharmony_ci * 56261847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 56361847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 56461847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 56561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 56661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 56761847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 56861847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 56961847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 57061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 57161847f8eSopenharmony_ci * @atomicservice 57261847f8eSopenharmony_ci * @since 11 57361847f8eSopenharmony_ci */ 57461847f8eSopenharmony_ci function unregisterContinuation(token: number): Promise<void>; 57561847f8eSopenharmony_ci 57661847f8eSopenharmony_ci /** 57761847f8eSopenharmony_ci * Updates the connection state of the device where the specified ability is successfully hopped. 57861847f8eSopenharmony_ci * 57961847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 58061847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 58161847f8eSopenharmony_ci * @param { string } deviceId - Indicates the ID of the device whose connection state is to be updated. 58261847f8eSopenharmony_ci * @param { DeviceConnectState } status - Indicates the connection state to update. 58361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result. 58461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 58561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 58661847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 58761847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 58861847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 58961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 59061847f8eSopenharmony_ci * @since 9 59161847f8eSopenharmony_ci */ 59261847f8eSopenharmony_ci /** 59361847f8eSopenharmony_ci * Updates the connection state of the device where the specified ability is successfully hopped. 59461847f8eSopenharmony_ci * 59561847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 59661847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 59761847f8eSopenharmony_ci * @param { string } deviceId - Indicates the ID of the device whose connection state is to be updated. 59861847f8eSopenharmony_ci * @param { DeviceConnectState } status - Indicates the connection state to update. 59961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result. 60061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 60161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 60261847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 60361847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 60461847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 60561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 60661847f8eSopenharmony_ci * @atomicservice 60761847f8eSopenharmony_ci * @since 11 60861847f8eSopenharmony_ci */ 60961847f8eSopenharmony_ci function updateContinuationState( 61061847f8eSopenharmony_ci token: number, 61161847f8eSopenharmony_ci deviceId: string, 61261847f8eSopenharmony_ci status: DeviceConnectState, 61361847f8eSopenharmony_ci callback: AsyncCallback<void> 61461847f8eSopenharmony_ci ): void; 61561847f8eSopenharmony_ci 61661847f8eSopenharmony_ci /** 61761847f8eSopenharmony_ci * Updates the connection state of the device where the specified ability is successfully hopped. 61861847f8eSopenharmony_ci * 61961847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 62061847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 62161847f8eSopenharmony_ci * @param { string } deviceId - Indicates the ID of the device whose connection state is to be updated. 62261847f8eSopenharmony_ci * @param { DeviceConnectState } status - Indicates the connection state to update. 62361847f8eSopenharmony_ci * @returns { Promise<void> } callback Indicates the callback to be invoked when the continuation manager service 62461847f8eSopenharmony_ci * is connected. 62561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 62661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 62761847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 62861847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 62961847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 63061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 63161847f8eSopenharmony_ci * @since 9 63261847f8eSopenharmony_ci */ 63361847f8eSopenharmony_ci /** 63461847f8eSopenharmony_ci * Updates the connection state of the device where the specified ability is successfully hopped. 63561847f8eSopenharmony_ci * 63661847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 63761847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 63861847f8eSopenharmony_ci * @param { string } deviceId - Indicates the ID of the device whose connection state is to be updated. 63961847f8eSopenharmony_ci * @param { DeviceConnectState } status - Indicates the connection state to update. 64061847f8eSopenharmony_ci * @returns { Promise<void> } callback Indicates the callback to be invoked when the continuation manager service 64161847f8eSopenharmony_ci * is connected. 64261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 64361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 64461847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 64561847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 64661847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 64761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 64861847f8eSopenharmony_ci * @atomicservice 64961847f8eSopenharmony_ci * @since 11 65061847f8eSopenharmony_ci */ 65161847f8eSopenharmony_ci function updateContinuationState(token: number, deviceId: string, status: DeviceConnectState): Promise<void>; 65261847f8eSopenharmony_ci 65361847f8eSopenharmony_ci /** 65461847f8eSopenharmony_ci * Start to manage the devices that can be selected for continuation. 65561847f8eSopenharmony_ci * 65661847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 65761847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 65861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result. 65961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 66061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 66161847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 66261847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 66361847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 66461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 66561847f8eSopenharmony_ci * @since 9 66661847f8eSopenharmony_ci */ 66761847f8eSopenharmony_ci /** 66861847f8eSopenharmony_ci * Start to manage the devices that can be selected for continuation. 66961847f8eSopenharmony_ci * 67061847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 67161847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 67261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result. 67361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 67461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 67561847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 67661847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 67761847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 67861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 67961847f8eSopenharmony_ci * @atomicservice 68061847f8eSopenharmony_ci * @since 11 68161847f8eSopenharmony_ci */ 68261847f8eSopenharmony_ci function startContinuationDeviceManager(token: number, callback: AsyncCallback<void>): void; 68361847f8eSopenharmony_ci 68461847f8eSopenharmony_ci /** 68561847f8eSopenharmony_ci * Start to manage the devices that can be selected for continuation. 68661847f8eSopenharmony_ci * 68761847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 68861847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 68961847f8eSopenharmony_ci * @param { ContinuationExtraParams } options - Indicates the extraParams object containing the extra parameters 69061847f8eSopenharmony_ci * used to filter list of available devices. This parameter can be null. 69161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - AsyncCallback form returns the interface call result. 69261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 69361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 69461847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 69561847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 69661847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 69761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 69861847f8eSopenharmony_ci * @since 9 69961847f8eSopenharmony_ci */ 70061847f8eSopenharmony_ci /** 70161847f8eSopenharmony_ci * Start to manage the devices that can be selected for continuation. 70261847f8eSopenharmony_ci * 70361847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 70461847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 70561847f8eSopenharmony_ci * @param { ContinuationExtraParams } options - Indicates the extraParams object containing the extra parameters 70661847f8eSopenharmony_ci * used to filter list of available devices. This parameter can be null. 70761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - AsyncCallback form returns the interface call result. 70861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 70961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 71061847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 71161847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 71261847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 71361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 71461847f8eSopenharmony_ci * @atomicservice 71561847f8eSopenharmony_ci * @since 11 71661847f8eSopenharmony_ci */ 71761847f8eSopenharmony_ci function startContinuationDeviceManager( 71861847f8eSopenharmony_ci token: number, 71961847f8eSopenharmony_ci options: ContinuationExtraParams, 72061847f8eSopenharmony_ci callback: AsyncCallback<void> 72161847f8eSopenharmony_ci ): void; 72261847f8eSopenharmony_ci 72361847f8eSopenharmony_ci /** 72461847f8eSopenharmony_ci * Start to manage the devices that can be selected for continuation. 72561847f8eSopenharmony_ci * 72661847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 72761847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 72861847f8eSopenharmony_ci * @param { ContinuationExtraParams } [options] - Indicates extraParams object containing extra parameters used to 72961847f8eSopenharmony_ci * filter the list of available devices. This parameter can be null. 73061847f8eSopenharmony_ci * @returns { Promise<void> } callback Indicates the callback to be invoked when continuation manager service is connected. 73161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 73261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types 73361847f8eSopenharmony_ci * <br>2. Parameter verification failed; 73461847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 73561847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 73661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 73761847f8eSopenharmony_ci * @since 9 73861847f8eSopenharmony_ci */ 73961847f8eSopenharmony_ci /** 74061847f8eSopenharmony_ci * Start to manage the devices that can be selected for continuation. 74161847f8eSopenharmony_ci * 74261847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 74361847f8eSopenharmony_ci * @param { number } token - Indicates the registration token of the ability. 74461847f8eSopenharmony_ci * @param { ContinuationExtraParams } [options] - Indicates extraParams object containing extra parameters used to 74561847f8eSopenharmony_ci * filter the list of available devices. This parameter can be null. 74661847f8eSopenharmony_ci * @returns { Promise<void> } callback Indicates the callback to be invoked when continuation manager service is connected. 74761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 74861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 74961847f8eSopenharmony_ci * <br>2. Parameter verification failed; 75061847f8eSopenharmony_ci * @throws { BusinessError } 16600001 - The system ability works abnormally. 75161847f8eSopenharmony_ci * @throws { BusinessError } 16600002 - The specified token or callback is not registered. 75261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 75361847f8eSopenharmony_ci * @atomicservice 75461847f8eSopenharmony_ci * @since 11 75561847f8eSopenharmony_ci */ 75661847f8eSopenharmony_ci function startContinuationDeviceManager(token: number, options?: ContinuationExtraParams): Promise<void>; 75761847f8eSopenharmony_ci 75861847f8eSopenharmony_ci /** 75961847f8eSopenharmony_ci * Device connection status data structure. 76061847f8eSopenharmony_ci * 76161847f8eSopenharmony_ci * @enum { number } 76261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 76361847f8eSopenharmony_ci * @since 8 76461847f8eSopenharmony_ci */ 76561847f8eSopenharmony_ci /** 76661847f8eSopenharmony_ci * Device connection status data structure. 76761847f8eSopenharmony_ci * 76861847f8eSopenharmony_ci * @enum { number } 76961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 77061847f8eSopenharmony_ci * @atomicservice 77161847f8eSopenharmony_ci * @since 11 77261847f8eSopenharmony_ci */ 77361847f8eSopenharmony_ci export enum DeviceConnectState { 77461847f8eSopenharmony_ci /** 77561847f8eSopenharmony_ci * Initial state of device connection. 77661847f8eSopenharmony_ci * 77761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 77861847f8eSopenharmony_ci * @since 8 77961847f8eSopenharmony_ci */ 78061847f8eSopenharmony_ci /** 78161847f8eSopenharmony_ci * Initial state of device connection. 78261847f8eSopenharmony_ci * 78361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 78461847f8eSopenharmony_ci * @atomicservice 78561847f8eSopenharmony_ci * @since 11 78661847f8eSopenharmony_ci */ 78761847f8eSopenharmony_ci IDLE = 0, 78861847f8eSopenharmony_ci 78961847f8eSopenharmony_ci /** 79061847f8eSopenharmony_ci * Device connection status. 79161847f8eSopenharmony_ci * 79261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 79361847f8eSopenharmony_ci * @since 8 79461847f8eSopenharmony_ci */ 79561847f8eSopenharmony_ci /** 79661847f8eSopenharmony_ci * Device connection status. 79761847f8eSopenharmony_ci * 79861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 79961847f8eSopenharmony_ci * @atomicservice 80061847f8eSopenharmony_ci * @since 11 80161847f8eSopenharmony_ci */ 80261847f8eSopenharmony_ci CONNECTING = 1, 80361847f8eSopenharmony_ci 80461847f8eSopenharmony_ci /** 80561847f8eSopenharmony_ci * The device is connected. 80661847f8eSopenharmony_ci * 80761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 80861847f8eSopenharmony_ci * @since 8 80961847f8eSopenharmony_ci */ 81061847f8eSopenharmony_ci /** 81161847f8eSopenharmony_ci * The device is connected. 81261847f8eSopenharmony_ci * 81361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 81461847f8eSopenharmony_ci * @atomicservice 81561847f8eSopenharmony_ci * @since 11 81661847f8eSopenharmony_ci */ 81761847f8eSopenharmony_ci CONNECTED = 2, 81861847f8eSopenharmony_ci 81961847f8eSopenharmony_ci /** 82061847f8eSopenharmony_ci * The device is disconnected. 82161847f8eSopenharmony_ci * 82261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 82361847f8eSopenharmony_ci * @since 8 82461847f8eSopenharmony_ci */ 82561847f8eSopenharmony_ci /** 82661847f8eSopenharmony_ci * The device is disconnected. 82761847f8eSopenharmony_ci * 82861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 82961847f8eSopenharmony_ci * @atomicservice 83061847f8eSopenharmony_ci * @since 11 83161847f8eSopenharmony_ci */ 83261847f8eSopenharmony_ci DISCONNECTING = 3 83361847f8eSopenharmony_ci } 83461847f8eSopenharmony_ci 83561847f8eSopenharmony_ci /** 83661847f8eSopenharmony_ci * Indicates the description of additional parameters for continuation. 83761847f8eSopenharmony_ci * 83861847f8eSopenharmony_ci * @enum { number } 83961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 84061847f8eSopenharmony_ci * @since 8 84161847f8eSopenharmony_ci */ 84261847f8eSopenharmony_ci /** 84361847f8eSopenharmony_ci * Indicates the description of additional parameters for continuation. 84461847f8eSopenharmony_ci * 84561847f8eSopenharmony_ci * @enum { number } 84661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 84761847f8eSopenharmony_ci * @atomicservice 84861847f8eSopenharmony_ci * @since 11 84961847f8eSopenharmony_ci */ 85061847f8eSopenharmony_ci export enum ContinuationMode { 85161847f8eSopenharmony_ci /** 85261847f8eSopenharmony_ci * Collaboration with a single device. 85361847f8eSopenharmony_ci * 85461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 85561847f8eSopenharmony_ci * @since 8 85661847f8eSopenharmony_ci */ 85761847f8eSopenharmony_ci /** 85861847f8eSopenharmony_ci * Collaboration with a single device. 85961847f8eSopenharmony_ci * 86061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 86161847f8eSopenharmony_ci * @atomicservice 86261847f8eSopenharmony_ci * @since 11 86361847f8eSopenharmony_ci */ 86461847f8eSopenharmony_ci COLLABORATION_SINGLE = 0, 86561847f8eSopenharmony_ci 86661847f8eSopenharmony_ci /** 86761847f8eSopenharmony_ci * Collaboration with multiple devices. 86861847f8eSopenharmony_ci * 86961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 87061847f8eSopenharmony_ci * @since 8 87161847f8eSopenharmony_ci */ 87261847f8eSopenharmony_ci /** 87361847f8eSopenharmony_ci * Collaboration with multiple devices. 87461847f8eSopenharmony_ci * 87561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 87661847f8eSopenharmony_ci * @atomicservice 87761847f8eSopenharmony_ci * @since 11 87861847f8eSopenharmony_ci */ 87961847f8eSopenharmony_ci COLLABORATION_MULTIPLE = 1 88061847f8eSopenharmony_ci } 88161847f8eSopenharmony_ci 88261847f8eSopenharmony_ci /** 88361847f8eSopenharmony_ci * Indicates the description of transfer results for continuation. 88461847f8eSopenharmony_ci * 88561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 88661847f8eSopenharmony_ci * @since 10 88761847f8eSopenharmony_ci */ 88861847f8eSopenharmony_ci /** 88961847f8eSopenharmony_ci * Indicates the description of transfer results for continuation. 89061847f8eSopenharmony_ci * @typedef { _ContinuationResult } 89161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 89261847f8eSopenharmony_ci * @atomicservice 89361847f8eSopenharmony_ci * @since 11 89461847f8eSopenharmony_ci */ 89561847f8eSopenharmony_ci export type ContinuationResult = _ContinuationResult; 89661847f8eSopenharmony_ci 89761847f8eSopenharmony_ci /** 89861847f8eSopenharmony_ci * Indicates the description of additional parameters for continuation. 89961847f8eSopenharmony_ci * 90061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 90161847f8eSopenharmony_ci * @since 10 90261847f8eSopenharmony_ci */ 90361847f8eSopenharmony_ci /** 90461847f8eSopenharmony_ci * Indicates the description of additional parameters for continuation. 90561847f8eSopenharmony_ci * @typedef { _ContinuationExtraParams } 90661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.DistributedAbilityManager 90761847f8eSopenharmony_ci * @atomicservice 90861847f8eSopenharmony_ci * @since 11 90961847f8eSopenharmony_ci */ 91061847f8eSopenharmony_ci export type ContinuationExtraParams = _ContinuationExtraParams; 91161847f8eSopenharmony_ci} 91261847f8eSopenharmony_ciexport default continuationManager; 913