The flow triggers when User is present (I coulldn't find "Device unlocked" trigger), then it checks the proximity sensor. So when my phone is unlocked in my pocket, the flow will lock the sreen and announce the accident.
There is second flow in my package, that is initially disabled but becomes enabled when the mentioned accident happens. This second flow pops a message and a notification on statusbar, when I unlock my phone after the accidental unlock happened. After that it disables itself.
NOTE:
------
These flows are in the stage of testing, so any suggestions or modifications will be appreciated

Cheers!