diff --git a/toolkit/system/dbus/nsNetworkManagerListener.cpp b/toolkit/system/dbus/nsNetworkManagerListener.cpp index 12b18fff5d23..42e2d8edf2d3 100644 --- a/toolkit/system/dbus/nsNetworkManagerListener.cpp +++ b/toolkit/system/dbus/nsNetworkManagerListener.cpp @@ -45,6 +45,8 @@ #include "nsServiceManagerUtils.h" #include "nsIObserverService.h" #include "nsStringAPI.h" +#include "nsIPrefBranch2.h" +#include "nsIPrefService.h" // Define NetworkManager API constants. This avoids a dependency on // NetworkManager-devel. @@ -187,7 +189,17 @@ nsNetworkManagerListener::UpdateNetworkStatus(DBusMessage* msg) { if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32, &result, DBUS_TYPE_INVALID)) return; - + + // Don't update status if disabled by pref + nsCOMPtr prefs = + do_GetService(NS_PREFSERVICE_CONTRACTID); + if (prefs) { + PRBool ignore = PR_FALSE; + prefs->GetBoolPref("toolkit.networkmanager.disable", &ignore); + if (ignore) + return; + } + mNetworkManagerActive = PR_TRUE; PRBool wasUp = mLinkUp;