1e41f4b71Sopenharmony_ci# Wi-Fi Subsystem ChangeLog 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci## cl.location.1 Location Service Permission Change 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ciFrom API version 9, the **ohos.permission.APPROXIMATELY_LOCATION** permission is added for obtaining the approximate location. 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ciIf you use API version 9 or later, you need to apply for both the **ohos.permission.LOCATION** and **ohos.permission.APPROXIMATELY_LOCATION** permissions. Applying for only the **ohos.permission.LOCATION** permission will fail. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci**Change Impacts** 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ciApplications using API versions earlier than 9 are not affected. For an application using API version 9 or later, the method for applying for the location permission is changed. The details are as follows: 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ciBefore using basic location capabilities, check whether your application has been granted the permission to access the device location information. If not, your application needs to obtain the permission from the user as described below. 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ciThe system provides the following location permissions: 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci- ohos.permission.LOCATION 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci- ohos.permission.APPROXIMATELY_LOCATION 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci- ohos.permission.LOCATION_IN_BACKGROUND 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ciIf your application needs to access the device location information, it must first apply for required permissions. Specifically speaking: 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ciAPI versions earlier than 9: Apply for **ohos.permission.LOCATION**. 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ciAPI version 9 and later: Apply for **ohos.permission.APPROXIMATELY_LOCATION**, or apply for **ohos.permission.APPROXIMATELY_LOCATION** and **ohos.permission.LOCATION**. Note that **ohos.permission.LOCATION** cannot be applied for separately. 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci| API Version| Location Permission | Permission Application Result| Location Accuracy | 30e41f4b71Sopenharmony_ci| ------------- | ------------------------------------------------------------ | -------- | -------------------------------- | 31e41f4b71Sopenharmony_ci| Earlier than 9 | ohos.permission.LOCATION | Success | Location accurate to meters| 32e41f4b71Sopenharmony_ci| 9 and later | ohos.permission.LOCATION | Failure | No location obtained | 33e41f4b71Sopenharmony_ci| 9 and later | ohos.permission.APPROXIMATELY_LOCATION | Success | Location accurate to 5 kilometers | 34e41f4b71Sopenharmony_ci| 9 and later | ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.LOCATION| Success | Location accurate to meters| 35e41f4b71Sopenharmony_ci 36e41f4b71Sopenharmony_ciIf your application needs to access the device location information when running in the background, it must be configured to be able to run in the background and be granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information after your application moves to the background. 37e41f4b71Sopenharmony_ci 38e41f4b71Sopenharmony_ciYou can declare the required permissions in your application's configuration file. For details, see the [permission application guide](../../../application-dev/security/accesstoken-guidelines.md). 39e41f4b71Sopenharmony_ci 40e41f4b71Sopenharmony_ci**Key API/Component Changes** 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_ci| Class | API Type| Declaration | Change Type | 43e41f4b71Sopenharmony_ci| ----------- | -------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 44e41f4b71Sopenharmony_ci| wifiManager | method | function scan(): void; | The permission is changed to **ohos.permission.SET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 45e41f4b71Sopenharmony_ci| wifiManager | method | function getScanResults(): Promise<Array<WifiScanInfo>>; | The permission is changed to **ohos.permission.GET_WIFI_INFO** and **ohos.permission.GET_WIFI_PEERS_MAC** or **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 46e41f4b71Sopenharmony_ci| wifiManager | method | function getScanResults(callback: AsyncCallback<Array<WifiScanInfo>>): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO** and **ohos.permission.GET_WIFI_PEERS_MAC** or **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 47e41f4b71Sopenharmony_ci| wifiManager | method | function getScanResultsSync(): Array<WifiScanInfo>; | The permission is changed to **ohos.permission.GET_WIFI_INFO** and **ohos.permission.GET_WIFI_PEERS_MAC** or **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 48e41f4b71Sopenharmony_ci| wifiManager | method | function getCandidateConfigs(): Array<WifiDeviceConfig>; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 49e41f4b71Sopenharmony_ci| wifiManager | method | function getDeviceConfigs(): Array<WifiDeviceConfig>; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, **ohos.permission.APPROXIMATELY_LOCATION**, and **ohos.permission.GET_WIFI_CONFIG**.| 50e41f4b71Sopenharmony_ci| wifiManager | method | function getStations(): Array<StationInfo>; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, **ohos.permission.APPROXIMATELY_LOCATION**, and **ohos.permission.MANAGE_WIFI_HOTSPOT**.| 51e41f4b71Sopenharmony_ci| wifiManager | method | function getCurrentGroup(): Promise<WifiP2pGroupInfo>; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 52e41f4b71Sopenharmony_ci| wifiManager | method | function getCurrentGroup(callback: AsyncCallback<WifiP2pGroupInfo>): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 53e41f4b71Sopenharmony_ci| wifiManager | method | function getP2pPeerDevices(): Promise<WifiP2pDevice[]>; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 54e41f4b71Sopenharmony_ci| wifiManager | method | function getP2pPeerDevices(callback: AsyncCallback<WifiP2pDevice[]>): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 55e41f4b71Sopenharmony_ci| wifiManager | method | function p2pConnect(config: WifiP2PConfig): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 56e41f4b71Sopenharmony_ci| wifiManager | method | function startDiscoverDevices(): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 57e41f4b71Sopenharmony_ci| wifiManager | method | function getP2pGroups(): Promise<Array<WifiP2pGroupInfo>>; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 58e41f4b71Sopenharmony_ci| wifiManager | method | function getP2pGroups(callback: AsyncCallback<Array<WifiP2pGroupInfo>>): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 59e41f4b71Sopenharmony_ci| wifiManager | method | function on(type: "p2pDeviceChange", callback: Callback<WifiP2pDevice>): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 60e41f4b71Sopenharmony_ci| wifiManager | method | function off(type: "p2pDeviceChange", callback?: Callback<WifiP2pDevice>): void; | The permission is changed to **ohos.permission.LOCATION** and **ohos.permission.APPROXIMATELY_LOCATION**.| 61e41f4b71Sopenharmony_ci| wifiManager | method | function on(type: "p2pPeerDeviceChange", callback: Callback<WifiP2pDevice[]>): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| 62e41f4b71Sopenharmony_ci| wifiManager | method | function off(type: "p2pPeerDeviceChange", callback?: Callback<WifiP2pDevice[]>): void; | The permission is changed to **ohos.permission.LOCATION** and **ohos.permission.APPROXIMATELY_LOCATION**.| 63