A workaround for devices where hidden apis are unavailable (by default they are unavailable on devices with Android 9+)
They work for devices on which the command
_adb shell settings put global hidden_apipolicy 1
is executed and don't work otherwise.
This workaround fixes this restriction and if hidden apis are unavailable we use getCurrentFocus() instead of mServedView.
Tested locally on Google Pixel 4a with _hidden_apipolicy unset.
A workaround for devices where hidden apis are unavailable (by default they are unavailable on devices with Android 9+) They work for devices on which the command _adb shell settings put global hidden_apipolicy 1 is executed and don't work otherwise. This workaround fixes this restriction and if hidden apis are unavailable we use getCurrentFocus() instead of mServedView.
Tested locally on Google Pixel 4a with _hidden_apipolicy unset.