From 13e349b5604aa1c47b312ad86627ac408544495b Mon Sep 17 00:00:00 2001 From: zhangzezhong Date: Fri, 1 Aug 2025 14:50:29 +0800 Subject: [PATCH] test Signed-off-by: zhangzezhong --- ...@ohos.app.ability.AtomicServiceOptions.ets | 4 +++- ...ohos.app.ability.InsightIntentExecutor.ets | 18 +++++++++-------- .../ets/@ohos.app.ability.OpenLinkOptions.ets | 8 +++++--- ....app.ability.UIExtensionContentSession.ets | 20 ++++++++++--------- frameworks/ets/ets/@ohos.app.ability.Want.ets | 3 ++- .../ets/@ohos.app.ability.insightIntent.ets | 6 ++++-- .../@ohos.app.ability.insightIntentDriver.ets | 4 +++- .../ets/ets/@ohos.app.ability.wantAgent.ets | 6 ++++-- frameworks/ets/ets/application/CustomData.ets | 5 +++-- .../ets/ets/application/UIAbilityContext.ets | 10 ++++++---- frameworks/ets/ets/wantAgent/triggerInfo.ets | 10 ++++++---- .../ets/ets/wantAgent/wantAgentInfo.ets | 10 ++++++---- 12 files changed, 63 insertions(+), 41 deletions(-) diff --git a/frameworks/ets/ets/@ohos.app.ability.AtomicServiceOptions.ets b/frameworks/ets/ets/@ohos.app.ability.AtomicServiceOptions.ets index 366dc566859..d3bdeaa762e 100644 --- a/frameworks/ets/ets/@ohos.app.ability.AtomicServiceOptions.ets +++ b/frameworks/ets/ets/@ohos.app.ability.AtomicServiceOptions.ets @@ -15,7 +15,9 @@ import StartOptions from '@ohos.app.ability.StartOptions'; +export type RecordData = undefined | null | Object | Record | Array; + export default class AtomicServiceOptions extends StartOptions { flags?: int; - parameters?: Record; + parameters?: RecordData; } \ No newline at end of file diff --git a/frameworks/ets/ets/@ohos.app.ability.InsightIntentExecutor.ets b/frameworks/ets/ets/@ohos.app.ability.InsightIntentExecutor.ets index 8918a24a9d1..3e6d857accd 100644 --- a/frameworks/ets/ets/@ohos.app.ability.InsightIntentExecutor.ets +++ b/frameworks/ets/ets/@ohos.app.ability.InsightIntentExecutor.ets @@ -18,6 +18,8 @@ import insightIntent from './@ohos.app.ability.insightIntent'; import InsightIntentContext from '@ohos.app.ability.InsightIntentContext'; import type UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; +export type RecordData = undefined | null | Object | Record | Array; + export default class InsightIntentExecutor { context: InsightIntentContext = {}; public nativeExecutor: long = 0; @@ -28,7 +30,7 @@ export default class InsightIntentExecutor { public native nativeOnExecuteResult(data: insightIntent.ExecuteResult): void; - public callOnExecuteInUIAbilityForegroundMode(name: string, param: Record, + public callOnExecuteInUIAbilityForegroundMode(name: string, param: RecordData, pageLoader: window.WindowStage): insightIntent.ExecuteResult { let p = this.onExecuteInUIAbilityForegroundMode(name, param, pageLoader); if (p instanceof Promise) { @@ -44,7 +46,7 @@ export default class InsightIntentExecutor { } } - public callOnExecuteInUIAbilityBackgroundMode(name: string, param: Record): + public callOnExecuteInUIAbilityBackgroundMode(name: string, param: RecordData): insightIntent.ExecuteResult { let p = this.onExecuteInUIAbilityBackgroundMode(name, param); if (p instanceof Promise) { @@ -60,7 +62,7 @@ export default class InsightIntentExecutor { } } - public callOnExecuteInUIExtensionAbility(name: string, param: Record, + public callOnExecuteInUIExtensionAbility(name: string, param: RecordData, pageLoader: UIExtensionContentSession): insightIntent.ExecuteResult { let p = this.onExecuteInUIExtensionAbility(name, param, pageLoader); if (p instanceof Promise) { @@ -76,7 +78,7 @@ export default class InsightIntentExecutor { } } - public callOnExecuteInServiceExtensionAbility(name: string, param: Record): + public callOnExecuteInServiceExtensionAbility(name: string, param: RecordData): insightIntent.ExecuteResult { let p = this.onExecuteInServiceExtensionAbility(name, param); if (p instanceof Promise) { @@ -92,25 +94,25 @@ export default class InsightIntentExecutor { } } - onExecuteInUIAbilityForegroundMode(name: string, param: Record, pageLoader: window.WindowStage): + onExecuteInUIAbilityForegroundMode(name: string, param: RecordData, pageLoader: window.WindowStage): insightIntent.ExecuteResult | Promise { let ret: insightIntent.ExecuteResult = {}; return ret; } - onExecuteInUIAbilityBackgroundMode(name: string, param: Record): + onExecuteInUIAbilityBackgroundMode(name: string, param: RecordData): insightIntent.ExecuteResult | Promise { let ret: insightIntent.ExecuteResult = {}; return ret; } - onExecuteInUIExtensionAbility(name: string, param: Record, pageLoader: UIExtensionContentSession): + onExecuteInUIExtensionAbility(name: string, param: RecordData, pageLoader: UIExtensionContentSession): insightIntent.ExecuteResult | Promise { let ret: insightIntent.ExecuteResult = {}; return ret; } - onExecuteInServiceExtensionAbility(name: string, param: Record): + onExecuteInServiceExtensionAbility(name: string, param: RecordData): insightIntent.ExecuteResult | Promise { let ret: insightIntent.ExecuteResult = {}; return ret; diff --git a/frameworks/ets/ets/@ohos.app.ability.OpenLinkOptions.ets b/frameworks/ets/ets/@ohos.app.ability.OpenLinkOptions.ets index bd90238425e..f81d09d0976 100644 --- a/frameworks/ets/ets/@ohos.app.ability.OpenLinkOptions.ets +++ b/frameworks/ets/ets/@ohos.app.ability.OpenLinkOptions.ets @@ -13,12 +13,14 @@ * limitations under the License. */ +export type RecordData = undefined | null | Object | Record | Array; + export default interface OpenLinkOptions { appLinkingOnly?: boolean; - parameters?: Record; + parameters?: RecordData; } class OpenLinkOptionsImpl implements OpenLinkOptions { appLinkingOnly?: boolean|undefined; - parameters?: Record|undefined; -} \ No newline at end of file + parameters?: RecordData|undefined; +} diff --git a/frameworks/ets/ets/@ohos.app.ability.UIExtensionContentSession.ets b/frameworks/ets/ets/@ohos.app.ability.UIExtensionContentSession.ets index 266dbed17a1..db3cfc2eba3 100644 --- a/frameworks/ets/ets/@ohos.app.ability.UIExtensionContentSession.ets +++ b/frameworks/ets/ets/@ohos.app.ability.UIExtensionContentSession.ets @@ -21,6 +21,8 @@ import { LocalStorage } from '@ohos.arkui.stateManagement'; import AsyncCallbackWrapper from './utils/AbilityUtils'; import AbilityStartCallback from 'application.AbilityStartCallback'; +export type RecordData = undefined | null | Object | Record | Array; + class Cleaner { static callback(cleaner: Cleaner): void { cleaner.clean() @@ -50,25 +52,25 @@ export default class UIExtensionContentSession { } this.registerCleaner(this.nativeContextSession) } - native nativeSendData(data: Record): void; + native nativeSendData(data: RecordData): void; native loadContent(path: string, storage?: LocalStorage): void; native setWindowBackgroundColor(color: string): void; native getUIExtensionHostWindowProxy(): uiExtensionHost.UIExtensionHostWindowProxy; - native nativeSetReceiveDataCallback(callback: (data: Record) => void): void; - native nativeSetReceiveDataForResultCallback(callback: (data: Record) => Record): void; + native nativeSetReceiveDataCallback(callback: (data: RecordData) => void): void; + native nativeSetReceiveDataForResultCallback(callback: (data: RecordData) => Record): void; native terminateSelfSync(callback:AsyncCallbackWrapper): void; native terminateSelfWithResultSync(parameter: AbilityResult, callback:AsyncCallbackWrapper): void; - private native nativeStartAbilityByTypeSync(type: string, wantParam: Record, startCallback: AbilityStartCallback): BusinessError; + private native nativeStartAbilityByTypeSync(type: string, wantParam: RecordData, startCallback: AbilityStartCallback): BusinessError; - sendData(data: Record): void { + sendData(data: RecordData): void { this.nativeSendData(data); } - setReceiveDataCallback(callback: (data: Record) => void): void { + setReceiveDataCallback(callback: (data: RecordData) => void): void { this.nativeSetReceiveDataCallback(callback); } - setReceiveDataForResultCallback(callback: (data: Record) => Record): void { + setReceiveDataForResultCallback(callback: (data: RecordData) => Record): void { this.nativeSetReceiveDataForResultCallback(callback); } @@ -118,7 +120,7 @@ export default class UIExtensionContentSession { return p; } - startAbilityByType(type: string, wantParam: Record, startCallback: AbilityStartCallback, + startAbilityByType(type: string, wantParam: RecordData, startCallback: AbilityStartCallback, callback: AsyncCallback): void { let p1 = taskpool.execute((): BusinessError => { return this.nativeStartAbilityByTypeSync(type, wantParam, startCallback); @@ -135,7 +137,7 @@ export default class UIExtensionContentSession { }); } - startAbilityByType(type: string, wantParam: Record, + startAbilityByType(type: string, wantParam: RecordData, startCallback: AbilityStartCallback): Promise { let p = new Promise((resolve: (v: undefined) => void, reject: (error: BusinessError) => void): void => { let p1 = taskpool.execute((): BusinessError => { diff --git a/frameworks/ets/ets/@ohos.app.ability.Want.ets b/frameworks/ets/ets/@ohos.app.ability.Want.ets index 3d0cbd3d008..b04709177d3 100644 --- a/frameworks/ets/ets/@ohos.app.ability.Want.ets +++ b/frameworks/ets/ets/@ohos.app.ability.Want.ets @@ -18,6 +18,7 @@ import hilog from '@ohos.hilog' type valueType = NullishType; const DOMAIN_ID = 0xD001300; const TAG = 'WantSerializeTool'; +export type RecordData = undefined | null | Object | Record | Array; class RecordWriter { private buffer = new StringBuilder(); @@ -226,7 +227,7 @@ export default class Want { type?: string; flags?: int; action?: string; - parameters?: Record; + parameters?: RecordData; entities?: Array; moduleName?: string; } diff --git a/frameworks/ets/ets/@ohos.app.ability.insightIntent.ets b/frameworks/ets/ets/@ohos.app.ability.insightIntent.ets index 0fcc3f864b6..bae32de6007 100644 --- a/frameworks/ets/ets/@ohos.app.ability.insightIntent.ets +++ b/frameworks/ets/ets/@ohos.app.ability.insightIntent.ets @@ -18,6 +18,8 @@ import wantConstant from '@ohos.app.ability.wantConstant'; namespace insightIntent { + export type RecordData = undefined | null | Object | Record | Array; + export enum ExecuteMode { UI_ABILITY_FOREGROUND = 0, UI_ABILITY_BACKGROUND = 1, @@ -27,14 +29,14 @@ namespace insightIntent { export interface ExecuteResult { code: int; - result?: Record; + result?: RecordData; uris?: Array; flags?: int; } export class ExecuteResultInner implements ExecuteResult{ code: int; - result?: Record; + result?: RecordData; uris?: Array; flags?: int; } diff --git a/frameworks/ets/ets/@ohos.app.ability.insightIntentDriver.ets b/frameworks/ets/ets/@ohos.app.ability.insightIntentDriver.ets index 20c9bcfe130..a9cc6ceff00 100644 --- a/frameworks/ets/ets/@ohos.app.ability.insightIntentDriver.ets +++ b/frameworks/ets/ets/@ohos.app.ability.insightIntentDriver.ets @@ -23,12 +23,14 @@ export default namespace insightIntentDriver { loadLibrary("insight_intent_driver_ani_kit.z") + export type RecordData = undefined | null | Object | Record | Array; + export interface ExecuteParam { bundleName: string; moduleName: string; abilityName: string; insightIntentName: string; - insightIntentParam: Record; + insightIntentParam: RecordData; executeMode: insightIntent.ExecuteMode; displayId?: long; uris?: Array; diff --git a/frameworks/ets/ets/@ohos.app.ability.wantAgent.ets b/frameworks/ets/ets/@ohos.app.ability.wantAgent.ets index b0ba39051db..4feced1fe09 100644 --- a/frameworks/ets/ets/@ohos.app.ability.wantAgent.ets +++ b/frameworks/ets/ets/@ohos.app.ability.wantAgent.ets @@ -22,6 +22,8 @@ import AsyncCallbackWrapper from './utils/AbilityUtils'; namespace wantAgent { loadLibrary("aniwantagent.z"); + export type RecordData = undefined | null | Object | Record | Array; + class Cleaner { public ptr: long = 0; @@ -323,7 +325,7 @@ namespace wantAgent { want: Want; finalCode: int; finalData: string; - extraInfo?: Record; + extraInfo?: RecordData; } class CompleteDataImpl implements CompleteData { @@ -331,7 +333,7 @@ namespace wantAgent { public want: Want; public finalCode: int; public finalData: string; - public extraInfo?: Record; + public extraInfo?: RecordData; } export type TriggerInfo = _TriggerInfo; diff --git a/frameworks/ets/ets/application/CustomData.ets b/frameworks/ets/ets/application/CustomData.ets index 5e588bee98f..b73619de69a 100644 --- a/frameworks/ets/ets/application/CustomData.ets +++ b/frameworks/ets/ets/application/CustomData.ets @@ -12,11 +12,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +export type RecordData = undefined | null | Object | Record | Array; export default interface CustomData { - data: Record; + data: RecordData; } class CustomDataInner implements CustomData { - public data: Record = {}; + public data: RecordData = {}; } \ No newline at end of file diff --git a/frameworks/ets/ets/application/UIAbilityContext.ets b/frameworks/ets/ets/application/UIAbilityContext.ets index fce9b28feff..715e6a424e7 100644 --- a/frameworks/ets/ets/application/UIAbilityContext.ets +++ b/frameworks/ets/ets/application/UIAbilityContext.ets @@ -31,6 +31,8 @@ import AbilityStartCallback from 'application.AbilityStartCallback'; import AtomicServiceOptions from '@ohos.app.ability.AtomicServiceOptions'; import image from '@ohos.multimedia.image'; +export type RecordData = undefined | null | Object | Record | Array; + class Cleaner { public ptr: long = 0; @@ -441,10 +443,10 @@ export default class UIAbilityContext extends Context { this.nativeSetColorMode(colorMode); } - startAbilityByType(type: string, wantParam: Record, startCallback: AbilityStartCallback, + startAbilityByType(type: string, wantParam: RecordData, startCallback: AbilityStartCallback, callback: AsyncCallback): void { let p1 = taskpool.execute((): BusinessError => { - return this.nativeStartAbilityByTypeSync(type, wantParam, startCallback); + return this.nativeStartAbilityByTypeSync(type, wantParam as Record, startCallback); }); p1.then((e: NullishType) => { let retError = e as BusinessError; @@ -492,11 +494,11 @@ hideAbility(): Promise { return p; } - startAbilityByType(type: string, wantParam: Record, + startAbilityByType(type: string, wantParam: RecordData, startCallback: AbilityStartCallback): Promise { let p = new Promise((resolve: (v: undefined) => void, reject: (error: BusinessError) => void): void => { let p1 = taskpool.execute((): BusinessError => { - return this.nativeStartAbilityByTypeSync(type, wantParam, startCallback); + return this.nativeStartAbilityByTypeSync(type, wantParam as Record, startCallback); }); p1.then((e: NullishType) => { let retError = e as BusinessError; diff --git a/frameworks/ets/ets/wantAgent/triggerInfo.ets b/frameworks/ets/ets/wantAgent/triggerInfo.ets index 0653b0f4486..b20d442c46d 100644 --- a/frameworks/ets/ets/wantAgent/triggerInfo.ets +++ b/frameworks/ets/ets/wantAgent/triggerInfo.ets @@ -16,12 +16,14 @@ import Want from '@ohos.app.ability.Want'; import StartOptions from '@ohos.app.ability.StartOptions'; +export type RecordData = undefined | null | Object | Record | Array; + export interface TriggerInfo { code: number; want?: Want; permission?: string; - extraInfo?: Record; - extraInfos?: Record; + extraInfo?: RecordData; + extraInfos?: RecordData; startOptions?: StartOptions; } @@ -29,7 +31,7 @@ class TriggerInfoImpl implements TriggerInfo { public code: number; public want?: Want; public permission?: string; - public extraInfo?: Record; - public extraInfos?: Record; + public extraInfo?: RecordData; + public extraInfos?: RecordData; public startOptions?: StartOptions; } diff --git a/frameworks/ets/ets/wantAgent/wantAgentInfo.ets b/frameworks/ets/ets/wantAgent/wantAgentInfo.ets index ae0859b67e6..50227059b87 100644 --- a/frameworks/ets/ets/wantAgent/wantAgentInfo.ets +++ b/frameworks/ets/ets/wantAgent/wantAgentInfo.ets @@ -17,13 +17,15 @@ import Want from '@ohos.app.ability.Want'; import wantAgent from '@ohos.app.ability.wantAgent'; import type abilityWantAgent from '@ohos.app.ability.wantAgent'; +export type RecordData = undefined | null | Object | Record | Array; + export interface WantAgentInfo { wants: Array; actionType?: abilityWantAgent.OperationType; requestCode: number; actionFlags?: Array; - extraInfo?: Record; - extraInfos?: Record; + extraInfo?: RecordData; + extraInfos?: RecordData; } class WantAgentInfoImpl implements WantAgentInfo { @@ -31,8 +33,8 @@ class WantAgentInfoImpl implements WantAgentInfo { public actionType?: abilityWantAgent.OperationType; public requestCode: number; public actionFlags?: Array; - public extraInfo?: Record; - public extraInfos?: Record; + public extraInfo?: RecordData; + public extraInfos?: RecordData; constructor(wants: Array) { this.wants = wants; -- Gitee