void
nsNetworkManagerListener::UpdateNetworkStatus(DBusMessage* msg) {
  PRInt32 result;
  if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32, &result,
                             DBUS_TYPE_INVALID))
    return;
  
  mNetworkManagerActive = PR_TRUE;
  
  PRBool wasUp = mLinkUp;
  mLinkUp = result == NM_STATE_CONNECTED;
  if (wasUp == mLinkUp)
    return;

  NotifyNetworkStatusObservers();
}
void
nsNetworkManagerListener::UpdateNetworkStatus(DBusMessage* msg)
{
  int32_t result;
  if (!dbus_message_get_args(msg, nullptr, DBUS_TYPE_UINT32, &result,
                             DBUS_TYPE_INVALID)) {
    return;
  }

  mNetworkManagerActive = true;

  bool wasUp = mLinkUp;
  mLinkUp = result == NM_STATE_CONNECTED_OLD ||
            result == NM_STATE_CONNECTED_LOCAL ||
            result == NM_STATE_CONNECTED_SITE ||
            result == NM_STATE_CONNECTED_GLOBAL;
  if (wasUp == mLinkUp) {
    return;
  }

  NotifyNetworkStatusObservers();
}
void
nsNetworkManagerListener::UnregisterWithConnection(DBusConnection* connection) {
  mNetworkManagerActive = PR_FALSE;
  NotifyNetworkStatusObservers();
}