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

!14075 翻译已完成12955+12840+13040

Merge pull request !14075 from shawn_he/12955-b
# Location Subsystem ChangeLog
## cl.location.1 Deletion of the geoLocationManager.requestEnableLocation API in API Version 9
When the location function is disabled, your application can call the **geoLocationManager.requestEnableLocation** API to request the user to enable the location function. However, this API is seldom used, and user experience for this API is not very good because the user is not notified of the scenario in which your application uses the location information.
Therefore, your app shows a popup, asking the user to go to the settings page and enable the location function. In addition, the popup clearly states the scenarios in which the location information will be used, improving user experience.
**Change Impacts**
Your application cannot use the **geoLocationManager.requestEnableLocation** API in API version 9 to request the user to enable the location function. Instead, you need to implement a popup asking the user to enable the location function for your application.
**Key API/Component Changes**
| Class | API Type| Declaration | Change Type |
| ------------------ | -------- | ------------------------------------------------------------ | ------------------ |
| geoLocationManager | method | function requestEnableLocation(callback: AsyncCallback<boolean>): void; | Deleted from API version 9|
| geoLocationManager | method | function requestEnableLocation(): Promise<boolean>; | Deleted from API version 9|
# Globalization Subsystem ChangeLog
## cl.global.1 Runtime Authentication Added for System APIs
The internationalization component of the globalization subsystem adds runtime authentication for system APIs in certain scenarios. The following changes are made in API version 9 and later:
- Setting the system language, country or region, and area
- Setting the 24-hour format of the system
- Adding and removing the preferred language
- Setting localized numbers
You need to adapt your application based on the following information.
**Change Impacts**
APIs involved in the preceding scenarios can be properly called only by system applications that have the **UPDATE_CONFIGURATION** permission.
**Key API/Component Changes**
- Involved APIs:
- setSystemLanguage(language: string): void;
- setSystemRegion(region: string): void;
- setSystemLocale(locale: string): void;
- set24HourClock(option: boolean): void;
- addPreferredLanguage(language: string, index?: number): void;
- removePreferredLanguage(index: number): void;
- setUsingLocalDigit(flag: boolean): void;
**Adaptation Guide**
Make sure the application trying to call any of the above APIs is a system application. Non-system applications are not allowed to call the APIs.
An exception will be thrown upon lack of a necessary permission or a call request from a non-system application. The exception can be captured via **try-catch**.
```js
import I18n from '@ohos.i18n'
try {
I18n.System.setSystemLanguage('zh');
} catch(error) {
console.error(`call System.setSystemLanguage failed, error code: ${error.code}, message: ${error.message}.`)
}
```
USB Manager ChangeLog
## cl.usb_manager.1 System API Change
Runtime authentication is performed for system APIs of the USB manager. An asynchronous API throws an error code via **Promise.reject**.
If your application is developed based on earlier versions, modify the return values of functions. Otherwise, the original service logic will be affected.
**Key API/Component Changes**
| Bundle Name | Original API | New API |
| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| ohos.usbV9.d.ts | function setCurrentFunctions(funcs: FunctionType): Promise<boolean>; | function setCurrentFunctions(funcs: FunctionType): Promise<void>; |
| ohos.usbV9.d.ts | function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise<boolean>; | function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise<void>; |
**Adaptation Guide**
For details, see the [reference](../../../application-dev/reference/errorcodes/errorcode-universal.md) for each API.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册