Closed Bug 1029390 Opened 7 years ago Closed 7 years ago

[Bluetooth] Convert Bluedroid A2DP/AVRCP APIs to asynchronous design

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S1 (1aug)

People

(Reporter: tzimmermann, Assigned: tzimmermann)

References

Details

Attachments

(5 files, 2 obsolete files)

No description provided.
Assignee: nobody → tzimmermann
Status: NEW → ASSIGNED
Attachment #8456070 - Flags: review?(shuang)
Hi Shawn,

This is the final patch set for asynchronous Bluedroid calls. The next would be the conversion of method arguments, handled in bug 1038591.
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #6)
> Hi Shawn,
> 
> This is the final patch set for asynchronous Bluedroid calls. The next would
> be the conversion of method arguments, handled in bug 1038591.

Thanks a lot for the patches, I will check them today.
With patch [03] applied, I get a segmentation fault, when I try to pair and connect with my handset. The code seems to release BluetoothProfileController twice. I don't understand why this happens, because my result handler holds a reference to the controller. Any ideas, Shawn?


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 178.178]
0xb4d92082 in mozilla::dom::bluetooth::BluetoothProfileController::Release (this=0xaea22740) at ../../../../mozilla-central/dom/bluetooth/BluetoothProfileController.h:65
65	  NS_INLINE_DECL_REFCOUNTING(BluetoothProfileController)
(gdb) bt
#0  0xb4d92082 in mozilla::dom::bluetooth::BluetoothProfileController::Release (this=0xaea22740) at ../../../../mozilla-central/dom/bluetooth/BluetoothProfileController.h:65
#1  0xb4d92144 in nsRefPtr<mozilla::dom::bluetooth::BluetoothProfileController>::~nsRefPtr (this=0xabc50118, __in_chrg=<optimized out>) at ../../dist/include/nsAutoPtr.h:852
#2  0xb4d9aace in ConnectResultHandler::~ConnectResultHandler (this=0xabc50110, __in_chrg=<optimized out>)
    at ../../../../mozilla-central/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp:774
#3  0xb4d9aaec in ConnectResultHandler::~ConnectResultHandler (this=0xabc50110, __in_chrg=<optimized out>)
    at ../../../../mozilla-central/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp:774
#4  0xb4d9d3f0 in mozilla::dom::bluetooth::BluetoothHandsfreeResultHandler::Release (this=0xabc50110)
    at ../../../../mozilla-central/dom/bluetooth/bluedroid/BluetoothInterface.h:78
#5  0xb4d9d414 in ~nsRefPtr (this=0xab4dc2cc, __in_chrg=<optimized out>) at ../../dist/include/nsAutoPtr.h:852
#6  mozilla::dom::bluetooth::BluetoothInterfaceRunnable0<mozilla::dom::bluetooth::BluetoothHandsfreeResultHandler, void>::~BluetoothInterfaceRunnable0 (this=0xab4dc2c0, 
    __in_chrg=<optimized out>) at ../../../../mozilla-central/dom/bluetooth/bluedroid/BluetoothInterface.cpp:27
#7  0xb4d9d430 in mozilla::dom::bluetooth::BluetoothInterfaceRunnable0<mozilla::dom::bluetooth::BluetoothHandsfreeResultHandler, void>::~BluetoothInterfaceRunnable0 (
    this=0xab4dc2c0, __in_chrg=<optimized out>) at ../../../../mozilla-central/dom/bluetooth/bluedroid/BluetoothInterface.cpp:27
