@hmos-library-adapter/fast 0.0.17-beta.0 → 0.0.17-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@hmos-library-adapter/executer/README.md +2 -2
- package/node_modules/@hmos-library-adapter/executer/shared/skill-map.json +5 -1
- package/node_modules/@hmos-library-adapter/executer/shared/skills/arkts-rules/SKILL.md +400 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/CHANGELOG.md +1391 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/COMPATIBILITY.md +53 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/README.md +123 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/SKILL.md +48 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/agents/upgrade-assess-change.md +37 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/agents/upgrade-fix-file.md +23 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/package.json +19 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/26.0.0/beta1-changes-for-all-apps.md +1793 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/26.0.0/beta1-ux-style-and-effect-changes.md +288 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/26.0.0/beta2-changes-for-all-apps.md +148 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/26.0.0/release-changes-for-all-apps.md +662 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/5.0.1(13)/beta3-os-api-behavior-changes.md +652 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/5.0.1(13)/beta3-ux-style-and-effect-changes.md +222 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/5.0.1(13)/release-os-api-behavior-changes.md +444 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/5.0.1(13)/release-ux-style-and-effect-changes.md +221 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/5.0.2(14)/os-api-behavior-changes.md +1767 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/5.0.2(14)/ux-style-and-effect-changes.md +134 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/5.0.3(15)/beta1-os-api-behavior-changes.md +430 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/5.0.3(15)/beta1-ux-style-and-effect-changes.md +49 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/5.0.3(15)/beta2-os-api-behavior-changes.md +240 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/5.0.3(15)/beta2-ux-style-and-effect-changes.md +90 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/5.0.3(15)/release-os-api-behavior-changes.md +69 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/5.1.0(18)/os-api-behavior-changes.md +1294 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/5.1.0(18)/ux-style-and-effect-changes.md +147 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/6.0.0(20)/beta1-os-api-behavior-changes.md +1019 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/6.0.0(20)/beta1-ux-style-and-effect-changes.md +153 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/6.0.0(20)/beta2-os-api-behavior-changes.md +662 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/6.0.0(20)/beta2-ux-style-and-effect-changes.md +78 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/6.0.0(20)/beta3-os-api-behavior-changes.md +167 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/6.0.0(20)/beta5-os-api-behavior-changes.md +52 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs/6.1.0(23)/changes-for-all-apps.md +397 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/changelogs-index.json +883 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/common/arkts-coding-standards.md +53 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/common/compatibility.md +207 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/common/native-adaptation.md +21 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/common/runtime-functional-tests.md +62 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/common/sdk-versions.md +77 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/common/troubleshooting.md +54 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/common/verification.md +79 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/common/workflow-scan.md +41 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/deprecated/context-migration.md +274 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/deprecated/deprecated-api-adaptation.md +157 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/deprecated/deprecated-api-examples.md +219 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/toolchain/hvigor.md +50 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/upgrade/har-upgrade.md +60 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/upgrade/scanner-missed-cases.md +171 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/upgrade/upgrade-compatibility.md +112 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/upgrade/upgrade-examples.md +289 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/references/upgrade/upgrade-workflow.md +122 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/references/generate-behavior-policy.mjs +96 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/references/references.mjs +9 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/regression/compare-deprecated.mjs +57 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/regression/compare-golden.mjs +130 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/regression/regress-deprecated.mjs +120 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/test/behavior-catalog-generation.test.mjs +59 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/test/behavior-local-sources.test.mjs +44 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/test/changelog-index.test.mjs +66 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/test/compare-golden.test.mjs +103 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/test/fixtures/behavior/local-sources.csv +5 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/test/references.test.mjs +16 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/test/skill-content.test.mjs +139 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/test/skill-frontmatter.test.mjs +11 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/test/test-suite.test.mjs +65 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/validation/skill-content.mjs +125 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/validation/skill-frontmatter.mjs +6 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/maintenance/validation/validate-skill.mjs +57 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/CHANGELOG.md +506 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/GOLDEN_VALIDATION.md +42 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/README.md +137 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/behavior/behavior-policy.mjs +117 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/behavior/upgrade-coverage.mjs +29 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/bin/deveco-worker-compat.cjs +21 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/bin/harmony-api-scan.mjs +17 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/core/cli.mjs +416 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/core/deveco.mjs +348 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/core/project.mjs +81 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/core/rules.mjs +425 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/core/runtime-identity.mjs +23 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/core/scan-runner.mjs +521 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/core/sdk-deprecations.mjs +204 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/data/behavior-change-policy.json +4378 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/deprecated/arkts-deprecations.mjs +363 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/deprecated/build-log.mjs +72 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/native/native.mjs +95 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/package.json +16 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/batch-layout.test.mjs +94 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/behavior-policy.test.mjs +75 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/build-log.test.mjs +69 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/cli.test.mjs +102 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/csv.test.mjs +35 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/deprecations.test.mjs +283 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/deveco.test.mjs +262 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/helpers/scan-batch.mjs +10 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/native.test.mjs +108 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/project.test.mjs +42 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/rules.test.mjs +190 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/runtime-identity.test.mjs +53 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/scan-mode.test.mjs +38 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/scan-runner.test.mjs +481 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/scan-scope.test.mjs +110 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/source-inputs.test.mjs +64 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/scanner/test/upgrade.test.mjs +164 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/format/args.mjs +66 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/format/csv.mjs +85 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/format/json5.mjs +92 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/format/upgrade-results.mjs +45 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/format/zip.mjs +87 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/io/fs-utils.mjs +60 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/artifact-layout.mjs +74 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/changelog-index.mjs +29 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/deveco-version.mjs +40 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/document-links.mjs +30 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/errors.mjs +41 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/fs.mjs +72 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/paths.mjs +34 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/process.mjs +154 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/scan-mode.mjs +7 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/scan-statistics.mjs +7 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/scan-version-catalog.json +43 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/scan-versions.mjs +51 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/sdk-layout.mjs +27 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/source-scope.mjs +108 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/source-types.mjs +7 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/platform/version.mjs +76 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/test/deveco-version.test.mjs +50 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/test/document-links.test.mjs +13 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/test/errors.test.mjs +40 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/test/fs-utils.test.mjs +31 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/test/platform-paths.test.mjs +19 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/test/process-utils.test.mjs +68 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/test/scan-versions.test.mjs +26 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/test/sdk-version.test.mjs +17 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/shared/test/upgrade-results.test.mjs +140 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/scripts/test-suite.mjs +29 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/templates/deprecated-report.md +86 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/templates/progress.md +150 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/templates/results.md +110 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/templates/upgrade-report.md +105 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/templates/upgrade-spec.md +58 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-api-upgrade-adapter/templates/upgrade-test-report.md +47 -0
- package/node_modules/@hmos-library-adapter/executer/shared/skills/harmonyos-knowledge/SKILL.md +70 -0
- package/node_modules/@hmos-library-adapter/executer/src/config.js +3 -4
- package/node_modules/@hmos-library-adapter/executer/src/doctor.js +1 -1
- package/node_modules/@hmos-library-adapter/executer/src/install.js +1 -1
- package/node_modules/@hmos-library-adapter/executer/src/paths.js +4 -4
- package/package.json +1 -1
|
@@ -0,0 +1,1767 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: OS平台API行为的变更
|
|
3
|
+
source: https://developer.huawei.com/consumer/cn/doc/harmonyos-releases/changelogs-for-all-apps-b123sp16
|
|
4
|
+
category: harmonyos-releases
|
|
5
|
+
downloaded_at: 2026-09-03
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# OS平台API行为的变更
|
|
9
|
+
|
|
10
|
+
## Ability
|
|
11
|
+
|
|
12
|
+
### 包管理bundleManager/AbilityInfo中新增必选属性orientationId
|
|
13
|
+
|
|
14
|
+
**变更原因**
|
|
15
|
+
|
|
16
|
+
按照终端设备用户的使用习惯,应用应当能够根据设备类型配置默认的窗口旋转方式,应用在orientation配置资源引用,使用时根据资源ID orientationId解析具体配置。
|
|
17
|
+
|
|
18
|
+
**变更影响**
|
|
19
|
+
|
|
20
|
+
此变更涉及应用适配。
|
|
21
|
+
|
|
22
|
+
变更前:应用在构造AbilityInfo时编译无问题。
|
|
23
|
+
|
|
24
|
+
变更后:应用在构造AbilityInfo时需要添加必选参数orientationId。
|
|
25
|
+
|
|
26
|
+
**起始API Level**
|
|
27
|
+
|
|
28
|
+
9
|
|
29
|
+
|
|
30
|
+
**关键的接口/组件变更**
|
|
31
|
+
|
|
32
|
+
AbilityInfo.d.ts中新增必选属性orientationId。
|
|
33
|
+
|
|
34
|
+
**适配指导**
|
|
35
|
+
|
|
36
|
+
升级到API14后,如果应用在自己的业务中构造了AbilityInfo结构体,则需要在构造的AbilityInfo结构体中新增必选属性orientationId。
|
|
37
|
+
|
|
38
|
+
## ArkData
|
|
39
|
+
|
|
40
|
+
### 数据库插入长度为0的Uint8Array的数据,getRow、getValue 接口返回值发生变化
|
|
41
|
+
|
|
42
|
+
**变更原因**
|
|
43
|
+
|
|
44
|
+
当插入列类型是blob且数据为长度为0的Uint8Array时,数据库对应错误写入null值,导致使用getRow和getValue接口读取时,读取数值结果错误与插入数据不匹配。
|
|
45
|
+
|
|
46
|
+
**变更影响**
|
|
47
|
+
|
|
48
|
+
此变更涉及应用适配。
|
|
49
|
+
|
|
50
|
+
**说明**
|
|
51
|
+
|
|
52
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
53
|
+
|
|
54
|
+
变更前:在blob类型的列里插入长度为0的Uint8Array,调用getRow/getValue接口,获取到的值是null。
|
|
55
|
+
|
|
56
|
+
变更后:在blob类型的列里插入长度为0的Uint8Array,调用getRow/getValue接口,获取到的值是长度为0的Uint8Array。
|
|
57
|
+
|
|
58
|
+
**起始API Level**
|
|
59
|
+
|
|
60
|
+
| 接口名称 | 起始API Level |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| getRow | 11 |
|
|
63
|
+
| getValue | 12 |
|
|
64
|
+
|
|
65
|
+
**变更的接口/组件**
|
|
66
|
+
|
|
67
|
+
@ohos.data.relationalStore.d.ts中getRow接口。
|
|
68
|
+
|
|
69
|
+
@ohos.data.relationalStore.d.ts中getValue接口。
|
|
70
|
+
|
|
71
|
+
**适配指导**
|
|
72
|
+
|
|
73
|
+
变更后,接口的调用方式没有发生变化。开发者需要关注,在blob类型的列里插入长度为0的Uint8Array后,调用getRow或getValue获取到的值发生了变化。
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import { relationalStore } from '@kit.ArkData';
|
|
77
|
+
import { BusinessError } from '@kit.BasicServicesKit';
|
|
78
|
+
import { UIAbility } from '@kit.AbilityKit';
|
|
79
|
+
import { window } from '@kit.ArkUI';
|
|
80
|
+
|
|
81
|
+
const STORE_CONFIG: relationalStore.StoreConfig = {
|
|
82
|
+
name: "RdbTest.db",
|
|
83
|
+
securityLevel: relationalStore.SecurityLevel.S3
|
|
84
|
+
};
|
|
85
|
+
const CREATE_TABLE_TEST =
|
|
86
|
+
"CREATE TABLE IF NOT EXISTS EMPLOYEE (id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT NOT NULL, age INTEGER, salary REAL, blobType BLOB)";
|
|
87
|
+
|
|
88
|
+
let store: relationalStore.RdbStore | undefined = undefined;
|
|
89
|
+
relationalStore.getRdbStore(this.context, STORE_CONFIG, (err: BusinessError, rdbStore: relationalStore.RdbStore) => {
|
|
90
|
+
store = rdbStore;
|
|
91
|
+
store.executeSql(CREATE_TABLE_TEST);
|
|
92
|
+
if (err) {
|
|
93
|
+
console.error(`Get RdbStore failed, code is ${err.code},message is ${err.message}`);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
console.info('Get RdbStore successfully.');
|
|
97
|
+
})
|
|
98
|
+
//在ValuesBucket的blob类型插入长度为0的Uint8Array,并查询该数据。
|
|
99
|
+
let resultSet: relationalStore.ResultSet | undefined = undefined;
|
|
100
|
+
let predicates = new relationalStore.RdbPredicates("EMPLOYEE");
|
|
101
|
+
if (store != undefined) {
|
|
102
|
+
(store as relationalStore.RdbStore).query(predicates).then((result: relationalStore.ResultSet) => {
|
|
103
|
+
resultSet = result;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (resultSet != undefined) {
|
|
107
|
+
//blobType是数据类型为blob的列名
|
|
108
|
+
const codes = (resultSet as relationalStore.ResultSet).getValue((resultSet as relationalStore.ResultSet).getColumnIndex("blobType"));
|
|
109
|
+
}
|
|
110
|
+
//变更前 codes为null。
|
|
111
|
+
//变更后 codes为长度为0的Uint8Array。
|
|
112
|
+
|
|
113
|
+
if (resultSet != undefined) {
|
|
114
|
+
const row = (resultSet as relationalStore.ResultSet).getRow();
|
|
115
|
+
}
|
|
116
|
+
//变更前 row.blobType为null。
|
|
117
|
+
//变更后 row.blobType为长度为0的Uint8Array。
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 关系型数据管理@ohos.data.relationalStore.d.ts中getRdbStore接口新增错误码14800020,用于业务侧进行恢复重建数据库
|
|
121
|
+
|
|
122
|
+
**变更原因**
|
|
123
|
+
|
|
124
|
+
根密钥和工作密钥不匹配时返回的错误码不正确,新增14800020错误码,此错误码用于业务侧进行恢复重建数据库。
|
|
125
|
+
|
|
126
|
+
**变更影响**
|
|
127
|
+
|
|
128
|
+
**说明**
|
|
129
|
+
|
|
130
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
131
|
+
|
|
132
|
+
变更前:在根密钥和工作密钥不匹配场景下,不会抛出错误码,业务侧无法恢复数据库。
|
|
133
|
+
|
|
134
|
+
变更后:在根密钥和工作密钥不匹配场景下,会抛出14800020错误码,此错误码可用于业务侧进行恢复重建数据库。
|
|
135
|
+
|
|
136
|
+
**起始API Level**
|
|
137
|
+
|
|
138
|
+
9
|
|
139
|
+
|
|
140
|
+
**变更的接口/组件**
|
|
141
|
+
|
|
142
|
+
@ohos.data.relationalStore.d.ts中如下接口:
|
|
143
|
+
|
|
144
|
+
1. function getRdbStore(context: Context, config: StoreConfig, callback: AsyncCallback<RdbStore>): void;
|
|
145
|
+
|
|
146
|
+
2. function getRdbStore(context: Context, config: StoreConfig): Promise<RdbStore>;
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
**适配指导**
|
|
150
|
+
|
|
151
|
+
异常处理:在调用getRdbStore方法后,检查返回的错误码。如果错误码为14800020,表示数据库根密钥与工作密钥不匹配,需要进行重新建库。
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
import { relationalStore } from '@kit.ArkData';
|
|
155
|
+
import { BusinessError } from '@kit.BasicServicesKit';
|
|
156
|
+
import { UIAbility } from '@kit.AbilityKit';
|
|
157
|
+
import { window } from '@kit.ArkUI';
|
|
158
|
+
|
|
159
|
+
const STORE_CONFIG: relationalStore.StoreConfig = {
|
|
160
|
+
name: "RdbTest.db",
|
|
161
|
+
securityLevel: relationalStore.SecurityLevel.S3,
|
|
162
|
+
encrypt: true
|
|
163
|
+
};
|
|
164
|
+
const CREATE_TABLE_TEST =
|
|
165
|
+
"CREATE TABLE IF NOT EXISTS EMPLOYEE (id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT NOT NULL, age INTEGER, salary REAL, blobType BLOB)";
|
|
166
|
+
|
|
167
|
+
let store: relationalStore.RdbStore | undefined = undefined;
|
|
168
|
+
relationalStore.getRdbStore(this.context, STORE_CONFIG, (err: BusinessError, rdbStore: relationalStore.RdbStore) => {
|
|
169
|
+
store = rdbStore;
|
|
170
|
+
store.executeSql(CREATE_TABLE_TEST);
|
|
171
|
+
if (err) {
|
|
172
|
+
console.error(`Get RdbStore failed, code is ${err.code},message is ${err.message}`);
|
|
173
|
+
//业务侧需要进行数据库恢复。
|
|
174
|
+
//err.code为14800020业务侧需要进行数据库恢复。
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
console.info('Get RdbStore successfully.');
|
|
178
|
+
})
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## ArkTS
|
|
182
|
+
|
|
183
|
+
### 延迟加载(lazy import)影响异步任务执行时序变更为不影响异步任务执行时序
|
|
184
|
+
|
|
185
|
+
**变更原因**
|
|
186
|
+
|
|
187
|
+
延迟加载(lazy import)特性在测试过程中发现问题,使用lazy import的变量,会改变异步任务的运行时序。
|
|
188
|
+
|
|
189
|
+
**变更影响**
|
|
190
|
+
|
|
191
|
+
此变更涉及应用适配。
|
|
192
|
+
|
|
193
|
+
变更前: 使用lazy import的变量,会改变异步任务的运行时序。
|
|
194
|
+
|
|
195
|
+
变更后: 使用lazy import的变量,不会改变异步任务的运行时序。
|
|
196
|
+
|
|
197
|
+
**起始API Level**
|
|
198
|
+
|
|
199
|
+
12
|
|
200
|
+
|
|
201
|
+
**变更的接口/组件**
|
|
202
|
+
|
|
203
|
+
不涉及
|
|
204
|
+
|
|
205
|
+
**适配指导**
|
|
206
|
+
|
|
207
|
+
排查使用lazy import变量的场景,该功能的时序可能会发生改变。
|
|
208
|
+
|
|
209
|
+
例如:
|
|
210
|
+
|
|
211
|
+
```typescript
|
|
212
|
+
// myLog.ets
|
|
213
|
+
export class MyLog {
|
|
214
|
+
static log(s:string) {
|
|
215
|
+
console.log(s);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// test.ets
|
|
220
|
+
import lazy { MyLog } from './myLog'
|
|
221
|
+
|
|
222
|
+
async function asyncFunc(f?:string): Promise<number> {
|
|
223
|
+
MyLog.log("asyncFunc start");
|
|
224
|
+
return new Promise(resolve => {
|
|
225
|
+
resolve(0);
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
export async function taskTest() {
|
|
229
|
+
MyLog.log("taskTest start");
|
|
230
|
+
asyncFunc().then((res) => {
|
|
231
|
+
MyLog.log("asyncFunc then");
|
|
232
|
+
});
|
|
233
|
+
MyLog.log("taskTest end");
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
【提示】修改之前,lazy import会影响异步任务的运行时序,该用例的输出为:
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
taskTest start
|
|
241
|
+
asyncFunc start
|
|
242
|
+
asyncFunc then
|
|
243
|
+
taskTest end
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
修复问题之后,该用例的输出为:
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
taskTest start
|
|
250
|
+
asyncFunc start
|
|
251
|
+
taskTest end
|
|
252
|
+
asyncFunc then
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
本变更修复该问题,使得lazy import不会影响异步任务运行时序。
|
|
256
|
+
|
|
257
|
+
### 执行幂运算(\*\*)当底数是1,指数是NaN或ToNumber之后是NaN的情况的返回值变更
|
|
258
|
+
|
|
259
|
+
**变更原因**
|
|
260
|
+
|
|
261
|
+
ArkTS执行幂运算时,当底数为1,指数为NaN或ToNumber之后是NaN,返回值为1,与ECMAScript® 2021 Language Specification描述不符。
|
|
262
|
+
|
|
263
|
+
**变更影响**
|
|
264
|
+
|
|
265
|
+
该变更为不兼容变更。
|
|
266
|
+
|
|
267
|
+
变更前: 执行幂运算,当底数为1,指数为NaN或ToNumber之后是NaN,返回值为1。
|
|
268
|
+
|
|
269
|
+
变更后: 执行幂运算,当底数为1,指数为NaN或ToNumber之后是NaN,返回值为NaN。
|
|
270
|
+
|
|
271
|
+
**起始API Level**
|
|
272
|
+
|
|
273
|
+
6
|
|
274
|
+
|
|
275
|
+
**变更的接口/组件**
|
|
276
|
+
|
|
277
|
+
不涉及
|
|
278
|
+
|
|
279
|
+
**适配指导**
|
|
280
|
+
|
|
281
|
+
排查是否对 \*\*(幂运算)有如下情况的使用
|
|
282
|
+
|
|
283
|
+
例如:
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
console.log((1 ** NaN).toString())
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
未变更前该用例输出为:
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
1
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
变更后该用例输出为:
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
NaN
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**说明**
|
|
302
|
+
|
|
303
|
+
对于类似 1 \*\* "test" 的用法,在ets文件中不能使用,但是可能在三方库中有使用,该行为同样会变化。
|
|
304
|
+
|
|
305
|
+
本变更修复该问题,\*\* (幂运算)对于底数是1,指数为NaN或ToNumber之后是NaN的情况会返回NaN。
|
|
306
|
+
|
|
307
|
+
### String.prototype.lastIndexOf接口查找空字符串行为变更
|
|
308
|
+
|
|
309
|
+
**变更原因**
|
|
310
|
+
|
|
311
|
+
String.prototype.lastIndexOf接口查找空字符串时返回值为-1,与ECMAScript® 2021 Language Specification描述不符。
|
|
312
|
+
|
|
313
|
+
**变更影响**
|
|
314
|
+
|
|
315
|
+
该变更为不兼容变更。
|
|
316
|
+
|
|
317
|
+
变更前:String.prototype.lastIndexOf接口查找字符串为空时返回值为-1。
|
|
318
|
+
|
|
319
|
+
变更后:String.prototype.lastIndexOf接口查找字符串为空时返回值为最后一个字符的位置加1。
|
|
320
|
+
|
|
321
|
+
**起始API Level**
|
|
322
|
+
|
|
323
|
+
6
|
|
324
|
+
|
|
325
|
+
**变更的接口/组件**
|
|
326
|
+
|
|
327
|
+
String.prototype.lastIndexOf
|
|
328
|
+
|
|
329
|
+
**适配指导**
|
|
330
|
+
|
|
331
|
+
排查是否有使用String.prototype.lastIndexOf接口查找空字符串的场景。
|
|
332
|
+
|
|
333
|
+
例如:
|
|
334
|
+
|
|
335
|
+
```
|
|
336
|
+
console.log("abcde".lastIndexOf("").toString())
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
未变更前该用例输出为:
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
-1
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
变更后该用例输出为:
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
5
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
本变更修复该问题,String.prototype.lastIndexOf查找空串的结果是最后一个字符的位置加1。
|
|
352
|
+
|
|
353
|
+
## ArkUI
|
|
354
|
+
|
|
355
|
+
### ImageAttributeModifier支持new方式创建ColorFilter对象传入colorFilter接口变更
|
|
356
|
+
|
|
357
|
+
**变更原因**
|
|
358
|
+
|
|
359
|
+
ImageAttributeModifier不支持new方式创建ColorFilter对象传入colorFilter接口,修复后即可增加colorFilter接口的支持范围,并且ColorFilter在业务代码中传递更加便捷。
|
|
360
|
+
|
|
361
|
+
**变更影响**
|
|
362
|
+
|
|
363
|
+
此变更涉及应用适配。
|
|
364
|
+
|
|
365
|
+
**说明**
|
|
366
|
+
|
|
367
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
368
|
+
|
|
369
|
+
变更前:ImageAttributeModifier不支持new方式创建ColorFilter对象传入colorFilter接口。
|
|
370
|
+
|
|
371
|
+
变更后:ImageAttributeModifier支持new方式创建ColorFilter对象传入colorFilter接口。
|
|
372
|
+
|
|
373
|
+
**起始API Level**
|
|
374
|
+
|
|
375
|
+
9
|
|
376
|
+
|
|
377
|
+
**变更的接口/组件**
|
|
378
|
+
|
|
379
|
+
ImageAttributeModifier的colorFilter接口。
|
|
380
|
+
|
|
381
|
+
**适配指导**
|
|
382
|
+
|
|
383
|
+
已知bug修复,无需适配。使用ImageAttributeModifier的colorFilter接口时,已经支持new方式创建ColorFilter对象传入接口中。示例如下:
|
|
384
|
+
|
|
385
|
+
```typescript
|
|
386
|
+
import { ImageModifier } from '@kit.ArkUI'
|
|
387
|
+
|
|
388
|
+
class SelfImageModifier extends ImageModifier {
|
|
389
|
+
applyNormalAttribute(instance: ImageAttribute): void {
|
|
390
|
+
let colorFilter = new ColorFilter([0.5, 0.5, 0.5, 0, 0.1, 0.2, 0.2, 0.2, 0, 0.1, 0.1, 0.1, 0.1, 0, 0.1, 0.8, 0.8, 0.8, 0, 0.3])
|
|
391
|
+
instance.colorFilter(colorFilter)
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
@Entry
|
|
396
|
+
@Component
|
|
397
|
+
struct ColorFilters {
|
|
398
|
+
@State modifier: ImageModifier = new SelfImageModifier()
|
|
399
|
+
|
|
400
|
+
build() {
|
|
401
|
+
Column() {
|
|
402
|
+
Image($r('app.media.startIcon'))
|
|
403
|
+
.width(100)
|
|
404
|
+
.height(100)
|
|
405
|
+
.attributeModifier(this.modifier)
|
|
406
|
+
}
|
|
407
|
+
.height('100%')
|
|
408
|
+
.width('100%')
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### 轴事件分发机制变更
|
|
414
|
+
|
|
415
|
+
**变更原因**
|
|
416
|
+
|
|
417
|
+
轴事件分发错误,开发者如果改了组件z序,组件显示、隐藏后不能正确分发到挂载轴事件的XComponent组件上。
|
|
418
|
+
|
|
419
|
+
**变更影响**
|
|
420
|
+
|
|
421
|
+
此变更涉及应用适配。
|
|
422
|
+
|
|
423
|
+
通过OH\_NativeXComponent\_RegisterUIInputEventCallback接口注册监听回调,在轴事件触发此回调时,分发机制变更。
|
|
424
|
+
|
|
425
|
+
变更前:在多层级组件堆叠场景下,zIndex属性会影响兄弟组件响应轴事件的顺序。堆叠场景下,先绑定挂载轴事件且zIndex大的组件,然后绑定挂载轴事件且zIndex小的组件,轴事件无法正常分发给挂载轴事件且zIndex较大的组件,而会分发给挂载轴事件但zIndex较小的组件。
|
|
426
|
+
|
|
427
|
+
变更后:在多层级组件堆叠场景下,zIndex属性会影响兄弟组件响应轴事件的顺序。堆叠场景下,先绑定挂载轴事件且zIndex大的组件,然后绑定挂载轴事件且zIndex小的组件,轴事件可以正常分发给挂载轴事件且zIndex较大的组件,挂载轴事件但zIndex较小的组件无法收到事件。
|
|
428
|
+
|
|
429
|
+
**起始API Level**
|
|
430
|
+
|
|
431
|
+
11
|
|
432
|
+
|
|
433
|
+
**变更的接口/组件**
|
|
434
|
+
|
|
435
|
+
[OH\_NativeXComponent\_RegisterUIInputEventCallback](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/capi-native-interface-xcomponent-h#oh_nativexcomponent_registeruiinputeventcallback)接口。
|
|
436
|
+
|
|
437
|
+
**适配指导**
|
|
438
|
+
|
|
439
|
+
默认行为变更,应注意变更后的行为是否对整体应用逻辑产生影响。
|
|
440
|
+
|
|
441
|
+
### List组件首次创建布局时,Scroller控制器的跳转方法优先级变更为高于initialIndex的优先级
|
|
442
|
+
|
|
443
|
+
**访问级别**
|
|
444
|
+
|
|
445
|
+
公开接口
|
|
446
|
+
|
|
447
|
+
**变更原因**
|
|
448
|
+
|
|
449
|
+
**说明**
|
|
450
|
+
|
|
451
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
452
|
+
|
|
453
|
+
initialIndex仅支持设定起始index,并默认将列表头部对齐,这使得开发者无法自定义对齐策略。scrollToIndex允许指定index与对齐方式,然而其效果会被initialIndex覆盖。因此,需要提升scrollToIndex的优先级,使其高于initialIndex。这样一来,在组件初次布局时,如果开发者希望设定起始index并同时指定对齐方式,即可通过使用scrollToIndex来达成目标。
|
|
454
|
+
|
|
455
|
+
**变更影响**
|
|
456
|
+
|
|
457
|
+
此变更涉及应用适配。
|
|
458
|
+
|
|
459
|
+
场景1:List设置initialIndex为0(默认也是0),并在首次布局前调用scrollToIndex(1)。
|
|
460
|
+
|
|
461
|
+
| 变更前 | 变更后 |
|
|
462
|
+
| --- | --- |
|
|
463
|
+
| List首次布局将从index为0的ListItem开始布局。 | List首次布局将从index为1的ListItem开始布局。 |
|
|
464
|
+
|
|
465
|
+
场景2:List设置initialIndex为0(默认也是0),并在首次布局前调用scrollEdge(Edge.Bottom)。
|
|
466
|
+
|
|
467
|
+
| 变更前 | 变更后 |
|
|
468
|
+
| --- | --- |
|
|
469
|
+
| List首次布局将展示在顶部,即index为0的ListItem处于顶部。 | List首次布局将展示在底部,即index为最大值的ListItem处于底部。 |
|
|
470
|
+
|
|
471
|
+
**起始API Level**
|
|
472
|
+
|
|
473
|
+
7
|
|
474
|
+
|
|
475
|
+
**变更的接口/组件**
|
|
476
|
+
|
|
477
|
+
List组件的initialIndex接口和Scroller控制器的跳转接口(scrollToIndex、scrollToItemInGroup和scrollEdge)。
|
|
478
|
+
|
|
479
|
+
**适配指导**
|
|
480
|
+
|
|
481
|
+
需要对使用List组件的页面进行排查,检查是否在onAppear或其他List组件首次布局之前的阶段,同时设置了initialIndex并调用了scrollToIndex,、scrollToItemInGroup或scrollEdge接口。在变更后,initialIndex的生效优先级将低于scrollToIndex、scrollToItemInGroup或scrollEdge的优先级。
|
|
482
|
+
|
|
483
|
+
### Image组件的borderRadius接口支持动态修改
|
|
484
|
+
|
|
485
|
+
**变更原因**
|
|
486
|
+
|
|
487
|
+
为了增强功能的灵活性,Image组件的borderRadius接口支持动态修改。动态修改可以实时更新borderRadius的值,灵活地调整图片的圆角效果。例如,可根据用户交互或状态变化即时改变圆角半径。
|
|
488
|
+
|
|
489
|
+
**变更影响**
|
|
490
|
+
|
|
491
|
+
此变更涉及应用适配。
|
|
492
|
+
|
|
493
|
+
**说明**
|
|
494
|
+
|
|
495
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
496
|
+
|
|
497
|
+
变更前:Image组件的borderRadius接口动态修改不生效。
|
|
498
|
+
|
|
499
|
+
变更后:Image组件的borderRadius接口动态修改生效。
|
|
500
|
+
|
|
501
|
+
| 变更前 | 变更后 |
|
|
502
|
+
| --- | --- |
|
|
503
|
+
|  |  |
|
|
504
|
+
|
|
505
|
+
```
|
|
506
|
+
// xxx.ets
|
|
507
|
+
@Entry
|
|
508
|
+
@Component
|
|
509
|
+
struct Index {
|
|
510
|
+
@State borderRadiusValue: number = 10;
|
|
511
|
+
build() {
|
|
512
|
+
Column() {
|
|
513
|
+
Text("BorderRadiusValue = " + this.borderRadiusValue)
|
|
514
|
+
.height(100)
|
|
515
|
+
.width(200)
|
|
516
|
+
.fontSize(FontWeight.Bold)
|
|
517
|
+
Image($r("app.media.sky"))
|
|
518
|
+
.height(300)
|
|
519
|
+
.width(300)
|
|
520
|
+
.borderRadius(this.borderRadiusValue)
|
|
521
|
+
Button("增加BorderRadius")
|
|
522
|
+
.onClick(()=>{
|
|
523
|
+
this.borderRadiusValue += 10
|
|
524
|
+
})
|
|
525
|
+
}
|
|
526
|
+
.height('100%')
|
|
527
|
+
.width('100%')
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
**起始API Level**
|
|
533
|
+
|
|
534
|
+
7
|
|
535
|
+
|
|
536
|
+
**变更的接口/组件**
|
|
537
|
+
|
|
538
|
+
Image组件的borderRadius接口。
|
|
539
|
+
|
|
540
|
+
**适配指导**
|
|
541
|
+
|
|
542
|
+
如果应用需要动态修改borderRadius接口,可以在运行时灵活调整圆角效果以响应用户交互或其他状态变化。
|
|
543
|
+
|
|
544
|
+
如果应用不需要动态修改borderRadius接口,例如:避免在运行时改变圆角效果。borderRadius接口的参数建议设置为固定值,例如:borderRadius('5px')。
|
|
545
|
+
|
|
546
|
+
### RichEditor(富文本)在光标处于文本起始位置情况时向前删除空文本onWillChange回调变更
|
|
547
|
+
|
|
548
|
+
**变更原因**
|
|
549
|
+
|
|
550
|
+
RichEditorController构造的富文本:光标位于文本起始位置时向前删除,触发onWillChange回调范围是\[-1, -1\],不符合接口定义。
|
|
551
|
+
|
|
552
|
+
RichEditorStyledStringController构造的富文本:光标位于文本起始位置时向前删除,触发onWillChange回调范围是\[0, 1\],不符合接口定义。
|
|
553
|
+
|
|
554
|
+
**变更影响**
|
|
555
|
+
|
|
556
|
+
此变更涉及应用适配。
|
|
557
|
+
|
|
558
|
+
**说明**
|
|
559
|
+
|
|
560
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
561
|
+
|
|
562
|
+
| 组件 | 变更前 | 变更后 |
|
|
563
|
+
| --- | --- | --- |
|
|
564
|
+
| RichEditorController构造的富文本 | 光标位于文本起始位置时向前删除,触发onWillChange回调范围是[-1, -1]。 | 光标位于文本起始位置时向前删除,触发onWillChange回调范围是[0, 0]。 |
|
|
565
|
+
| RichEditorStyledStringController构造的富文本 | 光标位于文本起始位置时向前删除,触发onWillChange回调范围是[0, 1]。 | 光标位于文本起始位置时向前删除,触发onWillChange回调范围是[0, 0]。 |
|
|
566
|
+
|
|
567
|
+
**起始API Level**
|
|
568
|
+
|
|
569
|
+
12
|
|
570
|
+
|
|
571
|
+
**变更的接口/组件**
|
|
572
|
+
|
|
573
|
+
RichEditor
|
|
574
|
+
|
|
575
|
+
**适配指导**
|
|
576
|
+
|
|
577
|
+
默认行为变更,应注意变更后的行为是否对整体应用逻辑产生影响。
|
|
578
|
+
|
|
579
|
+
### 修复zIndex接口会影响组件在3D变换中的透视效果的错误行为
|
|
580
|
+
|
|
581
|
+
**变更原因**
|
|
582
|
+
|
|
583
|
+
zIndex接口在3D变换场景与translateZ耦合,导致zIndex值的改变会影响3D变换时的透视效果。
|
|
584
|
+
|
|
585
|
+
**变更影响**
|
|
586
|
+
|
|
587
|
+
此变更涉及应用适配。
|
|
588
|
+
|
|
589
|
+
**说明**
|
|
590
|
+
|
|
591
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
592
|
+
|
|
593
|
+
变更前:开发者在3D变换中使用zIndex接口,zIndex接口的数值会影响近大远小的透视效果。
|
|
594
|
+
|
|
595
|
+
变更后:开发者在3D变换中使用zIndex接口,zIndex接口的数值不会影响近大远小的透视效果。
|
|
596
|
+
|
|
597
|
+
设置组件绕y轴旋转45度,同时设置zIndex值为200,变更前后效果如下:
|
|
598
|
+
|
|
599
|
+
| 变更前 | 变更后 |
|
|
600
|
+
| --- | --- |
|
|
601
|
+
|  |  |
|
|
602
|
+
|
|
603
|
+
**起始API Level**
|
|
604
|
+
|
|
605
|
+
7
|
|
606
|
+
|
|
607
|
+
**变更的接口/组件**
|
|
608
|
+
|
|
609
|
+
zIndex接口
|
|
610
|
+
|
|
611
|
+
**适配指导**
|
|
612
|
+
|
|
613
|
+
如仍需要实现变更前近大远小的透视效果,可以使用translate接口并设置z向平移实现近大远小的透视效果,示例代码如下:
|
|
614
|
+
|
|
615
|
+
```
|
|
616
|
+
@Entry
|
|
617
|
+
@Preview
|
|
618
|
+
@Component
|
|
619
|
+
struct zIndexTest {
|
|
620
|
+
build() {
|
|
621
|
+
Column() {
|
|
622
|
+
Stack() {
|
|
623
|
+
Column()
|
|
624
|
+
.backgroundColor("rgb(213, 213, 213)")
|
|
625
|
+
.width('600px')
|
|
626
|
+
.height('600px')
|
|
627
|
+
Column()
|
|
628
|
+
.backgroundColor("rgb(0, 74, 175)")
|
|
629
|
+
.width('600px')
|
|
630
|
+
.height('600px')
|
|
631
|
+
.rotate({
|
|
632
|
+
y: 1,
|
|
633
|
+
angle: 45
|
|
634
|
+
})
|
|
635
|
+
.translate({ x: 0, y: 0, z: 66 }) // 使用translate接口并设置Z向移动,实现3D变换中的近大远小透视效果
|
|
636
|
+
}.margin({ top: 80 })
|
|
637
|
+
}
|
|
638
|
+
.width('100%')
|
|
639
|
+
.height('100%')
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
实现效果如下图所示:
|
|
645
|
+
|
|
646
|
+

|
|
647
|
+
|
|
648
|
+
### 屏幕Display对象rotation和orientation属性变更
|
|
649
|
+
|
|
650
|
+
**变更原因**
|
|
651
|
+
|
|
652
|
+
手机、平板等不同设备,电子器件贴片方向具有差异,传感器自然方向与屏幕的物理方向具有偏差,导致平板上屏幕Display对象中的rotation和orientation的变化方向和手机不统一,给用户带来困扰,需要针对设备类型做特殊处理,影响使用。
|
|
653
|
+
|
|
654
|
+
**变更影响**
|
|
655
|
+
|
|
656
|
+
此变更涉及应用适配。
|
|
657
|
+
|
|
658
|
+
**说明**
|
|
659
|
+
|
|
660
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
661
|
+
|
|
662
|
+
变更后平板上获取屏幕的横竖屏状态时,方向会与更改前不同,与手机保持一致。
|
|
663
|
+
|
|
664
|
+
变更前后对比效果,如下图所示:
|
|
665
|
+
|
|
666
|
+
| 设备旋转方向 | 平板变更前 | 平板变更后 | 手机 |
|
|
667
|
+
| --- | --- | --- | --- |
|
|
668
|
+
|  | rotation: 1orientation: 0 | rotation: 0orientation: 0 | rotation: 0orientation: 0 |
|
|
669
|
+
|  | rotation: 2orientation: 3 | rotation: 1orientation: 1 | rotation: 1orientation: 1 |
|
|
670
|
+
|  | rotation: 3orientation: 2 | rotation: 2orientation: 2 | rotation: 2orientation: 2 |
|
|
671
|
+
|  | rotation: 0orientation: 1 | rotation: 3orientation: 3 | rotation: 3orientation: 3 |
|
|
672
|
+
|
|
673
|
+
**起始API Level**
|
|
674
|
+
|
|
675
|
+
7
|
|
676
|
+
|
|
677
|
+
**变更的接口/组件**
|
|
678
|
+
|
|
679
|
+
@ohos.display.d.ts文件中屏幕Display对象的rotation和orientation属性。
|
|
680
|
+
|
|
681
|
+
**适配指导**
|
|
682
|
+
|
|
683
|
+
平板上监听横竖屏状态变更:
|
|
684
|
+
|
|
685
|
+
业务方通过display.on('change')监听屏幕属性变化,从Display对象获取的rotation、orientation值。业务方如果在平板上判断rotation、orientation是否为某个横竖屏状态再处理相应业务,需要注意该值的变更。
|
|
686
|
+
|
|
687
|
+
以充电口朝下方向(此时rotation为0)为准,顺时针旋转0、90、180、270度,平板设备上对应的rotation和orientation对照表如下所示:
|
|
688
|
+
|
|
689
|
+
| 顺时针旋转角度 | rotation变更前 | rotation变更后 | orientation变更前 | orientation变更后 |
|
|
690
|
+
| --- | --- | --- | --- | --- |
|
|
691
|
+
| 0 | 1 | 0 | 0 | 0 |
|
|
692
|
+
| 90 | 2 | 1 | 3 | 1 |
|
|
693
|
+
| 180 | 3 | 2 | 2 | 2 |
|
|
694
|
+
| 270 | 0 | 3 | 1 | 3 |
|
|
695
|
+
|
|
696
|
+
### @ohos.arkui.uiExtension中uiExtension命名空间下新增properties必选属性
|
|
697
|
+
|
|
698
|
+
**变更原因**
|
|
699
|
+
|
|
700
|
+
[EmbeddedComponent](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/ts-container-embedded-component)所在的应用窗口移动的场景下,无法获取该组件的大小和位置信息,不满足开发者业务诉求。
|
|
701
|
+
|
|
702
|
+
**变更影响**
|
|
703
|
+
|
|
704
|
+
此变更涉及应用适配。
|
|
705
|
+
|
|
706
|
+
变更前:uiExtension命名空间下的WindowProxy无必选属性properties。
|
|
707
|
+
|
|
708
|
+
变更后:uiExtension命名空间下的WindowProxy有必选属性properties。
|
|
709
|
+
|
|
710
|
+
**起始API Level**
|
|
711
|
+
|
|
712
|
+
14
|
|
713
|
+
|
|
714
|
+
**变更的接口/组件**
|
|
715
|
+
|
|
716
|
+
WindowProxy的properties属性
|
|
717
|
+
|
|
718
|
+
**适配指导**
|
|
719
|
+
|
|
720
|
+
升级到API14后,如果应用在自己的业务中实现WindowProxy这个Interface,则需要在自定义的实现中新增必选属性properties。
|
|
721
|
+
|
|
722
|
+
### Navigation的menus接口、NavDestination的title和menus接口支持Resource类型资源
|
|
723
|
+
|
|
724
|
+
**变更原因**
|
|
725
|
+
|
|
726
|
+
基础能力增强,Navigationd的menus接口、NavDestination的title和menus接口支持Resource类型资源。
|
|
727
|
+
|
|
728
|
+
**变更影响**
|
|
729
|
+
|
|
730
|
+
由于NavigationMenuItem变量类型变更为 string | Resource,不再与单一变量类型string相匹配,因此将NavigationMenuItem赋值给一个string类型变量,程序会编译报错。
|
|
731
|
+
|
|
732
|
+
```
|
|
733
|
+
const myIcon: NavigationMenuItem = { value: "图标", icon: "https://example.png"}
|
|
734
|
+
const myString: string = myIcon.value
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
**起始API Level**
|
|
738
|
+
|
|
739
|
+
9
|
|
740
|
+
|
|
741
|
+
**变更的接口/组件**
|
|
742
|
+
|
|
743
|
+
Navigation的menus接口、NavDestination的title和menus接口
|
|
744
|
+
|
|
745
|
+
**适配指导**
|
|
746
|
+
|
|
747
|
+
```
|
|
748
|
+
// navigation.ets
|
|
749
|
+
// 使用resource类型资源赋值给Navigation/NavDestination的title及menu接口
|
|
750
|
+
Navigation() {
|
|
751
|
+
// xxx
|
|
752
|
+
}
|
|
753
|
+
// $r('app.string.MyTestNavigationTitle')需要替换为开发者所需的资源文件
|
|
754
|
+
.title($r('app.string.MyTestNavigationTitle')) // 可直接将resource类型资源传递给title接口
|
|
755
|
+
// menus内的item设置可直接支持resource类型资源
|
|
756
|
+
.menus([
|
|
757
|
+
{
|
|
758
|
+
// $r("app.string.MyTestMenuValue1")和$r("app.media.1")需要替换为开发者所需的资源文件
|
|
759
|
+
value: $r("app.string.MyTestMenuValue1"),
|
|
760
|
+
icon: $r("app.media.1")
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
// $r("app.string.MyTestMenuValue2")和$r("app.media.2")需要替换为开发者所需的资源文件
|
|
764
|
+
value: $r("app.string.MyTestMenuValue2"),
|
|
765
|
+
icon: $r("app.media.2")
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
// $r("app.string.MyTestMenuValue3")和$r("app.media.3")需要替换为开发者所需的资源文件
|
|
769
|
+
value: $r("app.string.MyTestMenuValue3"),
|
|
770
|
+
icon: $r("app.media.3")
|
|
771
|
+
}
|
|
772
|
+
])
|
|
773
|
+
```
|
|
774
|
+
```
|
|
775
|
+
// navDestination.ets
|
|
776
|
+
// Navigation及NavDestination的CommonTitle类型,支持设置resource资源
|
|
777
|
+
// 需要替换为开发者所需的资源文件
|
|
778
|
+
@State commonTitle: NavDestinationCommonTitle = { main: $r('app.string.MyTestNavigationTitle'), sub: $r('app.string.MyTestNavigationTitle')}
|
|
779
|
+
NavDestination() {
|
|
780
|
+
// xxx
|
|
781
|
+
}
|
|
782
|
+
.menus([
|
|
783
|
+
{
|
|
784
|
+
// $r("app.string.MyTestMenuValue1")和$r("app.media.4")需要替换为开发者所需的资源文件
|
|
785
|
+
value: $r("app.string.MyTestMenuValue1"),
|
|
786
|
+
icon: $r("app.media.4")
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
// $r("app.string.MyTestMenuValue2")和$r("app.media.5")需要替换为开发者所需的资源文件
|
|
790
|
+
value: $r("app.string.MyTestMenuValue2"),
|
|
791
|
+
icon: $r("app.media.5")
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
// $r("app.string.MyTestMenuValue3")和$r("app.media.6")需要替换为开发者所需的资源文件
|
|
795
|
+
value: $r("app.string.MyTestMenuValue3"),
|
|
796
|
+
icon: $r("app.media.6")
|
|
797
|
+
}
|
|
798
|
+
])
|
|
799
|
+
.title(this.commonTitle)
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
### 在PC/2in1设备上getWindowStatus和on('windowStatusChange')接口在窗口最大化状态返回值变更
|
|
803
|
+
|
|
804
|
+
**变更原因**
|
|
805
|
+
|
|
806
|
+
getWindowStatus和on('windowStatusChange')接口在最大化状态返回值为WindowStatusType::FULL\_SCREEN,与实际情况不符合。
|
|
807
|
+
|
|
808
|
+
应用无法直接通过这两个接口在PC/2in1设备上区分当前最大化和全屏状态,与接口功能设计不符合。
|
|
809
|
+
|
|
810
|
+
**变更影响**
|
|
811
|
+
|
|
812
|
+
**说明**
|
|
813
|
+
|
|
814
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
815
|
+
|
|
816
|
+
变更前:PC/2in1设备上调用getWindowStatus和on('windowStatusChange')接口,在最大化状态返回值为WindowStatusType::FULL\_SCREEN。
|
|
817
|
+
|
|
818
|
+
变更后:PC/2in1设备上调用getWindowStatus和on('windowStatusChange')接口,在最大化状态返回值为WindowStatusType::MAXIMIZE。
|
|
819
|
+
|
|
820
|
+
**起始API Level**
|
|
821
|
+
|
|
822
|
+
on('windowStatusChange'):11
|
|
823
|
+
|
|
824
|
+
getWindowStatus:12
|
|
825
|
+
|
|
826
|
+
**变更的接口/组件**
|
|
827
|
+
|
|
828
|
+
@ohos.window.d.ts
|
|
829
|
+
|
|
830
|
+
系统能力:SystemCapability.Window.SessionManager
|
|
831
|
+
|
|
832
|
+
接口:getWindowStatus、on('windowStatusChange')
|
|
833
|
+
|
|
834
|
+
**适配指导**
|
|
835
|
+
|
|
836
|
+
针对PC/2in1设备上想要区分当前窗口最大化状态和全屏状态的场景,在变更前后的实现方案分别如下:
|
|
837
|
+
|
|
838
|
+
- API version 13及之前的版本,可以在窗口状态为WindowStatusType::FULL\_SCREEN的情况下,再调用[getImmersiveModeEnabledState()](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-apis-window-window#getimmersivemodeenabledstate12)接口进行进一步判断,到底是最大化状态还是全屏状态。若接口返回true则表示当前窗口为全屏状态,若接口返回false则表示当前窗口为最大化状态。
|
|
839
|
+
|
|
840
|
+
- API version 14及之后的版本,可以直接调用getWindowStatus、on('windowStatusChange')接口区分窗口最大化和全屏状态。
|
|
841
|
+
|
|
842
|
+
不过需要注意返回值的变更和代码适配:若应用针对WindowStatusType::FULL\_SCREEN和WindowStatusType::MAXIMIZE状态的代码处理逻辑相同,则在对应的逻辑处理时,直接追加WindowStatusType::MAXIMIZE判断条件(条件或)即可;若应用针对WindowStatusType::FULL\_SCREEN和WindowStatusType::MAXIMIZE状态有不同的处理逻辑,则需要增加新的WindowStatusType::MAXIMIZE条件判断分支中进行窗口最大化状态相关逻辑的处理。
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
以下示例以on('windowStatusChange')接口为例,提供变更前后PC/2in1设备上区分当前窗口最大化状态和全屏状态的指导和适配示例:
|
|
846
|
+
|
|
847
|
+
API version 13及之前版本区分最大化状态示例:
|
|
848
|
+
|
|
849
|
+
```typescript
|
|
850
|
+
// EntryAbility.ets
|
|
851
|
+
import { BusinessError } from '@kit.BasicServicesKit';
|
|
852
|
+
|
|
853
|
+
export default class EntryAbility extends UIAbility {
|
|
854
|
+
// ...
|
|
855
|
+
onWindowStageCreate(windowStage: window.WindowStage) {
|
|
856
|
+
console.info('onWindowStageCreate');
|
|
857
|
+
try {
|
|
858
|
+
let windowClass = windowStage.getMainWindowSync();
|
|
859
|
+
windowClass?.on("windowStatusChange", (windowStatusType: window.WindowStatusType) => {
|
|
860
|
+
if (windowStatusType == window.WindowStatusType.FULL_SCREEN) {
|
|
861
|
+
// isFullScreen 为true 表示全屏,为false 表示最大化
|
|
862
|
+
let isFullScreen: boolean = windowClass.getImmersiveModeEnabledState();
|
|
863
|
+
} else {
|
|
864
|
+
// ...
|
|
865
|
+
}
|
|
866
|
+
})
|
|
867
|
+
} catch (exception) {
|
|
868
|
+
console.error(`Failed to obtain the main window. Cause code: ${exception.code}, message: ${exception.message}`);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
API version 14版本区分最大化状态示例:
|
|
875
|
+
|
|
876
|
+
```typescript
|
|
877
|
+
// EntryAbility.ets
|
|
878
|
+
import { BusinessError } from '@kit.BasicServicesKit';
|
|
879
|
+
|
|
880
|
+
export default class EntryAbility extends UIAbility {
|
|
881
|
+
// ...
|
|
882
|
+
onWindowStageCreate(windowStage: window.WindowStage) {
|
|
883
|
+
console.info('onWindowStageCreate');
|
|
884
|
+
try {
|
|
885
|
+
let windowClass = windowStage.getMainWindowSync();
|
|
886
|
+
windowClass?.on("windowStatusChange", (windowStatusType: window.WindowStatusType) => {
|
|
887
|
+
// 应用对于窗口全屏和最大化状态的处理逻辑不同,新增window.WindowStatusType.MAXIMIZE的判断分支
|
|
888
|
+
if (windowStatusType == window.WindowStatusType.FULL_SCREEN) {
|
|
889
|
+
// ....
|
|
890
|
+
} else if (windowStatusType == window.WindowStatusType.MAXIMIZE) {
|
|
891
|
+
// ...
|
|
892
|
+
} else {
|
|
893
|
+
// ...
|
|
894
|
+
}
|
|
895
|
+
})
|
|
896
|
+
} catch (exception) {
|
|
897
|
+
console.error(`Failed to obtain the main window. Cause code: ${exception.code}, message: ${exception.message}`);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
```
|
|
902
|
+
|
|
903
|
+
API version 14版本不区分最大化状态示例:
|
|
904
|
+
|
|
905
|
+
```typescript
|
|
906
|
+
// EntryAbility.ets
|
|
907
|
+
import { BusinessError } from '@kit.BasicServicesKit';
|
|
908
|
+
|
|
909
|
+
export default class EntryAbility extends UIAbility {
|
|
910
|
+
// ...
|
|
911
|
+
onWindowStageCreate(windowStage: window.WindowStage) {
|
|
912
|
+
console.info('onWindowStageCreate');
|
|
913
|
+
try {
|
|
914
|
+
let windowClass = windowStage.getMainWindowSync();
|
|
915
|
+
windowClass?.on("windowStatusChange", (windowStatusType: window.WindowStatusType) => {
|
|
916
|
+
// 应用对于窗口全屏和最大化状态的处理逻辑相同,直接在判断时新增针对window.WindowStatusType.MAXIMIZE的或条件
|
|
917
|
+
if (windowStatusType == window.WindowStatusType.FULL_SCREEN ||
|
|
918
|
+
windowStatusType == window.WindowStatusType.MAXIMIZE) {
|
|
919
|
+
// ....
|
|
920
|
+
} else {
|
|
921
|
+
// ...
|
|
922
|
+
}
|
|
923
|
+
})
|
|
924
|
+
} catch (exception) {
|
|
925
|
+
console.error(`Failed to obtain the main window. Cause code: ${exception.code}, message: ${exception.message}`);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
```
|
|
930
|
+
|
|
931
|
+
### setWindowLayoutFullScreen、setImmersiveModeEnabledState接口在PC/2in1设备的自由多窗模式上禁用
|
|
932
|
+
|
|
933
|
+
**变更原因**
|
|
934
|
+
|
|
935
|
+
因为phone设备上的沉浸式是应用布局全屏且窗口与系统状态栏与导航条交叠,而PC/2in1设备上的沉浸式是应用布局全屏且隐藏系统状态栏和Dock栏,行为与phone设备不一致。所以在PC/2in1设备的自由多窗模式上禁用setWindowLayoutFullScreen、setImmersiveModeEnabledState接口,只能调用maximize接口设置进入/退出沉浸式,在进入最大化时通过maximize接口的入参控制状态栏和Dock栏的隐藏/显示状态。
|
|
936
|
+
|
|
937
|
+
**变更影响**
|
|
938
|
+
|
|
939
|
+
变更前:PC/2in1设备的自由多窗模式上调用setWindowLayoutFullScreen、setImmersiveModeEnabledState接口,窗口进入/退出沉浸式。
|
|
940
|
+
|
|
941
|
+
变更后:PC/2in1设备的自由多窗模式上调用setWindowLayoutFullScreen、setImmersiveModeEnabledState接口不生效。
|
|
942
|
+
|
|
943
|
+
**起始API Level**
|
|
944
|
+
|
|
945
|
+
- setWindowLayoutFullScreen:9
|
|
946
|
+
- setImmersiveModeEnabledState:12
|
|
947
|
+
|
|
948
|
+
**变更的接口/组件**
|
|
949
|
+
|
|
950
|
+
@ohos.window.d.ts
|
|
951
|
+
|
|
952
|
+
系统能力:SystemCapability.Window.SessionManager
|
|
953
|
+
|
|
954
|
+
接口:setWindowLayoutFullScreen、setImmersiveModeEnabledState
|
|
955
|
+
|
|
956
|
+
**适配指导**
|
|
957
|
+
|
|
958
|
+
PC/2in1设备的自由多窗模式上需要调用[maximize](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-apis-window-window#maximize12)接口实现窗口沉浸式状态设置。
|
|
959
|
+
|
|
960
|
+
当调用[setWindowLayoutFullScreen](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-apis-window-window#setwindowlayoutfullscreen9)接口时,建议同时调用setWindowLayoutFullScreen和maximize接口。
|
|
961
|
+
|
|
962
|
+
当调用[setImmersiveModeEnabledState](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-apis-window-window#setimmersivemodeenabledstate12)接口时,建议同时调用setImmersiveModeEnabledState和maximize接口。
|
|
963
|
+
|
|
964
|
+
示例:
|
|
965
|
+
|
|
966
|
+
```typescript
|
|
967
|
+
// EntryAbility.ets
|
|
968
|
+
import { BusinessError } from '@kit.BasicServicesKit';
|
|
969
|
+
|
|
970
|
+
export default class EntryAbility extends UIAbility {
|
|
971
|
+
// ...
|
|
972
|
+
onWindowStageCreate(windowStage: window.WindowStage): void {
|
|
973
|
+
console.info('onWindowStageCreate');
|
|
974
|
+
let windowClass: window.Window | undefined = undefined;
|
|
975
|
+
windowStage.getMainWindow((err: BusinessError, data) => {
|
|
976
|
+
const errCode: number = err.code;
|
|
977
|
+
if (errCode) {
|
|
978
|
+
console.error(`Failed to obtain the main window. Cause code: ${err.code}, message: ${err.message}`);
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
windowClass = data;
|
|
982
|
+
let isLayoutFullScreen = true;
|
|
983
|
+
try {
|
|
984
|
+
let promise = windowClass.setWindowLayoutFullScreen(isLayoutFullScreen);
|
|
985
|
+
promise.then(() => {
|
|
986
|
+
console.info('Succeeded in setting the window layout to full-screen mode.');
|
|
987
|
+
}).catch((err: BusinessError) => {
|
|
988
|
+
console.error(`Failed to set the window layout to full-screen mode. Cause code: ${err.code}, message: ${err.message}`);
|
|
989
|
+
});
|
|
990
|
+
} catch (exception) {
|
|
991
|
+
console.error(`Failed to set the window layout to full-screen mode. Cause code: ${exception.code}, message: ${exception.message}`);
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
try {
|
|
995
|
+
let promise = windowClass.maximize(window.MaximizePresentation.ENTER_IMMERSIVE);
|
|
996
|
+
promise.then(() => {
|
|
997
|
+
console.info('Succeeded in maximizing the window.');
|
|
998
|
+
}).catch((err: BusinessError) => {
|
|
999
|
+
console.error(`Failed to maximize the window. Cause code: ${err.code}, message: ${err.message}`);
|
|
1000
|
+
});
|
|
1001
|
+
} catch (exception) {
|
|
1002
|
+
console.error(`Failed to maximize the window. Cause code: ${exception.code}, message: ${exception.message}`);
|
|
1003
|
+
}
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
```
|
|
1008
|
+
```typescript
|
|
1009
|
+
// EntryAbility.ets
|
|
1010
|
+
import { BusinessError } from '@kit.BasicServicesKit';
|
|
1011
|
+
|
|
1012
|
+
export default class EntryAbility extends UIAbility {
|
|
1013
|
+
// ...
|
|
1014
|
+
onWindowStageCreate(windowStage: window.WindowStage): void {
|
|
1015
|
+
console.info('onWindowStageCreate');
|
|
1016
|
+
let windowClass: window.Window | undefined = undefined;
|
|
1017
|
+
windowStage.getMainWindow((err: BusinessError, data) => {
|
|
1018
|
+
const errCode: number = err.code;
|
|
1019
|
+
if (errCode) {
|
|
1020
|
+
console.error(`Failed to obtain the main window. Cause code: ${err.code}, message: ${err.message}`);
|
|
1021
|
+
return;
|
|
1022
|
+
}
|
|
1023
|
+
windowClass = data;
|
|
1024
|
+
try {
|
|
1025
|
+
let enabled = true;
|
|
1026
|
+
windowClass.setImmersiveModeEnabledState(enabled);
|
|
1027
|
+
} catch (exception) {
|
|
1028
|
+
console.error(`Failed to set the window immersive mode enabled status. Cause code: ${exception.code}, message: ${exception.message}`);
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
try {
|
|
1032
|
+
let promise = windowClass.maximize(window.MaximizePresentation.ENTER_IMMERSIVE);
|
|
1033
|
+
promise.then(() => {
|
|
1034
|
+
console.info('Succeeded in maximizing the window.');
|
|
1035
|
+
}).catch((err: BusinessError) => {
|
|
1036
|
+
console.error(`Failed to maximize the window. Cause code: ${err.code}, message: ${err.message}`);
|
|
1037
|
+
});
|
|
1038
|
+
} catch (exception) {
|
|
1039
|
+
console.error(`Failed to maximize the window. Cause code: ${exception.code}, message: ${exception.message}`);
|
|
1040
|
+
}
|
|
1041
|
+
});
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
```
|
|
1045
|
+
|
|
1046
|
+
### setWindowBrightness在PC/2in1设备的行为变更
|
|
1047
|
+
|
|
1048
|
+
**变更原因**
|
|
1049
|
+
|
|
1050
|
+
PC/2in1设备下,在视频播放页面,通过快捷键调节屏幕亮度不生效,原因是快捷键调节系统亮度,而在视频播放页面屏幕亮度跟随窗口亮度值。
|
|
1051
|
+
|
|
1052
|
+
**变更影响**
|
|
1053
|
+
|
|
1054
|
+
变更前:PC/2in1设备下,窗口设置屏幕亮度生效时,控制中心和快捷键不可以调整系统屏幕亮度,窗口恢复默认系统亮度之后,控制中心和快捷键可以调整屏幕亮度。
|
|
1055
|
+
|
|
1056
|
+
变更后:PC/2in1设备下,窗口设置屏幕亮度生效时,控制中心和快捷键也可以调整系统屏幕亮度。
|
|
1057
|
+
|
|
1058
|
+
**起始API Level**
|
|
1059
|
+
|
|
1060
|
+
9
|
|
1061
|
+
|
|
1062
|
+
**变更的接口/组件**
|
|
1063
|
+
|
|
1064
|
+
@ohos.window.d.ts
|
|
1065
|
+
|
|
1066
|
+
setWindowBrightness接口
|
|
1067
|
+
|
|
1068
|
+
**适配指导**
|
|
1069
|
+
|
|
1070
|
+
默认行为变更,无需适配。
|
|
1071
|
+
|
|
1072
|
+
## Basic Service Kit
|
|
1073
|
+
|
|
1074
|
+
### setAppAccess错误码变更
|
|
1075
|
+
|
|
1076
|
+
**变更原因**
|
|
1077
|
+
|
|
1078
|
+
为防止资源浪费,禁止应用无限制地通过调用该接口授予三方应用权限,当授权应用数量超过1024个时,返回新增的错误码(12400005)。
|
|
1079
|
+
|
|
1080
|
+
**变更影响**
|
|
1081
|
+
|
|
1082
|
+
此变更涉及应用适配。
|
|
1083
|
+
|
|
1084
|
+
变更前:setAppAccess传入的第三方应用包名未安装时,返回错误码12400001提示应用未找到。
|
|
1085
|
+
|
|
1086
|
+
变更后:setAppAccess传入的第三方应用包名未安装时,当已授权的应用列表未超过限制数量时返回成功,当已授权的应用列表超过了限制数量,返回错误码12400005提示授权应用数量超过了上限。
|
|
1087
|
+
|
|
1088
|
+
**起始API Level**
|
|
1089
|
+
|
|
1090
|
+
9
|
|
1091
|
+
|
|
1092
|
+
**变更的接口/组件**
|
|
1093
|
+
|
|
1094
|
+
@ohos.account.appAccount.d.ts中如下接口:
|
|
1095
|
+
|
|
1096
|
+
- setAppAccess(name: string, bundleName: string, isAccessible: boolean, callback: AsyncCallback<void>): void
|
|
1097
|
+
|
|
1098
|
+
- setAppAccess(name: string, bundleName: string, isAccessible: boolean): Promise<void>
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
**适配指导**
|
|
1102
|
+
|
|
1103
|
+
调用setAppAccess接口新增12400005错误码,示例如下:
|
|
1104
|
+
|
|
1105
|
+
```typescript
|
|
1106
|
+
import { BusinessError } from '@ohos.base';
|
|
1107
|
+
import account_appAccount from '@ohos.account.appAccount';
|
|
1108
|
+
|
|
1109
|
+
let appAccountManager: account_appAccount.AppAccountManager = account_appAccount.createAppAccountManager();
|
|
1110
|
+
|
|
1111
|
+
try {
|
|
1112
|
+
appAccountManager.setAppAccess('ZhangSan', 'com.example.accountjsdemo', true, (err: BusinessError) => {
|
|
1113
|
+
if (err.code === 12400005) {
|
|
1114
|
+
//处理授权应用数量超过上限异常,比如对之前已授权的应用取消授权
|
|
1115
|
+
} else if (err) {
|
|
1116
|
+
console.log('setAppAccess failed: ' + JSON.stringify(err));
|
|
1117
|
+
} else {
|
|
1118
|
+
console.log('setAppAccess successfully');
|
|
1119
|
+
}
|
|
1120
|
+
});
|
|
1121
|
+
} catch (err) {
|
|
1122
|
+
console.log('setAppAccess exception: ' + JSON.stringify(err));
|
|
1123
|
+
}
|
|
1124
|
+
```
|
|
1125
|
+
|
|
1126
|
+
## Call Service Kit
|
|
1127
|
+
|
|
1128
|
+
### kit.CallKit.d.ts文件废弃,替换为kit.CallServiceKit.d.ts文件访问级别
|
|
1129
|
+
|
|
1130
|
+
**变更原因**
|
|
1131
|
+
|
|
1132
|
+
命名优化
|
|
1133
|
+
|
|
1134
|
+
**变更影响**
|
|
1135
|
+
|
|
1136
|
+
此变更涉及应用适配。
|
|
1137
|
+
|
|
1138
|
+
应用导入依赖时,强烈建议使用更名后的kit,即kit.CallServiceKit.d.ts。如继续使用kit.CallKit.d.ts,可能会在后续版本出现错误。
|
|
1139
|
+
|
|
1140
|
+
**起始API Level**
|
|
1141
|
+
|
|
1142
|
+
4.1.0(11)
|
|
1143
|
+
|
|
1144
|
+
**变更的接口/组件**
|
|
1145
|
+
|
|
1146
|
+
变更前:kit.CallKit.d.ts文件
|
|
1147
|
+
|
|
1148
|
+
变更后:kit.CallServiceKit.d.ts文件
|
|
1149
|
+
|
|
1150
|
+
**适配指导**
|
|
1151
|
+
|
|
1152
|
+
以导入voipCall为例,导入voipCall时,需要使用新的kit文件,其他代码不需要修改:
|
|
1153
|
+
|
|
1154
|
+
变更前:import { voipCall } from '@kit.CallKit';
|
|
1155
|
+
|
|
1156
|
+
变更后:import { voipCall } from '@kit.CallServiceKit';
|
|
1157
|
+
|
|
1158
|
+
## Core File Kit
|
|
1159
|
+
|
|
1160
|
+
### 持久化权限激活接口实现从sandbox\_manager模块切换到UPMS模块
|
|
1161
|
+
|
|
1162
|
+
**变更原因**
|
|
1163
|
+
|
|
1164
|
+
sandbox\_manager权限清理存在时序问题,需要在临时授权中添加时间戳,所有的临时授权调节到UPMS统一添加时间戳处理。
|
|
1165
|
+
|
|
1166
|
+
**变更影响**
|
|
1167
|
+
|
|
1168
|
+
此变更涉及应用适配。
|
|
1169
|
+
|
|
1170
|
+
变更前:fileShare.activatePermission和OH\_FileShare\_ActivatePermission激活接口调用sandbox\_manager接口能力实现激活功能,应用退出阶段可以进行激活持久化权限。
|
|
1171
|
+
|
|
1172
|
+
变更后:fileShare.activatePermission和OH\_FileShare\_ActivatePermission激活接口调用UPMS接口能力实现激活功能,且在应用退出阶段不能进行持久化权限激活操作(退出阶段激活的权限在退出之后也会进行权限回收,这个阶段的激活操作实际没有意义)。
|
|
1173
|
+
|
|
1174
|
+
**起始API Level**
|
|
1175
|
+
|
|
1176
|
+
11
|
|
1177
|
+
|
|
1178
|
+
**变更的接口/组件**
|
|
1179
|
+
|
|
1180
|
+
@ohos.fileshare.d.ts的ArkTS API:ohos.fileshare.activatePermission。
|
|
1181
|
+
|
|
1182
|
+
oh\_file\_share.h中的C API:OH\_FileShare\_ActivatePermission
|
|
1183
|
+
|
|
1184
|
+
**适配指导**
|
|
1185
|
+
|
|
1186
|
+
开发者在使用时无需重新适配,接口内部处理流程更新。
|
|
1187
|
+
|
|
1188
|
+
如果开发者在应用退出阶段调用了激活接口:
|
|
1189
|
+
|
|
1190
|
+
变更前:会激活成功。
|
|
1191
|
+
|
|
1192
|
+
变更后:返回13900001错误码,提示不允许操作。
|
|
1193
|
+
|
|
1194
|
+
由于该阶段的激活属于无效操作,因此建议开发者删除此阶段的激活操作或者忽略此阶段的激活失败。
|
|
1195
|
+
|
|
1196
|
+
## Core Vision Kit
|
|
1197
|
+
|
|
1198
|
+
### @hms.ai.vision.objectDetection.d.ts和@hms.ai.vision.skeletonDetection.d.ts方法文件变更
|
|
1199
|
+
|
|
1200
|
+
**变更原因**
|
|
1201
|
+
|
|
1202
|
+
错误信息表述有误。
|
|
1203
|
+
|
|
1204
|
+
**变更影响**
|
|
1205
|
+
|
|
1206
|
+
此变更涉及应用适配。
|
|
1207
|
+
|
|
1208
|
+
变更前:在多目标识别与骨骼点检测SDK中,错误码1011000001和1011000002错误信息写反。
|
|
1209
|
+
|
|
1210
|
+
\* @throws { BusinessError } 1011000001 - The service is abnormal.
|
|
1211
|
+
|
|
1212
|
+
\* @throws { BusinessError } 1011000002 - Failed to run, please try again.
|
|
1213
|
+
|
|
1214
|
+
变更后:错误码1011000001和1011000002错误信息与实际实现以及资料保持一致。
|
|
1215
|
+
|
|
1216
|
+
\* @throws { BusinessError } 1011000001 - Failed to run, please try again.
|
|
1217
|
+
|
|
1218
|
+
\* @throws { BusinessError } 1011000002 - The service is abnormal.
|
|
1219
|
+
|
|
1220
|
+
**起始API Level**
|
|
1221
|
+
|
|
1222
|
+
5.0.0(12)
|
|
1223
|
+
|
|
1224
|
+
**变更的接口/组件**
|
|
1225
|
+
|
|
1226
|
+
- static create(): Promise<ObjectDetector>
|
|
1227
|
+
- process(request: visionBase.Request): Promise<ObjectDetectionResponse>
|
|
1228
|
+
- static create(): Promise<SkeletonDetector>
|
|
1229
|
+
- process(request: visionBase.Request): Promise<SkeletonDetectionResponse>
|
|
1230
|
+
|
|
1231
|
+
**适配指导**
|
|
1232
|
+
|
|
1233
|
+
无需特殊适配,实现未进行变更,不影响开发者实际对涉及接口的使用。
|
|
1234
|
+
|
|
1235
|
+
## DFX Kit
|
|
1236
|
+
|
|
1237
|
+
## Form Kit
|
|
1238
|
+
|
|
1239
|
+
### FormLink的router事件允许拉起Ability类型范围变更
|
|
1240
|
+
|
|
1241
|
+
**变更原因**
|
|
1242
|
+
|
|
1243
|
+
FormLink的router事件当前未对被拉起的Ability类型进行校验,但实际此事件应只允许拉起UIAbility,针对使用router事件拉起非UIAbility的场景,需要做安全加固。
|
|
1244
|
+
|
|
1245
|
+
**变更影响**
|
|
1246
|
+
|
|
1247
|
+
此变更涉及应用适配。
|
|
1248
|
+
|
|
1249
|
+
变更前:通过FormLink接口的router事件,可以拉起所有类型的Ability。
|
|
1250
|
+
|
|
1251
|
+
变更后:通过FormLink接口的router事件,仅允许拉起UIAbility。
|
|
1252
|
+
|
|
1253
|
+
**起始API Level**
|
|
1254
|
+
|
|
1255
|
+
9
|
|
1256
|
+
|
|
1257
|
+
**变更的接口/组件**
|
|
1258
|
+
|
|
1259
|
+
FormLink
|
|
1260
|
+
|
|
1261
|
+
**适配指导**
|
|
1262
|
+
|
|
1263
|
+
应用侧使用FormLink接口的router事件拉起Ability时,需确保拉起的目标Ability属于UIAbility。若需要拉起其他类型的Ability,建议通过其他类型的事件,例如message事件,跳转到FormExtensionAbility内处理。
|
|
1264
|
+
|
|
1265
|
+
## Image Kit
|
|
1266
|
+
|
|
1267
|
+
### image.ImageSource.DecodingOptionsForPicture接口的desiredAuxiliaryPictures属性系统能力变更
|
|
1268
|
+
|
|
1269
|
+
**变更原因**
|
|
1270
|
+
|
|
1271
|
+
接口DecodingOptionsForPicture与属性desiredAuxiliaryPictures归属的系统能力不一致,会影响对接口支持系统能力情况的判断,需要将desiredAuxiliaryPictures的SystemCapability中的SystemCapability.Multimedia.Image.Core改为SystemCapability.Multimedia.Image.ImageSource。
|
|
1272
|
+
|
|
1273
|
+
**变更影响**
|
|
1274
|
+
|
|
1275
|
+
此变更涉及应用适配。
|
|
1276
|
+
|
|
1277
|
+
对接口中属性的SystemCapability进行调整,对接口本身的使用方式无影响。
|
|
1278
|
+
|
|
1279
|
+
变更前:DecodingOptionsForPicture接口的系统能力要求为“SystemCapability.Multimedia.Image.Core”。
|
|
1280
|
+
|
|
1281
|
+
变更后:DecodingOptionsForPicture接口的系统能力要求为“SystemCapability.Multimedia.Image.ImageSource”。
|
|
1282
|
+
|
|
1283
|
+
**起始API Level**
|
|
1284
|
+
|
|
1285
|
+
13
|
|
1286
|
+
|
|
1287
|
+
**变更的接口/组件**
|
|
1288
|
+
|
|
1289
|
+
@ohos.multimedia.image中涉及修改的属性如下:
|
|
1290
|
+
|
|
1291
|
+
| 接口名 | 接口说明 | 属性名 | 属性说明 |
|
|
1292
|
+
| --- | --- | --- | --- |
|
|
1293
|
+
| image.ImageSource.DecodingOptionsForPicture | 图像解码设置选项 | desiredAuxiliaryPictures | 设置AuxiliaryPicture类型,默认解码所有AuxiliaryPicture类型。 |
|
|
1294
|
+
|
|
1295
|
+
**适配指导**
|
|
1296
|
+
|
|
1297
|
+
接口中属性的SystemCapability正常应该与对应接口的SystemCapability一致。但如果代码中涉及调用canIUse()方法对本次变更涉及接口支持情况进行判断,则应修改canIUse()方法传入的SystemCapability,判断设备是否支持图片源解码解析能力需使用canIUse("SystemCapability.Multimedia.Image.ImageSource")。
|
|
1298
|
+
|
|
1299
|
+
### image.Component.setAuxiliaryPictureInfo接口行为变更
|
|
1300
|
+
|
|
1301
|
+
**变更原因**
|
|
1302
|
+
|
|
1303
|
+
通过setAuxiliaryPictureInfo设置辅助图信息时,会将辅助图信息中的size、pixelFormat等信息同步到pixelMap的ImageInfo中,需要对size和pixelFormat信息做合法校验,防止对pixelMap像素数据信息的越界访问。
|
|
1304
|
+
|
|
1305
|
+
**变更影响**
|
|
1306
|
+
|
|
1307
|
+
此变更涉及应用适配。
|
|
1308
|
+
|
|
1309
|
+
**说明**
|
|
1310
|
+
|
|
1311
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
1312
|
+
|
|
1313
|
+
变更前:setAuxiliaryPictureInfo()接口设置辅助图信息时,对pixelFormat没有校验,都可以设置成功。
|
|
1314
|
+
|
|
1315
|
+
变更后:setAuxiliaryPictureInfo()接口设置辅助图信息时,若将存储像素字节数变大,则设置不成功,返回错误码401。例如将pixelFormat从RGBA\_8888设置为RGBA\_F16。
|
|
1316
|
+
|
|
1317
|
+
**起始API Level**
|
|
1318
|
+
|
|
1319
|
+
13
|
|
1320
|
+
|
|
1321
|
+
**变更的接口/组件**
|
|
1322
|
+
|
|
1323
|
+
| API类型 | 所在d.ts文件 | 接口名 | 接口起始版本 |
|
|
1324
|
+
| --- | --- | --- | --- |
|
|
1325
|
+
| ArkTS API | @ohos.multimedia.image.d.ts | setAuxiliaryPictureInfo(info: AuxiliaryPictureInfo): void | 13 |
|
|
1326
|
+
|
|
1327
|
+
**适配指导**
|
|
1328
|
+
|
|
1329
|
+
设置辅助图信息时,如果将存储像素字节数变大,则设置不成功,返回错误码401。
|
|
1330
|
+
|
|
1331
|
+
```typescript
|
|
1332
|
+
import { image } from '@kit.ImageKit';
|
|
1333
|
+
import { colorSpaceManager } from '@kit.ArkGraphics2D';
|
|
1334
|
+
async function setAuxiliaryPitcutreInfo() {
|
|
1335
|
+
const array: ArrayBuffer = new ArrayBuffer(100);
|
|
1336
|
+
let imageSource: image.ImageSource = image.createImageSource(array);
|
|
1337
|
+
let options: image.DecodingOptionsForPicture = {
|
|
1338
|
+
desiredAuxiliaryPictures: [image.AuxiliaryPictureType.FRAGMENT_MAP]
|
|
1339
|
+
};
|
|
1340
|
+
try {
|
|
1341
|
+
let picture: image.Picture = await imageSource.createPicture(options);
|
|
1342
|
+
let auxiliaryPicture = picture.getAuxiliaryPicture(image.AuxiliaryPictureType.FRAGMENT_MAP);
|
|
1343
|
+
let originInfo = auxiliaryPicture?.getAuxiliaryPictureInfo();
|
|
1344
|
+
console.info("CreatePicture", 'originInfo = ' + JSON.stringify(originInfo));
|
|
1345
|
+
let changedInfo: image.AuxiliaryPictureInfo = {
|
|
1346
|
+
auxiliaryPictureType: image.AuxiliaryPictureType.FRAGMENT_MAP,
|
|
1347
|
+
size: { height: 410, width: 3072 },
|
|
1348
|
+
rowStride: 3072 * 8,
|
|
1349
|
+
pixelFormat: image.PixelMapFormat.RGBA_F16,
|
|
1350
|
+
colorSpace: colorSpaceManager.create(colorSpaceManager.ColorSpace.DCI_P3),
|
|
1351
|
+
};
|
|
1352
|
+
try {
|
|
1353
|
+
auxiliaryPicture?.setAuxiliaryPictureInfo(changedInfo);
|
|
1354
|
+
console.info("CreatePicture", `changedInfo us ${changedInfo}`);
|
|
1355
|
+
} catch (error) {
|
|
1356
|
+
console.error("CreatePicture", `setAuxiliaryPictureInfo, error.code is ${error.code}, error.message is ${error.message}`);
|
|
1357
|
+
}
|
|
1358
|
+
} catch (err) {
|
|
1359
|
+
console.error("CreatePicture", ' decode Picture failed !!!');
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
```
|
|
1363
|
+
|
|
1364
|
+
### image.Component.OH\_AuxiliaryPictureNative\_SetInfo()接口行为变更
|
|
1365
|
+
|
|
1366
|
+
**变更原因**
|
|
1367
|
+
|
|
1368
|
+
通过OH\_AuxiliaryPictureNative\_SetInfo设置辅助图信息时,会将辅助图信息中的size、pixelFormat等信息同步到pixelMap的ImageInfo中,需要对size和pixelFormat信息做合法校验,防止对pixelMap像素数据信息的越界访问。
|
|
1369
|
+
|
|
1370
|
+
**变更影响**
|
|
1371
|
+
|
|
1372
|
+
此变更涉及应用适配。
|
|
1373
|
+
|
|
1374
|
+
**说明**
|
|
1375
|
+
|
|
1376
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
1377
|
+
|
|
1378
|
+
变更前:OH\_AuxiliaryPictureNative\_SetInfo()接口设置辅助图信息时,对pixelFormat没有校验,都可以设置成功。
|
|
1379
|
+
|
|
1380
|
+
变更后:OH\_AuxiliaryPictureNative\_SetInfo()接口设置辅助图信息时,若将存储像素字节数变大,则设置不成功,返回错误码401。例如将pixelFormat从RGBA\_8888设置为RGBA\_F16。
|
|
1381
|
+
|
|
1382
|
+
**起始API Level**
|
|
1383
|
+
|
|
1384
|
+
13
|
|
1385
|
+
|
|
1386
|
+
**变更的接口/组件**
|
|
1387
|
+
|
|
1388
|
+
| API类型 | 所在头文件 | 接口名 | 接口起始版本 |
|
|
1389
|
+
| --- | --- | --- | --- |
|
|
1390
|
+
| C API | picture_native.h | Image_ErrorCode OH_AuxiliaryPictureNative_SetInfo(OH_AuxiliaryPictureNative *auxiliaryPicture, OH_AuxiliaryPictureInfo *info) | 13 |
|
|
1391
|
+
|
|
1392
|
+
**适配指导**
|
|
1393
|
+
|
|
1394
|
+
设置辅助图信息时,如果将存储像素字节数变大,则设置不成功,返回错误码401。
|
|
1395
|
+
|
|
1396
|
+
```cpp
|
|
1397
|
+
#include <hilog/log.h>
|
|
1398
|
+
#include <multimedia/image_framework/image/image_native.h>
|
|
1399
|
+
#include <multimedia/image_framework/image/image_packer_native.h>
|
|
1400
|
+
#include <multimedia/image_framework/image/image_source_native.h>
|
|
1401
|
+
#include <multimedia/image_framework/image/picture_native.h>
|
|
1402
|
+
Image_ErrorCode SetAuxiliaryPictureInfoTest() {
|
|
1403
|
+
size_t filePathSize = 1024;
|
|
1404
|
+
OH_ImageSourceNative* imageSource = nullptr;
|
|
1405
|
+
Image_ErrorCode image_ErrorCode = OH_ImageSourceNative_CreateFromUri("test.jpg", filePathSize, &imageSource);
|
|
1406
|
+
if (image_ErrorCode != Image_ErrorCode::IMAGE_SUCCESS || imageSource == nullptr) {
|
|
1407
|
+
OH_LOG_ERROR(LOG_APP, "OH_ImageSourceNative_CreateFromUri failed.");
|
|
1408
|
+
}
|
|
1409
|
+
OH_DecodingOptionsForPicture *opts = nullptr;
|
|
1410
|
+
OH_DecodingOptionsForPicture_Create(&opts);
|
|
1411
|
+
OH_PictureNative *picture = nullptr;
|
|
1412
|
+
image_ErrorCode = OH_ImageSourceNative_CreatePicture(imageSource, opts, &picture);
|
|
1413
|
+
OH_ImageSourceNative_Release(imageSource);
|
|
1414
|
+
OH_DecodingOptionsForPicture_Release(opts);
|
|
1415
|
+
if (image_ErrorCode != Image_ErrorCode::IMAGE_SUCCESS || picture == nullptr) {
|
|
1416
|
+
OH_LOG_ERROR(LOG_APP, "OH_ImageSourceNative_CreatePicture failed. image_ErrorCode=%{public}d", image_ErrorCode);
|
|
1417
|
+
}
|
|
1418
|
+
OH_AuxiliaryPictureNative *auxiliaryPicture = nullptr;
|
|
1419
|
+
image_ErrorCode = OH_PictureNative_GetAuxiliaryPicture(
|
|
1420
|
+
picture, Image_AuxiliaryPictureType::AUXILIARY_PICTURE_TYPE_FRAGMENT_MAP, &auxiliaryPicture);
|
|
1421
|
+
if (image_ErrorCode != Image_ErrorCode::IMAGE_SUCCESS || auxiliaryPicture == nullptr) {
|
|
1422
|
+
OH_LOG_ERROR(LOG_APP, "OH_PictureNative_GetAuxiliaryPicture failed. image_ErrorCode=%{public}d", image_ErrorCode);
|
|
1423
|
+
}
|
|
1424
|
+
OH_AuxiliaryPictureInfo *auxInfo = nullptr;
|
|
1425
|
+
image_ErrorCode = OH_AuxiliaryPictureNative_GetInfo(auxiliaryPicture, &auxInfo);
|
|
1426
|
+
PIXEL_FORMAT newPixelFormat = PIXEL_FORMAT_RGBA_F16;
|
|
1427
|
+
OH_AuxiliaryPictureInfo_SetPixelFormat(auxInfo, newPixelFormat);
|
|
1428
|
+
image_ErrorCode = OH_AuxiliaryPictureNative_SetInfo(auxiliaryPicture, auxInfo);
|
|
1429
|
+
if (image_ErrorCode != Image_ErrorCode::IMAGE_SUCCESS || auxInfo == nullptr) {
|
|
1430
|
+
OH_LOG_ERROR(LOG_APP, "OH_AuxiliaryPictureNative_SetInfo failed. image_ErrorCode=%{public}d", image_ErrorCode);
|
|
1431
|
+
}
|
|
1432
|
+
OH_AuxiliaryPictureInfo_Release(auxInfo);
|
|
1433
|
+
OH_AuxiliaryPictureNative_Release(auxiliaryPicture);
|
|
1434
|
+
return IMAGE_SUCCESS;
|
|
1435
|
+
}
|
|
1436
|
+
```
|
|
1437
|
+
|
|
1438
|
+
### image接口Heif格式类型变更
|
|
1439
|
+
|
|
1440
|
+
**变更原因**
|
|
1441
|
+
|
|
1442
|
+
相机Heif编码时,使用图片标准定义image/heic参数编码失败,当前版本Image中的格式参数定义为image/heif,不符合图片标准定义,为提升规范性,将Heif格式图片mimeType变更为image/heic。
|
|
1443
|
+
|
|
1444
|
+
**变更影响**
|
|
1445
|
+
|
|
1446
|
+
**说明**
|
|
1447
|
+
|
|
1448
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
1449
|
+
|
|
1450
|
+
1. OH\_PackingOptions\_SetMimeType()接口Heif格式参数类型变更,此变更涉及应用适配。
|
|
1451
|
+
|
|
1452
|
+
变更前:设置Heif格式图片mimeType传入参数为image/heif。
|
|
1453
|
+
|
|
1454
|
+
变更后:设置Heif格式图片mimeType传入参数为image/heic。
|
|
1455
|
+
|
|
1456
|
+
2. OH\_PackingOptions\_GetMimeType()接口Heif格式返回类型变更,此变更涉及应用适配。
|
|
1457
|
+
|
|
1458
|
+
变更前:获取Heif格式图片mimeType为image/heif。
|
|
1459
|
+
|
|
1460
|
+
变更后:获取Heif格式图片mimeType为image/heic。
|
|
1461
|
+
|
|
1462
|
+
3. 调用ImageSource实例提供的supportedFormats接口查询设备支持解码Heif格式返回类型变更,此变更涉及应用适配。
|
|
1463
|
+
|
|
1464
|
+
变更前:查询设备支持的解码类型Heif格式返回值为image/heif。
|
|
1465
|
+
|
|
1466
|
+
变更后:查询设备支持的解码类型Heif格式返回值为image/heic。
|
|
1467
|
+
|
|
1468
|
+
4. 调用ImagePacker实例提供的supportedFormats接口查询设备支持编码Heif格式返回类型变更,此变更涉及应用适配。
|
|
1469
|
+
|
|
1470
|
+
变更前:查询设备支持的编码类型Heif格式返回值为image/heif。
|
|
1471
|
+
|
|
1472
|
+
变更后:查询设备支持的编码类型Heif格式返回值为image/heic。
|
|
1473
|
+
|
|
1474
|
+
5. image.PackingOption结构体Heif格式编码参数变更,此变更不涉及应用适配。
|
|
1475
|
+
|
|
1476
|
+
变更前:Heif格式图片编码参数的mimeType类型为image/heif。
|
|
1477
|
+
|
|
1478
|
+
变更后:Heif格式图片编码参数的mimeType类型为image/heif或者image/heic。
|
|
1479
|
+
|
|
1480
|
+
6. OH\_PackingOptions结构体Heif格式编码参数变更,此变更不涉及应用适配。
|
|
1481
|
+
|
|
1482
|
+
变更前:Heif格式图片编码参数的mimeType类型为image/heif。
|
|
1483
|
+
|
|
1484
|
+
变更后:Heif格式图片编码参数的mimeType类型为image/heif或者image/heic。
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
**起始API Level**
|
|
1488
|
+
|
|
1489
|
+
10-12
|
|
1490
|
+
|
|
1491
|
+
**变更的接口/组件**
|
|
1492
|
+
|
|
1493
|
+
| API类型 | 所在d.ts/头文件 | 接口名 | 接口起始版本 |
|
|
1494
|
+
| --- | --- | --- | --- |
|
|
1495
|
+
| C API | image_packer_native.h | Image_ErrorCode OH_PackingOptions_SetMimeType(OH_PackingOptions *options, Image_MimeType *format) | 12 |
|
|
1496
|
+
| C API | image_packer_native.h | Image_ErrorCode OH_PackingOptions_GetMimeType(OH_PackingOptions *options, Image_MimeType *format) | 12 |
|
|
1497
|
+
| ArkTS API | @ohos.multimedia.image.d.ts | imagePacker.supportedFormats: Array<string> | 10 |
|
|
1498
|
+
| ArkTS API | @ohos.multimedia.image.d.ts | imageSource.supportedFormats: Array<string> | 10 |
|
|
1499
|
+
| ArkTS API | @ohos.multimedia.image.d.ts | image.PackingOption | 11 |
|
|
1500
|
+
| C API | image_packer_native.h | struct OH_PackingOptions | 12 |
|
|
1501
|
+
|
|
1502
|
+
**适配指导**
|
|
1503
|
+
|
|
1504
|
+
1. 调用OH\_PackingOptions\_SetMimeType(OH\_PackingOptions \*options, Image\_MimeType \*format)设置Heif格式图片mimeType时,需要将传入的format参数更新为image/heic。
|
|
1505
|
+
2. 调用OH\_PackingOptions\_GetMimeType(OH\_PackingOptions \*options, Image\_MimeType \*format)获取Heif格式图片mimeType时,返回的format为image/heic,开发者需检视应用的示例工程,根据实际情况修改。
|
|
1506
|
+
3. 调用ImageSource实例提供的supportedFormatsImageSource实例提供的查询设备的解码类型时,开发者调用行为不变,如果设备支持Heif类型,返回值将由image/heif变更为image/heic。
|
|
1507
|
+
4. 调用ImagePacker实例提供的supportedFormatsImageSource实例提供的查询设备的编码类型时,开发者调用行为不变,如果设备支持Heif类型,返回值将由image/heif变更为image/heic。
|
|
1508
|
+
5. 调用image.PackingOption进行Heif图片编码时,开发者调用参数可以使用变更前的image/heif类型,也可以使用image/heic类型。
|
|
1509
|
+
6. 调用OH\_PackingOptions进行Heif图片编码时,开发者调用参数可以使用变更前的image/heif类型,也可以使用image/heic类型。
|
|
1510
|
+
|
|
1511
|
+
## Media Kit
|
|
1512
|
+
|
|
1513
|
+
### AVErrorCode枚举值变更
|
|
1514
|
+
|
|
1515
|
+
**变更原因**
|
|
1516
|
+
|
|
1517
|
+
播放器当前上报的IO错误码只有一个,为了帮助开发者更好地了解播放失败的原因,本次细化了IO相关错误,提升生态应用友好度。
|
|
1518
|
+
|
|
1519
|
+
**变更影响**
|
|
1520
|
+
|
|
1521
|
+
此变更涉及应用适配。
|
|
1522
|
+
|
|
1523
|
+
**说明**
|
|
1524
|
+
|
|
1525
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
1526
|
+
|
|
1527
|
+
变更前:应用使用到该接口时,错误码上报规则保持不变,涉及到IO返回错误的接口返回原有的值。
|
|
1528
|
+
|
|
1529
|
+
变更后:播放框架返回IO类网络错误时,对应的错误码会细化,涉及到IO返回错误的接口返回值会有变化,用户升级后需要适配新的错误码上报规则。
|
|
1530
|
+
|
|
1531
|
+
| 接口声明 | 变更前 | 变更后 |
|
|
1532
|
+
| --- | --- | --- |
|
|
1533
|
+
| AVPlayer.on(type: 'error', callback: ErrorCallback) | AVERR_IO = 5400103 | 网络场景原有错误码废弃,返回细化后的错误码5411001 ~ 5411011,其余场景不变。 |
|
|
1534
|
+
| void (*OH_AVPlayerOnErrorCallback)(OH_AVPlayer *player, int32_t errorCode, const char *errorMsg) | AV_ERR_IO = 4 | 网络场景原有错误码废弃,返回细化后的错误码5411001 ~ 5411011,其余场景不变。 |
|
|
1535
|
+
|
|
1536
|
+
**起始API Level**
|
|
1537
|
+
|
|
1538
|
+
9
|
|
1539
|
+
|
|
1540
|
+
**变更的接口/组件**
|
|
1541
|
+
|
|
1542
|
+
1. @ohos.multimedia.media.d.ts中接口:
|
|
1543
|
+
|
|
1544
|
+
AVPlayer.on(type: 'error', callback: ErrorCallback)。
|
|
1545
|
+
|
|
1546
|
+
2. avplayer\_base.h中接口:
|
|
1547
|
+
|
|
1548
|
+
void (\*OH\_AVPlayerOnErrorCallback)(OH\_AVPlayer \*player, int32\_t errorCode, const char \*errorMsg)。
|
|
1549
|
+
|
|
1550
|
+
|
|
1551
|
+
**适配指导**
|
|
1552
|
+
|
|
1553
|
+
变更后,应用监听IO相关错误时,需新增5411001 ~ 5411011内的错误码监听。
|
|
1554
|
+
|
|
1555
|
+
参考Media错误码说明文档。
|
|
1556
|
+
|
|
1557
|
+
## Scan Kit
|
|
1558
|
+
|
|
1559
|
+
### 自定义界面扫码权限校验错误码变更
|
|
1560
|
+
|
|
1561
|
+
**变更原因**
|
|
1562
|
+
|
|
1563
|
+
按照错误码规范要求,权限不足时报201错误码。
|
|
1564
|
+
|
|
1565
|
+
**变更影响**
|
|
1566
|
+
|
|
1567
|
+
此变更涉及应用适配。
|
|
1568
|
+
|
|
1569
|
+
**说明**
|
|
1570
|
+
|
|
1571
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
1572
|
+
|
|
1573
|
+
变更前:在未申请相机权限时调用customScan模块init接口,返回错误码1000500001。customScan模块start接口未作相机权限检验,会检验init接口调用状态,init接口调用失败返回错误码1000500001。
|
|
1574
|
+
|
|
1575
|
+
变更后:在未申请相机权限时调用customScan模块init接口和start接口,返回错误码201。
|
|
1576
|
+
|
|
1577
|
+
**起始API Level**
|
|
1578
|
+
|
|
1579
|
+
4.1.0(11)
|
|
1580
|
+
|
|
1581
|
+
**变更的接口/组件**
|
|
1582
|
+
|
|
1583
|
+
customScan模块下接口:
|
|
1584
|
+
|
|
1585
|
+
- init(options?: scanBarcode.ScanOptions):void;
|
|
1586
|
+
|
|
1587
|
+
- start(viewControl: ViewControl, callback: AsyncCallback<Array<scanBarcode.ScanResult>>, frameCallback?: AsyncCallback<ScanFrame>): void;
|
|
1588
|
+
|
|
1589
|
+
- start(viewControl: ViewControl): Promise<Array<scanBarcode.ScanResult>>;
|
|
1590
|
+
|
|
1591
|
+
|
|
1592
|
+
**适配指导**
|
|
1593
|
+
|
|
1594
|
+
无需特殊适配,如果有根据错误码去申请相机权限的场景,需要将错误码从1000500001变更为201。
|
|
1595
|
+
|
|
1596
|
+
### 集成自定义界面扫码应用适配窗口子系统属性变更
|
|
1597
|
+
|
|
1598
|
+
**变更原因**
|
|
1599
|
+
|
|
1600
|
+
窗口子系统[屏幕Display对象rotation和orientation属性变更](#屏幕display对象rotation和orientation属性变更),会导致集成自定义界面扫码的应用相机预览画面和码图位置出现错误,影响用户使用。
|
|
1601
|
+
|
|
1602
|
+
**变更影响**
|
|
1603
|
+
|
|
1604
|
+
**说明**
|
|
1605
|
+
|
|
1606
|
+
此变更已做版本隔离,变更仅在应用的targetSdkVersion设置为大于等于5.0.2(14)时生效。
|
|
1607
|
+
|
|
1608
|
+
变更前:手机和平板旋转同样的角度,从屏幕Display对象中的rotation和orientation获取的值不一致,业务方处理相机预览画面和码图位置时,需要针对设备类型做特殊适配。
|
|
1609
|
+
|
|
1610
|
+
变更后:手机和平板旋转同样的角度,从屏幕Display对象中的rotation和orientation获取的值保持一致,业务方使用变更前的适配方案会导致平板相机预览画面和码图位置错误,需要统一使用Display对象的rotation属性处理手机和平板设备。
|
|
1611
|
+
|
|
1612
|
+
**起始API Level**
|
|
1613
|
+
|
|
1614
|
+
4.1.0(11)
|
|
1615
|
+
|
|
1616
|
+
**变更的接口/组件**
|
|
1617
|
+
|
|
1618
|
+
@ohos.display.d.ts文件中屏幕Display对象的rotation和orientation属性。
|
|
1619
|
+
|
|
1620
|
+
**适配指导**
|
|
1621
|
+
|
|
1622
|
+
业务方需要获取Display对象并读取其[rotation](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/js-apis-display#display)属性值,根据rotation值、XComponent宽高和位置计算自定义扫码识别结果码图位置,请参考[示例代码](https://gitcode.com/harmonyos_samples/scan-kit_-sample-code_-clientdemo_-arkts)。
|
|
1623
|
+
|
|
1624
|
+
## 调试工具
|
|
1625
|
+
|
|
1626
|
+
### hdc file recv命令不支持操作媒体库目录
|
|
1627
|
+
|
|
1628
|
+
**变更原因**
|
|
1629
|
+
|
|
1630
|
+
由于业务演进方向不同,媒体和文档目录需要不同的权限策略,变更后禁止通过hdc file recv命令将媒体库目录内文件从远端设备接收至本地。
|
|
1631
|
+
|
|
1632
|
+
**变更影响**
|
|
1633
|
+
|
|
1634
|
+
此变更涉及应用适配。
|
|
1635
|
+
|
|
1636
|
+
变更前:hdc命令中file recv(接收)命令可以操作媒体库目录内文件从远端设备接收至本地。
|
|
1637
|
+
|
|
1638
|
+
变更后:hdc命令中file recv(接收)命令无法操作媒体库目录内文件从远端设备接收至本地。
|
|
1639
|
+
|
|
1640
|
+
**起始API Level**
|
|
1641
|
+
|
|
1642
|
+
不涉及
|
|
1643
|
+
|
|
1644
|
+
**变更的接口/组件**
|
|
1645
|
+
|
|
1646
|
+
hdc命令行工具
|
|
1647
|
+
|
|
1648
|
+
**适配指导**
|
|
1649
|
+
|
|
1650
|
+
媒体库目录包含
|
|
1651
|
+
|
|
1652
|
+
/storage/cloud/<USERID>/files/Photo
|
|
1653
|
+
|
|
1654
|
+
/storage/media/<USERID>/local/files/Photo
|
|
1655
|
+
|
|
1656
|
+
通过如下两步操作可以将媒体库文件接收到本地:
|
|
1657
|
+
|
|
1658
|
+
1. 通过mediatool recv命令将指定uri对应的媒体库资源的源文件内容导出到定的设备路径下(/data/local/tmp),具体操作说明可阅读[mediatool参考文档](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/mediatool#导出命令mediatool-recv)。
|
|
1659
|
+
```
|
|
1660
|
+
> mediatool recv file://media/Photo/3 /data/local/tmp/out.jpg
|
|
1661
|
+
Table Name: Photos
|
|
1662
|
+
/data/local/tmp/out.jpg
|
|
1663
|
+
```
|
|
1664
|
+
|
|
1665
|
+
2. 通过hdc file recv命令将媒体文件从远端设备接收文件至本地。
|
|
1666
|
+
```
|
|
1667
|
+
> hdc file recv /data/local/tmp/out.jpg ./out.jpg
|
|
1668
|
+
```
|
|
1669
|
+
|
|
1670
|
+
|
|
1671
|
+
### hdc的file recv命令及shell读取权限变更
|
|
1672
|
+
|
|
1673
|
+
**变更原因**
|
|
1674
|
+
|
|
1675
|
+
为了更好的保护终端用户的隐私安全,加强hdc/shell对系统目录文件的权限管控。
|
|
1676
|
+
|
|
1677
|
+
**变更影响**
|
|
1678
|
+
|
|
1679
|
+
此变更涉及应用适配。
|
|
1680
|
+
|
|
1681
|
+
变更前:支持通过hdc/shell对系统目录文件访问,如调试应用数据沙箱等。
|
|
1682
|
+
|
|
1683
|
+
变更后:用户所在用户组必须具备访问调试应用沙箱目录的权限,方能通过hdc/shell访问该目录。
|
|
1684
|
+
|
|
1685
|
+
**起始API Level**
|
|
1686
|
+
|
|
1687
|
+
不涉及
|
|
1688
|
+
|
|
1689
|
+
**变更的接口/组件**
|
|
1690
|
+
|
|
1691
|
+
hdc命令行工具
|
|
1692
|
+
|
|
1693
|
+
**适配指导**
|
|
1694
|
+
|
|
1695
|
+
通过hdc访问调试签名的应用的数据沙箱目录文件,需要在目录、文件创建时指定用户组读取权限。
|
|
1696
|
+
|
|
1697
|
+
路径如:
|
|
1698
|
+
|
|
1699
|
+
/data/app/el1/<USERID>/base/<BUNDLENAME>
|
|
1700
|
+
|
|
1701
|
+
/data/app/el1/<USERID>/database/<BUNDLENAME>
|
|
1702
|
+
|
|
1703
|
+
/data/app/el2/<USERID>/base/<BUNDLENAME>
|
|
1704
|
+
|
|
1705
|
+
/data/app/el2/<USERID>/database/<BUNDLENAME>
|
|
1706
|
+
|
|
1707
|
+
### hidumper组件内存输出显示每列后新增一个空格
|
|
1708
|
+
|
|
1709
|
+
**变更原因**
|
|
1710
|
+
|
|
1711
|
+
解决生态调优测试的显示问题。
|
|
1712
|
+
|
|
1713
|
+
**变更影响**
|
|
1714
|
+
|
|
1715
|
+
此变更涉及应用适配。
|
|
1716
|
+
|
|
1717
|
+
变更前:内存较大时,相邻的两列数据中间无空格
|
|
1718
|
+
|
|
1719
|
+
```
|
|
1720
|
+
hidumper --mem `pidof render_service_`
|
|
1721
|
+
```
|
|
1722
|
+
|
|
1723
|
+

|
|
1724
|
+
|
|
1725
|
+
变更后:每一列数据后新增一个空格
|
|
1726
|
+
|
|
1727
|
+
```
|
|
1728
|
+
hidumper --mem `pidof render_service_`
|
|
1729
|
+
```
|
|
1730
|
+
|
|
1731
|
+

|
|
1732
|
+
|
|
1733
|
+
其中hidumper、hidumper --mem、hidumper -c \[system\]变更效果与hidumper --mem \[pid\]命令效果一致。
|
|
1734
|
+
|
|
1735
|
+
**变更的接口/组件**
|
|
1736
|
+
|
|
1737
|
+
hidumper组件
|
|
1738
|
+
|
|
1739
|
+
**适配指导**
|
|
1740
|
+
|
|
1741
|
+
根据格式变更后进行调整适配
|
|
1742
|
+
|
|
1743
|
+
### 安装的应用是已卸载的预置应用时校验签名是否一致
|
|
1744
|
+
|
|
1745
|
+
**变更原因**
|
|
1746
|
+
|
|
1747
|
+
预置应用被卸载后可以安装一个bundleName相同、签名不同的hap仿冒,有安全风险。
|
|
1748
|
+
|
|
1749
|
+
**变更影响**
|
|
1750
|
+
|
|
1751
|
+
此变更涉及应用适配。
|
|
1752
|
+
|
|
1753
|
+
变更前:预置应用被卸载后安装一个bundleName相同、签名不同的hap会安装成功。
|
|
1754
|
+
|
|
1755
|
+
变更后:预置应用被卸载后安装一个bundleName相同、签名不同的hap会安装失败。
|
|
1756
|
+
|
|
1757
|
+
**起始API Level**
|
|
1758
|
+
|
|
1759
|
+
7
|
|
1760
|
+
|
|
1761
|
+
**变更的接口/组件**
|
|
1762
|
+
|
|
1763
|
+
[bm工具](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/bm-tool#安装命令install)安装命令。
|
|
1764
|
+
|
|
1765
|
+
**适配指导**
|
|
1766
|
+
|
|
1767
|
+
预置应用使用hdc命令安装时,安装hap的签名应该与预置hap的签名一致。
|