summaryrefslogtreecommitdiffstats
path: root/include/ui
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-11-18 20:53:46 -0800
committerJeff Brown <jeffbrown@google.com>2010-11-30 18:50:17 -0800
commit1f2451007c660091b7b090c1ea332f9044515d2d (patch)
treeeddeaa59b0443b271353cd731e9ce7ce5b1cd993 /include/ui
parent47e6b1b5eef8ee99872f278f66bc498c4fcca0d8 (diff)
downloadframeworks_base-1f2451007c660091b7b090c1ea332f9044515d2d.zip
frameworks_base-1f2451007c660091b7b090c1ea332f9044515d2d.tar.gz
frameworks_base-1f2451007c660091b7b090c1ea332f9044515d2d.tar.bz2
Ensure the ShortcutManager uses the correct key character map.
The ShortcutManager used to only receive the key code of the key event that triggered the shortcut. This change now provides the shortcut manager with the whole key event so it can look up the associated character using the correct key character map. To make this more efficient, added a mechanism for recycling key events. At the moment it is only used by key events owned by the system process, since clients of the existing API (such as Views) might continue to hold on to key events after dispatch has finished so they would break if the key event were recycled by the framework. Deprecated KeyCharacterMap.BUILT_IN_KEYBOARD. Change-Id: I4313725dd63f2be01c350c005a41c7fde9bc67e8
Diffstat (limited to 'include/ui')
-rw-r--r--include/ui/Input.h4
-rw-r--r--include/ui/InputDispatcher.h7
2 files changed, 2 insertions, 9 deletions
diff --git a/include/ui/Input.h b/include/ui/Input.h
index 11b798f..4dc8f2a 100644
--- a/include/ui/Input.h
+++ b/include/ui/Input.h
@@ -507,10 +507,8 @@ enum InputDeviceConfigurationFileType {
/*
* Get the path of an input device configuration file, if one is available.
* Spaces in the name are replaced with underscores.
+ * Considers both system provided and user installed configuration files.
*
- * Looks in: <system-root>/usr/<type-specific-directory>/<name><extension>.
- *
- * TODO Also look in a user installable location.
* Returns an empty string if not found.
*/
extern String8 getInputDeviceConfigurationFilePath(
diff --git a/include/ui/InputDispatcher.h b/include/ui/InputDispatcher.h
index d0812de..b621680 100644
--- a/include/ui/InputDispatcher.h
+++ b/include/ui/InputDispatcher.h
@@ -291,9 +291,7 @@ public:
* This method is expected to set the POLICY_FLAG_PASS_TO_USER policy flag if the event
* should be dispatched to applications.
*/
- virtual void interceptKeyBeforeQueueing(nsecs_t when, int32_t deviceId,
- int32_t action, int32_t& flags, int32_t keyCode, int32_t scanCode,
- uint32_t& policyFlags) = 0;
+ virtual void interceptKeyBeforeQueueing(const KeyEvent* keyEvent, uint32_t& policyFlags) = 0;
/* Intercepts a generic touch, trackball or other event before queueing it.
* The policy can use this method as an opportunity to perform power management functions
@@ -894,9 +892,6 @@ private:
// Input channels that will receive a copy of all input events.
Vector<sp<InputChannel> > mMonitoringChannels;
- // Preallocated key event object used for policy inquiries.
- KeyEvent mReusableKeyEvent;
-
// Event injection and synchronization.
Condition mInjectionResultAvailableCondition;
bool hasInjectionPermission(int32_t injectorPid, int32_t injectorUid);