Default [Q] Modifying android source code

Hi guys,

I am modifying the bluedroid stack of android. The bluetooth framework starting from android.bluetooth talks through a binder to /packages/apps/bluetooth which calls the /hardware/include/bluetooth through a JNI which in turn calls the bluedroid stack which then calls the libbt-vendor. The issue I am having is I need to add another function to the android.bluetooth and make it available as an api. However after modifying the bluedroid I dont know how to trace the code. I am unable to make any JNI calls match. Could someone point me to the correct resource as to how to trace code from the Java api down to the lowest layer? Are there any tools for doing this? I would like some pointers please