#8  0xb42b1504 in nsRunnable::Release (this=0xab4dc2c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/glue/nsThreadUtils.cpp:32
#9  0xb42a171e in nsCOMPtr<nsIStackFrame>::~nsCOMPtr (this=0xbeb897b0, __in_chrg=<optimized out>) at ../../../dist/include/nsCOMPtr.h:513
#10 0xb42f870c in ProcessNextEvent (aResult=0xbeb897f7, aMayWait=false, this=0xb6b4d700) at ../../../../mozilla-central/xpcom/threads/nsThread.cpp:771
#11 nsThread::ProcessNextEvent (this=0xb6b4d700, aMayWait=<optimized out>, aResult=0xbeb897f7) at ../../../../mozilla-central/xpcom/threads/nsThread.cpp:685
#12 0xb42b1ccc in NS_ProcessNextEvent (aThread=0xb6b4d700, aMayWait=<optimized out>) at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/glue/nsThreadUtils.cpp:256
#13 0xb44ae670 in mozilla::ipc::MessagePump::Run (this=0xb6b01e50, aDelegate=0xb6b701a0) at ../../../../mozilla-central/ipc/glue/MessagePump.cpp:99
#14 0xb449cc26 in MessageLoop::RunInternal (this=0xb6b701a0) at ../../../../mozilla-central/ipc/chromium/src/base/message_loop.cc:229
#15 0xb449cc3e in RunHandler (this=0xb6b701a0) at ../../../../mozilla-central/ipc/chromium/src/base/message_loop.cc:222
#16 MessageLoop::Run (this=0xb6b701a0) at ../../../../mozilla-central/ipc/chromium/src/base/message_loop.cc:196
#17 0xb4af67ea in nsBaseAppShell::Run (this=0xb20b55e0) at ../../../../mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:164
#18 0xb53bcc9e in nsAppStartup::Run (this=0xb21078e0) at ../../../../../mozilla-central/toolkit/components/startup/nsAppStartup.cpp:278
#19 0xb53a217a in XREMain::XRE_mainRun (this=0xbeb8998c) at ../../../../mozilla-central/toolkit/xre/nsAppRunner.cpp:4013
#20 0xb53a2366 in XREMain::XRE_main (this=0xbeb8998c, argc=<optimized out>, argv=<optimized out>, aAppData=<optimized out>)
    at ../../../../mozilla-central/toolkit/xre/nsAppRunner.cpp:4084
#21 0xb53a24c0 in XRE_main (argc=1, argv=0xbeb8bb44, aAppData=0x24938, aFlags=<optimized out>) at ../../../../mozilla-central/toolkit/xre/nsAppRunner.cpp:4298
#22 0x0000ae9c in do_main (argv=0xbeb8bb44, argc=1) at ../../../../mozilla-central/b2g/app/nsBrowserApp.cpp:163
#23 main (argc=<optimized out>, argv=<optimized out>) at ../../../../mozilla-central/b2g/app/nsBrowserApp.cpp:256
Flags: needinfo?(shuang)
I also see the following segmentation fault.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 177.594]
0xb5867f56 in readByte (this=<optimized out>) at ../../../../mozilla-central/js/src/jit/CompactBuffer.h:57
57	        return *buffer_++;
(gdb) bt
#0  0xb5867f56 in readByte (this=<optimized out>) at ../../../../mozilla-central/js/src/jit/CompactBuffer.h:57
#1  readVariableLength (this=<optimized out>) at ../../../../mozilla-central/js/src/jit/CompactBuffer.h:40
#2  readUnsigned (this=<optimized out>) at ../../../../mozilla-central/js/src/jit/CompactBuffer.h:72
#3  read (this=<synthetic pointer>) at ../../../../mozilla-central/js/src/jit/arm/Assembler-arm.cpp:631
#4  js::jit::Assembler::TraceJumpRelocations (trc=0xaf826908, code=0xae3b0150, reader=<optimized out>) at ../../../../mozilla-central/js/src/jit/arm/Assembler-arm.cpp:794
#5  0xb57692fa in js::jit::JitCode::trace (this=0xae3b0150, trc=0xaf826908) at ../../../../mozilla-central/js/src/jit/Ion.cpp:756
#6  0xb56ea01c in MarkChildren (code=0xae3b0150, trc=0xaf826908) at ../../../../mozilla-central/js/src/gc/Marking.cpp:1410
#7  js::GCMarker::processMarkStackOther (this=0xaf826908, tag=<optimized out>, addr=2923102544) at ../../../../mozilla-central/js/src/gc/Marking.cpp:1585
#8  0xb56ef896 in js::GCMarker::drainMarkStack (this=0xaf826908, budget=...) at ../../../../mozilla-central/js/src/gc/Marking.cpp:1737
#9  0xb58ab782 in js::gc::GCRuntime::drainMarkStack (this=0xaf8261d8, sliceBudget=..., phase=<optimized out>) at ../../../../mozilla-central/js/src/jsgc.cpp:4341
#10 0xb58e19a2 in js::gc::GCRuntime::incrementalCollectSlice (this=0xaf8261d8, budget=<optimized out>, reason=JS::gcreason::DOM_WORKER, gckind=js::GC_SHRINK)
    at ../../../../mozilla-central/js/src/jsgc.cpp:4849
