From b372d5cdc720cbf93d8bfb82cff4e03a607b6f52 Mon Sep 17 00:00:00 2001 From: zhongjianfei Date: Sat, 18 Sep 2021 19:50:30 +0800 Subject: [PATCH] zhongjianfei@huawei.com Signed-off-by: zhongjianfei Change-Id: I2305ed87cab653f19490dabb18487b8b1ad31464 --- api/@internal/ets/lifecycle.d.ts | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index c1469fe5fd..fc4e021a22 100644 --- a/api/@internal/ets/lifecycle.d.ts +++ b/api/@internal/ets/lifecycle.d.ts @@ -20,6 +20,7 @@ import { DataAbilityResult } from "../ability/dataAbilityResult"; import { DataAbilityOperation } from "../ability/dataAbilityOperation"; import dataAbility from "../@ohos.data.dataAbility"; import rdb from "../@ohos.data.rdb"; +import rpc from "../@ohos.rpc"; import resourceManager from "../@ohos.resourceManager"; import { PacMap } from "../ability/dataAbilityHelper"; @@ -183,6 +184,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. * -- Gitee