(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:
parent
afa04bd376
commit
0f16bddb02
|
@ -176,17 +176,15 @@ static inline void engine_handle_input(void)
|
||||||
bool debug_enable = g_settings.input.debug_enable;
|
bool debug_enable = g_settings.input.debug_enable;
|
||||||
struct android_app *android_app = (struct android_app*)g_android;
|
struct android_app *android_app = (struct android_app*)g_android;
|
||||||
uint64_t *lifecycle_state = &g_extern.lifecycle_state;
|
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));
|
*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.
|
// 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;
|
bool long_msg_enable = false;
|
||||||
int32_t handled = 1;
|
int32_t handled = 1;
|
||||||
int action = 0;
|
int action = 0;
|
||||||
|
@ -345,6 +343,7 @@ static inline void engine_handle_input(void)
|
||||||
|
|
||||||
AInputQueue_finishEvent(android_app->inputQueue, event, handled);
|
AInputQueue_finishEvent(android_app->inputQueue, event, handled);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle all events. If our activity is in pause state, block until we're unpaused.
|
// Handle all events. If our activity is in pause state, block until we're unpaused.
|
||||||
|
|
Loading…
Reference in New Issue