First stab at attaching native event dispatching.

Provides the basic infrastructure for a
NativeActivity's native code to get an object representing
its event stream that can be used to read input events.

Still work to do, probably some API changes, and reasonable
default key handling (so that for example back will still
work).

Change-Id: I6db891bc35dc9683181d7708eaed552b955a077e
diff --git a/include/ui/Input.h b/include/ui/Input.h
index 979d6e8..32f85b3 100644
--- a/include/ui/Input.h
+++ b/include/ui/Input.h
@@ -40,6 +40,11 @@
  */
 #define MAX_POINTERS 10
 
+/*
+ * Declare a concrete type for the NDK's input event forward declaration.
+ */
+struct input_event_t { };
+
 namespace android {
 
 /*
@@ -128,8 +133,6 @@
 /*
  * Input events.
  */
-struct input_event_t { };
-
 class InputEvent : public input_event_t {
 public:
     virtual ~InputEvent() { }
diff --git a/include/ui/InputTransport.h b/include/ui/InputTransport.h
index 7b182f3..d6bded6 100644
--- a/include/ui/InputTransport.h
+++ b/include/ui/InputTransport.h
@@ -330,4 +330,24 @@
 
 } // namespace android
 
+/*
+ * NDK input queue API.
+ */
+struct input_queue_t {
+public:
+    /* Creates a consumer associated with an input channel. */
+    explicit input_queue_t(const android::sp<android::InputChannel>& channel);
+
+    /* Destroys the consumer and releases its input channel. */
+    ~input_queue_t();
+
+    inline android::InputConsumer& getConsumer() { return mConsumer; }
+    
+    android::status_t consume(android::InputEvent** event);
+    
+private:
+    android::InputConsumer mConsumer;
+    android::PreallocatedInputEventFactory mInputEventFactory;
+};
+
 #endif // _UI_INPUT_TRANSPORT_H