Closed
Bug 824458
Opened 12 years ago
Closed 12 years ago
[Bluetooth] Unable to search devices again after calling StopDiscovery()
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
People
(Reporter: echou, Assigned: echou)
Details
Attachments
(2 files, 2 obsolete files)
Currently Gaia calls adapter.StopDiscovery() to stop searching Bluetooth devices whenever leaving Settings page or timed out, but Evelyn found that onsuccess/onerror of the DOM Request returned by StopDiscovery() are usually not fired. That would result in a wrong state of Bluetooth UI (still shows "Searching for devices" and "Search" button wouldn't appear even if discovery has been stopped). Please see the attached photo for more detail. This is a follow-up to bug 820166. You can also get more information from bug 820166 comment 9.
Assignee | ||
Comment 1•12 years ago
|
||
Assignee: nobody → echou
Assignee | ||
Comment 2•12 years ago
|
||
The root cause is we used the asynchronous dbus function call and hit a known issue of DBus, please see https://bugs.freedesktop.org/show_bug.cgi?id=19796 for details of the bug. It is a timing issue. If the response of the target function returned faster than callback function is set, then the callback would never be invoked. To solve this, I replaced original async function call with blocking calls on non-main thread.
Attachment #695450 -
Flags: review?(gyeh)
Assignee | ||
Updated•12 years ago
|
blocking-basecamp: --- → ?
Updated•12 years ago
|
blocking-basecamp: ? → +
Updated•12 years ago
|
Target Milestone: --- → B2G C3 (12dec-1jan)
Comment 3•12 years ago
|
||
Comment on attachment 695450 [details] [diff] [review] patch 1: v1: the callback function set to dubs is usually not called Review of attachment 695450 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me. ::: dom/bluetooth/linux/BluetoothDBusService.cpp @@ +161,5 @@ > + BluetoothReplyRunnable* aRunnable) > + : mAdapterPath(aAdapterPath) > + , mDeviceObjectPath(aDeviceObjectPath) > + , mRunnable(aRunnable) > + { We'd like to make sure that either aDeviceObjectPath or aRunnable is not null. MOZ_ASSERT(aDeviceObjectPath && aRunnable); @@ +192,5 @@ > + > +private: > + nsString mAdapterPath; > + const char* mDeviceObjectPath; > + BluetoothReplyRunnable* mRunnable; How about using reference counting pointers nsRefPtr here? nsRefPtr<BluetoothReplyRunnable> mRunnable; @@ +203,5 @@ > + BluetoothReplyRunnable* aRunnable) > + : mAdapterPath(aAdapterPath) > + , mMessageName(aMessageName) > + , mRunnable(aRunnable) > + { Add assertion to make sure both aMessageName and aRunnable aren't null. MOZ_ASSERT(aMessageName && aRunnable); @@ +230,5 @@ > + > +private: > + nsString mAdapterPath; > + const char* mMessageName; > + BluetoothReplyRunnable* mRunnable; Using nsRefPtr<BluetoothReplyRunnable>
Attachment #695450 -
Flags: review?(gyeh) → review+
Assignee | ||
Comment 5•12 years ago
|
||
try: https://tbpl.mozilla.org/?tree=Try&rev=61667e313fe8 https://tbpl.mozilla.org/?tree=Try&rev=17f067eeee45
Assignee | ||
Comment 6•12 years ago
|
||
Updated because of build error
Attachment #695553 -
Attachment is obsolete: true
Assignee | ||
Comment 7•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/914889120beb
Comment 8•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/914889120beb
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 9•12 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/fa89be38bac7 https://hg.mozilla.org/releases/mozilla-b2g18/rev/b357c8c75904
You need to log in
before you can comment on or make changes to this bug.
Description
•