vanilla-music / vanilla-headphone-detector

Persistent service that launches Vanilla Music on headset-plug event
GNU General Public License v3.0
10 stars 5 forks source link

Bluetooth support #8

Open adrian-bl opened 7 years ago

adrian-bl commented 7 years ago

As requested in: https://github.com/vanilla-music/vanilla/issues/598

Would be nice if the headset plugged detection worked also with Bluetooth. After disconnecting it stops, but when the headset is reconnected I have to play manually (not really comfortable on motorcycle with BT helmets as you have to stop).

brandonkirsch commented 6 years ago

I have working Bluetooth headset detection support added to the headphone detector, but I had to re-arrange the codebase in order to get it to build with Android Studio.

It uses an unprivileged BroadcastReceiver that listens for android.bluetooth.a2dp.profile.action.CONNECTION_STATE_CHANGED and launches / plays Vanilla as appropriate.

If I could get a little help building the project, or if you are willing to accept some path re-arrangements, then I would be happy to send over a PR.

adrian-bl commented 6 years ago

Re-arranging the paths would be fine for me (we can also drop ant and switch to gradle).

(Note that i am on vacation right now and only have sporadic internet access, so expect some delays)

scrunchy commented 6 years ago

Hi, just checking if this was likely to be incorporated any time? Otherwise might look for another means of implementing

adrian-bl commented 6 years ago

No pull request was opened yet.

Also: in the meantime i switched the project to use gradle: building with Android Studio should now work out of the box.

brandonkirsch commented 6 years ago

Sorry friends - I struggled to correctly convert the project over to Gradle.

I will take a look at @adrian-bl's new codebase and see if I can build it before sending over a patch for Bluetooth support. It's been working properly on my personal (hacked up) copy for about 6 weeks now.

adrian-bl commented 6 years ago

brandonkirsch@ did you find some time to merge your patch into the new project structure? Also: feel free to post a gist with your changes - i'd be happy to merge them into the existing HEAD for you.