This method does not behave correctly when wifi is connected but the last CONNECTIVITY_ACTION broadcast was not for wifi. This could happen due to another network connecting or disconnecting, such as VPN. Bug: 179774433 Test: test-only change Change-Id: Ib2010b3871133c38b6d508bf508134dd9b814ce2