summaryrefslogtreecommitdiffstats
path: root/services/input/tests
Commit message (Collapse)AuthorAgeFilesLines
* Propagate input ANR reason to activity manager log.Jeff Brown2013-09-101-1/+2
| | | | | | | | Make it a little easier to diagnose input dispatch timeouts by providing the detailed reason as the ANR annotation in the log. Bug: 10689184 Change-Id: Ie18fd9ad066b0673d1f57c030e027ad0085f4650
* Add controller numbers for gamepads / joysticksMichael Wright2013-07-231-13/+23
| | | | Change-Id: I30ac9add6a2473a5ebd83a022c571545e61d1136
* Move input library code to frameworks/native.Jeff Brown2013-07-011-1/+2
| | | | | | | | | No longer compile libandroidfw as a static library on the device since it already exists as a shared library. Keeping the static library would force us to provide a static library version of libinput for the device as well which doesn't make sense. Change-Id: I3517881b87b47dcc209d80dbd0ac6b5cf29a766f
* Build native libinput tests using BUILD_NATIVE_TESTSBrett Chabot2013-05-161-1/+1
| | | | Change-Id: Ic50c828e1e8879e70aa85de63303ead11886d498
* Add liblogYing Wang2013-04-091-0/+1
| | | | | Bug: 8580410 Change-Id: I746aa8258866508c3a725d0773faf4518096548f
* Bundle correlated switch changes atomically.Jeff Brown2012-09-272-3/+7
| | | | | | | This is a prerequisite for headset jack detection on Manta. Bug: 6548391 Change-Id: I549a194344511c0cee578b00f6a9ab5fdbdfb99c
* Make input system aware of multiple displays.Jeff Brown2012-09-101-0/+3
| | | | | | | | | | | | | | | | | | | | The input system needs to know about the window that has focus, even if it is on a secondary display. So now we send it the list of all windows and indicate which display they are on. We filter the list of windows as necessary when delivering touch events. To keep things simple, monitor input channels and input filters are not supported except on the main display. We also do not pass the display id to applications; it is only used inside the input system for now. Properly scale touch coordinates based on the viewport. This will be needed to ensure that touch works on external display as well as when the internal display is being used to simulate a different resolution. Change-Id: I1815579a52fcc852c519b5391fc7ab8767c2dc59
* Make display manager tell input system about viewports.Jeff Brown2012-09-081-2/+15
| | | | | | | The window manager is no longer responsible for telling the input system about the display viewport. Change-Id: I932882bae55decef55f25093bb2a7ebac1620bb1
* Improve handling of built-in keyboard.Jeff Brown2012-05-011-90/+0
| | | | | | | | | | | | | | | | | The window manager policy made some incorrect assumptions about the meaning of the Configuration.keyboard field. We need to be more careful about distinguishing between built-in and external keyboards. Most of this change is to move the determination of the parts of the Configuration related to input devices into the WindowManagerService leveraging new features of the InputManagerService to good effect. Then we plumb through the flag that indicates whether a device is internal or external so that we can be more particular about how the lid switch effects changes to the Configuration. Bug: 6424373 Change-Id: I36a1c22ade35e578955465a25940a33f227b9763
* Get alias for Bluetooth devices.Jeff Brown2012-04-201-4/+8
| | | | | | | | | | | Bluetooth devices can be renamed by the user. Make the input system aware of the user-specified name and transparently pass it down to applications. This enables the keyboard layout picker Settings UI to use device names that are consistent with what the user set in the Bluetooth UI. Bug: 6363157 Change-Id: I8eea26ce2c69c2a3f09c8de02e9e847610e0419c
* Fix build.Jeff Brown2012-04-171-1/+1
| | | | Change-Id: I277042c91b34af59e70941fd5b458581310b1c22
* Support loading keyboard layout overlays from resources.Jeff Brown2012-04-171-0/+8
| | | | | | | | | | | | | | | | | | | | | | Added the concept of a keyboard layout overlay, which is a key character map file that has "type OVERLAY". Added support for loading keyboard layout overlays from resources dynamically. The layouts are reloaded whenever they are changed in the Settings application or an application is installed. This is somewhat more aggressive than necessary so we might want to optimize it later. Before system-ready, the input system uses just the generic keyboard layouts that are included on the device system image. After system-ready, it considers the user's selected keyboard layout overlay and attempts to load it as necessary. We need to wait until system-ready before doing this because we need to be in a state where it is safe to start applications or access their resources. Bug: 6110399 Change-Id: Iae0886d3356649b0d2440aa00910a888cedd8323
* Add support for input devices that have vibrators.Jeff Brown2012-04-131-0/+6
| | | | | | | | | | Added a getVibrator() method to InputDevice which returns a Vibrator associated with that input device. Its uses the same API as the system vibrator which makes it easy for applications to be modified to use one or the other. Bug: 6334179 Change-Id: Ifc7f13dbcb778670f3f1c07ccc562334e6109d2e
* Notify applications when input devices change.Jeff Brown2012-04-121-51/+46
| | | | | | | | | | | | | | | | | This change allows the InputManager to keep track of what input devices are registered with the system and when they change. It needs to do this so that it can properly clear its cache of input device properties (especially the key map!) when changes occur. Added new API so that applications can register listeners for input device changes. Fixed a minor bug in EventHub where it didn't handle EPOLLHUP properly so it would spam the log about unsupposed epoll events until inotify noticed that the device was gone and removed it. Change-Id: I937d8c601f7185d4299038bce6a2934fe4fdd2b3
* HID usage should take precedence over scan code.Jeff Brown2012-04-121-13/+17
| | | | Change-Id: Ibd8988e3dcc0d64f4019ffe491d9789733f9d243
* Refactor key code mapping.Jeff Brown2012-04-111-141/+249
| | | | | | | | | | | | | | | | | | | Added handling for EV_MSC / MSC_SCAN which typically reports the HID usage associated with a key. This will enable key maps to map keys with HID usages that Linux does not natively recognize. Removed keyCode and flags fields from EventHub RawEvent since they don't necessarily make sense in isolation now that we pay attention to HID usage codes too. Removed the fallback code for mapping keys and axes. In practice, an input device should be self-sufficient. We should not ever need to look at the built-in keyboard's key map. In fact, there usually isn't a built-in keyboard anyhow. This code was originally working around a problem where we weren't loading the key map for touch screens with virtual keys, which has long since been fixed. Change-Id: I0a319bdec44be9514f795526347397e94d53a127
* Request key maps from input manager service.Jeff Brown2012-04-101-2/+2
| | | | | | | | | | | | | | | | | | Instead of each application loading the KeyCharacterMap from the file system, get them from the input manager service as part of the InputDevice object. Refactored InputManager to be a proper singleton instead of having a bunch of static methods. InputManager now maintains a cache of all InputDevice objects that it has loaded. Currently we never invalidate the cache which can cause InputDevice to return stale motion ranges if the device is reconfigured. This will be fixed in a future change. Added a fake InputDevice with ID -1 to represent the virtual keyboard. Change-Id: If7a695839ad0972317a5aab89e9d1e42ace28eb7
* Add a unique input device descriptor.Jeff Brown2012-04-061-11/+18
| | | | | | | | | | | | | The purpose of the input device descriptor is to make it possible to associate persistent settings for each input device, such as the keyboard layout. The descriptor is a hash of the information we have about the device, such as its vendor id, product id, unique id, name, or location. Bug: 6110399 Change-Id: Idb80f946819b3f0dbf4e661bb0a753dbc2b60981
* frameworks/base refactoringMathias Agopian2012-02-201-0/+1
| | | | | | create the new libandroidfw from parts of libui and libutils Change-Id: I1584995616fff5d527a2aba63921b682a6194d58
* Eliminate hw.keyboards system properties.Jeff Brown2011-11-151-0/+4
| | | | | | | | | | | | Stop using system properties to publish information about the key character map path. Instead, we can retrieve it on demand by asking the window manager. It was possible to exhaust the supply of system properties when repeatedly adding and removing input devices. Bug: 5532806 Change-Id: Idd361a24ad7db2edc185c8546db7fb05f9c28669
* Improve screenshot chord debouncing.Jeff Brown2011-10-121-2/+2
| | | | | | | | | | | | | | | | | | | Bug: 5011907 Introduce a 150ms delay in handling volume down keys while waiting to see if a power key will follow. Don't trigger the screenshot chord if both volume up and volume down are pressed together. Don't trigger the long-press power menu if volume keys are also pressed. Require the user to press both keys in the chord within the debounce time and continue long-pressing them in order to trigger the screenshot action. Change-Id: I248968d37b73c09d6d08e7f62667c443eba32da0
* Support composite touch / joystick devices better.Jeff Brown2011-08-311-5/+11
| | | | | | | | This change enables the joystick input mapper to handle any axes that are not claimed by the touch input mapper, which makes auxiliary controls such as wheels / knobs accessible. Change-Id: I01ee7f342ac91acfcb4ccb6676fd52b3d5bf31a0
* Support BTN_TOOL_*TAP as synonyms for BTN_TOOL_FINGER.Jeff Brown2011-08-231-2/+50
| | | | | | | | | | | | Bug: 5205301 Some drivers report one finger as BTN_TOOL_FINGER, two as BTN_TOOL_DOUBLETAP, three as BTN_TOOL_TRIPLETAP and four as BTN_TOOL_QUADTAP. Since we care about the tool type, we need to handle _DOUBLE/_TRIPLE/_QUAD tap in the same way we handle _FINGER. Change-Id: I8eb83d2a2bada9ac32d07619c7eea84e924316b8
* Input system bug fixes, particularly for stylus.Jeff Brown2011-08-191-279/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 5049148 Finished stylus support, including support for indirect stylus and mouse tools. Added TILT axis. When stylus tilt X/Y is available, it is transformed into an orientation and tilt inclination which is a more convenient representation and a simpler extension to the exiting API. Touch devices now only report touch data using a single input source. Previously touch devices in pointer mode would report both absolute touch pad data and cooked pointer gestures. Now we just pick one. The touch device switches modes as needed when the focused application enables/disables pointer gestures. This change greatly simplifies the code and reduces the load on the input dispatcher. Fixed an incorrect assumption that the value of ABS_(MT_)DISTANCE would be zero whenever the stylus was in direct contact. It appears that the correct way to determine whether the stylus is in direct contact (rather than hovering) is by checking for a non-zero reported pressure. Added code to read the initial state of tool buttons and axis values when the input devices are initialized or reset. This fixes problems where the input mapper state might have the wrong initial state. Moved responsibility for cancelling pending inputs (keys down, touches, etc.) to the InputDispatcher by sending it a device reset notification. This frees the InputReader from having to synthesize events during reset, which was cumbersome and somewhat brittle to begin with. Consolidated more of the common accumulator logic from SingleTouchInputMapper and MultiTouchInputMapper into TouchInputMapper. Improved the PointerLocation output. Change-Id: I595d3647f7fd7cb1e3eff8b3c76b85043b5fe2f0
* Improve touch device configuration.Jeff Brown2011-08-111-54/+73
| | | | | | | | | | | | Bug: 5064702 This change improves compatibility with standard touch device drivers. All existing touch device IDC files will need to be updated because the input system now assumes that the touch device drivers implement the multitouch input protocol correctly and use the appropriate axes. Change-Id: I93aad0e011efea74fbc7fa3da31f7967aff8136c
* Add input system to Watchdog.Jeff Brown2011-08-101-0/+3
| | | | | | Bug: 5094994 Change-Id: I153866958efc64ac19bda8b997c1c9f6ad425ec4
* Refactor input reader to add stylus support.Jeff Brown2011-07-311-409/+1497
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 5064702 Introduced the concept of an InputListener to further decouple the InputReader from the InputDispatcher. The InputListener exposes just the minimum interface that the InputReader needs to communicate with the outside world. The InputReader passes arguments to the InputListener by reference, which makes it easy to queue them up. Consolidated all of the InputReader locks into one simple global Mutex. The reason this wasn't done before was due to potential re-entrance in outbound calls to the InputDispatcher. To fix this, the InputReader now queues up all of the events it wants to send using a QueuedInputListener, then flushes them outside of the critical section after all of the event processing is finished. Removing all of the InputMapper locks greatly simplifies the implementation. Added tests for new stylus features such as buttons, tool types, and hovering. Added some helpers to BitSet32 to handle common code patterns like finding the first marked bit and clearing it. Fixed a bug in VelocityTracker where the wrong pointer trace could get cleared when handling ACTION_POINTER_DOWN. Oops. Changed PointerCoords so it no longer stores useless zero axis values. Removed editAxisValue because it is not very useful when all zero value axes are absent and therefore cannot be edited in place. Added dispatch of stylus hover events. Added support for distance and tool types. Change-Id: I4cf14d134fcb1db7d10be5f2af7b37deef8f8468
* Merge "Fix uses of all-subdir-makefiles"Ying Wang2011-07-271-1/+1
|\
| * Fix uses of all-subdir-makefilesYing Wang2011-07-271-1/+1
| | | | | | | | | | | | | | | | We should use all-makefiles-under instead. all-subdir-makefiles can be used only before any "include" statement. Before this change, both subdirs were actually not included. Change-Id: I6bf35d07f294a5012c9322096f999ac26e37432f
* | Report the external display size to the input reader.Jeff Brown2011-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The input reader needs this information so that it knows how to interpolate touches on an external touch screen. Changed Display so that it asks the WindowManager what the real display size is (as opposed to the raw display size). This means it now takes into the forced display size set by adb shell am display-size. Replaced all calls to getRealWidth() / getRealHeight() / getRealMetrics() in the WindowManager and replaced them with direct usages of the mCurDisplayWidth / mCurDisplayHeight so that the WM doesn't end up making a reentrant Binder call into itself. Fixed the table status bar HeightReceiver so that it updates the height on all configuration changes since it is possible that the display size changed independently of an external HDMI display being plugged / unplugged. Improved the Display class documentation to make the distinctions betweeen the various sizes clearer. Change-Id: I3f75de559d3ebffed532ab46c4ae52c5e7f1da2b
* | Handle stylus buttons and tool types.Jeff Brown2011-07-251-0/+39
|/ | | | | | | | | | | | | | | | Added TOOL_TYPE_ERASER. Refactored the InputReader to share more code between the various input mappers that handle button states and to simplify the accumulator implementations by having each one only handle a single type of input. Removed the concept of direct/indirect tool types from the API. If we add it back, it should be done in a manner that is orthogonal to the tool type itself, perhaps as a flags field on the pointer. The device source may well provide sufficient information anyhow. Change-Id: I811c22d95e8304269b6ee4f6d11a6b04f3cfc1b2
* Refactor input dispatcher use of window/app handles.Jeff Brown2011-07-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This change moves the cached window and application input state into the handle objects themselves. It simplifies the dispatcher somewhat because it no longer needs to fix up references to transient InputWindow objects each time the window list is updated. This change will also make it easier to optimize setInputWindows to avoid doing a lot of redundant data copying. In principle, only the modified fields need to be updated. However, for now we continue to update all fields in unison as before. It turns out that the input dispatcher was inappropriately retaining pointers to InputWindow objects within the mWindows InputWindow vector. This vector is copy-on-write so it is possible and the item pointers to change if an editing operation is performed on the vector when it does not exclusively own the underlying SharedBuffer. This bug was uncovered by a previous change that replaced calls to clear() and appendVector() with a simple use of operator= which caused the buffer to be shared. Consequently after editItemAt was called (which it shouldn't have, actually) the buffer was copied and the cached InputWindow pointers became invalid. Oops. This change fixes the problem. Change-Id: I0a259339a6015fcf9113dc4081a6875e047fd425
* Remove the simulator target from all makefiles.Jeff Brown2011-07-111-4/+0
| | | | | | Bug: 5010576 Change-Id: I04d722f258951a3078fe07899f5bbe8aac02a8e8
* Drop obsolete touch screen hacks.Jeff Brown2011-07-011-8/+0
| | | | Change-Id: I47354c37ee2cc2b36340eb709bb5043b3ba78ed9
* Workaround apps that make assumptions about pointer ids.Jeff Brown2011-07-011-22/+22
| | | | | | | | | | Modified the touch input mapper to assign pointer ids sequentially starting from 0 instead of using the tracking id or slot index supplied by the driver. Applications should not depend on this ordering but some do. (sigh) Bug: 4980884 Change-Id: I0dfeb3ac27c57a7102a13c960c760e2a02eb7669
* Query input device for initial slot index.Jeff Brown2011-07-011-0/+20
| | | | | | | | | | | This fixes a problem where touches can get stuck because the driver and the framework have different ideas of what the initial slot index is. The framework assumed it was slot 0 but it could in principle be any slot, such as slot 1. When that happened, the framework would start tracking the first touch as slot 0, but it might never receive an "up" for that slot. Change-Id: Idaffc4534b275d66b9d4360987b28dc2d0f63218
* Add support for disabling pointer gestures.Jeff Brown2011-06-141-11/+8
| | | | | | | | | | | | Made it possible for individual windows to disable pointer gestures while the window has focus using a private API. Cleaned up the InputReader configuration code to enable in-place reconfiguration of input devices without having to reopen them all. This change makes changing the pointer speed somewhat nicer since the pointer doesn't jump back to the origin after each change. Change-Id: I9727419c2f4cb39e16acb4b15fd7fd84526b1239
* EventHub code cleanup.Jeff Brown2011-06-141-1/+4
| | | | | | | | | Use epoll_wait() instead of poll(). Dropped all support for non-Linux platforms. Added a wake-up protocol so that the InputReader can wake up the event loop immediately as needed. Change-Id: Ibf84337bcceb3c2df068c5c637de42a319786d66
* Take advantage of updated linux/input.h kernel headers.Jeff Brown2011-06-131-1/+2
| | | | Change-Id: I72d2ef82de5c504d46b0cdb57aa43bbd0d769174
* am e046555b: am fd324486: am 5cb05eea: Merge "Fix build." into honeycomb-mr2Jeff Brown2011-06-071-2/+2
|\ | | | | | | | | * commit 'e046555b4d92179327d12d888be967fff5c027ca': Fix build.
| * Fix build.Jeff Brown2011-06-061-2/+2
| | | | | | | | Change-Id: I9ea07637058e2aa74d20d881bc21fea305cc869e
* | resolved conflicts for merge of ca2b552d to masterJeff Brown2011-06-031-2/+5
|\ \ | |/ | | | | Change-Id: I2f3693a59042ac5aa2d7bcdc3a504c78dc99a18b
| * Add a preference panel for mouse speed.Jeff Brown2011-06-021-2/+5
| | | | | | | | | | Bug: 4124987 Change-Id: I3ce175d268a1d043cf5878481261b1049a15a149
* | resolved conflicts for merge of 7e193916 to masterDianne Hackborn2011-06-032-26/+20
|\ \ | |/ | | | | Change-Id: If06892419319c3a2d4ab6b03dd3ceb99b83803b5
| * Use ViewConfiguration to seed input system configuration.Jeff Brown2011-05-312-26/+20
| | | | | | | | | | | | | | | | | | Fix bug where the pointer presentation would be updated on any input reader timeout rather than only when a pointer gesture is in progress. Bug: 4124987 Change-Id: Ie9bba4a0b3228d55e45e65fa2ede5cd6ba887a08
* | am 3f5b95b0: am a4e74744: am fa574c0e: Merge "Touch pad UX improvements." ↵Jeff Brown2011-05-311-2/+2
|\ \ | |/ | | | | | | | | | | into honeycomb-mr2 * commit '3f5b95b05efcf7ab2e8f193649b841dc1786f2ef': Touch pad UX improvements.
| * Touch pad UX improvements.Jeff Brown2011-05-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Fade the pointer spot when swiping or performing a freeform gesture. Support configuring the gesture mode in the device IDC file. Added workaround for devices that report individual finger movements one at a time instead of all at once. Bug: 4124987 Change-Id: I44628b00382ad59306e4ec5c4717d69cc6fbebb8
| * Initial checkin of spot presentation for touchpad gestures. (DO NOT MERGE)Jeff Brown2011-05-251-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a new PointerIcon API (hidden for now) for loading pointer icons. Fixed a starvation problem in the native Looper's sendMessage implementation which caused new messages to be posted ahead of old messages sent with sendMessageDelayed. Redesigned the touch pad gestures to be defined in terms of more fluid finger / spot movements. The objective is to reinforce the natural mapping between fingers and spots which means there must not be any discontinuities in spot motion relative to the fingers. Removed the SpotController stub and folded its responsibilities into PointerController. Change-Id: Ib647dbd7a57a7f30dd9c6e2c260df51d7bbdd18e
| * Add a sprite controller. (DO NOT MERGE)Jeff Brown2011-05-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored PointerController to extract the surface management code to a new component called a SpriteController so that it can be used to move finger tracking spots around the screen as well. The SpriteController is designed to fully decouple the client from any latency introduced by surface transactions and drawing. All sprite updates are performed asynchronously on the Looper using a copy of the sprite state. Added a stub SpotController implementation for touch pad UX. It will be implemented in a subsequent patch. Fixed a little bug in pointer orientation changes when entering DISPLAY_ORIENTATION_90 the x offset was clobbered. Change-Id: I6d59d80df9af61e93af50290e7776337d10c9d5a
| * Optimize EventHub to process events in big chunks. (DO NOT MERGE)Jeff Brown2011-05-241-5/+5
| | | | | | | | | | | | | | When 10 fingers are down, reduces the CPU time spent by the InputReader thread from ~30% to ~5% on Stingray. Change-Id: I42ee5c67b8521af715cbab43e763a4af4eb1f914