#11 0xb58e20c6 in js::gc::GCRuntime::gcCycle (this=0xaf8261d8, incremental=<optimized out>, budget=0, gckind=js::GC_SHRINK, reason=JS::gcreason::DOM_WORKER)
    at ../../../../mozilla-central/js/src/jsgc.cpp:5022
#12 0xb58e2330 in js::gc::GCRuntime::collect (this=0xaf8261d8, incremental=<optimized out>, budget=0, gckind=js::GC_SHRINK, reason=JS::gcreason::DOM_WORKER)
    at ../../../../mozilla-central/js/src/jsgc.cpp:5182
#13 0xb58e5228 in GC (reason=<optimized out>, gckind=js::GC_SHRINK, rt=<optimized out>) at ../../../../mozilla-central/js/src/jsgc.cpp:5213
#14 JS::ShrinkingGC (rt=<optimized out>, reason=<optimized out>) at ../../../../mozilla-central/js/src/jsfriendapi.cpp:198
#15 0xb4d0429e in mozilla::dom::workers::WorkerPrivate::GarbageCollectInternal (this=0xb0f3ac00, aCx=0xb0b13830, aShrinking=<optimized out>, aCollectChildren=<optimized out>)
    at ../../../../mozilla-central/dom/workers/WorkerPrivate.cpp:5613
#16 0xb4d042ec in (anonymous namespace)::GarbageCollectRunnable::WorkerRun (this=<optimized out>, aCx=<optimized out>, aWorkerPrivate=<optimized out>)
    at ../../../../mozilla-central/dom/workers/WorkerPrivate.cpp:1681
#17 0xb4d0ce84 in mozilla::dom::workers::WorkerRunnable::Run (this=0xb00dd900) at ../../../../mozilla-central/dom/workers/WorkerRunnable.cpp:312
#18 0xb4d082ee in mozilla::dom::workers::WorkerPrivate::ProcessAllControlRunnablesLocked (this=0xb0f3ac00) at ../../../../mozilla-central/dom/workers/WorkerPrivate.cpp:4500
#19 0xb4d0bc8a in mozilla::dom::workers::WorkerPrivate::DoRunLoop (this=0xb0f3ac00, aCx=0xb0b13830) at ../../../../mozilla-central/dom/workers/WorkerPrivate.cpp:3996
#20 0xb4cf4dc8 in (anonymous namespace)::WorkerThreadPrimaryRunnable::Run (this=0xb0f6f900) at ../../../../mozilla-central/dom/workers/RuntimeService.cpp:2725
#21 0xb42f96de in ProcessNextEvent (aResult=0xb0affe27, aMayWait=false, this=0xb1b4e550) at ../../../../mozilla-central/xpcom/threads/nsThread.cpp:766
#22 nsThread::ProcessNextEvent (this=0xb1b4e550, aMayWait=<optimized out>, aResult=0xb0affe27) at ../../../../mozilla-central/xpcom/threads/nsThread.cpp:685
#23 0xb42b2ccc in NS_ProcessNextEvent (aThread=0xb1b4e550, aMayWait=<optimized out>) at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/glue/nsThreadUtils.cpp:256
#24 0xb44af456 in mozilla::ipc::MessagePumpForNonMainThreads::Run (this=0xb0f305e0, aDelegate=0xb136a6a0) at ../../../../mozilla-central/ipc/glue/MessagePump.cpp:326
#25 0xb449dc26 in MessageLoop::RunInternal (this=0xb136a6a0) at ../../../../mozilla-central/ipc/chromium/src/base/message_loop.cc:229
#26 0xb449dc3e in RunHandler (this=0xb136a6a0) at ../../../../mozilla-central/ipc/chromium/src/base/message_loop.cc:222
#27 MessageLoop::Run (this=0xb136a6a0) at ../../../../mozilla-central/ipc/chromium/src/base/message_loop.cc:196
#28 0xb42fa60c in nsThread::ThreadFunc (aArg=0xb1b4e550) at ../../../../mozilla-central/xpcom/threads/nsThread.cpp:346
#29 0xb6711420 in _pt_root (arg=0xb13fbb80) at ../../../../../../mozilla-central/nsprpub/pr/src/pthreads/ptthread.c:212
#30 0xb6f22a5c in __thread_entry (func=0xb6711379 <_pt_root>, arg=0xb13fbb80, tls=0xb0afff00) at bionic/libc/bionic/pthread_create.cpp:92
#31 0xb6f22bd8 in pthread_create (thread_out=0xbeb46c64, attr=<optimized out>, start_routine=0x78, arg=0xb13fbb80) at bionic/libc/bionic/pthread_create.cpp:201
#32 0xb13fbb80 in ?? ()
Cannot access memory at address 0x0
#33 0xb13fbb80 in ?? ()
Cannot access memory at address 0x0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Changes since v1:

  - fix segmentation fault during connect operation

