Commit 9970ee06 authored by Kyle Horimoto's avatar Kyle Horimoto Committed by Commit Bot

[CrOS Cellular] Fix click on Cellular network in mobile subpage.

Before this CL, clicking on a non-connectable Cellular network in the
mobile subpage would result in no action except for some UI jank. This
was due to the fact that the network cannot be configured and thus it is
not possible to attempt a connection.

This CL fixes this situation by navigating to the network's detail page
in this situation.

Bug: 947351
Change-Id: If390de1f8fd5476fbae193a9597f64dc31fa9143
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1777067
Auto-Submit: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692212}
parent da073a9c
......@@ -576,7 +576,7 @@ Polymer({
assert(this.defaultNetwork !== undefined);
const networkState = e.detail;
e.target.blur();
if (this.canConnect_(networkState)) {
if (this.canAttemptConnection_(networkState)) {
this.fire('network-connect', {networkState: networkState});
return;
}
......@@ -601,11 +601,13 @@ Polymer({
},
/**
* Determines whether or not a network state can be connected to.
* Determines whether or not it is possible to attempt a connection to the
* provided network (e.g., whether it's possible to connect or configure the
* network for connection).
* @param {!OncMojo.NetworkStateProperties} state The network state.
* @private
*/
canConnect_: function(state) {
canAttemptConnection_: function(state) {
if (state.connectionState != mojom.ConnectionStateType.kNotConnected) {
return false;
}
......@@ -618,6 +620,11 @@ Polymer({
this.defaultNetwork.connectionState))) {
return false;
}
// Cellular networks do not have a configuration flow, so it's not possible
// to attempt a connection if the network is not conncetable.
if (state.type == mojom.NetworkType.kCellular && !state.connectable) {
return false;
}
return true;
},
......
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