void Connection::UpdateFromNetworkInfo(const hal::NetworkInformation& aNetworkInfo) { mType = static_cast<ConnectionType>(aNetworkInfo.type()); mIsWifi = aNetworkInfo.isWifi(); mDHCPGateway = aNetworkInfo.dhcpGateway(); }
void Connection::UpdateFromNetworkInfo(const hal::NetworkInformation& aNetworkInfo) { mBandwidth = aNetworkInfo.bandwidth(); mCanBeMetered = aNetworkInfo.canBeMetered(); mIsWifi = aNetworkInfo.isWifi(); mDHCPGateway = aNetworkInfo.dhcpGateway(); }
void RequestSyncWifiService::Notify(const hal::NetworkInformation& aNetworkInfo) { bool isWifi = aNetworkInfo.isWifi(); if (isWifi == mIsWifi) { return; } mIsWifi = isWifi; nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService(); if (obs) { obs->NotifyObservers(nullptr, "wifi-state-changed", mIsWifi ? MOZ_UTF16("enabled") : MOZ_UTF16("disabled")); } }