• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# JS API Changes of the Ability Framework
2
3The table below lists the APIs changes of the ability framework in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release.
4
5## API Changes
6
7| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
8|---|---|---|---|
9| AbilityContext | AbilityContext | restoreWindowStage(localStorage: LocalStorage) : void; | Added|
10| AbilityContext | AbilityContext | requestPermissionsFromUser(permissions: Array\<string>, requestCallback: AsyncCallback\<PermissionRequestResult>) : void;<br>requestPermissionsFromUser(permissions: Array\<string>) : Promise\<PermissionRequestResult>; | Added|
11| AbilityContext | AbilityContext | setMissionIcon(icon: image.PixelMap, callback:AsyncCallback\<void>): void;<br>setMissionIcon(icon: image.PixelMap): Promise\<void>; | Added|
12| AbilityContext | AbilityContext | setMissionLabel(label: string, callback:AsyncCallback\<void>): void;<br>setMissionLabel(label: string): Promise\<void>; | Added|
13| AbilityContext | AbilityContext | disconnectAbility(connection: number, callback:AsyncCallback\<void>): void;<br>disconnectAbility(connection: number): Promise\<void>; | Added|
14| AbilityContext | AbilityContext | connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; | Added|
15| AbilityContext | AbilityContext | connectAbility(want: Want, options: ConnectOptions): number; | Added|
16| AbilityContext | AbilityContext | terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback\<void>): void;<br>terminateSelfWithResult(parameter: AbilityResult): Promise\<void>; | Added|
17| AbilityContext | AbilityContext | terminateSelf(callback: AsyncCallback\<void>): void;<br>terminateSelf(): Promise\<void>; | Added|
18| AbilityContext | AbilityContext | startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback\<AbilityResult>): void;<br>startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\<void>): void;<br>startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\<AbilityResult>; | Added|
19| AbilityContext | AbilityContext | startAbilityForResult(want: Want, callback: AsyncCallback\<AbilityResult>): void;<br>startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback\<AbilityResult>): void;<br>startAbilityForResult(want: Want, options?: StartOptions): Promise\<AbilityResult>; | Added|
20| AbilityContext | AbilityContext | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<void>): void;<br>startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\<void>): void;<br>startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\<void>; | Added|
21| AbilityContext | AbilityContext | startAbilityByCall(want: Want): Promise\<Caller>; | Added|
22| AbilityContext | AbilityContext | startAbility(want: Want, callback: AsyncCallback\<void>): void;<br>startAbility(want: Want, options: StartOptions, callback: AsyncCallback\<void>): void;<br>startAbility(want: Want, options?: StartOptions): Promise\<void>; | Added|
23| AbilityContext | AbilityContext | config: Configuration; | Added|
24| AbilityContext | AbilityContext | currentHapModuleInfo: HapModuleInfo; | Added|
25| AbilityContext | AbilityContext | abilityInfo: AbilityInfo; | Added|
26| abilityDelegator | AbilityDelegator | doAbilityBackground(ability: Ability, callback: AsyncCallback\<boolean>): void;<br>doAbilityBackground(ability: Ability): Promise\<boolean>; | Added|
27| abilityDelegator | AbilityDelegator | doAbilityForeground(ability: Ability, callback: AsyncCallback\<boolean>): void;<br>doAbilityForeground(ability: Ability): Promise\<boolean>; | Added|
28| abilityDelegator | AbilityDelegator | startAbility(want: Want, callback: AsyncCallback\<void>): void;<br>startAbility(want: Want): Promise\<void>; | Added|
29| abilityDelegator | AbilityDelegator | getCurrentTopAbility(callback: AsyncCallback\<Ability>): void;<br>getCurrentTopAbility(): Promise\<Ability> | Added|
30| abilityDelegator | AbilityDelegator | getAbilityState(ability: Ability): number; | Added|
31| abilityDelegator | AbilityDelegator | getAppContext(): Context; | Added|
32| abilityDelegator | AbilityDelegator | waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<Ability>): void;<br>waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback\<Ability>): void;<br>waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise\<Ability>; | Added|
33| abilityDelegator | AbilityDelegator | removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<void>): void;<br>removeAbilityMonitor(monitor: AbilityMonitor): Promise\<void>; | Added|
34| abilityDelegator | AbilityDelegator | addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<void>): void;<br>addAbilityMonitor(monitor: AbilityMonitor): Promise\<void>; | Added|
35| abilityMonitor | AbilityMonitor | onWindowStageDestroy?:(data: Ability) => void; | Added|
36| abilityMonitor | AbilityMonitor | onWindowStageRestore?:(data: Ability) => void; | Added|
37| abilityMonitor | AbilityMonitor | onWindowStageCreate?:(data: Ability) => void; | Added|
38| abilityMonitor | AbilityMonitor | onAbilityDestroy?:(data: Ability) => void; | Added|
39| abilityMonitor | AbilityMonitor | onAbilityBackground?:(data: Ability) => void; | Added|
40| abilityMonitor | AbilityMonitor | onAbilityForeground?:(data: Ability) => void; | Added|
41| abilityMonitor | AbilityMonitor | onAbilityCreate?:(data: Ability) => void; | Added|
42| abilityMonitor | AbilityMonitor | abilityName: string; | Added|
43| AbilityStageContext | AbilityStageContext | config: Configuration; | Added|
44| AbilityStageContext | AbilityStageContext | currentHapModuleInfo: HapModuleInfo; | Added|
45| AbilityStateData | AbilityStateData | moduleName: string; | Added|
46| ApplicationContext | ApplicationContext | unregisterAbilityLifecycleCallback(callbackId: number,  callback: AsyncCallback\<void>): void;<br>unregisterAbilityLifecycleCallback(callbackId: number): Promise\<void>; | Added|
47| ApplicationContext | ApplicationContext | registerAbilityLifecycleCallback(callback: AbilityLifecycleCallback): number; | Added|
48| context | AreaMode | EL2 = 1 | Added|
49| context | AreaMode | EL1 = 0 | Added|
50| context | Context | createBundleContext(bundleName: string): Context; | Added|
51| context | Context | area: AreaMode; | Added|
52| context | Context | eventHub: EventHub; | Added|
53| context | Context | distributedFilesDir: string; | Added|
54| context | Context | bundleCodeDir : string; | Added|
55| context | Context | preferencesDir : string; | Added|
56| context | Context | databaseDir : string; | Added|
57| context | Context | filesDir : string; | Added|
58| context | Context | tempDir: string; | Added|
59| context | Context | cacheDir: string; | Added|
60| context | Context | applicationInfo: ApplicationInfo; | Added|
61| context | Context | resourceManager: resmgr.ResourceManager; | Added|
62| EventHub | EventHub | emit(event: string, ...args: Object[]): void | Added|
63| EventHub | EventHub | off(event: string, callback?: Function): void | Added|
64| EventHub | EventHub | on(event: string, callback: Function): void | Added|
65| extensionAbilityInfo | ExtensionAbilityInfo | readonly writePermission: string; | Added|
66| extensionAbilityInfo | ExtensionAbilityInfo | readonly readPermission: string; | Added|
67| extensionAbilityInfo | ExtensionAbilityInfo | readonly enabled: boolean; | Added|
68| extensionAbilityInfo | ExtensionAbilityInfo | readonly metadata: Array\<Metadata>; | Added|
69| extensionAbilityInfo | ExtensionAbilityInfo | readonly applicationInfo: ApplicationInfo; | Added|
70| extensionAbilityInfo | ExtensionAbilityInfo | readonly permissions: Array\<string>; | Added|
71| extensionAbilityInfo | ExtensionAbilityInfo | readonly extensionAbilityType: bundle.ExtensionAbilityType; | Added|
72| extensionAbilityInfo | ExtensionAbilityInfo | readonly isVisible: boolean; | Added|
73| extensionAbilityInfo | ExtensionAbilityInfo | readonly iconId: number; | Added|
74| extensionAbilityInfo | ExtensionAbilityInfo | readonly descriptionId: number; | Added|
75| extensionAbilityInfo | ExtensionAbilityInfo | readonly labelId: number; | Added|
76| extensionAbilityInfo | ExtensionAbilityInfo | readonly name: string; | Added|
77| extensionAbilityInfo | ExtensionAbilityInfo | readonly moduleName: string; | Added|
78| extensionAbilityInfo | ExtensionAbilityInfo | readonly bundleName: string; | Added|
79| ExtensionContext | ExtensionContext | config: Configuration; | Added|
80| ExtensionContext | ExtensionContext | currentHapModuleInfo: HapModuleInfo; | Added|
81| ExtensionRunningInfo | ExtensionRunningInfo | type: bundle.ExtensionAbilityType; | Added|
82| ExtensionRunningInfo | ExtensionRunningInfo | clientPackage: Array\<String>; | Added|
83| ExtensionRunningInfo | ExtensionRunningInfo | startTime: number; | Added|
84| ExtensionRunningInfo | ExtensionRunningInfo | processName: string; | Added|
85| ExtensionRunningInfo | ExtensionRunningInfo | uid: number; | Added|
86| ExtensionRunningInfo | ExtensionRunningInfo | pid: number; | Added|
87| ExtensionRunningInfo | ExtensionRunningInfo | extension: ElementName; | Added|
88| FormExtensionContext | FormExtensionContext | updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback\<void>): void;<br>updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise\<void>; | Added|
89| MissionListener | MissionListener | onMissionIconUpdated(mission: number, icon: image.PixelMap): void; | Added|
90| ohos.application.Ability | Ability | dump(params: Array\<string>): Array\<string>; | Added|
91| ohos.application.Ability | Ability | onConfigurationUpdated(config: Configuration): void; | Added|
92| ohos.application.Ability | Ability | onNewWant(want: Want): void; | Added|
93| ohos.application.Ability | Ability | onContinue(wantParam : {[key: string]: any}): AbilityConstant.OnContinueResult; | Added|
94| ohos.application.Ability | Ability | onBackground(): void; | Added|
95| ohos.application.Ability | Ability | onForeground(): void; | Added|
96| ohos.application.Ability | Ability | onDestroy(): void; | Added|
97| ohos.application.Ability | Ability | onWindowStageRestore(windowStage: window.WindowStage): void; | Added|
98| ohos.application.Ability | Ability | onWindowStageDestroy(): void; | Added|
99| ohos.application.Ability | Ability | onWindowStageCreate(windowStage: window.WindowStage): void; | Added|
100| ohos.application.Ability | Ability | onCreate(want: Want, param: AbilityConstant.LaunchParam): void; | Added|
101| ohos.application.Ability | Ability | callee: Callee; | Added|
102| ohos.application.Ability | Ability | lastRequestWant: Want; | Added|
103| ohos.application.Ability | Ability | launchWant: Want; | Added|
104| ohos.application.Ability | Ability | context: AbilityContext; | Added|
105| ohos.application.Ability | Callee | off(method: string): void; | Added|
106| ohos.application.Ability | Callee | on(method: string, callback: CaleeCallBack): void; | Added|
107| ohos.application.Ability | Caller | onRelease(callback: OnReleaseCallBack): void; | Added|
108| ohos.application.Ability | Caller | release(): void; | Added|
109| ohos.application.Ability | Caller | callWithResult(method: string, data: rpc.Sequenceable): Promise<rpc.MessageParcel>; | Added|
110| ohos.application.Ability | Caller | call(method: string, data: rpc.Sequenceable): Promise\<void>; | Added|
111| ohos.application.Ability | CaleeCallBack | (indata: rpc.MessageParcel): rpc.Sequenceable; | Added|
112| ohos.application.Ability | OnReleaseCallBack | (msg: string): void; | Added|
113| ohos.application.AbilityConstant | OnContinueResult | MISMATCH = 2 | Added|
114| ohos.application.AbilityConstant | OnContinueResult | REJECT = 1 | Added|
115| ohos.application.AbilityConstant | OnContinueResult | AGREE = 0 | Added|
116| ohos.application.AbilityConstant | LastExitReason | NORMAL = 2 | Added|
117| ohos.application.AbilityConstant | LastExitReason | ABILITY_NOT_RESPONDING = 1 | Added|
118| ohos.application.AbilityConstant | LastExitReason | UNKNOWN = 0 | Added|
119| ohos.application.AbilityConstant | LaunchReason | CONTINUATION = 3 | Added|
120| ohos.application.AbilityConstant | LaunchReason | CALL = 2 | Added|
121| ohos.application.AbilityConstant | LaunchReason | START_ABILITY = 1 | Added|
122| ohos.application.AbilityConstant | LaunchReason | UNKNOWN = 0 | Added|
123| ohos.application.AbilityConstant | LaunchParam | lastExitReason: LastExitReason; | Added|
124| ohos.application.AbilityConstant | LaunchParam | launchReason: LaunchReason; | Added|
125| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityContinue(ability: Ability): void; | Added|
126| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityBackground(ability: Ability): void; | Added|
127| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityForeground(ability: Ability): void; | Added|
128| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityDestroy(ability: Ability): void; | Added|
129| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityWindowStageDestroy(ability: Ability): void; | Added|
130| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityWindowStageCreate(ability: Ability): void; | Added|
131| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityCreate(ability: Ability): void; | Added|
132| ohos.application.abilityManager | abilityManager | function getTopAbility(): Promise\<ElementName>;<br>function getTopAbility(callback: AsyncCallback\<ElementName>): void; | Added|
133| ohos.application.abilityManager | abilityManager | function getExtensionRunningInfos(upperLimit: number): Promise\<Array\<ExtensionRunningInfo>>;<br>function getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback\<Array\<ExtensionRunningInfo>>): void; | Added|
134| ohos.application.AbilityStage | AbilityStage | onConfigurationUpdated(config: Configuration): void; | Added|
135| ohos.application.AbilityStage | AbilityStage | onAcceptWant(want: Want): string; | Added|
136| ohos.application.AbilityStage | AbilityStage | onCreate(): void; | Added|
137| ohos.application.AbilityStage | AbilityStage | context: AbilityStageContext; | Added|
138| ohos.application.Configuration | Configuration | displayId?: number; | Added|
139| ohos.application.Configuration | Configuration | screenDensity?: ConfigurationConstant.ScreenDensity; | Added|
140| ohos.application.Configuration | Configuration | direction?: ConfigurationConstant.Direction; | Added|
141| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_XXXLDPI = 640 | Added|
142| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_XXLDPI = 480 | Added|
143| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_XLDPI = 320 | Added|
144| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_LDPI = 240 | Added|
145| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_MDPI = 160 | Added|
146| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_SDPI = 120 | Added|
147| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_NOT_SET = 0 | Added|
148| ohos.application.ConfigurationConstant | Direction | DIRECTION_HORIZONTAL = 1 | Added|
149| ohos.application.ConfigurationConstant | Direction | DIRECTION_VERTICAL = 0 | Added|
150| ohos.application.ConfigurationConstant | Direction | DIRECTION_NOT_SET = -1 | Added|
151| ohos.application.FormExtension | FormExtension | onAcquireFormState?(want: Want): formInfo.FormState; | Added|
152| ohos.application.FormExtension | FormExtension | onConfigurationUpdated(config: Configuration): void; | Added|
153| ohos.application.FormExtension | FormExtension | onDestroy(formId: string): void; | Added|
154| ohos.application.FormExtension | FormExtension | onEvent(formId: string, message: string): void; | Added|
155| ohos.application.FormExtension | FormExtension | onVisibilityChange(newStatus: { [key: string]: number }): void; | Added|
156| ohos.application.FormExtension | FormExtension | onUpdate(formId: string): void; | Added|
157| ohos.application.FormExtension | FormExtension | onCastToNormal(formId: string): void; | Added|
158| ohos.application.FormExtension | FormExtension | onCreate(want: Want): formBindingData.FormBindingData; | Added|
159| ohos.application.FormExtension | FormExtension | context: FormExtensionContext; | Added|
160| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | dump(params: Array\<string>): Array\<string>; | Added|
161| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onConfigurationUpdated(config: Configuration): void; | Added|
162| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onReconnect(want: Want): void; | Added|
163| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onDisconnect(want: Want): void; | Added|
164| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onConnect(want: Want): rpc.RemoteObject; | Added|
165| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onRequest(want: Want, startId: number): void; | Added|
166| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onDestroy(): void; | Added|
167| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onCreate(want: Want): void; | Added|
168| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | context: ServiceExtensionContext; | Added|
169| ohos.application.StartOptions | StartOptions | displayId?: number; | Added|
170| ohos.application.StartOptions | StartOptions | windowMode?: number; | Added|
171| ohos.application.StaticSubscriberExtensionAbility | StaticSubscriberExtensionAbility | onReceiveEvent(event: CommonEventData): void; | Added|
172| ohos.application.uriPermissionManager | uriPermissionManager | function verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number, callback: AsyncCallback\<number>): void;<br>function verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number): Promise\<number>; | Added|
173| ohos.application.WindowExtensionAbility | WindowExtensionAbility | onWindowReady(window: Window): void; | Added|
174| ohos.application.WindowExtensionAbility | WindowExtensionAbility | onDisconnect(want: Want): void; | Added|
175| ohos.application.WindowExtensionAbility | WindowExtensionAbility | onConnect(want: Want): rpc.RemoteObject; | Added|
176| ohos.application.WindowExtensionAbility | WindowExtensionAbility | context: ExtensionContext; | Added|
177| ohos.wantAgent | wantAgent | function getOperationType(agent: WantAgent, callback: AsyncCallback\<number>): void;<br>function getOperationType(agent: WantAgent): Promise\<number>; | Added|
178| PermissionRequestResult | PermissionRequestResult | authResults: Array\<number>; | Added|
179| PermissionRequestResult | PermissionRequestResult | permissions: Array\<string>; | Added|
180| ServiceExtensionContext | ServiceExtensionContext | disconnectAbility(connection: number, callback:AsyncCallback\<void>): void;<br>disconnectAbility(connection: number): Promise\<void>; | Added|
181| ServiceExtensionContext | ServiceExtensionContext | connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; | Added|
182| ServiceExtensionContext | ServiceExtensionContext | connectAbility(want: Want, options: ConnectOptions): number; | Added|
183| ServiceExtensionContext | ServiceExtensionContext | terminateSelf(callback: AsyncCallback\<void>): void;<br>terminateSelf(): Promise\<void>; | Added|
184| ServiceExtensionContext | ServiceExtensionContext | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<void>): void;<br>startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\<void>): void;<br>startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\<void>; | Added|
185| ServiceExtensionContext | ServiceExtensionContext | startAbility(want: Want, callback: AsyncCallback\<void>): void;<br>startAbility(want: Want, options: StartOptions, callback: AsyncCallback\<void>): void;<br>startAbility(want: Want, options?: StartOptions): Promise\<void>; | Added|
186| ServiceExtensionContext | ServiceExtensionContext | extensionAbilityInfo: ExtensionAbilityInfo; | Added|
187