Check input device's all sub devices for isEnabled()

We now allow individual sub devices in an input device to be enabled
and disabled, the isEnalbed() function should check all sub devices and return
true if any device is enabled.

Bug: 161634265
Bug: 175953789
Test: atest inputflinger_tests
Change-Id: Ia5b93089f34d464e9c61595af621e3711837171b
diff --git a/services/inputflinger/reader/InputReader.cpp b/services/inputflinger/reader/InputReader.cpp
index be21ace..6c493ff 100644
--- a/services/inputflinger/reader/InputReader.cpp
+++ b/services/inputflinger/reader/InputReader.cpp
@@ -222,7 +222,9 @@
     }
 
     // Sensor input device is noisy, to save power disable it by default.
-    if (device->getClasses().test(InputDeviceClass::SENSOR)) {
+    // Input device is classified as SENSOR when any sub device is a SENSOR device, check Eventhub
+    // device class to disable SENSOR sub device only.
+    if (mEventHub->getDeviceClasses(eventHubId).test(InputDeviceClass::SENSOR)) {
         mEventHub->disableDevice(eventHubId);
     }
 }