summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-07-16 11:11:18 -0400
committerMike Lockwood <lockwood@android.com>2009-07-16 11:51:42 -0400
commitb441106276a9c5fcd47642aff8cda2a2039481c0 (patch)
tree78bd11f01e77433292148b50fc67ba98cdd1219d /include
parent7151edd5d83b3b770a0dc77cf52f7fe56b2a3af6 (diff)
downloadframeworks_native-b441106276a9c5fcd47642aff8cda2a2039481c0.zip
frameworks_native-b441106276a9c5fcd47642aff8cda2a2039481c0.tar.gz
frameworks_native-b441106276a9c5fcd47642aff8cda2a2039481c0.tar.bz2
EventHub: Add support for excluding devices from being opened by as a keyboard.
This will be used to avoid unnecessarily listening to data from sensors that function as event devices. Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'include')
-rw-r--r--include/ui/EventHub.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/ui/EventHub.h b/include/ui/EventHub.h
index d9c0af2..d62fd7d 100644
--- a/include/ui/EventHub.h
+++ b/include/ui/EventHub.h
@@ -75,7 +75,11 @@ public:
status_t scancodeToKeycode(int32_t deviceId, int scancode,
int32_t* outKeycode, uint32_t* outFlags) const;
-
+
+ // exclude a particular device from opening
+ // this can be used to ignore input devices for sensors
+ void addExcludedDevice(const char* deviceName);
+
// special type codes when devices are added/removed.
enum {
DEVICE_ADDED = 0x10000000,
@@ -88,10 +92,9 @@ public:
virtual bool getEvent(int32_t* outDeviceId, int32_t* outType,
int32_t* outScancode, int32_t* outKeycode, uint32_t *outFlags,
int32_t* outValue, nsecs_t* outWhen);
-
+
protected:
virtual ~EventHub();
- virtual void onFirstRef();
private:
bool openPlatformInput(void);
@@ -139,7 +142,10 @@ private:
device_t **mDevices;
struct pollfd *mFDs;
int mFDCount;
-
+
+ bool mOpened;
+ List<String8> mExcludedDevices;
+
// device ids that report particular switches.
#ifdef EV_SW
int32_t mSwitches[SW_MAX+1];