зеркало из https://github.com/mozilla/pjs.git
Bug 424626 - Add a pref to make it possible to ignore NetworkManager's network status events, r=roc
This commit is contained in:
Родитель
b3cc1e062d
Коммит
6d5feb7559
|
@ -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<nsIPrefBranch2> 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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче