示例#1
0
void
Connection::UpdateFromNetworkInfo(const hal::NetworkInformation& aNetworkInfo)
{
  mType = static_cast<ConnectionType>(aNetworkInfo.type());
  mIsWifi = aNetworkInfo.isWifi();
  mDHCPGateway = aNetworkInfo.dhcpGateway();
}
示例#2
0
void
Connection::UpdateFromNetworkInfo(const hal::NetworkInformation& aNetworkInfo)
{
  mBandwidth = aNetworkInfo.bandwidth();
  mCanBeMetered = aNetworkInfo.canBeMetered();
  mIsWifi = aNetworkInfo.isWifi();
  mDHCPGateway = aNetworkInfo.dhcpGateway();
}
示例#3
0
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"));
  }
}