We noticed some strange behaviour with dPad event handling in the Android app. We are overriding the dispatchKeyEvent method in the Activity to handle the dPad events in Android TV app. Everything works as expected in normal mode. But when accessibility or talkback is turned on then, dPad events(right, left, up and down) are not received. Because of this navigation functionalities are not working as expected in the accessibility mode.
Please note that dPad Center or OK and Back key events are received. It would be great if someone provide some insights or solution on this particular issue.
Below is the simple code what we are trying. Debug logs are getting printed in regular mode. But in accessibility mode, dispatchKeyEvent method itself not get called.
class VPActivity : FragmentActivity() {
@UnstableApi
@SuppressLint("RestrictedApi")
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
Log.d("TVApp", "key event " + event)
return super.dispatchKeyEvent(event)
}
}