From bf07a7d8ffb83b4fcf063f5a94dbae2b20c8f81e Mon Sep 17 00:00:00 2001 From: sty Date: Wed, 18 Jun 2025 21:20:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E7=A8=8B=E5=A4=87=E9=80=89=E4=B8=BB?= =?UTF-8?q?=E6=8E=A7=E8=BF=9B=E7=A8=8Bsdk=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sty Change-Id: I7341393ebd216a08b149695a9c725ca62924bc3d --- api/@ohos.app.ability.application.d.ts | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/api/@ohos.app.ability.application.d.ts b/api/@ohos.app.ability.application.d.ts index 7979f66a2d..737f515410 100644 --- a/api/@ohos.app.ability.application.d.ts +++ b/api/@ohos.app.ability.application.d.ts @@ -104,6 +104,38 @@ declare namespace application { * @since 14 */ export function getApplicationContext(): ApplicationContext; + + /** + * Elevate the current process to be a candidate master process. + * If UIAbility or UIExtension component within the application is configured with "isolationProcess",launching an + * instance of such UIAbility or UIExtension will trigger a callback to the master process's "onNewProcessRequest". + * The "onNewProcessRequest" callback return value determines whether the new instance starts in a new process or an existing one. + * After successfully invoking this interface, the current process becomes a candidate master process. If the original master process + * is destroyed, the candidate process with the highest priority will be selected as the new master process. + * + * @param { boolean } insertToHead - Whether inset current process to the head of candidates master process list. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 16000115 - The current process is not running a component configured with "isolationProcess" + * and cannot be set as a candidate master process. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 20 + */ + export function promoteCurrentToCandidateMasterProcess(insertToHead : boolean): Promise; + + /** + * Revoke current process as a candidate master process. + * + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 16000116 - The current process is already a master process and does not support cancellation. + * @throws { BusinessError } 16000117 - The current process is not a candidate master process and does not support cancellation. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 20 + */ + export function demoteCurrentFromCandidateMasterProcess(): Promise; } export default application; \ No newline at end of file -- Gitee