!71 修改上报框架的JSON格式

Merge pull request !71 from 李一鸣/changeJSON
This commit is contained in:
openharmony_ci 2024-10-30 02:13:15 +00:00 committed by Gitee
commit ed02afc4ee
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -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 {