Signed-off-by: jerry <sijunjie@huawei.com>
This commit is contained in:
jerry 2022-01-26 07:16:34 +00:00
parent 88fc63bd24
commit 814f798a4f
3 changed files with 90 additions and 0 deletions

View File

@ -62,6 +62,20 @@ declare namespace appManager {
function getForegroundApplications(callback: AsyncCallback<Array<AppStateData>>): void;
function getForegroundApplications(): Promise<Array<AppStateData>>;
/**
* 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<void>;
function killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback<void>): void;
/**
* Is user running in stability test.
*

44
api/application/AbilityContext.d.ts vendored Executable file → Normal file
View File

@ -61,6 +61,21 @@ export default class AbilityContext extends Context {
startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void;
startAbility(want: Want, options?: StartOptions): Promise<void>;
/**
* 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>): void;
startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<void>): void;
startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<void>;
/**
* 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<AbilityResult>): void;
startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>;
/**
* 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<AbilityResult>): void;
startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<void>): void;
startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<AbilityResult>;
/**
* 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.
*

View File

@ -44,6 +44,21 @@ export default class ServiceExtensionContext extends ExtensionContext {
startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void;
startAbility(want: Want, options?: StartOptions): Promise<void>;
/**
* 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>): void;
startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<void>): void;
startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<void>;
/**
* 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.
*
* <p>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.</p>
*
* @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}.