I was was able to fix the problem fro comment [08] by not holding a reference to the profile controller in the result handler. Instead the result handler will call into the A2DP manager to do the cleanup work. This design is identical to the HFP manager. This fixes the bug, but still I have no idea what the original bug is.

The problem reported in [09] looks unrelated.
Attachment #8456939 - Flags: review?(shuang)
Attachment #8456072 - Flags: review?(shuang)
Attachment #8456072 - Attachment is obsolete: true
Hi Thomas,
I'm working some 2.0 blockers, so sorry for delay review your patches. I will continue in these two days.
OK, sure. Thanks for keeping me up-to-date.
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #9)
> I also see the following segmentation fault.
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 177.594]
> 0xb5867f56 in readByte (this=<optimized out>) at
> ../../../../mozilla-central/js/src/jit/CompactBuffer.h:57
> 57	        return *buffer_++;
> (gdb) bt
> #0  0xb5867f56 in readByte (this=<optimized out>) at
> ../../../../mozilla-central/js/src/jit/CompactBuffer.h:57
> #1  readVariableLength (this=<optimized out>) at
> ../../../../mozilla-central/js/src/jit/CompactBuffer.h:40
> #2  readUnsigned (this=<optimized out>) at
> ../../../../mozilla-central/js/src/jit/CompactBuffer.h:72
> #3  read (this=<synthetic pointer>) at
> ../../../../mozilla-central/js/src/jit/arm/Assembler-arm.cpp:631
> #4  js::jit::Assembler::TraceJumpRelocations (trc=0xaf826908,
> code=0xae3b0150, reader=<optimized out>) at
> ../../../../mozilla-central/js/src/jit/arm/Assembler-arm.cpp:794
> #5  0xb57692fa in js::jit::JitCode::trace (this=0xae3b0150, trc=0xaf826908)
> at ../../../../mozilla-central/js/src/jit/Ion.cpp:756
> #6  0xb56ea01c in MarkChildren (code=0xae3b0150, trc=0xaf826908) at
> ../../../../mozilla-central/js/src/gc/Marking.cpp:1410
> #7  js::GCMarker::processMarkStackOther (this=0xaf826908, tag=<optimized
> out>, addr=2923102544) at
> ../../../../mozilla-central/js/src/gc/Marking.cpp:1585
> #8  0xb56ef896 in js::GCMarker::drainMarkStack (this=0xaf826908, budget=...)
> at ../../../../mozilla-central/js/src/gc/Marking.cpp:1737
> #9  0xb58ab782 in js::gc::GCRuntime::drainMarkStack (this=0xaf8261d8,
> sliceBudget=..., phase=<optimized out>) at
> ../../../../mozilla-central/js/src/jsgc.cpp:4341
> #10 0xb58e19a2 in js::gc::GCRuntime::incrementalCollectSlice
> (this=0xaf8261d8, budget=<optimized out>, reason=JS::gcreason::DOM_WORKER,
> gckind=js::GC_SHRINK)
>     at ../../../../mozilla-central/js/src/jsgc.cpp:4849
> #11 0xb58e20c6 in js::gc::GCRuntime::gcCycle (this=0xaf8261d8,
> incremental=<optimized out>, budget=0, gckind=js::GC_SHRINK,
> reason=JS::gcreason::DOM_WORKER)
>     at ../../../../mozilla-central/js/src/jsgc.cpp:5022
> #12 0xb58e2330 in js::gc::GCRuntime::collect (this=0xaf8261d8,
> incremental=<optimized out>, budget=0, gckind=js::GC_SHRINK,
> reason=JS::gcreason::DOM_WORKER)
>     at ../../../../mozilla-central/js/src/jsgc.cpp:5182
> #13 0xb58e5228 in GC (reason=<optimized out>, gckind=js::GC_SHRINK,
> rt=<optimized out>) at ../../../../mozilla-central/js/src/jsgc.cpp:5213
> #14 JS::ShrinkingGC (rt=<optimized out>, reason=<optimized out>) at
> ../../../../mozilla-central/js/src/jsfriendapi.cpp:198
> #15 0xb4d0429e in
> mozilla::dom::workers::WorkerPrivate::GarbageCollectInternal
> (this=0xb0f3ac00, aCx=0xb0b13830, aShrinking=<optimized out>,
> aCollectChildren=<optimized out>)
>     at ../../../../mozilla-central/dom/workers/WorkerPrivate.cpp:5613
> #16 0xb4d042ec in (anonymous namespace)::GarbageCollectRunnable::WorkerRun
> (this=<optimized out>, aCx=<optimized out>, aWorkerPrivate=<optimized out>)
>     at ../../../../mozilla-central/dom/workers/WorkerPrivate.cpp:1681
> #17 0xb4d0ce84 in mozilla::dom::workers::WorkerRunnable::Run
> (this=0xb00dd900) at
> ../../../../mozilla-central/dom/workers/WorkerRunnable.cpp:312
> #18 0xb4d082ee in
> mozilla::dom::workers::WorkerPrivate::ProcessAllControlRunnablesLocked
> (this=0xb0f3ac00) at
> ../../../../mozilla-central/dom/workers/WorkerPrivate.cpp:4500
> #19 0xb4d0bc8a in mozilla::dom::workers::WorkerPrivate::DoRunLoop
> (this=0xb0f3ac00, aCx=0xb0b13830) at
> ../../../../mozilla-central/dom/workers/WorkerPrivate.cpp:3996
> #20 0xb4cf4dc8 in (anonymous namespace)::WorkerThreadPrimaryRunnable::Run
> (this=0xb0f6f900) at
> ../../../../mozilla-central/dom/workers/RuntimeService.cpp:2725
> #21 0xb42f96de in ProcessNextEvent (aResult=0xb0affe27, aMayWait=false,
> this=0xb1b4e550) at
> ../../../../mozilla-central/xpcom/threads/nsThread.cpp:766
> #22 nsThread::ProcessNextEvent (this=0xb1b4e550, aMayWait=<optimized out>,
> aResult=0xb0affe27) at
> ../../../../mozilla-central/xpcom/threads/nsThread.cpp:685
> #23 0xb42b2ccc in NS_ProcessNextEvent (aThread=0xb1b4e550,
> aMayWait=<optimized out>) at
> /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/glue/nsThreadUtils.
> cpp:256
> #24 0xb44af456 in mozilla::ipc::MessagePumpForNonMainThreads::Run
> (this=0xb0f305e0, aDelegate=0xb136a6a0) at
> ../../../../mozilla-central/ipc/glue/MessagePump.cpp:326
> #25 0xb449dc26 in MessageLoop::RunInternal (this=0xb136a6a0) at
> ../../../../mozilla-central/ipc/chromium/src/base/message_loop.cc:229
> #26 0xb449dc3e in RunHandler (this=0xb136a6a0) at
> ../../../../mozilla-central/ipc/chromium/src/base/message_loop.cc:222
> #27 MessageLoop::Run (this=0xb136a6a0) at
> ../../../../mozilla-central/ipc/chromium/src/base/message_loop.cc:196
> #28 0xb42fa60c in nsThread::ThreadFunc (aArg=0xb1b4e550) at
> ../../../../mozilla-central/xpcom/threads/nsThread.cpp:346
> #29 0xb6711420 in _pt_root (arg=0xb13fbb80) at
> ../../../../../../mozilla-central/nsprpub/pr/src/pthreads/ptthread.c:212
> #30 0xb6f22a5c in __thread_entry (func=0xb6711379 <_pt_root>,
> arg=0xb13fbb80, tls=0xb0afff00) at bionic/libc/bionic/pthread_create.cpp:92
> #31 0xb6f22bd8 in pthread_create (thread_out=0xbeb46c64, attr=<optimized
> out>, start_routine=0x78, arg=0xb13fbb80) at
> bionic/libc/bionic/pthread_create.cpp:201
> #32 0xb13fbb80 in ?? ()
> Cannot access memory at address 0x0
> #33 0xb13fbb80 in ?? ()
> Cannot access memory at address 0x0
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)

