161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2022 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 type { AsyncCallback, Callback } from './@ohos.base'; 2261847f8eSopenharmony_ciimport type { ContinuableInfo as _ContinuableInfo } from './application/ContinuableInfo'; 2361847f8eSopenharmony_ciimport type { ContinueCallback as _ContinueCallback } from './application/ContinueCallback'; 2461847f8eSopenharmony_ciimport type { ContinueDeviceInfo as _ContinueDeviceInfo } from './application/ContinueDeviceInfo'; 2561847f8eSopenharmony_ciimport type { ContinueMissionInfo as _ContinueMissionInfo } from './application/ContinueMissionInfo'; 2661847f8eSopenharmony_ciimport type { MissionCallback as _MissionCallback } from './application/MissionCallbacks'; 2761847f8eSopenharmony_ciimport type { MissionDeviceInfo as _MissionDeviceInfo } from './application/MissionDeviceInfo'; 2861847f8eSopenharmony_ciimport type { MissionParameter as _MissionParameter } from './application/MissionParameter'; 2961847f8eSopenharmony_ci 3061847f8eSopenharmony_ci/** 3161847f8eSopenharmony_ci * This module provides the capability to manage abilities and obtain system task information for distributed 3261847f8eSopenharmony_ci * scenario. 3361847f8eSopenharmony_ci * 3461847f8eSopenharmony_ci * @namespace distributedMissionManager 3561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 3661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 3761847f8eSopenharmony_ci * @since 9 3861847f8eSopenharmony_ci */ 3961847f8eSopenharmony_cideclare namespace distributedMissionManager { 4061847f8eSopenharmony_ci /** 4161847f8eSopenharmony_ci * Continue state change event definition. 4261847f8eSopenharmony_ci * 4361847f8eSopenharmony_ci * @enum { number } 4461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 4561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 4661847f8eSopenharmony_ci * @since 10 4761847f8eSopenharmony_ci */ 4861847f8eSopenharmony_ci enum ContinueState { 4961847f8eSopenharmony_ci /** 5061847f8eSopenharmony_ci * Mission continuable active. 5161847f8eSopenharmony_ci * 5261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 5361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 5461847f8eSopenharmony_ci * @since 10 5561847f8eSopenharmony_ci */ 5661847f8eSopenharmony_ci ACTIVE = 0, 5761847f8eSopenharmony_ci 5861847f8eSopenharmony_ci /** 5961847f8eSopenharmony_ci * Mission continuable inactive. 6061847f8eSopenharmony_ci * 6161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 6261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 6361847f8eSopenharmony_ci * @since 10 6461847f8eSopenharmony_ci */ 6561847f8eSopenharmony_ci INACTIVE = 1 6661847f8eSopenharmony_ci } 6761847f8eSopenharmony_ci 6861847f8eSopenharmony_ci /** 6961847f8eSopenharmony_ci * ContinueCallbackInfo. 7061847f8eSopenharmony_ci * 7161847f8eSopenharmony_ci * @interface ContinueCallbackInfo 7261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 7361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 7461847f8eSopenharmony_ci * @since 11 7561847f8eSopenharmony_ci */ 7661847f8eSopenharmony_ci interface ContinueCallbackInfo { 7761847f8eSopenharmony_ci /** 7861847f8eSopenharmony_ci * Continue state event. 7961847f8eSopenharmony_ci * 8061847f8eSopenharmony_ci * @type { ContinueState } 8161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 8261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 8361847f8eSopenharmony_ci * @since 11 8461847f8eSopenharmony_ci */ 8561847f8eSopenharmony_ci state: ContinueState; 8661847f8eSopenharmony_ci 8761847f8eSopenharmony_ci /** 8861847f8eSopenharmony_ci * Continuable information corresponding to ability. 8961847f8eSopenharmony_ci * 9061847f8eSopenharmony_ci * @type { ContinuableInfo } 9161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 9261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 9361847f8eSopenharmony_ci * @since 11 9461847f8eSopenharmony_ci */ 9561847f8eSopenharmony_ci info: ContinuableInfo; 9661847f8eSopenharmony_ci } 9761847f8eSopenharmony_ci 9861847f8eSopenharmony_ci /** 9961847f8eSopenharmony_ci * Start sync missions from remote device. 10061847f8eSopenharmony_ci * 10161847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS 10261847f8eSopenharmony_ci * @param { MissionParameter } parameter - Parameters corresponding to mission. 10361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of startSyncRemoteMissions. 10461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 10561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 10661847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 10761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 10861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 10961847f8eSopenharmony_ci * @since 9 11061847f8eSopenharmony_ci */ 11161847f8eSopenharmony_ci function startSyncRemoteMissions(parameter: MissionParameter, callback: AsyncCallback<void>): void; 11261847f8eSopenharmony_ci 11361847f8eSopenharmony_ci /** 11461847f8eSopenharmony_ci * Start sync missions from remote device. 11561847f8eSopenharmony_ci * 11661847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS 11761847f8eSopenharmony_ci * @param { MissionParameter } parameter - Parameters corresponding to mission. 11861847f8eSopenharmony_ci * @returns { Promise<void> } - the promise returned by the function. 11961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 12061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 12161847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 12261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 12361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 12461847f8eSopenharmony_ci * @since 9 12561847f8eSopenharmony_ci */ 12661847f8eSopenharmony_ci function startSyncRemoteMissions(parameter: MissionParameter): Promise<void>; 12761847f8eSopenharmony_ci 12861847f8eSopenharmony_ci /** 12961847f8eSopenharmony_ci * Stop sync missions from remote device. 13061847f8eSopenharmony_ci * 13161847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS 13261847f8eSopenharmony_ci * @param { MissionDeviceInfo } parameter - Parameters corresponding to mission. 13361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of stopSyncRemoteMissions. 13461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 13561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 13661847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 13761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 13861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 13961847f8eSopenharmony_ci * @since 9 14061847f8eSopenharmony_ci */ 14161847f8eSopenharmony_ci function stopSyncRemoteMissions(parameter: MissionDeviceInfo, callback: AsyncCallback<void>): void; 14261847f8eSopenharmony_ci 14361847f8eSopenharmony_ci /** 14461847f8eSopenharmony_ci * Stop sync missions from remote device. 14561847f8eSopenharmony_ci * 14661847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS 14761847f8eSopenharmony_ci * @param { MissionDeviceInfo } parameter - Parameters corresponding to mission. 14861847f8eSopenharmony_ci * @returns { Promise<void> } - the promise returned by the function. 14961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 15061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 15161847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 15261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 15361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 15461847f8eSopenharmony_ci * @since 9 15561847f8eSopenharmony_ci */ 15661847f8eSopenharmony_ci function stopSyncRemoteMissions(parameter: MissionDeviceInfo): Promise<void>; 15761847f8eSopenharmony_ci 15861847f8eSopenharmony_ci /** 15961847f8eSopenharmony_ci * Register the missionListener to ams. 16061847f8eSopenharmony_ci * 16161847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS 16261847f8eSopenharmony_ci * @param { MissionDeviceInfo } parameter - Parameters corresponding to mission. 16361847f8eSopenharmony_ci * @param { MissionCallback } options - The callbacks for registering mission. 16461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of registerMissionListener. 16561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 16661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 16761847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 16861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 16961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 17061847f8eSopenharmony_ci * @since 9 17161847f8eSopenharmony_ci */ 17261847f8eSopenharmony_ci function registerMissionListener( 17361847f8eSopenharmony_ci parameter: MissionDeviceInfo, 17461847f8eSopenharmony_ci options: MissionCallback, 17561847f8eSopenharmony_ci callback: AsyncCallback<void> 17661847f8eSopenharmony_ci ): void; 17761847f8eSopenharmony_ci 17861847f8eSopenharmony_ci /** 17961847f8eSopenharmony_ci * Register the missionListener to ams. 18061847f8eSopenharmony_ci * 18161847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS 18261847f8eSopenharmony_ci * @param { MissionDeviceInfo } parameter - Parameters corresponding to mission. 18361847f8eSopenharmony_ci * @param { MissionCallback } options - The callbacks for registering mission. 18461847f8eSopenharmony_ci * @returns { Promise<void> } - the promise returned by the function. 18561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 18661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 18761847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 18861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 18961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 19061847f8eSopenharmony_ci * @since 9 19161847f8eSopenharmony_ci */ 19261847f8eSopenharmony_ci function registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback): Promise<void>; 19361847f8eSopenharmony_ci 19461847f8eSopenharmony_ci /** 19561847f8eSopenharmony_ci * Unregister the missionListener to ams. 19661847f8eSopenharmony_ci * 19761847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS 19861847f8eSopenharmony_ci * @param { MissionDeviceInfo } parameter - Parameters corresponding to mission. 19961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of registerMissionListener. 20061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 20161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 20261847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 20361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 20461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 20561847f8eSopenharmony_ci * @since 9 20661847f8eSopenharmony_ci */ 20761847f8eSopenharmony_ci function unRegisterMissionListener(parameter: MissionDeviceInfo, callback: AsyncCallback<void>): void; 20861847f8eSopenharmony_ci 20961847f8eSopenharmony_ci /** 21061847f8eSopenharmony_ci * Unregister the missionListener to ams. 21161847f8eSopenharmony_ci * 21261847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS 21361847f8eSopenharmony_ci * @param { MissionDeviceInfo } parameter - Parameters corresponding to mission. 21461847f8eSopenharmony_ci * @returns { Promise<void> } - the promise returned by the function. 21561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 21661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 21761847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 21861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 21961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 22061847f8eSopenharmony_ci * @since 9 22161847f8eSopenharmony_ci */ 22261847f8eSopenharmony_ci function unRegisterMissionListener(parameter: MissionDeviceInfo): Promise<void>; 22361847f8eSopenharmony_ci 22461847f8eSopenharmony_ci /** 22561847f8eSopenharmony_ci * Register continuable info listener to ams. 22661847f8eSopenharmony_ci * 22761847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS 22861847f8eSopenharmony_ci * @param { 'continueStateChange' } type - Indicate the event type. 22961847f8eSopenharmony_ci * @param { Callback<{ state: ContinueState, info: ContinuableInfo }> } callback - The callback of continueStateChange. 23061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 23161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 23261847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 23361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 23461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 23561847f8eSopenharmony_ci * @since 10 23661847f8eSopenharmony_ci */ 23761847f8eSopenharmony_ci /** 23861847f8eSopenharmony_ci * Register continuable info listener to ams. 23961847f8eSopenharmony_ci * 24061847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS 24161847f8eSopenharmony_ci * @param { 'continueStateChange' } type - Indicate the event type. 24261847f8eSopenharmony_ci * @param { Callback<ContinueCallbackInfo> } callback - The callback of continueStateChange. 24361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 24461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 24561847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 24661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 24761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 24861847f8eSopenharmony_ci * @since 11 24961847f8eSopenharmony_ci */ 25061847f8eSopenharmony_ci function on(type: 'continueStateChange', callback: Callback<ContinueCallbackInfo>): void; 25161847f8eSopenharmony_ci 25261847f8eSopenharmony_ci /** 25361847f8eSopenharmony_ci * Unregister continuable info listener to ams. 25461847f8eSopenharmony_ci * 25561847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS 25661847f8eSopenharmony_ci * @param { 'continueStateChange' } type - Indicate the event type. 25761847f8eSopenharmony_ci * @param { Callback<{ state: ContinueState, info: ContinuableInfo }> } [callback] - The callback of continueStateChange. 25861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 25961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 26061847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 26161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 26261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 26361847f8eSopenharmony_ci * @since 10 26461847f8eSopenharmony_ci */ 26561847f8eSopenharmony_ci /** 26661847f8eSopenharmony_ci * Unregister continuable info listener to ams. 26761847f8eSopenharmony_ci * 26861847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS 26961847f8eSopenharmony_ci * @param { 'continueStateChange' } type - Indicate the event type. 27061847f8eSopenharmony_ci * @param { Callback<ContinueCallbackInfo> } callback - The callback of continueStateChange. 27161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 27261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 27361847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 27461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 27561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 27661847f8eSopenharmony_ci * @since 11 27761847f8eSopenharmony_ci */ 27861847f8eSopenharmony_ci function off(type: 'continueStateChange', callback?: Callback<ContinueCallbackInfo>): void; 27961847f8eSopenharmony_ci 28061847f8eSopenharmony_ci /** 28161847f8eSopenharmony_ci * Continue mission 28261847f8eSopenharmony_ci * 28361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS and ohos.permission.DISTRIBUTED_DATASYNC 28461847f8eSopenharmony_ci * @param { ContinueDeviceInfo } parameter - Parameters corresponding to continue mission. 28561847f8eSopenharmony_ci * @param { ContinueCallback } options - the migration task completes the callback function. 28661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of continueMission. 28761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 28861847f8eSopenharmony_ci * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 28961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 29061847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 29161847f8eSopenharmony_ci * @throws { BusinessError } 16300501 - The system ability work abnormally. 29261847f8eSopenharmony_ci * @throws { BusinessError } 16300502 - Failed to get the missionInfo of the specified missionId. 29361847f8eSopenharmony_ci * @throws { BusinessError } 16300503 - The application is not installed on the remote end and installation-free is 29461847f8eSopenharmony_ci * not supported. 29561847f8eSopenharmony_ci * @throws { BusinessError } 16300504 - The application is not installed on the remote end but installation-free is 29661847f8eSopenharmony_ci * supported, try again with freeInstall flag. 29761847f8eSopenharmony_ci * @throws { BusinessError } 16300505 - The operation device must be the device where the application to be continued 29861847f8eSopenharmony_ci * is located or the target device to be continued. 29961847f8eSopenharmony_ci * @throws { BusinessError } 16300506 - The local continuation task is already in progress. 30061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 30161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 30261847f8eSopenharmony_ci * @since 9 30361847f8eSopenharmony_ci */ 30461847f8eSopenharmony_ci function continueMission( 30561847f8eSopenharmony_ci parameter: ContinueDeviceInfo, 30661847f8eSopenharmony_ci options: ContinueCallback, 30761847f8eSopenharmony_ci callback: AsyncCallback<void> 30861847f8eSopenharmony_ci ): void; 30961847f8eSopenharmony_ci 31061847f8eSopenharmony_ci /** 31161847f8eSopenharmony_ci * Continue mission 31261847f8eSopenharmony_ci * 31361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS and ohos.permission.DISTRIBUTED_DATASYNC 31461847f8eSopenharmony_ci * @param { ContinueDeviceInfo } parameter - Parameters corresponding to continue mission. 31561847f8eSopenharmony_ci * @param { ContinueCallback } options - the migration task completes the callback function. 31661847f8eSopenharmony_ci * @returns { Promise<void> } - the promise returned by the function. 31761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 31861847f8eSopenharmony_ci * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 31961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 32061847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 32161847f8eSopenharmony_ci * @throws { BusinessError } 16300501 - The system ability work abnormally. 32261847f8eSopenharmony_ci * @throws { BusinessError } 16300502 - Failed to get the missionInfo of the specified missionId. 32361847f8eSopenharmony_ci * @throws { BusinessError } 16300503 - The application is not installed on the remote end and installation-free is 32461847f8eSopenharmony_ci * not supported. 32561847f8eSopenharmony_ci * @throws { BusinessError } 16300504 - The application is not installed on the remote end but installation-free is 32661847f8eSopenharmony_ci * supported, try again with freeInstall flag. 32761847f8eSopenharmony_ci * @throws { BusinessError } 16300505 - The operation device must be the device where the application to be continued 32861847f8eSopenharmony_ci * is located or the target device to be continued. 32961847f8eSopenharmony_ci * @throws { BusinessError } 16300506 - The local continuation task is already in progress. 33061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 33161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 33261847f8eSopenharmony_ci * @since 9 33361847f8eSopenharmony_ci */ 33461847f8eSopenharmony_ci function continueMission(parameter: ContinueDeviceInfo, options: ContinueCallback): Promise<void>; 33561847f8eSopenharmony_ci 33661847f8eSopenharmony_ci /** 33761847f8eSopenharmony_ci * Continue mission by ContinueMissionInfo. 33861847f8eSopenharmony_ci * 33961847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS and ohos.permission.DISTRIBUTED_DATASYNC 34061847f8eSopenharmony_ci * @param { ContinueMissionInfo } parameter - Parameters corresponding to continue mission info. 34161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of continue mission result. 34261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 34361847f8eSopenharmony_ci * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 34461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 34561847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 34661847f8eSopenharmony_ci * @throws { BusinessError } 16300501 - The system ability work abnormally. 34761847f8eSopenharmony_ci * @throws { BusinessError } 16300503 - The application is not installed on the remote end and installation-free is 34861847f8eSopenharmony_ci * not supported. 34961847f8eSopenharmony_ci * @throws { BusinessError } 16300504 - The application is not installed on the remote end but installation-free is 35061847f8eSopenharmony_ci * supported, try again with freeInstall flag. 35161847f8eSopenharmony_ci * @throws { BusinessError } 16300505 - The operation device must be the device where the application to be continued 35261847f8eSopenharmony_ci * is located or the target device to be continued. 35361847f8eSopenharmony_ci * @throws { BusinessError } 16300506 - The local continuation task is already in progress. 35461847f8eSopenharmony_ci * @throws { BusinessError } 16300507 - Failed to get the missionInfo of the specified bundle name. 35561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 35661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 35761847f8eSopenharmony_ci * @since 10 35861847f8eSopenharmony_ci */ 35961847f8eSopenharmony_ci function continueMission(parameter: ContinueMissionInfo, callback: AsyncCallback<void>): void; 36061847f8eSopenharmony_ci 36161847f8eSopenharmony_ci /** 36261847f8eSopenharmony_ci * Continue mission by ContinueMissionInfo. 36361847f8eSopenharmony_ci * 36461847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_MISSIONS and ohos.permission.DISTRIBUTED_DATASYNC 36561847f8eSopenharmony_ci * @param { ContinueMissionInfo } parameter - Parameters corresponding to continue mission info. 36661847f8eSopenharmony_ci * @returns { Promise<void> } - the promise returned by the function. 36761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 36861847f8eSopenharmony_ci * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 36961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 37061847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 37161847f8eSopenharmony_ci * @throws { BusinessError } 16300501 - The system ability work abnormally. 37261847f8eSopenharmony_ci * @throws { BusinessError } 16300503 - The application is not installed on the remote end and installation-free is 37361847f8eSopenharmony_ci * not supported. 37461847f8eSopenharmony_ci * @throws { BusinessError } 16300504 - The application is not installed on the remote end but installation-free is 37561847f8eSopenharmony_ci * supported, try again with freeInstall flag. 37661847f8eSopenharmony_ci * @throws { BusinessError } 16300505 - The operation device must be the device where the application to be continued 37761847f8eSopenharmony_ci * is located or the target device to be continued. 37861847f8eSopenharmony_ci * @throws { BusinessError } 16300506 - The local continuation task is already in progress. 37961847f8eSopenharmony_ci * @throws { BusinessError } 16300507 - Failed to get the missionInfo of the specified bundle name. 38061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 38161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 38261847f8eSopenharmony_ci * @since 10 38361847f8eSopenharmony_ci */ 38461847f8eSopenharmony_ci function continueMission(parameter: ContinueMissionInfo): Promise<void>; 38561847f8eSopenharmony_ci 38661847f8eSopenharmony_ci /** 38761847f8eSopenharmony_ci * Continuable information corresponding to ability. 38861847f8eSopenharmony_ci * @typedef { _ContinuableInfo } 38961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 39061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 39161847f8eSopenharmony_ci * @since 10 39261847f8eSopenharmony_ci */ 39361847f8eSopenharmony_ci export type ContinuableInfo = _ContinuableInfo; 39461847f8eSopenharmony_ci 39561847f8eSopenharmony_ci /** 39661847f8eSopenharmony_ci * Parameters corresponding to continue mission. 39761847f8eSopenharmony_ci * @typedef { _ContinueMissionInfo } 39861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 39961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 40061847f8eSopenharmony_ci * @since 10 40161847f8eSopenharmony_ci */ 40261847f8eSopenharmony_ci export type ContinueMissionInfo = _ContinueMissionInfo; 40361847f8eSopenharmony_ci 40461847f8eSopenharmony_ci /** 40561847f8eSopenharmony_ci * ContinueCallback registered for notify continue result. 40661847f8eSopenharmony_ci * @typedef { _ContinueCallback } 40761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 40861847f8eSopenharmony_ci * @systemapi 40961847f8eSopenharmony_ci * @since 10 41061847f8eSopenharmony_ci */ 41161847f8eSopenharmony_ci export type ContinueCallback = _ContinueCallback; 41261847f8eSopenharmony_ci 41361847f8eSopenharmony_ci /** 41461847f8eSopenharmony_ci * Parameters corresponding to continue mission. 41561847f8eSopenharmony_ci * @typedef { _ContinueDeviceInfo } 41661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 41761847f8eSopenharmony_ci * @systemapi 41861847f8eSopenharmony_ci * @since 10 41961847f8eSopenharmony_ci */ 42061847f8eSopenharmony_ci export type ContinueDeviceInfo = _ContinueDeviceInfo; 42161847f8eSopenharmony_ci 42261847f8eSopenharmony_ci /** 42361847f8eSopenharmony_ci * MissionCallback registered by app. 42461847f8eSopenharmony_ci * @typedef { _MissionCallback } 42561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 42661847f8eSopenharmony_ci * @systemapi 42761847f8eSopenharmony_ci * @since 10 42861847f8eSopenharmony_ci */ 42961847f8eSopenharmony_ci export type MissionCallback = _MissionCallback; 43061847f8eSopenharmony_ci 43161847f8eSopenharmony_ci /** 43261847f8eSopenharmony_ci * Parameters corresponding to mission. 43361847f8eSopenharmony_ci * @typedef { _MissionDeviceInfo } 43461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 43561847f8eSopenharmony_ci * @systemapi 43661847f8eSopenharmony_ci * @since 10 43761847f8eSopenharmony_ci */ 43861847f8eSopenharmony_ci export type MissionDeviceInfo = _MissionDeviceInfo; 43961847f8eSopenharmony_ci 44061847f8eSopenharmony_ci /** 44161847f8eSopenharmony_ci * Parameters corresponding to mission. 44261847f8eSopenharmony_ci * @typedef { _MissionParameter } 44361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Mission 44461847f8eSopenharmony_ci * @systemapi 44561847f8eSopenharmony_ci * @since 10 44661847f8eSopenharmony_ci */ 44761847f8eSopenharmony_ci export type MissionParameter = _MissionParameter; 44861847f8eSopenharmony_ci} 44961847f8eSopenharmony_ciexport default distributedMissionManager; 450