• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 元能力子系统ChangeLog
2
3## cl.ability.1 应用组件启动规则变更
4
5元能力子系统应用组件启动规则在如下场景中存在变更:
6
7 - 应用位于后台启动应用组件
8 - 跨应用启动invisible应用组件
9 - 跨应用启动FA模型的serviceAbility与dataAbility
10 - 使用startAbilityByCall接口
11
12开发者需要根据以下说明对应用进行适配。
13
14
15**变更影响**
16
17若未适配新规则,在上述场景下将无法启动应用组件
18> **注意,启动应用组件是指一切启动或连接Ability的行为:**
19<br> 1. 启动Ability,如使用startAbility、startServiceExtensionAbility、startAbilityByCall等接口。
20<br> 2. 连接Ability,如使用connectAbility、connectServiceExtensionAbility、acquireDataAbilityHelper、createDataShareHelper等接口。
21
22**关键的接口/组件变更**
23
24 - 涉及的应用组件
25   - Stage模型
26     - Ability
27     - ServiceExtension
28     - DataShareExtension
29   - FA模型
30     - PageAbility
31     - ServiceAbility
32     - DataAbility
33 - 涉及接口
34   - Stage模型
35     - startAbility(want: Want, callback: AsyncCallback<void>): void;
36     - startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void;
37     - startAbility(want: Want, options?: StartOptions): Promise<void>;
38     - startAbilityByCall(want: Want): Promise<Caller>;
39     - startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void;
40     - startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<void>): void;
41     - startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<void>;
42     - startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void;
43     - startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void;
44     - startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>;
45     - startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback<AbilityResult>): void;
46     - startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<void>): void;
47     - startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<AbilityResult>;
48     - startServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void;
49     - startServiceExtensionAbility(want: Want): Promise<void>;
50     - startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void;
51     - startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void>;
52     - stopServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void;
53     - stopServiceExtensionAbility(want: Want): Promise<void>;
54     - stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void;
55     - stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void>;
56     - connectAbility(want: Want, options: ConnectOptions): number;
57     - connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number;
58     - createDataShareHelper(context: Context, uri: string, callback: AsyncCallback<DataShareHelper>): void
59   - FA模型
60     - startAbility(parameter: StartAbilityParameter, callback: AsyncCallback<number>): void;
61     - startAbility(parameter: StartAbilityParameter): Promise<number>;
62     - startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback<AbilityResult>): void;
63     - startAbilityForResult(parameter: StartAbilityParameter): Promise<AbilityResult>;
64     - acquireDataAbilityHelper(uri: string): DataAbilityHelper;
65     - connectAbility(request: Want, options:ConnectOptions ): number;
66
67**适配指导**
68
69不同场景下的启动规则说明如下:
70 - **应用后台启动应用组件**
71   - OpenHarmony 3.2-beta3 版本规则:
72      - 应用位于后台时,启动应用组件不受任何限制。
73   - OpenHarmony 3.2-beta4 版本新规则:
74     - 当应用位于后台时,启动应用组件需鉴权,需申请的权限如下:
75      - ```json
76        {
77            "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND",
78            "grantMode": "system_grant",
79            "availableLevel": "system_basic",
80            "provisionEnable": true,
81            "distributedSceneEnable": false
82        }
83        ```
84          > **注:**
85          <br> 1. 即使启动同应用的组件,也受该规则限制。
86          <br> 2. 对于API8以及之前的SDK,启动serviceAbility和dataAbility不受此规则限制。
87
88 - **跨应用启动invisible应用组件**
89   - OpenHarmony 3.2-beta3 版本规则:
90     - 对于APL为normal的应用,无法跨应用启动invisible的应用组件
91   - OpenHarmony 3.2-beta4 版本新规则:
92     - 所有应用,若需要跨应用启动invisible的应用组件,需鉴权,需申请的权限如下:
93     - ```json
94        {
95            "name": "ohos.permission.START_INVISIBLE_ABILITY",
96            "grantMode": "system_grant",
97            "availableLevel": "system_core",
98            "provisionEnable": true,
99            "distributedSceneEnable": false
100        }
101        ```
102
103 - **跨应用启动FA模型的serviceAbility与dataAbility**
104
105   - OpenHarmony 3.2-beta3 版本规则:
106     - 可任意跨应用启动serviceAbility与dataAbility
107   - OpenHarmony 3.2-beta4 版本新规则:
108     - serviceAbility与dataAbility的提供方应用需配置关联启动,否则无法被跨应用拉起。(普通应用无法配置关联启动)
109
110
111 - **startAbilityByCall接口**
112   - OpenHarmony 3.2-beta3 版本规则:
113     - 可任意进行Call调用
114   - OpenHarmony 3.2-beta4 版本新规则:
115     - 不支持同应用startAbilityByCall调用
116      - 跨应用startAbilityByCall调用需鉴权,需申请的权限如下:
117
118      - ```json
119        {
120            "name": "ohos.permission.ABILITY_BACKGROUND_COMMUNICATION",
121            "grantMode": "system_grant",
122            "availableLevel": "system_basic",
123            "provisionEnable": true,
124            "distributedSceneEnable": false
125        }
126        ```
127        > **注:**
128        <br> 使用startAbilityByCall接口同时也受上述后台启动、跨应用启动invisible规则的限制。
129
130## cl.ability.2 跨设备应用组件启动规则变更(仅支持系统应用)
131
132元能力子系统跨设备应用组件启动规则在如下场景中存在变更:
133
134 - 应用位于后台启动应用组件
135 - 跨应用启动invisible应用组件
136 - 跨应用启动FA模型的serviceAbility
137
138开发者需要根据以下说明对应用进行适配。
139
140
141**变更影响**
142
143若未适配新规则,在上述场景下将无法启动应用组件
144> **注意,启动应用组件是指一切启动或连接Ability的行为:**
145<br> 1. 启动Ability,如使用startAbility、startAbilityForResult、startAbilityByCall等接口。
146<br> 2. 连接Ability,如使用connectAbility等接口。
147
148**关键的接口/组件变更**
149
150 - 涉及的应用组件
151   - Stage模型
152     - Ability
153     - ServiceExtension
154   - FA模型
155     - PageAbility
156     - ServiceAbility
157 - 涉及接口
158   - Stage模型
159     - startAbility(want: Want, callback: AsyncCallback<void>): void;
160     - startAbilityByCall(want: Want): Promise<Caller>;
161     - startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void;
162     - connectAbility(want: Want, options: ConnectOptions): number;
163   - FA模型
164     - startAbility(parameter: StartAbilityParameter, callback: AsyncCallback<number>): void;
165     - startAbility(parameter: StartAbilityParameter): Promise<number>;
166     - startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback<AbilityResult>): void;
167     - startAbilityForResult(parameter: StartAbilityParameter): Promise<AbilityResult>;
168     - connectAbility(request: Want, options:ConnectOptions ): number;
169
170**适配指导**
171
172不同场景下的启动规则说明如下:
173 - **应用后台启动应用组件**
174   - OpenHarmony 3.2-beta3 版本规则:
175      - 应用位于后台时,启动应用组件不受任何限制。
176   - OpenHarmony 3.2-beta4 版本新规则:
177     - 当应用位于后台时,启动应用组件需鉴权,需申请的权限如下:
178      - ```json
179        {
180            "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND",
181            "grantMode": "system_grant",
182            "availableLevel": "system_basic",
183            "provisionEnable": true,
184            "distributedSceneEnable": false
185        }
186        ```
187          > **注:**
188          <br> 1. 即使启动同应用的组件,也受该规则限制。
189          <br> 2. 对于API8以及之前的SDK,启动serviceAbility不受此规则限制。
190
191 - **跨应用启动invisible应用组件**
192   - OpenHarmony 3.2-beta3 版本规则:
193     - 无法跨应用启动invisible的应用组件
194   - OpenHarmony 3.2-beta4 版本新规则:
195     - 若需要跨应用启动invisible的应用组件,需鉴权,需申请的权限如下:
196     - ```json
197        {
198            "name": "ohos.permission.START_INVISIBLE_ABILITY",
199            "grantMode": "system_grant",
200            "availableLevel": "system_core",
201            "provisionEnable": true,
202            "distributedSceneEnable": false
203        }
204        ```
205
206 - **跨应用启动FA模型的serviceAbility**
207
208   - OpenHarmony 3.2-beta3 版本规则:
209     - 可任意跨应用启动serviceAbility
210   - OpenHarmony 3.2-beta4 版本新规则:
211     - serviceAbility的提供方应用需配置关联启动,否则无法被跨应用拉起。(普通应用无法配置关联启动)
212     - 关联启动配置
213     - ```json
214        {
215            "bundleName": "",
216            "app_signature": ["xxxxxxxxxxxxxxxxxxx"],
217            "associatedWakeUp": true
218        }
219        ```
220
221## cl.ability.3 API异常处理方式变更
222
223元能力部分接口使用业务逻辑返回值表示错误信息,不符合OpenHarmony接口错误码规范。
224
225**变更影响**
226
227基于此前版本开发的应用,需适配变更接口的错误信息返回方式,否则会影响原有业务逻辑。
228
229**关键接口/组件变更**
230
231为适配统一的API异常处理方式,对元能力相关接口进行废弃(下表中 原接口 列内容,其中的API9接口将被删除,API8及以前的接口将被标注为废弃),并新增对应接口(下表中 新接口 列内容)。新增接口支持统一的错误码异常处理规范,功能上与原接口保持一致。
232
233| 原接口                                          | 新接口                                          |
234| ----------------------------------------------- | ----------------------------------------------- |
235| @ohos.ability.wantConstant.d.ts                 | @ohos.app.ability.wantConstant.d.ts             |
236| @ohos.application.Ability.d.ts                  | @ohos.app.ability.UIAbility.d.ts                |
237| @ohos.application.AbilityConstant.d.ts          | @ohos.app.ability.AbilityConstant.d.ts          |
238| @ohos.application.abilityDelegatorRegistry.d.ts | @ohos.app.ability.abilityDelegatorRegistry.d.ts |
239| @ohos.application.AbilityLifecycleCallback.d.ts | @ohos.app.ability.AbilityLifecycleCallback.d.ts |
240| @ohos.application.abilityManager.d.ts           | @ohos.app.ability.abilityManager.d.ts           |
241| @ohos.application.AbilityStage.d.ts             | @ohos.app.ability.AbilityStage.d.ts             |
242| @ohos.application.appManager.d.ts               | @ohos.app.ability.appManager.d.ts               |
243| @ohos.application.Configuration.d.ts            | @ohos.app.ability.Configuration.d.ts            |
244| @ohos.application.ConfigurationConstant.d.ts    | @ohos.app.ability.ConfigurationConstant.d.ts    |
245| @ohos.application.context.d.ts                  | @ohos.app.ability.common.d.ts                   |
246| @ohos.application.EnvironmentCallback.d.ts      | @ohos.app.ability.EnvironmentCallback.d.ts      |
247| @ohos.application.errorManager.d.ts             | @ohos.app.ability.errorManager.d.ts             |
248| @ohos.application.ExtensionAbility.d.ts         | @ohos.app.ability.ExtensionAbility.d.ts         |
249| @ohos.application.formBindingData.d.ts          | @ohos.app.form.formBindingData.d.ts             |
250| @ohos.application.FormExtension.d.ts            | @ohos.app.form.FormExtensionAbility.d.ts        |
251| @ohos.application.formHost.d.ts                 | @ohos.app.form.formHost.d.ts                    |
252| @ohos.application.formInfo.d.ts                 | @ohos.app.form.formInfo.d.ts                    |
253| @ohos.application.formProvider.d.ts             | @ohos.app.form.formProvider.d.ts                |
254| @ohos.application.missionManager.d.ts           | @ohos.app.ability.missionManager.d.ts           |
255| @ohos.application.quickFixManager.d.ts          | @ohos.app.ability.quickFixManager.d.ts          |
256| @ohos.application.ServiceExtensionAbility.d.ts  | @ohos.app.ability.ServiceExtensionAbility.d.ts  |
257| @ohos.application.StartOptions.d.ts             | @ohos.app.ability.StartOptions.d.ts             |
258| @ohos.application.Want.d.ts                     | @ohos.app.ability.Want.d.ts                     |
259| @ohos.wantAgent.d.ts                            | @ohos.app.ability.wantAgent.d.ts                |
260
261**适配指导**
262
263如上所述,仅将老接口平移到了新的namespace中,所以可以通过修改import来解决适配问题:
264
265如原先接口使用了@ohos.application.missionManager
266
267```js
268import missionManager from '@ohos.application.missionManager';
269```
270
271可以通过直接修改import,来切换到新的namespace上:
272
273```js
274import missionManager from '@ohos.app.ability.missionManager';
275```
276
277此外还需要适配异常处理,具体参考新接口的接口文档。
278
279## cl.ability.4 接口变更
280
281对元能力部分接口名进行了变更。
282
283**关键的接口/组件变更**
284
285| 模块名                                    | 类名                    | 方法/属性/枚举/常量                                          | 变更类型 |
286| ----------------------------------------- | ----------------------- | ------------------------------------------------------------ | -------- |
287| @ohos.application.Ability                 | Caller                  | onRelease(callback: OnReleaseCallBack): **void**;            | 废弃     |
288| @ohos.app.ability.UIAbility               | Caller                  | on(**type**: "release", callback: OnReleaseCallBack): **void**; | 新增     |
289| @ohos.application.Ability                 | Ability                 | dump(params: Array<**string**>): Array<**string**>;          | 废弃     |
290| @ohos.app.ability.UIAbility               | UIAbility               | onDump(params: Array<**string**>): Array<**string**>;        | 新增     |
291| @ohos.application.appManager              | appManager              | **function** registerApplicationStateObserver(observer: ApplicationStateObserver): **number**; | 废弃     |
292| @ohos.application.appManager              | appManager              | **function** registerApplicationStateObserver(observer: ApplicationStateObserver, bundleNameList: Array<**string**>): **number**; | 废弃     |
293| @ohos.application.appManager              | appManager              | **function** unregisterApplicationStateObserver(observerId: **number**, callback: AsyncCallback<**void**>): **void**; | 废弃     |
294| @ohos.application.appManager              | appManager              | **function** unregisterApplicationStateObserver(observerId: **number**): Promise<**void**>; | 废弃     |
295| @ohos.app.ability.appManager              | appManager              | **function** on(**type**: "applicationState", observer: ApplicationStateObserver): **number**; | 新增     |
296| @ohos.app.ability.appManager              | appManager              | **function** on(**type**: "applicationState", observer: ApplicationStateObserver, bundleNameList: Array<**string**>): **number**; | 新增     |
297| @ohos.app.ability.appManager              | appManager              | **function** off(**type**: "applicationState", observerId: **number**, callback: AsyncCallback<**void**>): **void**; | 新增     |
298| @ohos.app.ability.appManager              | appManager              | **function** off(**type**: "applicationState", observerId: **number**): Promise<**void**>; | 新增     |
299| @ohos.application.errorManager            | errorManager            | **function** registerErrorObserver(observer: ErrorObserver): **number**; | 废弃     |
300| @ohos.application.errorManager            | errorManager            | **function** unregisterErrorObserver(observerId: **number**, callback: AsyncCallback<**void**>): **void**; | 废弃     |
301| @ohos.application.errorManager            | errorManager            | **function** unregisterErrorObserver(observerId: **number**): Promise<**void**>; | 废弃     |
302| @ohos.app.ability.errorManager            | errorManager            | **function** on(**type**: "error", observer: ErrorObserver): **number**; | 新增     |
303| @ohos.app.ability.errorManager            | errorManager            | **function** off(**type**: "error", observerId: **number**, callback: AsyncCallback<**void**>): **void**; | 新增     |
304| @ohos.app.ability.errorManager            | errorManager            | **function** off(**type**: "error", observerId: **number**): Promise<**void**>; | 新增     |
305| @ohos.application.missionManager          | missionManager          | **function** registerMissionListener(listener: MissionListener): **number**; | 废弃     |
306| @ohos.application.missionManager          | missionManager          | **function** unregisterMissionListener(listenerId: **number**, callback: AsyncCallback<**void**>): **void**; | 废弃     |
307| @ohos.application.missionManager          | missionManager          | **function** unregisterMissionListener(listenerId: **number**): Promise<**void**>; | 废弃     |
308| @ohos.app.ability.missionManager          | missionManager          | **function** on(**type**: "mission", listener: MissionListener): **number**; | 新增     |
309| @ohos.app.ability.missionManager          | missionManager          | **function** off(**type**: "mission", listenerId: **number**, callback: AsyncCallback<**void**>): **void**; | 新增     |
310| @ohos.app.ability.missionManager          | missionManager          | **function** off(**type**: "mission", listenerId: **number**): Promise<**void**>; | 新增     |
311| @ohos.application.FormExtension           | FormExtension           | onCreate(want: Want): formBindingData.FormBindingData;       | 废弃     |
312| @ohos.application.FormExtension           | FormExtension           | onCastToNormal(formId: **string**): **void**;                | 废弃     |
313| @ohos.application.FormExtension           | FormExtension           | onUpdate(formId: **string**): **void**;                      | 废弃     |
314| @ohos.application.FormExtension           | FormExtension           | onVisibilityChange(newStatus: { [key: **string**]: **number** }): **void**; | 废弃     |
315| @ohos.application.FormExtension           | FormExtension           | onEvent(formId: **string**, message: **string**): **void**;  | 废弃     |
316| @ohos.application.FormExtension           | FormExtension           | onDestroy(formId: **string**): **void**;                     | 废弃     |
317| @ohos.application.FormExtension           | FormExtension           | onShare?(formId: **string**): {[key: **string**]: **any**};  | 废弃     |
318| @ohos.app.form.FormExtensionAbility       | FormExtensionAbility    | onAddForm(want: Want): formBindingData.FormBindingData;      | 新增     |
319| @ohos.app.form.FormExtensionAbility       | FormExtensionAbility    | onCastToNormalForm(formId: **string**): **void**;            | 新增     |
320| @ohos.app.form.FormExtensionAbility       | FormExtensionAbility    | onUpdateForm(formId: **string**): **void**;                  | 新增     |
321| @ohos.app.form.FormExtensionAbility       | FormExtensionAbility    | onChangeFormVisibility(newStatus: { [key: **string**]: **number** }): **void**; | 新增     |
322| @ohos.app.form.FormExtensionAbility       | FormExtensionAbility    | onFormEvent(formId: **string**, message: **string**): **void**; | 新增     |
323| @ohos.app.form.FormExtensionAbility       | FormExtensionAbility    | onRemoveForm(formId: **string**): **void**;                  | 新增     |
324| @ohos.app.form.FormExtensionAbility       | FormExtensionAbility    | onShareForm?(formId: **string**): {[key: **string**]: **any**}; | 新增     |
325| @ohos.application.formHost.d.ts           | formHost                | **function** castTempForm(formId: **string**, callback: AsyncCallback<**void**>): **void**; | 废弃     |
326| @ohos.application.formHost.d.ts           | formHost                | **function** castTempForm(formId: **string**): Promise<**void**>; | 废弃     |
327| @ohos.app.form.formHost.d.ts              | formHost                | **function** castToNormalForm(formId: **string**, callback: AsyncCallback<**void**>): **void**; | 新增     |
328| @ohos.app.form.formHost.d.ts              | formHost                | **function** castToNormalForm(formId: **string**): Promise<**void**>; | 新增     |
329| @ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | dump(params: Array<**string**>): Array<**string**>;          | 废弃     |
330| @ohos.app.ability.ServiceExtensionAbility | ServiceExtensionAbility | onDump(params: Array<**string**>): Array<**string**>;        | 新增     |
331| application/AbilityContext                | AbilityContext          | connectAbility(want: Want, options: ConnectOptions): **number**; | 废弃     |
332| application/AbilityContext                | AbilityContext          | connectAbilityWithAccount(want: Want, accountId: **number**, options: ConnectOptions): **number**; | 废弃     |
333| application/AbilityContext                | AbilityContext          | disconnectAbility(connection: **number**, callback: AsyncCallback<**void**>): **void**; | 废弃     |
334| application/AbilityContext                | AbilityContext          | disconnectAbility(connection: **number**): Promise<**void**>; | 废弃     |
335| application/UIAbilityContext              | UIAbilityContext        | connectServiceExtensionAbilityWithAccount(want: Want, accountId: **number**, options: ConnectOptions): **number**; | 新增     |
336| application/UIAbilityContext              | UIAbilityContext        | connectServiceExtensionAbilityWithAccount(want: Want, accountId: **number**, options: ConnectOptions): **number**; | 新增     |
337| application/UIAbilityContext              | UIAbilityContext        | disconnectServiceExtensionAbility(connection: **number**, callback: AsyncCallback<**void**>): **void**; | 新增     |
338| application/UIAbilityContext              | UIAbilityContext        | disconnectServiceExtensionAbility(connection: **number**): Promise<**void**>; | 新增     |
339| application/ApplicationContext            | ApplicationContext      | registerAbilityLifecycleCallback(callback: AbilityLifecycleCallback): **number**; | 废弃     |
340| application/ApplicationContext            | ApplicationContext      | unregisterAbilityLifecycleCallback(callbackId: **number**, callback: AsyncCallback<**void**>): **void**; | 废弃     |
341| application/ApplicationContext            | ApplicationContext      | unregisterAbilityLifecycleCallback(callbackId: **number**): Promise<**void**>; | 废弃     |
342| application/ApplicationContext            | ApplicationContext      | registerEnvironmentCallback(callback: EnvironmentCallback): **number**; | 废弃     |
343| application/ApplicationContext            | ApplicationContext      | unregisterEnvironmentCallback(callbackId: **number**, callback: AsyncCallback<**void**>): **void**; | 废弃     |
344| application/ApplicationContext            | ApplicationContext      | unregisterEnvironmentCallback(callbackId: **number**): Promise<**void**>; | 废弃     |
345| application/ApplicationContext            | ApplicationContext      | on(**type**: "abilityLifecycle", callback: AbilityLifecycleCallback): **number**; | 新增     |
346| application/ApplicationContext            | ApplicationContext      | off(**type**: "abilityLifecycle", callbackId: **number**, callback: AsyncCallback<**void**>): **void**; | 新增     |
347| application/ApplicationContext            | ApplicationContext      | off(**type**: "abilityLifecycle", callbackId: **number**): Promise<**void**>; | 新增     |
348| application/ApplicationContext            | ApplicationContext      | on(**type**: "environment", callback: EnvironmentCallback): **number**; | 新增     |
349| application/ApplicationContext            | ApplicationContext      | off(**type**: "environment", callbackId: **number**, callback: AsyncCallback<**void**>): **void**; | 新增     |
350| application/ApplicationContext            | ApplicationContext      | off(**type**: "environment", callbackId: **number**): Promise<**void**>; | 新增     |
351| application/ServiceExtensionContext       | ServiceExtensionContext | connectAbility(want: Want, options: ConnectOptions): **number**; | 废弃     |
352| application/ServiceExtensionContext       | ServiceExtensionContext | connectAbilityWithAccount(want: Want, accountId: **number**, options: ConnectOptions): **number**; | 废弃     |
353| application/ServiceExtensionContext       | ServiceExtensionContext | disconnectAbility(connection: **number**, callback: AsyncCallback<**void**>): **void**; | 废弃     |
354| application/ServiceExtensionContext       | ServiceExtensionContext | disconnectAbility(connection: **number**): Promise<**void**>; | 废弃     |
355| application/ServiceExtensionContext       | ServiceExtensionContext | connectServiceExtensionAbility(want: Want, options: ConnectOptions): **number**; | 新增     |
356| application/ServiceExtensionContext       | ServiceExtensionContext | connectServiceExtensionAbilityWithAccount(want: Want, accountId: **number**, options: ConnectOptions): **number**; | 新增     |
357| application/ServiceExtensionContext       | ServiceExtensionContext | disconnectServiceExtensionAbility(connection: **number**, callback: AsyncCallback<**void**>): **void**; | 新增     |
358| application/ServiceExtensionContext       | ServiceExtensionContext | disconnectServiceExtensionAbility(connection: **number**): Promise<**void**>; | 新增     |
359
360