1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
https://bugzilla.mozilla.org/show_bug.cgi?id=639959
--- source/toolkit/system/dbus/nsNetworkManagerListener.cpp.foo 2011-03-08 14:26:28.167074923 -0600
+++ source/toolkit/system/dbus/nsNetworkManagerListener.cpp 2011-03-08 14:30:54.260748294 -0600
@@ -51,15 +51,13 @@
#define NM_DBUS_SERVICE "org.freedesktop.NetworkManager"
#define NM_DBUS_PATH "/org/freedesktop/NetworkManager"
#define NM_DBUS_INTERFACE "org.freedesktop.NetworkManager"
-#define NM_DBUS_SIGNAL_STATE_CHANGE "StateChange"
-typedef enum NMState
-{
- NM_STATE_UNKNOWN = 0,
- NM_STATE_ASLEEP,
- NM_STATE_CONNECTING,
- NM_STATE_CONNECTED,
- NM_STATE_DISCONNECTED
-} NMState;
+#define NM_DBUS_SIGNAL_STATE_CHANGE "StateChange" /* Deprecated in 0.7.x */
+#define NM_DBUS_SIGNAL_STATE_CHANGED "StateChanged"
+
+#define NM_STATE_CONNECTED_OLD 3
+#define NM_STATE_CONNECTED_LOCAL 50
+#define NM_STATE_CONNECTED_SITE 60
+#define NM_STATE_CONNECTED_GLOBAL 70
nsNetworkManagerListener::nsNetworkManagerListener() :
mLinkUp(PR_TRUE), mNetworkManagerActive(PR_FALSE),
@@ -174,7 +172,9 @@
PRBool
nsNetworkManagerListener::HandleMessage(DBusMessage* message) {
if (dbus_message_is_signal(message, NM_DBUS_INTERFACE,
- NM_DBUS_SIGNAL_STATE_CHANGE)) {
+ NM_DBUS_SIGNAL_STATE_CHANGE) ||
+ dbus_message_is_signal(message, NM_DBUS_INTERFACE,
+ NM_DBUS_SIGNAL_STATE_CHANGED)) {
UpdateNetworkStatus(message);
return PR_TRUE;
}
@@ -191,7 +191,10 @@
mNetworkManagerActive = PR_TRUE;
PRBool wasUp = mLinkUp;
- mLinkUp = result == NM_STATE_CONNECTED;
+ 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;
|