diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index c1469fe5fd78d294622747696e2e41d6d7cceb8c..fc4e021a223d1debbd5a35ca36bb4f04079ba09e 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. *