I was going through the bluedroid architecture and how it works and all those stuffs here. I wanted to know whether we can use bluedroid stack instead of bluez in raspbian. If its possible how can it be done since bluedroid does not support dbus?
Yes it can be used but not easily...
You have to have little expertise in C Programming .
Check ESP32 , they are using Bluedroid in FReeRTOS.
You have to go in similar way .. so basically You have to write your own application layer routines to drive the API of Bluedroid.
ESP32 people have used snipped version of bluedroid .i.e. All the Java Codes has been dropped from bluedroid .. and they have written simple basic application which talks to the top layer of Bluedroid C Files.
Short Answer to your question is: Yes it is achievable and if you follow the ESP32 way , You can have bluedroid running all in User Space.
It is quite different between those two bluetooth stacks I don't see anyone porting bluedroid to raspberry even someone porting it to rpi you still need applications to let it work
There is a new version of bluedroid, called fluoride, and it could be compiled on a linux/ubuntu distro. But it does not fully ready for end-user usage (maybe for chromebook?) event you compile it on ubuntu, you still need bluetooth applications to use those bluetooth features They can NOT run with bluedroid/fluroide bluetooth stack https://android.googlesource.com/platform/system/bt/
android and linux are different. although android uses the linux-kernel and it changes a lot things. application and standard libraries are different android has java blueooth application to some feature, like radio-on, file-sending... it use a lot android framework feature and it is not effective to porting whole android framework to rpi It needs a lot of work to re-write those application/GUI
bluedroid does not use dbus, it use apache license, donated to google by broadcom company
if you are a end-user, you may buy a cheaper cellphone or use a android-x86 to use bluedroid if you are interesting with bluedroid as a developer, you may start to check bluetooth stack specification as a start