From f130bee3f744a1a155859c89555d06967d2b7ced Mon Sep 17 00:00:00 2001 From: liu-binjun Date: Wed, 30 Nov 2022 11:36:22 +0800 Subject: [PATCH] bugfix:Modify the application method of ohos.permission.LOCATION permission Signed-off-by: liu-binjun --- api/@ohos.geoLocationManager.d.ts | 30 ------------------------------ api/@ohos.wifiManager.d.ts | 30 +++++++++++++++--------------- 2 files changed, 15 insertions(+), 45 deletions(-) diff --git a/api/@ohos.geoLocationManager.d.ts b/api/@ohos.geoLocationManager.d.ts index c7d1176383..9b6af91ce3 100644 --- a/api/@ohos.geoLocationManager.d.ts +++ b/api/@ohos.geoLocationManager.d.ts @@ -307,36 +307,6 @@ declare namespace geoLocationManager { */ function isLocationEnabled(): boolean; - /** - * Request enable location. The user needs to confirm whether to enable the location switch. - * @permission ohos.permission.APPROXIMATELY_LOCATION - * @param { AsyncCallback } callback - Indicates the callback for reporting the user confirmation result, - * If the function fails to execute, the error message will be carried in the first parameter err of AsyncCallback, - * If the function executes successfully, returns {@code true} if user agrees to open the location switch, returns {@code false} otherwise. - * @returns { void }. - * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 401 - Parameter error. - * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 3301000 - Location service is unavailable. - * @throws { BusinessError } 3301700 - No response to the request. - * @syscap SystemCapability.Location.Location.Core - * @since 9 - */ - function requestEnableLocation(callback: AsyncCallback): void; - - /** - * Request enable location. The user needs to confirm whether to enable the location switch. - * @permission ohos.permission.APPROXIMATELY_LOCATION - * @returns { Promise } The promise returned by the function. Returns {@code true} if user agrees to open the location switch, returns {@code false} otherwise. - * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 3301000 - Location service is unavailable. - * @throws { BusinessError } 3301700 - No response to the request. - * @syscap SystemCapability.Location.Location.Core - * @since 9 - */ - function requestEnableLocation(): Promise; - /** * Enable location switch. * @permission ohos.permission.MANAGE_SECURE_SETTINGS diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index ee9bdc6388..ad31e3a9f7 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -79,7 +79,7 @@ declare namespace wifiManager { * @throws {BusinessError} 2501000 - Operation failed. * @throws {BusinessError} 2501001 - Wifi is closed. * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION */ function scan(): void; @@ -93,7 +93,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) + * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or (ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION)) */ function getScanResults(): Promise>; function getScanResults(callback: AsyncCallback>): void; @@ -108,7 +108,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) + * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or (ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION)) */ function getScanResultsSync(): Array; @@ -184,7 +184,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION */ function getCandidateConfigs(): Array; @@ -424,7 +424,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.GET_WIFI_CONFIG + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. */ function getDeviceConfigs(): Array; @@ -612,7 +612,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core - * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. */ function getStations(): Array; @@ -640,7 +640,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION */ function getCurrentGroup(): Promise; function getCurrentGroup(callback: AsyncCallback): void; @@ -654,7 +654,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION */ function getP2pPeerDevices(): Promise; function getP2pPeerDevices(callback: AsyncCallback): void; @@ -712,7 +712,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION */ function p2pConnect(config: WifiP2PConfig): void; @@ -736,7 +736,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION */ function startDiscoverDevices(): void; @@ -778,7 +778,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION * @systemapi Hide this for inner system use. */ function getP2pGroups(): Promise>; @@ -1141,7 +1141,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION */ function on(type: "p2pDeviceChange", callback: Callback): void; @@ -1155,7 +1155,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @permission ohos.permission.LOCATION + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION */ function off(type: "p2pDeviceChange", callback?: Callback): void; @@ -1169,7 +1169,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION */ function on(type: "p2pPeerDeviceChange", callback: Callback): void; @@ -1182,7 +1182,7 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @permission ohos.permission.LOCATION + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION */ function off(type: "p2pPeerDeviceChange", callback?: Callback): void; -- Gitee