I also hit similar on my nexus-5. See bug 1041472. I can hit that JIT easily. It looks like regression.
(In reply to Shawn Huang [:shuang] [:shawnjohnjr] from comment #13)
> (In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #9)
> > I also see the following segmentation fault.
> 
> I also hit similar on my nexus-5. See bug 1041472. I can hit that JIT
> easily. It looks like regression.

hg backout -r 194555
It seems no longer crash.
(In reply to Shawn Huang [:shuang] [:shawnjohnjr] from comment #14)
> (In reply to Shawn Huang [:shuang] [:shawnjohnjr] from comment #13)
> > (In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #9)
> > > I also see the following segmentation fault.
> > 
> > I also hit similar on my nexus-5. See bug 1041472. I can hit that JIT
> > easily. It looks like regression.
> 
> hg backout -r 194555
> It seems no longer crash.

OK, it's unrelated. That's good! :D
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #15)
> (In reply to Shawn Huang [:shuang] [:shawnjohnjr] from comment #14)
> > (In reply to Shawn Huang [:shuang] [:shawnjohnjr] from comment #13)
> > > (In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #9)
> > > > I also see the following segmentation fault.
> > > 
> > > I also hit similar on my nexus-5. See bug 1041472. I can hit that JIT
> > > easily. It looks like regression.
> > 
> > hg backout -r 194555
> > It seems no longer crash.
> 
> OK, it's unrelated. That's good! :D
Thomas, do you have STR or your testing environment to share with for comment #9?
Nothing concrete. After booting, I usually scrolled on the home screen to see the icon of the System App. When I clicked it, the crash appeared during the app's startup. But I cannot definitely say if the app is relevant here.
I use a Nexus 4 with JB, BTW.
Ah, when testing the obsolete [03] patch, I saw several times SIGSEGV. But it doesn't happen on the new [03] patch anyway. Although that shall not be related. Strange bug.
 
#1  0xb4cab860 in nsCOMPtr<nsISupports>::nsCOMPtr (this=0xabe3c754, aSmartPtr=...) at ../../dist/include/nsCOMPtr.h:889
#2  0xb4caf138 in ObserverRef (aO=..., this=0xabe3c750) at ../../../../../workspace1/bluedroid-b2g-inbound/b2g-inbound/xpcom/ds/nsObserverList.h:25
#3  Construct<ObserverRef> (aArg=..., aE=0xabe3c750) at ../../dist/include/nsTArray.h:478
#4  implementation<ObserverRef, ObserverRef, unsigned int, unsigned int> (aValues=0xb1dc5ed0, aCount=11, aStart=<optimized out>, aElements=<optimized out>)
    at ../../dist/include/nsTArray.h:506
#5  AssignRange<ObserverRef> (aValues=<optimized out>, aCount=11, aStart=<optimized out>, this=0xbeff8084) at ../../dist/include/nsTArray.h:1622
#6  AppendElements<ObserverRef> (aArrayLen=11, aArray=<optimized out>, this=0xbeff8084) at ../../dist/include/nsTArray.h:1238
#7  nsTArray_Impl<ObserverRef, nsTArrayInfallibleAllocator>::AppendElements<ObserverRef, nsTArrayInfallibleAllocator> (this=this@entry=0xbeff8084, aArray=...)
    at ../../dist/include/nsTArray.h:1247
#8  0xb4caf558 in nsTArray_Impl (aOther=..., this=0xbeff8084) at ../../dist/include/nsTArray.h:755
#9  nsTArray (aOther=..., this=0xbeff8084) at ../../dist/include/nsTArray.h:1694
#10 nsObserverList::FillObserverArray (this=0xb0ae7774, aArray=...) at ../../../../../workspace1/bluedroid-b2g-inbound/b2g-inbound/xpcom/ds/nsObserverList.cpp:74
#11 0xb4caf6d8 in nsObserverList::NotifyObservers (this=<optimized out>, aSubject=aSubject@entry=0xb0aa1630, aTopic=aTopic@entry=0xab854440 "mozsettings-changed", 
    someData=someData@entry=0xabe20a40 u"{\"key\":\"deviceinfo.mac\",\"value\":\"8c:3a:e3:5c:f1:0d\",\"message\":\"fromSettingsChangeNotifier\"}")
    at ../../../../../workspace1/bluedroid-b2g-inbound/b2g-inbound/xpcom/ds/nsObserverList.cpp:97
#12 0xb4caf738 in NotifyObservers (aSomeData=0xabe20a40 u"{\"key\":\"deviceinfo.mac\",\"value\":\"8c:3a:e3:5c:f1:0d\",\"message\":\"fromSettingsChangeNotifier\"}", 
    aTopic=0xab854440 "mozsettings-changed", aSubject=0xb0aa1630, this=<optimized out>)
#13 nsObserverService::NotifyObservers (this=<optimized out>, aSubject=0xb0aa1630, aTopic=0xab854440 "mozsettings-changed", 
    aSomeData=0xabe20a40 u"{\"key\":\"deviceinfo.mac\",\"value\":\"8c:3a:e3:5c:f1:0d\",\"message\":\"fromSettingsChangeNotifier\"}")
    at ../../../../../workspace1/bluedroid-b2g-inbound/b2g-inbound/xpcom/ds/nsObserverService.cpp:316
Comment on attachment 8456939 [details] [diff] [review]
[03] Bug 1029390: Asynchronous A2DP connect/disconnect (v2)

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

::: dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
@@ +832,5 @@
> +BluetoothA2dpManager::OnDisconnectError()
> +{
> +  MOZ_ASSERT(NS_IsMainThread());
> +
> +  mController->NotifyCompletion(NS_LITERAL_STRING(ERR_CONNECTION_FAILED));

mController->NotifyCompletion(NS_LITERAL_STRING(ERR_DISCONNECTION_FAILED))
Attachment #8456939 - Flags: review?(shuang)
Changes since v2:

  - fixed incorrect error string for disconnect failures
Attachment #8456939 - Attachment is obsolete: true
Attachment #8460183 - Flags: review?(shuang)
Flags: needinfo?(shuang)
Hi Shawn,

This was the final patch set for the asynchronous design. The next step is the removal of all Bluedroid-specific types from the interface. The patches are done, but I still need to clean them up a bit.
You need to log in before you can comment on or make changes to this bug.