From d00dd9bddf1b2c78aff0b858ef0cc5c2a59b2817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Thu, 26 Sep 2019 12:57:40 +0200 Subject: Fix use of deprecated method for scanning wifi networks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scanForNetworksWithParameters has ben removed in the sdk that ships with XCode 11. Replace its use with scanForNetworksWithName. The results should be the same. Task-number: QTBUG-78997 Change-Id: Ifaeb6b380d02364133280b44644ae8ca1e51119a Reviewed-by: Peter Varga Reviewed-by: Jüri Valdmann (cherry picked from commit 1f1bd0af331476d46fe69ceb6df14b82f98cd54d) Reviewed-by: Dmitriy Kuminov Reviewed-by: Allan Sandfeld Jensen --- chromium/device/geolocation/wifi_data_provider_mac.mm | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/chromium/device/geolocation/wifi_data_provider_mac.mm b/chromium/device/geolocation/wifi_data_provider_mac.mm index a5f978bf7f7..9649d9bc14f 100644 --- a/chromium/device/geolocation/wifi_data_provider_mac.mm +++ b/chromium/device/geolocation/wifi_data_provider_mac.mm @@ -15,10 +15,8 @@ #include "device/geolocation/wifi_data_provider_common.h" #include "device/geolocation/wifi_data_provider_manager.h" -extern "C" NSString* const kCWScanKeyMerge; - @interface CWInterface (Private) -- (NSArray*)scanForNetworksWithParameters:(NSDictionary*)params +- (NSSet *)scanForNetworksWithName:(NSString *)networkName error:(NSError**)error; @end @@ -39,9 +37,6 @@ class CoreWlanApi : public WifiDataProviderCommon::WlanApiInterface { bool CoreWlanApi::GetAccessPointData(WifiData::AccessPointDataSet* data) { base::mac::ScopedNSAutoreleasePool auto_pool; - // Initialize the scan parameters with scan key merging disabled, so we get - // every AP listed in the scan without any SSID de-duping logic. - NSDictionary* params = @{ kCWScanKeyMerge : @NO }; NSSet* supported_interfaces = [CWInterface interfaceNames]; NSUInteger interface_error_count = 0; @@ -57,8 +52,8 @@ bool CoreWlanApi::GetAccessPointData(WifiData::AccessPointDataSet* data) { const base::TimeTicks start_time = base::TimeTicks::Now(); NSError* err = nil; - NSArray* scan = - [corewlan_interface scanForNetworksWithParameters:params error:&err]; + NSSet* scan = + [corewlan_interface scanForNetworksWithName:nil error:&err]; const int error_code = [err code]; const int count = [scan count]; // We could get an error code but count != 0 if the scan was interrupted, -- cgit v1.2.1