I know that services cannot implement Back key press and I understand the rationale. But there is an app called SideBar (on Play Store) that reacts to back key presses. It is a
It is probably done using system alert windows - so the service creates and manages a window that is added to the window manager, which has a custom callback set on it.