I saw this topic
Listen to volume buttons in background service?
and know the way to listenting to volume keys in background service is to detect the amount of system volume(or music...) and see if it decrease or increase we can detect buttons
i see an app that detects pressing volume up/down button together in locked mode or screen off and it is using AccessibilityService. how it is possible?
https://play.google.com/store/apps/details?id=in.blogspot.anselmbros.torchie&hl=en