Closed
Bug 988254
Opened 11 years ago
Closed 11 years ago
NFC: this.defaultAdapter is null from nfc_handover_manager.js
Categories
(Firefox OS Graveyard :: NFC, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
1.4 S5 (11apr)
People
(Reporter: allstars.chh, Assigned: arno)
References
Details
Attachments
(1 file)
03-25 07:23:17.876: E/GeckoConsole(179): [JavaScript Error: "this.defaultAdapter is null" {file: "app://system.gaiamobile.org/js/nfc_handover_manager.js" line: 232}]
03-25 07:23:17.876: E/GeckoConsole(179): [JavaScript Error: "NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS: [JavaScript Error: "this.defaultAdapter is null" {file: "app://system.gaiamobile.org/js/nfc_handover_manager.js" line: 232}]'[JavaScript Error: "this.defaultAdapter is null" {file: "app://system.gaiamobile.org/js/nfc_handover_manager.js" line: 232}]' when calling method: [nsIDOMSystemMessageCallback::handleMessage]" {file: "null" line: 0}]
STR:
1. enable bluetooth from Settings
2. reboot
3. Go to Galley, select an image and try to use Shrinking UI to transfer the image
4. When the user slides the Shrinking UI, there's an error from nfc_handover_manager.js
I think the bluetooth-adapter-added event in
https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/nfc_handover_manager.js#L86
only come when Bluetooth is enabled,
so if you reboot after enabled bluetooth, the object defaultAdapter in nfc_handover_manager.js will still be null.
Updated•11 years ago
|
Component: Gaia::System → NFC
Reporter | ||
Updated•11 years ago
|
Flags: needinfo?(dgarnerlee)
Comment 1•11 years ago
|
||
I'll take a look. We might need to re-query for the bluetooth-adapter (somehow) if it is reboot, or maybe enforce initialization order if the events are going to miss their targets.
It seems that the bluetooth-adapter-added event was fired after boot when BT was already enabled for older versions of gecko. This behavior seems to have changed in a recent version. Eric: for my peace of mind, can you confirm this?
Flags: needinfo?(echou)
Attachment #8402984 -
Flags: review?(ehung)
Comment 5•11 years ago
|
||
(In reply to arno from comment #3)
> It seems that the bluetooth-adapter-added event was fired after boot when BT
> was already enabled for older versions of gecko. This behavior seems to have
> changed in a recent version. Eric: for my peace of mind, can you confirm
> this?
Gaia remembers the status of Bluetooth before powered off and would try to enable Bluetooth at startup, and bluetooth-adapteradded would be fired when Bluetooth is enabled. In such case, as long as the event handler is hooked before firing the event, you should be able to receive it. But I'm not sure if the timing of "Gaia tries to enable Bluetooth" was changed.
Flags: needinfo?(echou)
Comment 6•11 years ago
|
||
Comment on attachment 8402984 [details]
Proper initialization in Handover Manager if BT is already enabled at boot
There is a code segment in Settings app do the same thing.
Attachment #8402984 -
Flags: review?(ehung) → review+
Reporter | ||
Comment 7•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.4 S6 (25apr)
Reporter | ||
Updated•11 years ago
|
Target Milestone: 1.4 S6 (25apr) → 1.4 S5 (11apr)
You need to log in
before you can comment on or make changes to this bug.
Description
•