From 7097f65d9eb9ccf155a6c9b701059d2bf35cb02e Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Wed, 2 Jul 2025 21:17:26 +0800 Subject: [PATCH 1/5] getPiPSettingSwitch Signed-off-by: wangyaohui --- .../reference/apis-arkui/js-apis-pipWindow.md | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md b/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md index d6f2ec4d35e..5268d5ea6b0 100644 --- a/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md +++ b/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md @@ -845,6 +845,47 @@ try { } ``` +### getPiPSettingSwitch20+ +getPiPSettingSwitch(): Promise<[boolean]> + +获取设置中自动启动画中画开关状态。 + +**原子化服务API:** 从API version 20开始,该接口支持在原子化服务中使用。 + +**系统能力:** SystemCapability.Window.SessionManager + +**返回值:** + +| 类型 | 说明 | +|----------------------|---------------------| +| Promise<[boolean]> | Promise对象,返回当前自动启动画中画开关状态。 | + +**错误码:** + +以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[窗口错误码](errorcode-window.md)。 + +| 错误码ID | 错误信息 | +|-------|-------------------------------------------------------------------------------------------------------------| +| 801 | Capability not supported. Failed to call the API due to limited device capabilities. | +| 1300014 | PiP internal error. | + +**示例:** + +```ts +let pipSwitchStatus: boolean | undefined = undefined; +try { + let promise : Promise = this.pipController.getPiPSettingSwitch(); + promise.then((data) => { + pipSwitchStatus = data; + console.info('Success in get pip switch status. switchStatus: ' + JSON.stringify(data)); + }).catch((err: BusinessError) => { + console.error(`Failed to get pip switch status. Cause code: ${err.code}, message: ${err.message}`); + }); +} catch (exception) { + console.error(`Failed to get pip switch status. Cause code: ${exception.code}, message: ${exception.message}`); +} +``` + ### on('stateChange') on(type: 'stateChange', callback: (state: PiPState, reason: string) => void): void -- Gitee From 6ad2fd6b070d8954843d62e7d8475d4074afd24d Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Fri, 4 Jul 2025 10:06:32 +0800 Subject: [PATCH 2/5] codeCheck Signed-off-by: wangyaohui --- .../reference/apis-arkui/js-apis-pipWindow.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md b/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md index 5268d5ea6b0..1aa4f476bab 100644 --- a/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md +++ b/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md @@ -846,9 +846,9 @@ try { ``` ### getPiPSettingSwitch20+ -getPiPSettingSwitch(): Promise<[boolean]> +getPiPSettingSwitch(): Promise<boolean> -获取设置中自动启动画中画开关状态。 +获取设置中自动启动画中画开关状态,仅支持手机和pad设备。 **原子化服务API:** 从API version 20开始,该接口支持在原子化服务中使用。 @@ -858,7 +858,7 @@ getPiPSettingSwitch(): Promise<[boolean]> | 类型 | 说明 | |----------------------|---------------------| -| Promise<[boolean]> | Promise对象,返回当前自动启动画中画开关状态。 | +| Promise<boolean> | Promise对象,返回当前自动启动画中画开关状态。 | **错误码:** -- Gitee From 455ea68d7f0c931b420ddbba0693b1a6ea40f3e0 Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Fri, 4 Jul 2025 15:16:32 +0800 Subject: [PATCH 3/5] codeCheck Signed-off-by: wangyaohui --- .../application-dev/reference/apis-arkui/js-apis-pipWindow.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md b/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md index 1aa4f476bab..938ce43d50f 100644 --- a/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md +++ b/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md @@ -858,7 +858,7 @@ getPiPSettingSwitch(): Promise<boolean> | 类型 | 说明 | |----------------------|---------------------| -| Promise<boolean> | Promise对象,返回当前自动启动画中画开关状态。 | +| Promise<boolean> | Promise对象,返回当前自动启动画中画开关状态,true表示开启,false表示关闭。 | **错误码:** @@ -877,7 +877,7 @@ try { let promise : Promise = this.pipController.getPiPSettingSwitch(); promise.then((data) => { pipSwitchStatus = data; - console.info('Success in get pip switch status. switchStatus: ' + JSON.stringify(data)); + console.info('Succeeded in geting pip switch status. switchStatus: ' + JSON.stringify(data)); }).catch((err: BusinessError) => { console.error(`Failed to get pip switch status. Cause code: ${err.code}, message: ${err.message}`); }); -- Gitee From 91e4f0c0f5f043a84beb90cf249d60503108c191 Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Fri, 4 Jul 2025 15:18:51 +0800 Subject: [PATCH 4/5] codeCheck Signed-off-by: wangyaohui --- .../application-dev/reference/apis-arkui/js-apis-pipWindow.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md b/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md index 938ce43d50f..7c6718f7199 100644 --- a/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md +++ b/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md @@ -848,7 +848,7 @@ try { ### getPiPSettingSwitch20+ getPiPSettingSwitch(): Promise<boolean> -获取设置中自动启动画中画开关状态,仅支持手机和pad设备。 +获取设置中自动启动画中画开关的状态,仅支持手机和pad设备。 **原子化服务API:** 从API version 20开始,该接口支持在原子化服务中使用。 @@ -877,7 +877,7 @@ try { let promise : Promise = this.pipController.getPiPSettingSwitch(); promise.then((data) => { pipSwitchStatus = data; - console.info('Succeeded in geting pip switch status. switchStatus: ' + JSON.stringify(data)); + console.info('Succeeded in getting pip switch status. switchStatus: ' + JSON.stringify(data)); }).catch((err: BusinessError) => { console.error(`Failed to get pip switch status. Cause code: ${err.code}, message: ${err.message}`); }); -- Gitee From 9698126a786fdd5229f5222ad8d317330428c5c0 Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Fri, 4 Jul 2025 17:55:39 +0800 Subject: [PATCH 5/5] codeCheck Signed-off-by: wangyaohui --- zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md b/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md index 7c6718f7199..ca96299491a 100644 --- a/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md +++ b/zh-cn/application-dev/reference/apis-arkui/js-apis-pipWindow.md @@ -848,7 +848,7 @@ try { ### getPiPSettingSwitch20+ getPiPSettingSwitch(): Promise<boolean> -获取设置中自动启动画中画开关的状态,仅支持手机和pad设备。 +获取设置中自动启动画中画开关的状态,仅支持手机和平板设备。 **原子化服务API:** 从API version 20开始,该接口支持在原子化服务中使用。 -- Gitee