From 87792292659be6c096f1e5cbb3da1f1031b8bb45 Mon Sep 17 00:00:00 2001 From: wangdongdong Date: Wed, 22 Dec 2021 18:56:11 +0800 Subject: [PATCH 1/2] Signed-off-by: wangdongdong Change-Id: I659cbe9d01dd1179d29f05a779e7573569a3956d --- api/@ohos.ability.featureAbility.d.ts | 12 +++++++++ api/ability/continueAbilityOptions.d.ts | 36 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 api/ability/continueAbilityOptions.d.ts diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index 9a9170e063..bb2d8fe62c 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -19,6 +19,7 @@ import { AbilityResult } from './ability/abilityResult'; import { Context } from './app/context'; import { DataAbilityHelper } from './ability/dataAbilityHelper'; import { ConnectOptions } from './ability/connectOptions'; +import { ContinueAbilityOptions } from './ability/continueAbilityOptions'; /** * A Feature Ability represents an ability with a UI and is designed to interact with users. @@ -142,6 +143,17 @@ declare namespace featureAbility { function disconnectAbility(connection: number, callback:AsyncCallback): void; function disconnectAbility(connection: number): Promise; + /** + * Migrates this ability to the given device on the same distributed network. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @return - + */ + function continueAbility(options: ContinueAbilityOptions, callback: AsyncCallback): void; + function continueAbility(options: ContinueAbilityOptions): Promise; + export enum AbilityWindowConfiguration { WINDOW_MODE_UNDEFINED = 0, WINDOW_MODE_FULLSCREEN = 1, diff --git a/api/ability/continueAbilityOptions.d.ts b/api/ability/continueAbilityOptions.d.ts new file mode 100755 index 0000000000..04584934f0 --- /dev/null +++ b/api/ability/continueAbilityOptions.d.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ContinueAbilityOptions { + /** + * Indicates the ID of the target device where this ability will be migrated to. + * + * @default - + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @sysCap AAFwk + */ + deviceId: string; + + /** + * Indicates whether the ability to be migrated back to the local device through + * + * @default - + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @sysCap AAFwk + */ + reversible?: boolean; +} \ No newline at end of file -- Gitee From 59450928eb0200003d8012b6c4875a31ab353158 Mon Sep 17 00:00:00 2001 From: wangdongdong Date: Wed, 22 Dec 2021 19:04:41 +0800 Subject: [PATCH 2/2] Signed-off-by: wangdongdong Change-Id: I43440fc0353409c7feec73527fc70995f6722d63 --- api/ability/continueAbilityOptions.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/api/ability/continueAbilityOptions.d.ts b/api/ability/continueAbilityOptions.d.ts index 04584934f0..9d1ce3c640 100755 --- a/api/ability/continueAbilityOptions.d.ts +++ b/api/ability/continueAbilityOptions.d.ts @@ -26,6 +26,7 @@ export interface ContinueAbilityOptions { /** * Indicates whether the ability to be migrated back to the local device through + * This is a reserved field. * * @default - * @devices phone, tablet, tv, wearable, car -- Gitee