Fix ConnectedNetworkByType() results during state transitions
If wifi and ethernet are both connected, and then the ethernet adapter is unplugged, network_list_ can end up looking like: network_list_[0] -> ethernet, idle network_list_[1] -> wifi, online shill will generally update the service's State property before it updates the manager's Services / ServiceCompleteList properties, leaving the now-idle service in the list. Since ConnectedNetworkByType() assumes that connected networks are listed first, it won't return the newly-active wifi network. Fix this by sorting the network list, and changing the sort function so that it doesn't prioritize idle ethernet services. BUG=768053 TEST=manually verify order with debug prints TEST=unit tests Change-Id: I3a110da7d99bd5e6463b86e17bc557124e875b85 Reviewed-on: https://chromium-review.googlesource.com/777970Reviewed-by:Steven Bennetts <stevenjb@chromium.org> Commit-Queue: Kevin Cernekee <cernekee@chromium.org> Cr-Commit-Position: refs/heads/master@{#517679}
Showing
Please register or sign in to comment