Wi-Fi Changelog

cl.wifiManager.1 Change of API Permissions

1 Involved APIs

API Permission Before Change Permission After Change
function getCandidateConfigs(): Array; The location permission is required. The location permission is not required.
function getDeviceConfigs(): Array; The location permission is required. The location permission is not required.
function getStations(): Array; The location permission is required.
A physical MAC address is returned.
The location permission is not required.
A random MAC address is returned (the GET_PEER_MAC permission is required if a real MAC address is returned).
function getCurrentP2pGroup(): Promise; The location permission is required. The location permission is not required.
function getCurrentP2pGroup(callback: AsyncCallback): void; The location permission is required. The location permission is not required.
function getP2pPeerDevices(): Promise<WifiP2pDevice[]>; The location permission is required.
A physical MAC address is returned.
The location permission is not required.
A random MAC address is returned (the GET_PEER_MAC permission is required if a real MAC address is returned).
function getP2pPeerDevices(callback: AsyncCallback<WifiP2pDevice[]>): void; The location permission is required. The location permission is not required.
A random MAC address is returned (the GET_PEER_MAC permission is required if a real MAC address is returned).
function p2pConnect(config: WifiP2PConfig): void; The location permission is required. The location permission is not required.
function startDiscoverDevices(): void; The location permission is required. The location permission is not required.
function getP2pGroups(): Promise<Array>; The location permission is required. The location permission is not required.
function getP2pGroups(callback: AsyncCallback<Array>): void; The location permission is required. The location permission is not required.
function on(type: "p2pDeviceChange", callback: Callback): void; The location permission is required.
A physical MAC address is returned.
The location permission is not required.
A random MAC address is returned (the GET_PEER_MAC permission is required if a real MAC address is returned).
function off(type: "p2pDeviceChange", callback?: Callback): void; The location permission is required.
A physical MAC address is returned.
The location permission is not required.
A random MAC address is returned (the GET_PEER_MAC permission is required if a real MAC address is returned).
function on(type: "p2pPeerDeviceChange", callback: Callback<WifiP2pDevice[]>): void; The location permission is required.
A physical MAC address is returned.
The location permission is not required.
A random MAC address is returned (the GET_PEER_MAC permission is required if a real MAC address is returned).
function off(type: "p2pPeerDeviceChange", callback?: Callback<WifiP2pDevice[]>): void; The location permission is required.
A physical MAC address is returned.
The location permission is not required.
A random MAC address is returned (the GET_PEER_MAC permission is required if a real MAC address is returned).

Change Impact

If your application is developed using the involved APIs of earlier versions, apply for the required permissions for the new APIs.

Key API/Component Changes NA

Adaptation Guide Apply for the required permissions for the involved APIs.

Deprecated scan(), getScanResults(), and getScanResultsSync(), and added new APIs to provide the related capabilities.

Change Impact The following APIs are deprecated since API 10, without affecting the compatibility of developed applications. However, you are advised to use new APIs.

Key API/Component Changes

Deprecated API New API Description
function scan(): void; function startScan(): void; Use startScan to start Wi-Fi scan.
function getScanResults(): Promise<Array>; function getScanInfoList(): Array; Use getScanInfoList to obtain the scan result.
function getScanResults(callback: AsyncCallback<Array>): void; function getScanInfoList(): Array; Use getScanInfoList to obtain the scan result.
function getScanResultsSync(): Array; function getScanInfoList(): Array; Use getScanInfoList to obtain the scan result.

Adaptation Guide Use the new APIs.