Bug 990458 - Part 4: WifiP2pManager changes to support updateNetworkInterface(). r=vchang
authorJessica Jong <jjong@mozilla.com>
Tue, 29 Jul 2014 16:44:29 +0800
changeset 196675 f03a68ec40ed0f11e8604cc15444b0b4a89a3430
parent 196674 0531a7a7f17e13567932e760c8800bcd27b7c098
child 196676 108f31c71a0b7f544768de95e1a9e76e86b4ec95
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersvchang
bugs990458
milestone34.0a1
Bug 990458 - Part 4: WifiP2pManager changes to support updateNetworkInterface(). r=vchang
dom/wifi/WifiP2pManager.jsm
--- a/dom/wifi/WifiP2pManager.jsm
+++ b/dom/wifi/WifiP2pManager.jsm
@@ -16,18 +16,16 @@ Cu.import("resource://gre/modules/system
 XPCOMUtils.defineLazyServiceGetter(this, "gSysMsgr",
                                    "@mozilla.org/system-message-internal;1",
                                    "nsISystemMessagesInternal");
 
 XPCOMUtils.defineLazyServiceGetter(this, "gNetworkManager",
                                    "@mozilla.org/network/manager;1",
                                    "nsINetworkManager");
 
-const kNetworkInterfaceStateChangedTopic = "network-interface-state-changed";
-
 this.EXPORTED_SYMBOLS = ["WifiP2pManager"];
 
 const EVENT_IGNORED                      = -1;
 const EVENT_UNKNOWN                      = -2;
 
 // Events from supplicant for p2p.
 const EVENT_P2P_DEVICE_FOUND             = 0;
 const EVENT_P2P_DEVICE_LOST              = 1;
@@ -1471,19 +1469,17 @@ function P2pStateMachine(aP2pCommand, aN
     if (_p2pNetworkInterface.registered) {
       resetP2pNetworkInterface();
       gNetworkManager.unregisterNetworkInterface(_p2pNetworkInterface);
       _p2pNetworkInterface.registered = false;
     }
   }
 
   function handleP2pNetworkInterfaceStateChanged() {
-    Services.obs.notifyObservers(_p2pNetworkInterface,
-                                 kNetworkInterfaceStateChangedTopic,
-                                 null);
+    gNetworkManager.updateNetworkInterface(_p2pNetworkInterface);
   }
 
   // Handle 'P2P_GROUP_STARTED' event.
   //
   // @param aInfo information carried by "P2P_GROUP_REMOVED" event:
   //   .ifname
   //   .role: "GO" or "client".
   //