Added the ability to read external batteries

Extended InputDevice and EventHub with capabilites to detect and read
external battery status and capacity. This allows devices such as
wireless gamepads to provide battery information to applications.

Bug: 161633432
Test: atest InputDeviceBatteryTest

Change-Id: I3c65166a1f0b055c5b85bad286afd5beb60bb303
Merged-In: I3c65166a1f0b055c5b85bad286afd5beb60bb303
diff --git a/libs/input/InputDevice.cpp b/libs/input/InputDevice.cpp
index 2ed441d..698cf6e 100644
--- a/libs/input/InputDevice.cpp
+++ b/libs/input/InputDevice.cpp
@@ -166,6 +166,7 @@
         mKeyboardType(other.mKeyboardType),
         mKeyCharacterMap(other.mKeyCharacterMap),
         mHasVibrator(other.mHasVibrator),
+        mHasBattery(other.mHasBattery),
         mHasButtonUnderPad(other.mHasButtonUnderPad),
         mHasSensor(other.mHasSensor),
         mMotionRanges(other.mMotionRanges),
@@ -187,6 +188,7 @@
     mSources = 0;
     mKeyboardType = AINPUT_KEYBOARD_TYPE_NONE;
     mHasVibrator = false;
+    mHasBattery = false;
     mHasButtonUnderPad = false;
     mHasSensor = false;
     mMotionRanges.clear();