summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ui/EventHub.h24
-rw-r--r--include/ui/Input.h4
-rw-r--r--include/ui/InputReader.h10
-rwxr-xr-xinclude/ui/KeycodeLabels.h2
-rw-r--r--include/utils/ZipFileRO.h11
5 files changed, 27 insertions, 24 deletions
diff --git a/include/ui/EventHub.h b/include/ui/EventHub.h
index d6b09dc..d78e35f 100644
--- a/include/ui/EventHub.h
+++ b/include/ui/EventHub.h
@@ -142,8 +142,13 @@ protected:
public:
// Synthetic raw event type codes produced when devices are added or removed.
enum {
+ // Sent when a device is added.
DEVICE_ADDED = 0x10000000,
- DEVICE_REMOVED = 0x20000000
+ // Sent when a device is removed.
+ DEVICE_REMOVED = 0x20000000,
+ // Sent when all added/removed devices from the most recent scan have been reported.
+ // This event is always sent at least once.
+ FINISHED_DEVICE_SCAN = 0x30000000,
};
virtual uint32_t getDeviceClasses(int32_t deviceId) const = 0;
@@ -181,6 +186,8 @@ public:
*/
virtual bool markSupportedKeyCodes(int32_t deviceId, size_t numCodes, const int32_t* keyCodes,
uint8_t* outFlags) const = 0;
+
+ virtual void dump(String8& dump) = 0;
};
class EventHub : public EventHubInterface
@@ -211,16 +218,18 @@ public:
virtual bool getEvent(RawEvent* outEvent);
+ virtual void dump(String8& dump);
+
protected:
virtual ~EventHub();
private:
bool openPlatformInput(void);
- int open_device(const char *device);
- int close_device(const char *device);
- int scan_dir(const char *dirname);
- int read_notify(int nfd);
+ int openDevice(const char *device);
+ int closeDevice(const char *device);
+ int scanDir(const char *dirname);
+ int readNotify(int nfd);
status_t mError;
@@ -239,8 +248,8 @@ private:
~device_t();
};
- device_t* getDevice(int32_t deviceId) const;
- bool hasKeycode(device_t* device, int keycode) const;
+ device_t* getDeviceLocked(int32_t deviceId) const;
+ bool hasKeycodeLocked(device_t* device, int keycode) const;
int32_t getScanCodeStateLocked(device_t* device, int32_t scanCode) const;
int32_t getKeyCodeStateLocked(device_t* device, int32_t keyCode) const;
@@ -269,6 +278,7 @@ private:
int mFDCount;
bool mOpened;
+ bool mNeedToSendFinishedDeviceScan;
List<String8> mExcludedDevices;
// device ids that report particular switches.
diff --git a/include/ui/Input.h b/include/ui/Input.h
index 21baf32..ee40b85 100644
--- a/include/ui/Input.h
+++ b/include/ui/Input.h
@@ -73,7 +73,8 @@ namespace android {
* policy decisions such as waking from device sleep.
*/
enum {
- /* These flags originate in RawEvents and are generally set in the key map. */
+ /* These flags originate in RawEvents and are generally set in the key map.
+ * See also labels for policy flags in KeycodeLabels.h. */
POLICY_FLAG_WAKE = 0x00000001,
POLICY_FLAG_WAKE_DROPPED = 0x00000002,
@@ -83,6 +84,7 @@ enum {
POLICY_FLAG_ALT_GR = 0x00000020,
POLICY_FLAG_MENU = 0x00000040,
POLICY_FLAG_LAUNCHER = 0x00000080,
+ POLICY_FLAG_VIRTUAL = 0x00000100,
POLICY_FLAG_RAW_MASK = 0x0000ffff,
diff --git a/include/ui/InputReader.h b/include/ui/InputReader.h
index d3fbaf7..3619189 100644
--- a/include/ui/InputReader.h
+++ b/include/ui/InputReader.h
@@ -103,10 +103,6 @@ public:
virtual bool getDisplayInfo(int32_t displayId,
int32_t* width, int32_t* height, int32_t* orientation) = 0;
- /* Provides feedback for a virtual key down.
- */
- virtual void virtualKeyDownFeedback() = 0;
-
/* Intercepts a key event.
* The policy can use this method as an opportunity to perform power management functions
* and early event preprocessing such as updating policy flags.
@@ -283,14 +279,14 @@ private:
// low-level input event decoding and device management
void process(const RawEvent* rawEvent);
- void addDevice(nsecs_t when, int32_t deviceId);
- void removeDevice(nsecs_t when, int32_t deviceId);
+ void addDevice(int32_t deviceId);
+ void removeDevice(int32_t deviceId);
InputDevice* createDevice(int32_t deviceId, const String8& name, uint32_t classes);
void configureExcludedDevices();
void consumeEvent(const RawEvent* rawEvent);
- void handleConfigurationChanged(nsecs_t when);
+ void handleConfigurationChanged();
// state management for all devices
Mutex mStateLock;
diff --git a/include/ui/KeycodeLabels.h b/include/ui/KeycodeLabels.h
index c8d6ffc..f71d9cd 100755
--- a/include/ui/KeycodeLabels.h
+++ b/include/ui/KeycodeLabels.h
@@ -142,6 +142,7 @@ static const KeycodeLabel KEYCODES[] = {
{ NULL, 0 }
};
+// See also policy flags in Input.h.
static const KeycodeLabel FLAGS[] = {
{ "WAKE", 0x00000001 },
{ "WAKE_DROPPED", 0x00000002 },
@@ -151,6 +152,7 @@ static const KeycodeLabel FLAGS[] = {
{ "ALT_GR", 0x00000020 },
{ "MENU", 0x00000040 },
{ "LAUNCHER", 0x00000080 },
+ { "VIRTUAL", 0x00000100 },
{ NULL, 0 }
};
diff --git a/include/utils/ZipFileRO.h b/include/utils/ZipFileRO.h
index 9668bde..e1ff780 100644
--- a/include/utils/ZipFileRO.h
+++ b/include/utils/ZipFileRO.h
@@ -64,15 +64,8 @@ public:
mNumEntries(-1), mDirectoryOffset(-1),
mHashTableSize(-1), mHashTable(NULL)
{}
- ~ZipFileRO() {
- free(mHashTable);
- if (mDirectoryMap)
- mDirectoryMap->release();
- if (mFd >= 0)
- close(mFd);
- if (mFileName)
- free(mFileName);
- }
+
+ ~ZipFileRO();
/*
* Open an archive.