I use Accessibility Service to intercept user keystrokes (in this case - Volume up) to call emergency services.In Accessibility service configuration, I specify the parameter  android:accessibilityFlags = "flagRequestFilterKeyEvents"In service, I process onKeyEvent to receive keystroke events such as Volume + Volume-, Home, Back, ect ...The problem is that when the application stops forcibly (by clearing the RAM), the Accesibillity service stops working and  keys Home, Menu, Back (all Navigation Bar), volume up and volume down completely stop responding not only for my application, but for systems completely. It only helps to reboot the device after which the Accessibility Service works fine or disables this service through the settings, then the keys work is fully restored.As I understand it, the system sends a notification about a click on a button to my service that dies with the application and method onKeyEvent (event: KeyEvent?):Boolean cannot answer in any way.As a result, the volume buttons and Navigation bar buttons become completely inoperative.I think the correct behavior in this case is that the death of the application should not stop the accesibility service or at least not block the device buttons, which will really upset the user.In my case, the user who turned on thisAccesibillity Service to call Emergency service will not only not receive it, but will also receive even greater difficulties managing his device.I push project to github to test and see this error: https://github.com/vedmitry7/AccessibilityServiceError I use Android 6.0.1 . Xiaomi Redmi 4 Prime but test and see that bug also in another devices and android versions. Video - https://drive.google.com/file/d/10A5Se8FJE2dziveaNE_JoQZfboHGqybA/view?usp=drive_web