Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

droid: fixed, useless verbose logging on new events and multiple inpu…

…t events handling (seen with game controllers)
  • Loading branch information...
commit d35d89317e7b875193e1f3b05dd2bfdfe7915520 1 parent ebd977f
@davilla davilla authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 xbmc/android/activity/android_main.cpp
View
26 xbmc/android/activity/android_main.cpp
@@ -19,15 +19,41 @@
*/
#include <stdlib.h>
+#include <errno.h>
#include <android_native_app_glue.h>
#include "EventLoop.h"
#include "XBMCApp.h"
+// copied from new android_native_app_glue.c
+static void process_input(struct android_app* app, struct android_poll_source* source) {
+ AInputEvent* event = NULL;
+ int processed = 0;
+ while (AInputQueue_getEvent(app->inputQueue, &event) >= 0) {
+ if (AInputQueue_preDispatchEvent(app->inputQueue, event)) {
+ continue;
+ }
+ int32_t handled = 0;
+ if (app->onInputEvent != NULL) handled = app->onInputEvent(app, event);
+ AInputQueue_finishEvent(app->inputQueue, event, handled);
+ processed = 1;
+ }
+ if (processed == 0) {
+ CXBMCApp::android_printf("process_input: Failure reading next input event: %s", strerror(errno));
+ }
+}
+
extern void android_main(struct android_app* state)
{
{
// make sure that the linker doesn't strip out our glue
app_dummy();
+
+ // revector inputPollSource.process so we can shut up
+ // its useless verbose logging on new events (see ouya)
+ // and fix the error in handling multiple input events.
+ // see https://code.google.com/p/android/issues/detail?id=41755
+ state->inputPollSource.process = process_input;
+
CEventLoop eventLoop(state);
CXBMCApp xbmcApp(state->activity);
if (xbmcApp.isValid())
Please sign in to comment.
Something went wrong with that request. Please try again.