diff --git a/api/@ohos.application.appManager.d.ts b/api/@ohos.application.appManager.d.ts index db2115cb51..77b341b2cc 100644 --- a/api/@ohos.application.appManager.d.ts +++ b/api/@ohos.application.appManager.d.ts @@ -62,6 +62,20 @@ declare namespace appManager { function getForegroundApplications(callback: AsyncCallback>): void; function getForegroundApplications(): Promise>; + /** + * Kill process with account. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @SysCap appexecfwk + * @param bundleName The process bundle name. + * @param accountId The account id. + * @systemapi hide this for inner system use + * @return - + */ + function killProcessWithAccount(bundleName: string, accountId: number): Promise; + function killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback): void; + /** * Is user running in stability test. * diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts old mode 100755 new mode 100644 index 6b88dcee88..65a97c683e --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -61,6 +61,21 @@ export default class AbilityContext extends Context { startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; startAbility(want: Want, options?: StartOptions): Promise; + /** + * Starts a new ability with account. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param want Indicates the want info to start. + * @param want Indicates the account to start. + * @systemapi hide for inner use. + * @return - + */ + startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; + /** * Starts an ability and returns the execution result when the ability is destroyed. * @@ -74,6 +89,21 @@ export default class AbilityContext extends Context { startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; startAbilityForResult(want: Want, options?: StartOptions): Promise; + /** + * Starts an ability and returns the execution result when the ability is destroyed with account. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param want Indicates the want info to start. + * @param want Indicates the account to start. + * @systemapi hide for inner use. + * @return Returns the {@link AbilityResult}. + */ + startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; + /** * Destroys this Page ability. * @@ -111,6 +141,20 @@ export default class AbilityContext extends Context { */ connectAbility(want: Want, options: ConnectOptions): number; + /** + * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template with account. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param want The element name of the service ability + * @param options The remote object instance + * @param accountId The account to connect + * @systemapi hide for inner use. + * @return Returns the number code of the ability connected + */ + connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; + /** * The callback interface was connect successfully. * diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts index a753bcc03c..200e2b3281 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.d.ts @@ -44,6 +44,21 @@ export default class ServiceExtensionContext extends ExtensionContext { startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; startAbility(want: Want, options?: StartOptions): Promise; + /** + * Service extension uses this method to start a specific ability with account. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param parameter Indicates the ability to start. + * @param parameter Indicates the accountId to start. + * @systemapi hide for inner use. + * @return - + */ + startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; + /** * Destroys this service extension. * @@ -72,6 +87,23 @@ export default class ServiceExtensionContext extends ExtensionContext { */ connectAbility(want: Want, options: ConnectOptions): number; + /** + * Connects an ability to a Service extension with account. + * + *

This method can be called by an ability or service extension, but the destination of the connection must be a + * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target + * service extension when the Service extension is connected.

+ * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param request Indicates the service extension to connect. + * @param request Indicates the account to connect. + * @systemapi hide for inner use. + * @return connection id, int value. + */ + connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; + /** * Disconnects an ability to a service extension, in contrast to * {@link connectAbility}.