Closed Bug 927298 Opened 11 years ago Closed 6 years ago

Support wifi hotspot status APIs

Categories

(Firefox OS Graveyard :: Wifi, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(tracking-b2g:backlog)

RESOLVED WONTFIX
tracking-b2g backlog

People

(Reporter: vchang, Unassigned)

References

Details

Attachments

(2 files, 3 obsolete files)

Currently, we use settings to indicate the enabling or disabling status of wifi hotspot. We need at least below APIs to indicate the status of wifi hotspot to gaia.  

   interface nsIDOMWifiManager : nsISupports
   {
     attribute nsIDOMEventListener onwifitetheringenabled;
     attribute nsIDOMEventListener onwifitetheringdisabled;
   }
Blocks: 917097
Hi Vincent,

Any updates?
Assignee: nobody → kchang
Assignee: kchang → dlee
Attachment #829150 - Attachment is obsolete: true
Attachment #829153 - Flags: review?(vchang)
Attachment #829153 - Attachment is obsolete: true
Attachment #829153 - Flags: review?(vchang)
Depends on: 936367
Status: NEW → ASSIGNED
Blocks: 947174
Depends on: 886110
blocking-b2g: --- → backlog
Attached patch WIP patch v1 (obsolete) — Splinter Review
Attachment #8477319 - Attachment is obsolete: true
Attachment #8479687 - Flags: review?(vchang)
Perfect! We finally can have an API to verify the tethering enable/disable result
in the test cases!
Comment on attachment 8479687 [details] [diff] [review]
Part2. DOM and WifiWorker implementation

Review of attachment 8479687 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/tethering/TetheringManager.js
@@ +41,3 @@
>      this.initDOMRequestHelper(aWindow, messages);
> +
> +    cpmm.sendSyncMessage("WifiManager:getState");

Do we need this for Tethering?

::: dom/wifi/WifiWorker.js
@@ +3444,5 @@
>      this.setWifiApEnabled(enabled, function() {
>        if ((enabled && WifiManager.tetheringState == "COMPLETED") ||
>            (!enabled && WifiManager.tetheringState == "UNINITIALIZED")) {
>          self._sendMessage(message, true, msg.data, msg);
> +        self._fireEvent("wifitetheringstateupdate", { state: enabled });

Do we still need the APIs? It seems that setTetheringEnabled() API has enough information to react tethering status.
Attachment #8479687 - Flags: review?(vchang)
Attachment #8479686 - Flags: review?(vchang)
(In reply to Vincent Chang[:vchang] from comment #8)
> Comment on attachment 8479687 [details] [diff] [review]
> Part2. DOM and WifiWorker implementation
> 
> Review of attachment 8479687 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/tethering/TetheringManager.js
> @@ +41,3 @@
> >      this.initDOMRequestHelper(aWindow, messages);
> > +
> > +    cpmm.sendSyncMessage("WifiManager:getState");
> 
> Do we need this for Tethering?
> 
In WifiWorker's implementation, getState will register domManager so if there is any event fired from WifiWorker, DOM layer can receive the message. For this patch, the required message is wifitetheringstateupdate.

> ::: dom/wifi/WifiWorker.js
> @@ +3444,5 @@
> >      this.setWifiApEnabled(enabled, function() {
> >        if ((enabled && WifiManager.tetheringState == "COMPLETED") ||
> >            (!enabled && WifiManager.tetheringState == "UNINITIALIZED")) {
> >          self._sendMessage(message, true, msg.data, msg);
> > +        self._fireEvent("wifitetheringstateupdate", { state: enabled });
> 
> Do we still need the APIs? It seems that setTetheringEnabled() API has
> enough information to react tethering status.

If a webpage only interested in knowing tethering state change , he can listen to this event to know if any other webpage change the tethering status by using setTetheringEnabled API.
Hi Vincent,
Could you help check if comment 9 is reasonable. thanks
Flags: needinfo?(vchang)
(In reply to Dimi Lee[:dimi][:dlee] from comment #9)
> (In reply to Vincent Chang[:vchang] from comment #8)
> > Comment on attachment 8479687 [details] [diff] [review]
> > Part2. DOM and WifiWorker implementation
> > 
> > Review of attachment 8479687 [details] [diff] [review]:
> > -----------------------------------------------------------------
> > 
> > ::: dom/tethering/TetheringManager.js
> > @@ +41,3 @@
> > >      this.initDOMRequestHelper(aWindow, messages);
> > > +
> > > +    cpmm.sendSyncMessage("WifiManager:getState");
> > 
> > Do we need this for Tethering?
> > 
> In WifiWorker's implementation, getState will register domManager so if
> there is any event fired from WifiWorker, DOM layer can receive the message.
> For this patch, the required message is wifitetheringstateupdate.

Yeah, you are right. So we should prevent _fireEvent() sending message to wrong dommanager?   
 
> > ::: dom/wifi/WifiWorker.js
> > @@ +3444,5 @@
> > >      this.setWifiApEnabled(enabled, function() {
> > >        if ((enabled && WifiManager.tetheringState == "COMPLETED") ||
> > >            (!enabled && WifiManager.tetheringState == "UNINITIALIZED")) {
> > >          self._sendMessage(message, true, msg.data, msg);
> > > +        self._fireEvent("wifitetheringstateupdate", { state: enabled });
> > 
> > Do we still need the APIs? It seems that setTetheringEnabled() API has
> > enough information to react tethering status.
> 
> If a webpage only interested in knowing tethering state change , he can
> listen to this event to know if any other webpage change the tethering
> status by using setTetheringEnabled API.

Make sense.
Flags: needinfo?(vchang)
blocking-b2g: backlog → ---
Not actively working on this, if anyone is interested in this please feel free to take it.
Assignee: dlee → nobody
Status: ASSIGNED → NEW
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: