[ndk 0.7.0] Allow any non-zero return code from `AInputQueue_preDispatchEvent()`
Hello, I believe the behaviour of InputQueue::pre_dispatch in v0.7 is wrong compared to v0.6, the ndk docs for AInputQueue_preDispatchEvent say this about the return value:
...Returns 0 if it was not pre-dispatched, meaning you can process it right now. If non-zero is returned, you must abandon the current event processing and allow the event to appear again in the event queue (if it does not get consumed during pre-dispatching).
Compared to the docs for the return value of AInputQueue_hasEvents (which the current version of InputQueue::has_events handles correctly):
Returns 1 if the queue has events; 0 if it does not have events; and a negative value if there is an error.
On the Quest 2, when the system menu is shown, the return value of AInputQueue_preDispatchEvent is -1 thus invoking the unreachable case. This does not happen with v0.6
Filling up this incomplete report:
- This change was made in #292;
- This behaviour was implied because of the implementation in https://cs.android.com/android/platform/superproject/+/master:frameworks/base/native/android/input.cpp;l=324;drc=3da1d20bcfb103f146ff67910d14b7b40f6f686f?q=AInputQueue_preDispatchEvent (why did "Quest 2" change system code?);
- Subsequently #294 also assumed that any valid return code is
0or1and nothing else.