This may be a bit too little too late but I found a solution. (Assuming the OP still wants to trigger OS back button from a floating view or service.)
It seems like it is possible to tell Android to press the back button, if you're a registered Accessibility Service. (Once your component is registered with Android, user must explicitly enable it in System Settings. So if this is simply a niche feature for your app rather than a critical function, it may be an overkill.)
Once you're done registering .etc. accordingly, your background service may tell the Accessibility Service to perform the back button, which can be done by calling
performGlobalAction(
GLOBAL_ACTION_BACK
)
from the Accessibility Service.
You do need API Level 16 or above for this to work.
I haven't got around to test this, but according to docs, this should work.
Tried and works on a number of recent devices. (Kitkat, Marshmellow and Nouget)
I found the app Back Button (No root) on play store which seem to employ this technique to draw soft buttons for back, home .etc. (which works on LG Nexus 5X and Samsung Galaxy Tab A 2016)
HTH