Commit c8f6e70a authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

Network config: Unset AutoConnect by default

Bug: 819148
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Idc7a6a4c695c4a6b53989689c245fa704b6b3204
Reviewed-on: https://chromium-review.googlesource.com/973920Reviewed-by: default avatarToni Barzic <tbarzic@chromium.org>
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544906}
parent 523bb320
...@@ -1169,6 +1169,9 @@ Polymer({ ...@@ -1169,6 +1169,9 @@ Polymer({
/** @private */ /** @private */
getPropertiesToSet_: function() { getPropertiesToSet_: function() {
var propertiesToSet = Object.assign({}, this.configProperties_); var propertiesToSet = Object.assign({}, this.configProperties_);
// Do not set AutoConnect by default, the connection manager will set
// it to true on a successful connection.
CrOnc.setTypeProperty(propertiesToSet, 'AutoConnect', undefined);
if (this.guid) if (this.guid)
propertiesToSet.GUID = this.guid; propertiesToSet.GUID = this.guid;
var eap = this.getEap_(propertiesToSet); var eap = this.getEap_(propertiesToSet);
......
...@@ -499,7 +499,8 @@ CrOnc.setValidStaticIPConfig = function(config, properties) { ...@@ -499,7 +499,8 @@ CrOnc.setValidStaticIPConfig = function(config, properties) {
* @param {!chrome.networkingPrivate.NetworkConfigProperties} properties * @param {!chrome.networkingPrivate.NetworkConfigProperties} properties
* The ONC property dictionary to modify. * The ONC property dictionary to modify.
* @param {string} key The property key which may be nested, e.g. 'Foo.Bar'. * @param {string} key The property key which may be nested, e.g. 'Foo.Bar'.
* @param {!CrOnc.NetworkPropertyType} value The property value to set. * @param {!CrOnc.NetworkPropertyType|undefined} value The property value to
* set. If undefined the property will be removed.
*/ */
CrOnc.setProperty = function(properties, key, value) { CrOnc.setProperty = function(properties, key, value) {
while (true) { while (true) {
...@@ -512,7 +513,10 @@ CrOnc.setProperty = function(properties, key, value) { ...@@ -512,7 +513,10 @@ CrOnc.setProperty = function(properties, key, value) {
properties = properties[keyComponent]; properties = properties[keyComponent];
key = key.substr(index + 1); key = key.substr(index + 1);
} }
properties[key] = value; if (value === undefined)
delete properties[key];
else
properties[key] = value;
}; };
/** /**
...@@ -520,7 +524,8 @@ CrOnc.setProperty = function(properties, key, value) { ...@@ -520,7 +524,8 @@ CrOnc.setProperty = function(properties, key, value) {
* @param {!chrome.networkingPrivate.NetworkConfigProperties} properties The * @param {!chrome.networkingPrivate.NetworkConfigProperties} properties The
* ONC properties to set. properties.Type must be set already. * ONC properties to set. properties.Type must be set already.
* @param {string} key The type property key, e.g. 'AutoConnect'. * @param {string} key The type property key, e.g. 'AutoConnect'.
* @param {!CrOnc.NetworkPropertyType} value The property value to set. * @param {!CrOnc.NetworkPropertyType|undefined} value The property value to
* set. If undefined the property will be removed.
*/ */
CrOnc.setTypeProperty = function(properties, key, value) { CrOnc.setTypeProperty = function(properties, key, value) {
if (properties.Type == undefined) { if (properties.Type == undefined) {
......
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