Add small user-event abstraction interface.

Preparation for future UI frontend/backend separation.

This is done to ensure that the code under android/skin/ does not depend
on any QEMU-specific header. We achieve this by adding a new abstract header
"user-events.h" and one QEMU-specific implementations for the functions
defined here.

This also modifies console.h and vl-android.c to make them closer to
upstream (by removing Android-specific changes).

+ fix Makefile.android to always build SDL from sources in standalone mode.

Change-Id: I0d152741e7bb2c9cd283f5c35bd054385c7c1eb3
diff --git a/android/main.c b/android/main.c
index c4e94c3..6f5fca4 100644
--- a/android/main.c
+++ b/android/main.c
@@ -24,6 +24,7 @@
 #include "qemu-common.h"
 #include "sysemu.h"
 #include "console.h"
+#include "user-events.h"
 
 #include <SDL.h>
 #include <SDL_syswm.h>
@@ -275,16 +276,6 @@
 /***********************************************************************/
 /***********************************************************************/
 
-void send_key_event(unsigned code, unsigned down)
-{
-    if(code == 0) {
-        return;
-    }
-    if (VERBOSE_CHECK(keys))
-        printf(">> KEY [0x%03x,%s]\n", (code & 0x1ff), down ? "down" : " up " );
-    kbd_put_keycode((code & 0x1ff) | (down ? 0x200 : 0));
-}
-
 /* called by the emulated framebuffer device each time the content of the
  * framebuffer has changed. the rectangle is the bounding box of all changes
  */
@@ -373,7 +364,7 @@
                     kcode = // qemulator_rotate_keycode(kKeyCodeDpadUp);
                         android_keycode_rotate(kKeyCodeDpadUp,
                             skin_layout_get_dpad_rotation(qemulator_get_layout(qemulator_get())));
-                    send_key_event( kcode, down );
+                    user_event_key( kcode, down );
                 }
                 else if (ev.button.button == 5)
                 {
@@ -383,7 +374,7 @@
                     kcode = // qemulator_rotate_keycode(kKeyCodeDpadDown);
                         android_keycode_rotate(kKeyCodeDpadDown,
                             skin_layout_get_dpad_rotation(qemulator_get_layout(qemulator_get())));
-                    send_key_event( kcode, down );
+                    user_event_key( kcode, down );
                 }
                 else if (ev.button.button == SDL_BUTTON_LEFT) {
                     skin_window_process_event( window, &ev );