Commit 874cc41c authored by James Hollyer's avatar James Hollyer Committed by Commit Bot

Reject Wifi Access Points without MAC Addresses in Network Location API

Mac OS is now preventing applications from being able to see Wifi Access Point
MAC Addresses if location services are turned off.  We did not have a check
for this and we were assuming that if we got an access point then it would
have a MAC Address.  This caused bad requests to be sent to the Location API.
This CL added in a check so that we do not include access points without MAC
Addresses in the request body.

Bug: 956376
Change-Id: Ifa67e8e1e025f8b75087c68751f5bc544d910566
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1583587Reviewed-by: default avatarMatt Reynolds <mattreynolds@chromium.org>
Commit-Queue: James Hollyer <jameshollyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654726}
parent b1acb75d
......@@ -277,8 +277,10 @@ void AddWifiData(const WifiData& wifi_data,
auto wifi_access_point_list = std::make_unique<base::ListValue>();
for (auto* ap_data : access_points_by_signal_strength) {
auto wifi_dict = std::make_unique<base::DictionaryValue>();
AddString("macAddress", base::UTF16ToUTF8(ap_data->mac_address),
wifi_dict.get());
auto macAddress = base::UTF16ToUTF8(ap_data->mac_address);
if (macAddress.empty())
continue;
AddString("macAddress", macAddress, wifi_dict.get());
AddInteger("signalStrength", ap_data->radio_signal_strength,
wifi_dict.get());
AddInteger("age", age_milliseconds, wifi_dict.get());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment