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

!12840 增加geoLocationManager和wifiManager的changelog

Merge pull request !12840 from 刘彬俊/master
# 位置服务子系统ChangeLog
## cl.location.1 删除API9接口geoLocationManager.requestEnableLocation
在位置开关关闭的场景下,应用可以调用geoLocationManager.requestEnableLocation接口,以请求用户开启位置开关;实际该接口使用较少,并且该接口用户体验不太好,并没有告诉用户该应用在什么场景下使用位置信息。
因此变更为由应用本身弹框请求用户跳转到settings开启位置开关,并且在弹框上写清楚会在什么场景下使用位置信息,这样用户体验更好。
**变更影响**
在API9上应用无法使用geoLocationManager.requestEnableLocation请求用户开启位置开关,需要应用自己实现弹框,请求用户开启位置开关。
**关键的接口/组件变更**
| 类名 | 接口类型 | 接口声明 | 变更类型 |
| -- | -- | -- | -- |
|geoLocationManager| method | function requestEnableLocation(callback: AsyncCallback<boolean>): void; | 该接口从API9中删除 |
|geoLocationManager| method | function requestEnableLocation(): Promise<boolean>; | 该接口从API9中删除 |
# 基础通信子系统WiFi ChangeLog
## cl.location.1 位置服务权限变更
从API9开始,增加ohos.permission.APPROXIMATELY_LOCATION,表示模糊位置权限。
如果应用开发者使用的API版本大于等于9,则需要同时申请ohos.permission.LOCATION和ohos.permission.APPROXIMATELY_LOCATION,单独申请ohos.permission.LOCATION会失败。
**变更影响**
如果是存量应用(使用的API版本小于9),则无影响。如果使用的API版本大于等于9,位置服务权限申请方式有变更,详情如下:
应用在使用系统能力前,需要检查是否已经获取用户授权访问设备位置信息。如未获得授权,可以向用户申请需要的位置权限,申请方式请参考下文。
系统提供的定位权限有:
- ohos.permission.LOCATION
- ohos.permission.APPROXIMATELY_LOCATION
- ohos.permission.LOCATION_IN_BACKGROUND
访问设备的位置信息,必须申请权限,并且获得用户授权。
API9之前的版本,申请ohos.permission.LOCATION即可。
API9及之后的版本,需要申请ohos.permission.APPROXIMATELY_LOCATION或者同时申请ohos.permission.APPROXIMATELY_LOCATION和ohos.permission.LOCATION;无法单独申请ohos.permission.LOCATION。
| 使用的API版本 | 申请位置权限 | 申请结果 | 位置的精确度 |
| -------- | -------- | -------- | -------- |
| 小于9 | ohos.permission.LOCATION | 成功 | 获取到精准位置,精准度在米级别。 |
| 大于等于9 | ohos.permission.LOCATION | 失败 | 无法获取位置。 |
| 大于等于9 | ohos.permission.APPROXIMATELY_LOCATION | 成功 | 获取到模糊位置,精确度为5公里。 |
| 大于等于9 | ohos.permission.APPROXIMATELY_LOCATION和ohos.permission.LOCATION | 成功 | 获取到精准位置,精准度在米级别。 |
如果应用在后台运行时也需要访问设备位置,除需要将应用声明为允许后台运行外,还必须申请ohos.permission.LOCATION_IN_BACKGROUND权限,这样应用在切入后台之后,系统可以继续上报位置信息。
开发者可以在应用配置文件中声明所需要的权限,具体可参考[授权申请指导](../../../application-dev/security/accesstoken-guidelines.md)
**关键的接口/组件变更**
| 类名 | 接口类型 | 接口声明 | 变更类型 |
| -- | -- | -- | -- |
|wifiManager| method | function scan(): void; | 权限变更为ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
|wifiManager| method | function getScanResults(): Promise<Array<WifiScanInfo>>; | 权限变更为ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or (ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION)) |
|wifiManager| method | function getScanResults(callback: AsyncCallback<Array<WifiScanInfo>>): void; | 权限变更为ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or (ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION)) |
|wifiManager| method | function getScanResultsSync(): Array<WifiScanInfo>; | 权限变更为ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or (ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION)) |
|wifiManager| method | function getCandidateConfigs(): Array<WifiDeviceConfig>; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
|wifiManager| method | function getDeviceConfigs(): Array<WifiDeviceConfig>; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.GET_WIFI_CONFIG |
|wifiManager| method | function getStations(): Array<StationInfo>; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT |
|wifiManager| method | function getCurrentGroup(): Promise<WifiP2pGroupInfo>; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
|wifiManager| method | function getCurrentGroup(callback: AsyncCallback<WifiP2pGroupInfo>): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
|wifiManager| method | function getP2pPeerDevices(): Promise<WifiP2pDevice[]>; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
|wifiManager| method | function getP2pPeerDevices(callback: AsyncCallback<WifiP2pDevice[]>): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
|wifiManager| method | function p2pConnect(config: WifiP2PConfig): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
|wifiManager| method | function startDiscoverDevices(): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
|wifiManager| method | function getP2pGroups(): Promise<Array<WifiP2pGroupInfo>>; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
|wifiManager| method | function getP2pGroups(callback: AsyncCallback<Array<WifiP2pGroupInfo>>): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
|wifiManager| method | function on(type: "p2pDeviceChange", callback: Callback<WifiP2pDevice>): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
|wifiManager| method | function off(type: "p2pDeviceChange", callback?: Callback<WifiP2pDevice>): void; | 权限变更为ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
|wifiManager| method | function on(type: "p2pPeerDeviceChange", callback: Callback<WifiP2pDevice[]>): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
|wifiManager| method | function off(type: "p2pPeerDeviceChange", callback?: Callback<WifiP2pDevice[]>): void; | 权限变更为ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION |
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册