openharmony 鸿蒙 changelogs-ability

2026-08-25 浏览 (1)

Ability Framework Changelog

cl.ability.1 AbilityDelegator.startAbility() Error Code Changed

Access Level

Public API

Reason for Change

All error codes returned by AbilityDelegator.startAbility() are inconsistent with the API documentation.

Impact of the Change

This change does not require application adaptation.

The change affects all error codes returned by AbilityDelegator.startAbility(). The error code mapping is as follows:

Before ChangeAfter Change
29360128401
209719916000001
209718716000002
209717916000004
209720816000005
209720716000006
209720316000008
1116000009
209720616000010
209732316000011
209720416000012
209721516000013
209716716000050
524288116000053
2936030016000055
209720516200001

Start API Level

API 9

Change Since

OpenHarmony SDK 6.0.0.32

Key API/Component Changes

startAbility() provided by AbilityDelegator

Adaptation Guide

No adaptation is required.

For details about the startAbility() API provided by AbilityDelegator, see startAbility.

cl.ability.2 Erasing Invalid URIs When Sharing Files via Want

Access Level

Public API

Reason for Change

In file sharing scenarios (where the flags field of Want is configured with wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION or wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION), an application can pass a single URI through the uri field of Want, or pass multiple URIs using the Key value of wantConstant.Params.PARAMS_STREAM. To ensure that the parameters passed to the target application are valid, the system proactively erases URIs that do not meet the conditions.

Impact of the Change

Before change, in file sharing scenarios, if the scheme of the uri field in Want is empty, or the scheme of the URIs in the wantConstant.Params.PARAMS_STREAM field is not file, the system does not perform any processing.

After change, in file sharing scenarios, if the scheme of the uri field in Want is empty, or the scheme of the URIs in the wantConstant.Params.PARAMS_STREAM field is not file, the system erases the corresponding URI values.

Start API Level

API 9

Change Since

OpenHarmony SDK 6.0.0.32

Key API/Component Changes

The APIs related to starting and exiting applications can trigger this change in file sharing scenarios. The involved interfaces are as follows:

UIAbilityContext:

  • startAbility(want: Want, callback: AsyncCallback<void>): void
  • startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void
  • startAbility(want: Want, options?: StartOptions): Promise<void>
  • startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void
  • startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void
  • startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>
  • terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void
  • terminateSelfWithResult(parameter: AbilityResult): Promise<void>
  • connectServiceExtensionAbility(want: Want, options: ConnectOptions): number
  • startAbilityByCall(want: Want): Promise<Caller>
  • startUIServiceExtensionAbility(want: Want): Promise<void>
  • connectUIServiceExtensionAbility(want: Want, callback: UIServiceExtensionConnectCallback) : Promise<UIServiceProxy>

UIExtensionContext:

  • startAbility(want: Want, callback: AsyncCallback<void>): void
  • startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void
  • startAbility(want: Want, options?: StartOptions): Promise<void>
  • startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void
  • startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void
  • startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>
  • connectServiceExtensionAbility(want: Want, options: ConnectOptions): number
  • terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void
  • terminateSelfWithResult(parameter: AbilityResult): Promise<void>
  • startUIServiceExtensionAbility(want: Want): Promise<void>
  • connectUIServiceExtensionAbility(want: Want, callback: UIServiceExtensionConnectCallback) : Promise<UIServiceProxy>

Adaptation Guide

Check whether the file URI read/write flag (wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION or wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION) is set in the flags field of Want and whether the uri or wantConstant.Params.PARAMS_STREAM field is set to a non-file URI.

Perform either of the following:

  • Delete the file URI read/write flag in the flags field of Want.
  • Change non-file URIs in the uri and wantConstant.Params.PARAMS_STREAM fields to file URIs. If the URI written earlier is a sandbox path, you can convert the URI into a file URI using fileUri.getUriFromPath.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 changelogs-image

openharmony 鸿蒙 changelogs-externaldevicemanager

openharmony 鸿蒙 changelogs-multimedia

openharmony 鸿蒙 changelogs-startup

openharmony 鸿蒙 changelogs-arkts

openharmony 鸿蒙 changelogs-bluetooth

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/UZfPH3A2