I am developing a music player app and have noticed specifically on Cyanogemod ROMS that there is a lock screen music visualizer (there are probably other ROMS with something similar that I haven't seen). My app uses a background service to keep music playing even if the app is closed. Currently my app has a lock screen notification which uses RemoteViews
to show the basic controls and the current song playing, nothing ground breaking here. Many media player apps have similar lock screen notifications with similar controls and the Cyanogenmod visualizer appears and reacts to the music, whereas with my app if music is playing and the device is on the lock screen the visualizer doesn't work.
I have tried setting various flags with the notification thinking this may invoke something that the custom ROM/OS looks for with notifications and then 'listens' to the audio output and displays the visualizer, but so far this hasn't helped.
I must be missing something obvious, and if someone has come across this before and got it working could point me in the right direction.
Below is an example of when the visualizer is working, just for reference.
UPDATE
I have decompiled the CyanogenMod System UI.apk - currently looking through that for some clues (needle in a haystack comes to mind!). I have found the Visualizer class that extends the View class and uses some sort of FFT algorithm, but no direct clues what makes it initialise/visible. I thought it may have something to do with using a MediaSession (my app doesn't presently use this) so changed the Service to include a MediaSession, still no luck.