Closed Bug 912930 Opened 13 years ago Closed 12 years ago

Stop using adapteradded event

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: echou, Assigned: echou)

Details

When Gaia enables Bluetooth, the event "enabled" will be fired. Literally, after receiving this event, Gaia should be able to get a valid BluetoothAdapter instance by getDefaultAdapter() and do the following operations. In fact, however, Gaia has to wait for another event "adapteradded" coming.
cc Bluetooth main contributors. Any advice would be very welcome. :)
This is much more straightforward!
Assignee: nobody → arthur.chen
Assignee: arthur.chen → echou
Hi Eric, I don't know the exact current behavior, so take my opinion with a grain of salt. Do you propose to remove 'adapteradded' completely or just for the first adapter? I'd go for the latter. If you remove 'adapteradded' completely, it might become a problem on the Desktop, where adapters can be added and removed at will. getDefaultAdapter() returns a DOM request. I suggest to continue with using 'adapteradded' for all adapters, including the first one, but only fire success for the DOM request of getDefaultAdapter after 'adapteradded' for the first adapter has been processed. The benefit of this approach is that the semantics of the API will remain straight-forward, but you don't have to wait for the first adapter explicitly.
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #3) > Do you propose to remove 'adapteradded' completely or just for the first > adapter? I'd go for the latter. If you remove 'adapteradded' completely, it > might become a problem on the Desktop, where adapters can be added and > removed at will. Second to this. Or, just keep the way it is sounds even better for me. The original way it more flexible and doesn't really seem to bring any serious inconvenience.
Quick note: once bug 939637 lands, we have to revise the test case as well when we try to do something to event adapteradded.
Close this as invalid since we're about to have a set of better, well-designed API. :) https://groups.google.com/forum/#!topic/mozilla.dev.webapi/SSVxpdq_lfQ
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.