(Android) Try to do engine_handle_input more or less exactly like

this (xcept for 'predispatch events' which caused issues on Xperia
Play apparently) - http://ps3computing.blogspot.nl/2012/12/anr-application-not-responding.html
This commit is contained in:
twinaphex 2013-03-03 20:57:14 +01:00
parent afa04bd376
commit 0f16bddb02

View File

@ -176,17 +176,15 @@ static inline void engine_handle_input(void)
bool debug_enable = g_settings.input.debug_enable;
struct android_app *android_app = (struct android_app*)g_android;
uint64_t *lifecycle_state = &g_extern.lifecycle_state;
AInputEvent* event = NULL;
*lifecycle_state &= ~((1ULL << RARCH_RESET) | (1ULL << RARCH_REWIND) | (1ULL << RARCH_FAST_FORWARD_KEY) | (1ULL << RARCH_FAST_FORWARD_HOLD_KEY) | (1ULL << RARCH_MUTE) | (1ULL << RARCH_SAVE_STATE_KEY) | (1ULL << RARCH_LOAD_STATE_KEY) | (1ULL << RARCH_STATE_SLOT_PLUS) | (1ULL << RARCH_STATE_SLOT_MINUS));
// Read all pending events.
while (AInputQueue_hasEvents(android_app->inputQueue) > 0)
while (AInputQueue_hasEvents(android_app->inputQueue))
{
if (AInputQueue_getEvent(android_app->inputQueue, &event) >= 0)
{
AInputEvent* event = NULL;
if (AInputQueue_getEvent(android_app->inputQueue, &event) < 0)
break;
bool long_msg_enable = false;
int32_t handled = 1;
int action = 0;
@ -345,6 +343,7 @@ static inline void engine_handle_input(void)
AInputQueue_finishEvent(android_app->inputQueue, event, handled);
}
}
}
// Handle all events. If our activity is in pause state, block until we're unpaused.