Background
I work on an app that has a floating UI shown over other apps (using SAW permission, AKA "display over other apps").
It also handles touch events that might come from the sides.
The problem
It seems that on some devices, when gesture navigation is enabled, touching on side sides might prioritize the system navigation instead of the app.
What I've tried
I want to change the UI so that at least it will be larger and makes it easier to touch, but only if the current configuration of the OS is on gesture navigation.
Sadly, all gesture-related questions that I've found are related to when you are inside an Activity already, offering to handle the protected areas. Nothing I've found is related to simple detection, let alone without View/Activity/Window.
The question
Given only the bare basic classes that are outside of Activity/View, how can I detect (including a callback when it changes) whether the device is on gesture navigation or not?