Add new axes for joysticks and mouse wheels.

Added API on InputDevice to query the set of axes available.
Added API on KeyEvent and MotionEvent to convert keycodes and axes
to symbolic name strings for diagnostic purposes.
Added API on KeyEvent to query if a given key code is a gamepad button.
Added a new "axis" element to key layout files to specify the
mapping between raw absolute axis values and motion axis ids.
Expanded the axis bitfield to 64bits to allow for future growth.
Modified the Makefile for keyboard prebuilts to run the keymap
validation tool during the build.
Added layouts for two game controllers.
Added default actions for game pad button keys.
Added more tests.
Fixed a bunch of bugs.

Change-Id: I73f9166c3b3c5bcf4970845b58088ad467525525
diff --git a/include/ui/Input.h b/include/ui/Input.h
index cb9327e..86ce098 100644
--- a/include/ui/Input.h
+++ b/include/ui/Input.h
@@ -170,10 +170,10 @@
  * Pointer coordinate data.
  */
 struct PointerCoords {
-    enum { MAX_AXES = 15 }; // 15 so that sizeof(PointerCoords) == 16 * 4 == 64
+    enum { MAX_AXES = 14 }; // 14 so that sizeof(PointerCoords) == 64
 
     // Bitfield of axes that are present in this structure.
-    uint32_t bits; // 32bits are enough for now, can raise to 64bit when needed
+    uint64_t bits;
 
     // Values of axes that are stored in this structure packed in order by axis id
     // for each axis that is present in the structure according to 'bits'.
@@ -183,41 +183,9 @@
         bits = 0;
     }
 
-    inline float getAxisValue(int32_t axis) const {
-        uint32_t axisBit = 1 << axis;
-        if (!(bits & axisBit)) {
-            return 0;
-        }
-        uint32_t index = __builtin_popcount(bits & (axisBit - 1));
-        return values[index];
-    }
-
-    inline status_t setAxisValue(int32_t axis, float value) {
-        uint32_t axisBit = 1 << axis;
-        uint32_t index = __builtin_popcount(bits & (axisBit - 1));
-        if (!(bits & axisBit)) {
-            uint32_t count = __builtin_popcount(bits);
-            if (count >= MAX_AXES) {
-                tooManyAxes(axis);
-                return NO_MEMORY;
-            }
-            bits |= axisBit;
-            for (uint32_t i = count; i > index; i--) {
-                values[i] = values[i - 1];
-            }
-        }
-        values[index] = value;
-        return OK;
-    }
-
-    inline float* editAxisValue(int32_t axis) {
-        uint32_t axisBit = 1 << axis;
-        if (!(bits & axisBit)) {
-            return NULL;
-        }
-        uint32_t index = __builtin_popcount(bits & (axisBit - 1));
-        return &values[index];
-    }
+    float getAxisValue(int32_t axis) const;
+    status_t setAxisValue(int32_t axis, float value);
+    float* editAxisValue(int32_t axis);
 
 #ifdef HAVE_ANDROID_OS
     status_t readFromParcel(Parcel* parcel);