From bd5c064ff8ffcff20081f06ca0bd2c159951a09e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=80=E9=B8=A3?= Date: Tue, 29 Oct 2024 19:45:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E6=8A=A5=E7=9A=84?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=EF=BC=8C=E6=94=B9=E4=B8=BAjson=20string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李一鸣 --- .../src/main/ets/PrivacyDialog/DialogAbility.ets | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/product/phone/src/main/ets/PrivacyDialog/DialogAbility.ets b/product/phone/src/main/ets/PrivacyDialog/DialogAbility.ets index 614fbb2..c692c82 100644 --- a/product/phone/src/main/ets/PrivacyDialog/DialogAbility.ets +++ b/product/phone/src/main/ets/PrivacyDialog/DialogAbility.ets @@ -21,6 +21,12 @@ import { BusinessError } from '@ohos.base'; const TAG = 'AVScreenCapture-DiaLogUIExtensionAbility'; +class JsonData { + public choice: string = 'false' + public displayId: number | null = -1 + public missionId: number | null = -1 +} + export default class DialogAbility extends UIExtensionAbility { onCreate(): void { Log.showInfo(TAG, 'DialogAbility onCreate'); @@ -37,8 +43,13 @@ export default class DialogAbility extends UIExtensionAbility { } onDestroy(): void { + const jsonData: JsonData = { + choice: globalThis.userChoice, + displayId: -1, + missionId: -1 + } Log.showInfo(TAG, `Report user choice sessionId(${globalThis.sessionId}), userChoice(${globalThis.userChoice})`); - media.reportAVScreenCaptureUserChoice(Number(globalThis.sessionId), globalThis.userChoice); + media.reportAVScreenCaptureUserChoice(Number(globalThis.sessionId), JSON.stringify(jsonData)); } onSessionCreate(want: Want, session: UIExtensionContentSession): void {