From 5453f46b692e976df6d19a6e116b47e8c6ceb07d Mon Sep 17 00:00:00 2001 From: zhongjianfei Date: Sat, 18 Sep 2021 19:42:13 +0800 Subject: [PATCH] zhongjianfei@huawei.com Signed-off-by: zhongjianfei Change-Id: I687072c78855202b2a6a0f61e575923862ba7cd4 --- api/@internal/ets/lifecycle.d.ts | 40 +++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index 9de0222be0..2fda3afdec 100644 --- a/api/@internal/ets/lifecycle.d.ts +++ b/api/@internal/ets/lifecycle.d.ts @@ -22,6 +22,7 @@ import dataAbility from "../@ohos.data.dataAbility"; import formBindingData from "../@ohos.ability.formBindingData"; import formManager from "../@ohos.ability.formManager"; import rdb from "../@ohos.data.rdb"; +import rpc from "../@ohos.rpc"; import resourceManager from "../@ohos.resourceManager"; import { PacMap } from "../ability/dataAbilityHelper"; @@ -289,6 +290,43 @@ export declare interface LifecycleService { */ onCommand?(want: Want, startId: number): void; + /** + * Called back when a Service ability is first connected to an ability. + * + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @param want Indicates connection information about the Service ability. + * @return Returns the proxy of the Service ability. + */ + onConnect?(want: Want): rpc.RemoteObject; + + /** + * Called back when all abilities connected to a Service ability are disconnected. + * + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @param want Indicates disconnection information about the Service ability. + * @return - + */ + onDisconnect?(want: Want): void; + + /** + * Called when a new client attempts to connect to a Service ability after all previous client connections to it + * are disconnected. + * + *

The Service ability must have been started but not been destroyed, that is, {@link #startAbility} has been + * called but {@link #terminateSelf} has not.

+ * + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @param want Indicates the want of the Service ability being connected. + * @return - + */ + onReconnect?(want: Want): void; + /** * Called back before an ability is destroyed. * @@ -482,4 +520,4 @@ export declare interface LifecycleData { * @return Returns the MIME type that matches the data specified by {@code uri}. */ getType?(uri: string): string; -} \ No newline at end of file +} -- Gitee