未验证 提交 7b6e2fcd 编写于 作者: O openharmony_ci 提交者: Gitee

!21081 翻译完成:19011+20633+20111+20368+20223+20606+20166+20703+20407+18973 changelog等刷新

Merge pull request !21081 from wusongqing/TR19011
......@@ -16,8 +16,8 @@ import bundleManager from '@ohos.bundle.bundleManager';
| Permission | Permission Level | Description |
| ------------------------------------------ | ------------ | ------------------|
| ohos.permission.GET_BUNDLE_INFO | normal | Permission to query information about a specified bundle. |
| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED| system_basic | Permission to query information about all bundles.|
| ohos.permission.GET_BUNDLE_INFO | normal | Permission to obtain basic information about a bundle. |
| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED| system_basic | Permission to obtain basic information and other sensitive information about a bundle.|
| ohos.permission.REMOVE_CACHE_FILES | system_basic | Permission to clear cache files of a bundle. |
|ohos.permission.CHANGE_ABILITY_ENABLED_STATE| system_basic | Permission to enable or disable an application or ability. |
| ohos.permission.GET_INSTALLED_BUNDLE_LIST | system_basic | Permission to read installed application list.|
......
......@@ -17,7 +17,6 @@ import installer from '@ohos.bundle.installer';
| Permission | Permission Level | Description |
| ------------------------------ | ----------- | ---------------- |
| ohos.permission.INSTALL_BUNDLE | system_core | Permission to install or uninstall bundles.|
| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED | system_basic | Permission to query information about all bundles.|
For details, see [Permission Levels](../../security/accesstoken-overview.md#permission-levels).
......@@ -94,7 +93,6 @@ Installs a bundle. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE<sup>10+</sup>
> **NOTE**
>
> Since API version 10, this API can be called with the **ohos.permission.INSTALL_ENTERPRISE_BUNDLE** permission.
......@@ -135,6 +133,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700043 | Failed to install the HAP because of low APL in the non-system data proxy (required APL: system_basic or system_core). |
| 17700044 | Failed to install the HAP because the isolationMode configured is not supported. |
| 17700047 | Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. |
| 17700048 | Failed to install the HAP because the code signature verification is failed. |
**Example**
......@@ -171,7 +170,6 @@ Installs a bundle. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE<sup>10+</sup>
> **NOTE**
>
> Since API version 10, this API can be called with the **ohos.permission.INSTALL_ENTERPRISE_BUNDLE** permission.
......@@ -210,6 +208,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700043 | Failed to install the HAP because of low APL in the non-system data proxy (required APL: system_basic or system_core). |
| 17700044 | Failed to install the HAP because the isolationMode configured is not supported. |
| 17700047 | Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. |
| 17700048 | Failed to install the HAP because the code signature verification is failed. |
**Example**
......@@ -243,7 +242,6 @@ Installs a bundle. This API uses a promise to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE<sup>10+</sup>
> **NOTE**
>
> Since API version 10, this API can be called with the **ohos.permission.INSTALL_ENTERPRISE_BUNDLE** permission.
......@@ -289,6 +287,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700043 | Failed to install the HAP because of low APL in the non-system data proxy (required APL: system_basic or system_core). |
| 17700044 | Failed to install the HAP because the isolationMode configured is not supported. |
| 17700047 | Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. |
| 17700048 | Failed to install the HAP because the code signature verification is failed. |
**Example**
......@@ -773,97 +772,6 @@ try {
}
```
## BundleInstaller.getSpecifiedDistributionType<sup>10+</sup>
getSpecifiedDistributionType(bundleName: string): string;
Obtains the distribution type of a bundle in synchronous mode. The return value is the **specifiedDistributionType** field value in **InstallParam** passed when **install** is called.
**System API**: This is a system API.
**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------------- | ----------------------------------- | ---- | ---------------------------- |
| bundleName | string | Yes | Bundle name.|
**Return value**
| Type | Description |
| ------------- | -------------------------------------- |
| string | Distribution type of the bundle.|
**Error codes**
For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md).
| ID| Error Message |
| -------- | ------------------------------------------------------------ |
| 17700001 | The specified bundleName is not found. |
**Example**
```ts
import installer from '@ohos.bundle.installer';
let bundleName = "com.example.myapplication";
try {
let type = installer.getSpecifiedDistributionType(bundleName);
console.info('getSpecifiedDistributionType successfully, type:' + type);
} catch (error) {
console.error('getSpecifiedDistributionType failed. Cause: ' + error.message);
}
```
## BundleInstaller.getAdditionalInfo<sup>10+</sup>
getAdditionalInfo(bundleName: string): string;
Obtains additional information about a bundle in synchronous mode. The return value is the **additionalInfo** field value in **InstallParam** passed when **install** is called.
**System API**: This is a system API.
**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------------- | ----------------------------------- | ---- | ---------------------------- |
| bundleName | string | Yes | Bundle name.|
**Return value**
| Type | Description |
| ------------- | -------------------------------------- |
| string | Additional information about the bundle.|
**Error codes**
For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md).
| ID| Error Message |
| -------- | ------------------------------------------------------------ |
| 17700001 | The specified bundleName is not found. |
**Example**
```ts
import installer from '@ohos.bundle.installer';
let bundleName = "com.example.myapplication";
try {
let info = installer.getAdditionalInfo(bundleName);
console.info('getAdditionalInfo successfully, additionInfo:' + info);
} catch (error) {
console.error('getAdditionalInfo failed. Cause: ' + error.message);
}
```
## HashParam
Defines the hash parameters for bundle installation and uninstall.
......@@ -888,17 +796,18 @@ Defines the parameters that need to be specified for bundle installation, uninst
| Name | Type | Mandatory | Description |
| ------------------------------ | ------------------------------ | ------------------ | ------------------ |
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. You can call [queryOsAccountLocalIdFromProcess](js-apis-osAccount.md#getOsAccountLocalId) to obtain the user ID of the current process.|
| installFlag | number | No | Installation flag. The value **0** means initial installation and **1** means overwrite installation. The default value is **0**.|
| installFlag | number | No | Installation flag. The value **0x00** means initial installation, **0x01** means overwrite installation, and **0x10** means installation-free. The default value is **0x00**.|
| isKeepData | boolean | No | Whether to retain the data directory during bundle uninstall. The default value is **false**.|
| hashParams | Array<[HashParam](#hashparam)> | No| Hash parameters. By default, no value is passed. |
| crowdtestDeadline| number | No | End date of crowdtesting. The default value is **-1**, indicating that no end date is specified for crowdtesting.|
| sharedBundleDirPaths<sup>10+</sup> | Array\<String> | No|Paths of the shared bundle files. By default, no value is passed.|
| specifiedDistributionType<sup>10+</sup> | string | No|Distribution type specified during application installation. By default, no value is passed. The maximum length is 128 bytes. This field is usually specified by the application market of the operating system operator.|
| additionalInfo<sup>10+</sup> | string | No|Additional information during application installation (usually an enterprise application). By default, no value is passed. The maximum length is 3,000 bytes. This field is usually specified by the application market of the operating system operator.|
| verifyCodeParams<sup>10+</sup> | Array<[VerifyCodeParam](#verifycodeparam10)> | No| Information about the code signature file. The default value is null. |
## UninstallParam<sup>10+</sup>
Defines the parameters required for the uninstallation of a shared bundle.
Defines the parameters required for the uninstall of a shared bundle.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
......@@ -908,3 +817,16 @@ Defines the parameters required for the uninstallation of a shared bundle.
| ----------- | ------ | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes | Name of the shared bundle. |
| versionCode | number | No | Version number of the shared bundle. By default, no value is passed, and all shared bundles of the specified name are uninstalled.|
## VerifyCodeParam<sup>10+</sup>
Defines the information about the code signature file.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**System API**: This is a system API.
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---------------- | ---------------- |
| moduleName | string | Yes| Module name of the bundle.|
| signatureFilePath | string | Yes| Path of the code signature file. |
......@@ -634,5 +634,5 @@ Enumerates the efficiency resource types.
| BLUETOOTH | 16 | Bluetooth resources are not proxied when the application is suspended.|
| GPS | 32 | GPS resources are not proxied when the application is suspended.|
| AUDIO | 64 | Audio resources are not proxied when the application is suspended.|
| RUNNING_LOCK | 128 | RUNNING_LOCK resources are not proxied when the application is suspended.|
| SENSOR | 256 | Sensor callbacks are not intercepted.|
| RUNNING_LOCK<sup>10+</sup> | 128 | RUNNING_LOCK resources are not proxied when the application is suspended.|
| SENSOR<sup>10+</sup> | 256 | Sensor callbacks are not intercepted.|
......@@ -220,7 +220,7 @@ Common kernel errors such as memory application and multi-thread processing erro
**Solution**
Ensure sufficient sytem memory.
Ensure sufficient system memory.
## 16000051 Network Error
......@@ -348,6 +348,60 @@ Cross-device installation-free is not supported.
Use installation-free on the same device.
## 16000058 Specified URI Flag Is Invalid
**Error Message**
Invalid URI flag.
**Description**
This error code is reported when the specified URI flag is invalid.
**Possible Causes**
An incorrect parameter is passed in.
**Solution**
Pass in a valid URI flag.
## 16000059 Specified URI Type Is Invalid
**Error Message**
Invalid URI type.
**Description**
This error code is reported when the specified URI type is invalid.
**Possible Causes**
An incorrect parameter is passed in. Currently, URI authorization management supports only URIs of the file type.
**Solution**
Ensure that the input parameter is of the supported URI type.
## 16000060 Sandbox Applications Cannot Authorize URIs
**Error Message**
Sandbox application can not grant URI permission.
**Description**
This error code is reported when a sandbox application authorizes a URI.
**Possible Causes**
Sandbox applications cannot authorize URIs.
**Solution**
Use a non-sandbox application.
## 16000101 shell Command Failure
**Error Message**
......@@ -750,7 +804,7 @@ Common kernel errors such as memory application and multi-thread processing erro
**Solution**
Ensure sufficient sytem memory.
Ensure sufficient system memory.
## 18500009 Application Has a Quick Fix Task Being Processed
......
# Bundle Management Subsystem Changelog
## cl.bundlemanager.1 Bottom Layer Implementation of getAllBundleInfo in @ohos.bundle.d.ts Changed
The **getAllBundleInfo** API in the **@ohos.bundle.d.ts** file is marked as deprecated. On the image with **targetAPILevel** set to API 9 or later, the returned data list is empty.
**Change Impact**
After an update to the new image version, the calling of **getAllBundleInfo** in **@ohos.bundle.d.ts** is successful. However, the returned data list is empty. To obtain the bundle information, call **getAllBundleInfo** in the **@ohos.bundle.bundleManager.d.ts** file.
**Key API/Component Changes**
The bottom-layer implementation is changed. The result value of **getAllBundleInfo** in **@ohos.bundle.d.ts** is empty.
**Adaptation Guide**
If your application uses **getAllBundleInfo** in **@ohos.bundle.d.ts**, replace it with **getAllBundleInfo** in **@ohos.bundle.bundleManager.d.ts**. For details about how to use the new API, see [API Reference](../../../application-dev/reference/apis/js-apis-bundleManager.md#bundlemanagergetallbundleinfo).
```ets
import bundleManager from '@ohos.bundle.bundleManager';
```
## cl.bundlemanager.2 Bottom Layer Implementation of getAllApplicationInfo in @ohos.bundle.d.ts Changed
The **getAllApplicationInfo** API in the **@ohos.bundle.d.ts** file is marked as deprecated. On the image with **targetAPILevel** set to API 9 or later, the returned data list is empty.
**Change Impact**
After an update to the new image version, the calling of **getAllApplicationInfo** in **@ohos.bundle.d.ts** is successful. However, the returned data list is empty. To obtain the application information, call **getAllApplicationInfo** in the **@ohos.bundle.bundleManager.d.ts** file.
**Key API/Component Changes**
The bottom-layer implementation is changed. The result value of **getAllApplicationInfo** in **@ohos.bundle.d.ts** is empty.
**Adaptation Guide**
If your application uses **getAllApplicationInfo** in **@ohos.bundle.d.ts**, replace it with **getAllApplicationInfo** in **@ohos.bundle.bundleManager.d.ts**. For details about how to use the new API, see [API Reference](../../../application-dev/reference/apis/js-apis-bundleManager.md#bundlemanagergetallapplicationinfo).
```ets
import bundleManager from '@ohos.bundle.bundleManager';
```
## cl.bundlemanager.3 Permission on getAllBundleInfo in @ohos.bundle.bundleManager.d.ts Changed
The APIs for obtaining the application list require authorization from the end user.
Therefore, the permission on **getAllBundleInfo** in **@ohos.bundle.bundleManager.d.ts** is changed to **ohos.permission.GET_INSTALLED_BUNDLE_LIST**.
**Change Impact**
After an update to the new image version, you must have the **ohos.permission.GET_INSTALLED_BUNDLE_LIST** permission when calling **getAllBundleInfo**. Otherwise, the call fails.
**Key API/Component Changes**
The permission on **getAllBundleInfo** in **@ohos.bundle.bundleManager.d.ts** is changed to **ohos.permission.GET_INSTALLED_BUNDLE_LIST**.
**Adaptation Guide**
Add the **ohos.permission.GET_INSTALLED_BUNDLE_LIST** permission to the configuration file of the application. This permission is of the **user_grant** type and is not authorized by default during application installation. You must display a dialog box to ask the permission from the user or use pre-authorization. For details about how to display a dialog box to ask for permission, see [Requesting User Authorization](../../../application-dev/security/accesstoken-guidelines.md#requesting-user-authorization). For details about how to use pre-authorization, see [Pre-authorizing user_grant Permissions](../../../application-dev/security/accesstoken-guidelines.md#pre-authorizing-user_grant-permissions).
## cl.bundlemanager.4 Permission on getAllApplicationInfo in @ohos.bundle.bundleManager.d.ts Changed
The APIs for obtaining the application list require authorization from the end user.
Therefore, the permission on **getAllApplicationInfo** in **@ohos.bundle.bundleManager.d.ts** is changed to **ohos.permission.GET_INSTALLED_BUNDLE_LIST**.
**Change Impact**
After an update to the new image version, you must have the **ohos.permission.GET_INSTALLED_BUNDLE_LIST** permission when calling **getAllApplicationInfo**. Otherwise, the call fails.
**Key API/Component Changes**
The permission on **getAllApplicationInfo** in **@ohos.bundle.bundleManager.d.ts** is changed to **ohos.permission.GET_INSTALLED_BUNDLE_LIST**.
**Adaptation Guide**
Add the **ohos.permission.GET_INSTALLED_BUNDLE_LIST** permission to the configuration file of the application. This permission is of the **user_grant** type and is not authorized by default during application installation. You must display a dialog box to ask the permission from the user or use pre-authorization. For details about how to display a dialog box to ask for permission, see [Requesting User Authorization](../../../application-dev/security/accesstoken-guidelines.md#requesting-user-authorization). For details about how to use pre-authorization, see [Pre-authorizing user_grant Permissions](../../../application-dev/security/accesstoken-guidelines.md#pre-authorizing-user_grant-permissions).
## cl.bundlemanager.5 getSpecifiedDistributionType Moved from @ohos.bundle.installer.d.ts to @ohos.bundle.bundleManager.d.ts
The **getSpecifiedDistributionType** API is moved from **@ohos.bundle.installer.d.ts** to **@ohos.bundle.bundleManager.d.ts**.
**Change Impact**
After an update to the new SDK version, the **getSpecifiedDistributionType** API in **@ohos.bundle.installer.d.ts** is moved to **@ohos.bundle.bundleManager.d.ts**.
**Key API/Component Changes**
The **getSpecifiedDistributionType** API in **@ohos.bundle.installer.d.ts** is moved to **@ohos.bundle.bundleManager.d.ts**.
**Adaptation Guide**
To use **getSpecifiedDistributionType**, import the **bundleManager** module.
```ets
import bundleManager form '@ohos.bundle.bundleManager'
```
## cl.bundlemanager.6 getAdditionalInfo Moved from @ohos.bundle.installer.d.ts to @ohos.bundle.bundleManager.d.ts
The **getAdditionalInfo** API is moved from **@ohos.bundle.installer.d.ts** to **@ohos.bundle.bundleManager.d.ts**.
**Change Impact**
After an update to the new SDK version, the **getAdditionalInfo** API in **@ohos.bundle.installer.d.ts** is moved to **@ohos.bundle.bundleManager.d.ts**.
**Key API/Component Changes**
The **getAdditionalInfo** API is moved from **@ohos.bundle.installer.d.ts** to **@ohos.bundle.bundleManager.d.ts**.
**Adaptation Guide**
To use **getAdditionalInfo**, import the **bundleManager** module.
```ets
import bundleManager form '@ohos.bundle.bundleManager'
```
## cl.bundlemanager.7 proxyDatas under Schema Renamed proxyData
**proxyDatas** is renamed **proxyData**.
**Change Impact**
After an update to the new image version, **proxyDatas** is renamed **proxyData**. Currently **proxyDatas** can still be used, but it will be deprecated soon. You are advised to replace **proxyDatas** with **proxyData** as soon as possible.
**Key API/Component Changes**
**proxyDatas** is renamed **proxyData**.
**Adaptation Guide**
Replace **proxyDatas** with **proxyData**.
\ No newline at end of file
# Multimedia Subsystem Changelog
## cl.multimedia.1 Stream Type Enum Declaration in Audio C APIs Changed
For the audio APIs of API version 10 in C, the audio output stream type is changed from **AUDIOSTREAM_TYPE_RERNDERER** to **AUDIOSTREAM_TYPE_RENDERER**.
**Change Impact**
Applications that use the involved APIs may have compatibility issues.
**Key API/Component Changes**
Before change:
```C
enum OH_AudioStream_Type {
/**
* The type for audio stream is renderer.
*/
AUDIOSTREAM_TYPE_RERNDERER = 1,
/**
* The type for audio stream is capturer.
*/
AUDIOSTREAM_TYPE_CAPTURER = 2
};
```
After change:
```C
enum OH_AudioStream_Type {
/**
* The type for audio stream is renderer.
*/
AUDIOSTREAM_TYPE_RENDERER = 1,
/**
* The type for audio stream is capturer.
*/
AUDIOSTREAM_TYPE_CAPTURER = 2
};
```
**Adaptation Guide**
Change **AUDIOSTREAM_TYPE_RERNDERER** to **AUDIOSTREAM_TYPE_RENDERER** in your code. Example:
Before change:
```C
OH_AudioStreamBuilder* builder;
OH_AudioStreamBuilder_Create(&builder, AUDIOSTREAM_TYPE_RERNDERER);
```
After change:
```C
OH_AudioStreamBuilder* builder;
OH_AudioStreamBuilder_Create(&builder, AUDIOSTREAM_TYPE_RENDERER);
```
## cl.multimedia.2 OH_AudioStream_Content Removed
For the audio APIs of API version 10 in C, **OH_AudioStream_Content** is removed for the audio output stream attributes.
**Change Impact**
Applications that use the involved APIs may have compatibility issues.
**Key API/Component Changes**
- In the **native_audiostream_base.h** file
Before change:
```C
typedef enum {
AUDIOSTREAM_CONTENT_TYPE_UNKNOWN = 0,
AUDIOSTREAM_CONTENT_TYPE_SPEECH = 1,
AUDIOSTREAM_CONTENT_TYPE_MUSIC = 2,
AUDIOSTREAM_CONTENT_TYPE_MOVIE = 3,
} OH_AudioStream_Content;
```
After change: **OH_AudioStream_Content** is removed.
- In the **native_audiostreambuilder.h** file
Before change:
```C
OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererInfo(OH_AudioStreamBuilder* builder,
OH_AudioStream_Usage usage, OH_AudioStream_Content content);
```
After change:
```C
OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererInfo(OH_AudioStreamBuilder* builder,
OH_AudioStream_Usage usage);
```
- In the **native_audiorenderer.h** file
Before change:
```C
OH_AudioStream_Result OH_AudioRenderer_GetRendererInfo(OH_AudioRenderer* renderer,
OH_AudioStream_Usage* usage, OH_AudioStream_Content* content);
```
After change:
```C
OH_AudioStream_Result OH_AudioRenderer_GetRendererInfo(OH_AudioRenderer* renderer,
OH_AudioStream_Usage* usage);
```
**Adaptation Guide**
When using **OH_AudioStreamBuilder_SetRendererInfo**, check the original **OH_AudioStream_Content** type against the following table and use the corresponding **OH_AudioStream_Usage** type based on the scenario.
| OH_AudioStream_Content | OH_AudioStream_Usage |
| ------------------------------- | ------------------------------------- |
| AUDIOSTREAM_CONTENT_TYPE_SPEECH | AUDIOSTREAM_USAGE_VOICE_COMMUNICATION |
| AUDIOSTREAM_CONTENT_TYPE_MUSIC | AUDIOSTREAM_USAGE_MUSIC |
| AUDIOSTREAM_CONTENT_TYPE_MOVIE | AUDIOSTREAM_USAGE_MOVIE |
**OH_AudioRenderer_GetRendererInfo** can be used to obtain the **OH_AudioStream_Usage** attribute but not the **OH_AudioStream_Content** attribute.
## cl.multimedia.3 OH_AudioStream_Usage Changed
In the **native_audiostream_base.h** file of the audio interfaces of API version 10 in C, for the **OH_AudioStream_Usage** enum, the enumerated value **AUDIOSTREAM_USAGE_MEDIA** is deleted, and **AUDIOSTREAM_USAGE_COMMUNICATION** is changed to **AUDIOSTREAM_USAGE_VOICE_COMMUNICATION** and **AUDIOSTREAM_USAGE_VOICE_ASSISTANT**.
**Change Impact**
Applications that use the involved APIs may have compatibility issues.
**Key API/Component Changes**
Before change:
```C
typedef enum {
AUDIOSTREAM_USAGE_UNKNOWN = 0,
AUDIOSTREAM_USAGE_MEDIA = 1,
AUDIOSTREAM_USAGE_COMMUNICATION = 2,
} OH_AudioStream_Usage;
```
After change:
```C
typedef enum {
/**
* Unknown usage.
*/
AUDIOSTREAM_USAGE_UNKNOWN = 0,
/**
* Music usage.
*/
AUDIOSTREAM_USAGE_MUSIC = 1,
/**
* Voice communication usage.
*/
AUDIOSTREAM_USAGE_VOICE_COMMUNICATION = 2,
/**
* Voice assistant usage.
*/
AUDIOSTREAM_USAGE_VOICE_ASSISTANT = 3,
/**
* Movie or video usage.
*/
AUDIOSTREAM_USAGE_MOVIE = 10,
} OH_AudioStream_Usage;
```
**Adaptation Guide**
When using **OH_AudioStreamBuilder_SetRendererInfo**, set **OH_AudioStream_Usage** to **AUDIOSTREAM_USAGE_MUSIC** or **AUDIOSTREAM_USAGE_MOVIE**, rather than **AUDIOSTREAM_USAGE_MEDIA**.
Before change:
```C
OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_MEDIA);
```
After change:
```C
OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_MUSIC); // Music scene
```
Or:
```C
OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_MOVIE); // Video scene
```
When using **OH_AudioStreamBuilder_SetRendererInfo**, set **OH_AudioStream_Usage** to **AUDIOSTREAM_USAGE_VOICE_COMMUNICATION** or **AUDIOSTREAM_USAGE_VOICE_ASSISTANT**, rather than **AUDIOSTREAM_USAGE_COMMUNICATION**.
Before change:
```C
OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_COMMUNICATION);
```
After change:
```C
OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_VOICE_COMMUNICATION); // Communication scene
```
Or:
```C
OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_VOICE_ASSISTANT); // Voice assistant scene
```
## cl.multimedia.4 AUDIOSTREAM_SAMPLE_F32LE Deleted for **OH_AudioStream_SampleFormat**
In the **native_audiostream_base.h** file of the audio interfaces of API version 10 in C, the enumerated value **AUDIOSTREAM_SAMPLE_F32LE** is deleted for the **OH_AudioStream_SampleFormat** enum.
**Change Impact**
Applications that use the involved APIs may have compatibility issues.
**Key API/Component Changes**
Before change:
```C
typedef enum {
AUDIOSTREAM_SAMPLE_U8 = 0,
AUDIOSTREAM_SAMPLE_S16LE = 1,
AUDIOSTREAM_SAMPLE_S24LE = 2,
AUDIOSTREAM_SAMPLE_S32LE = 3,
AUDIOSTREAM_SAMPLE_F32LE = 4,
} OH_AudioStream_SampleFormat;
```
After change:
```C
typedef enum {
/**
* Unsigned 8 format.
*/
AUDIOSTREAM_SAMPLE_U8 = 0,
/**
* Signed 16 bit integer, little endian.
*/
AUDIOSTREAM_SAMPLE_S16LE = 1,
/**
* Signed 24 bit integer, little endian.
*/
AUDIOSTREAM_SAMPLE_S24LE = 2,
/**
* Signed 32 bit integer, little endian.
*/
AUDIOSTREAM_SAMPLE_S32LE = 3,
} OH_AudioStream_SampleFormat;
```
**Adaptation Guide**
Do not use **AUDIOSTREAM_SAMPLE_F32LE** for **OH_AudioStream_SampleFormat**.
## cl.multimedia.5 Enumerated Values Added for OH_AudioStream_Result
In the **native_audiostream_base.h** file of the audio interfaces of API version 10 in C, new enumerated values are added for the **OH_AudioStream_Result** enum.
**Change Impact**
None.
**Key API/Component Changes**
Before change:
```C
typedef enum {
/**
* The call was successful.
*/
AUDIOSTREAM_SUCCESS,
/**
* This means that the function was executed with an invalid input parameter.
*/
AUDIOSTREAM_ERROR_INVALID_PARAM,
/**
* Execution status exception.
*/
AUDIOSTREAM_ERROR_ILLEGAL_STATE,
/**
* An system error has occurred.
*/
AUDIOSTREAM_ERROR_SYSTEM
} OH_AudioStream_Result;
```
After change:
```C
typedef enum {
/**
* The call was successful.
*/
AUDIOSTREAM_SUCCESS = 0,
/**
* This means that the function was executed with an invalid input parameter.
*/
AUDIOSTREAM_ERROR_INVALID_PARAM = 1,
/**
* Execution status exception.
*/
AUDIOSTREAM_ERROR_ILLEGAL_STATE = 2,
/**
* An system error has occurred.
*/
AUDIOSTREAM_ERROR_SYSTEM = 3
} OH_AudioStream_Result;
```
**Adaptation Guide**
No adaptation is required.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册