Closed Bug 1212943 Opened 7 years ago Closed 7 years ago

Build bluetoothd on CyanogenMod base


(Firefox OS Graveyard :: GonkIntegration, defect)

Gonk (Firefox OS)
Not set


(Not tracked)



(Reporter: afarden, Unassigned)




(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36

Steps to reproduce:

I've started the port to CM again from scratch. I've switched fw/av fw/base fw/native and hw/libhardware to those from CM

I think this is due to different headers in hardware/libhardware, I'm going to remove bluetoothd for now and continue the port, but here is the new bug and compiler error, as requested in Bug 1080483

Actual results:

target thumb C: bluetoothd <= system/bluetoothd/src/bt-av-io.c
target thumb C: bluetoothd <= system/bluetoothd/src/bt-core-io.c
target thumb C: bluetoothd <= system/bluetoothd/src/bt-hf-io.c
system/bluetoothd/src/bt-core-io.c: In function 'register_bt_core':
system/bluetoothd/src/bt-core-io.c:1507:5: error: initialization from incompatible pointer type [-Werror]
     .pin_request_cb = pin_request_cb,
system/bluetoothd/src/bt-core-io.c:1507:5: error: (near initialization for 'bt_callbacks.pin_request_cb') [-Werror]
cc1: all warnings being treated as errors
build/core/ recipe for target '/home/adfad666/CMB2G/out/target/product/sirius/obj/EXECUTABLES/bluetoothd_intermediates/bt-core-io.o' failed
make: *** [/home/adfad666/CMB2G/out/target/product/sirius/obj/EXECUTABLES/bluetoothd_intermediates/bt-core-io.o] Error 1
make: *** Waiting for unfinished jobs....
I should also mention I'm using stable/cm-12.1-YOG4P branch.
Flags: needinfo?(tzimmermann)

here's a patch to fix the API incompatibility. Can we distinguish CM from AOSP at build time? Is there a C preprocessor define?
Flags: needinfo?(tzimmermann)
Attachment #8671769 - Flags: feedback?(adam)
Blocks: 1080483
Patch seems to have worked (it built), I'll test it later.

Gecko uses a lot of #if ANDROID_VERSION >= ## and there's an equivalent CM_VERSION which we can probably use too.
OK I was able to test sooner than I expected, It seems fine, nothing funny in logcat, I was able to pair my sirius to my Xperia Z5 running stock Android.
Comment on attachment 8671769 [details] [diff] [review]

Review of attachment 8671769 [details] [diff] [review]:

Bluetooth is working on all devices I can test.
Attachment #8671769 - Flags: feedback?(adam) → feedback+
Cool! I think about how to integrate this into upstream. Can you point me to where CM_VERSION is defined? Or how does the value look like?
For CM upstream it is used here: but this value is complicated and only used as the name of the final ROM zip.

However that repo is full of useless things (for us on B2G) so I've created a vendor_cm-fake repo with just the parts we need, including a simple value for CM_VERSION:

You could do something like:

ifneq ($(filter 12%,$(CM_VERSION)),)
Fixed by Bug 1236841
Closed: 7 years ago
Resolution: --- → FIXED
Oh, I didn't notice that both APIs are actually the same. Thanks, Adam.
You need to log in before you can comment on or make changes to this bug.