Commit f301a0b3 authored by Michael Ershov's avatar Michael Ershov Committed by Commit Bot

Fix updating WiFi config on deleting ONC policy

Request full update of a WiFi service state also on removing it
from a profile.

Also fix FakeShillServiceClient to completely delete VPN service
config when it asked to do so (instead of keeping some settings
that makes sense for more persistent/real services like wifi or
ethernet).

Bug: 1032067
Change-Id: I19d6d2cd0e09c86e61af8a0151017fd93a545395
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1963860Reviewed-by: default avatarPavol Marko <pmarko@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Michael Ershov <miersh@google.com>
Cr-Commit-Position: refs/heads/master@{#736324}
parent 9680dd8c
......@@ -610,7 +610,10 @@ bool FakeShillServiceClient::ClearConfiguredServiceProperties(
const base::Value* visible_property = service_dict->FindKeyOfType(
shill::kVisibleProperty, base::Value::Type::BOOLEAN);
if (!visible_property || !visible_property->GetBool()) {
const base::Value* service_type = service_dict->FindKeyOfType(
shill::kTypeProperty, base::Value::Type::STRING);
if (!visible_property || !visible_property->GetBool() || !service_type ||
(service_type->GetString() == shill::kTypeVPN)) {
stub_services_.RemoveKey(service_path);
RemoveService(service_path);
return true;
......
......@@ -81,8 +81,8 @@ class COMPONENT_EXPORT(SHILL_CLIENT) ShillServiceClient {
// referenced by |service_path| is visible, keeps only its "intrinsic"
// properties and removes all other properties. Intrinsic properties are
// properties that describe the identity or the state of the service and
// are not configurable, such as SSID (for wifi), signal strength (for wifi)
// or provider (for VPN). All other properties are removed.
// are not configurable, such as SSID (for wifi), signal strength (for
// wifi). All other properties are removed.
virtual bool ClearConfiguredServiceProperties(
const std::string& service_path) = 0;
......
......@@ -1373,10 +1373,9 @@ void NetworkStateHandler::UpdateNetworkServiceProperty(
if (!changed)
return;
// If added to a Profile, request a full update so that a NetworkState
// gets created.
bool request_update =
prev_profile_path.empty() && !network->profile_path().empty();
// If added or removed from a Profile, request a full update so that a
// NetworkState gets created.
bool request_update = prev_profile_path != network->profile_path();
bool sort_networks = false;
bool notify_default = network->path() == default_network_path_;
bool notify_connection_state = false;
......
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