summaryrefslogtreecommitdiffstats
path: root/services/input
Commit message (Collapse)AuthorAgeFilesLines
* Make input system aware of multiple displays.Jeff Brown2012-09-108-133/+301
| | | | | | | | | | | | | | | | | | | | 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-085-94/+124
| | | | | | | The window manager is no longer responsible for telling the input system about the display viewport. Change-Id: I932882bae55decef55f25093bb2a7ebac1620bb1
* Remove unused "layer" argument from show().Jeff Brown2012-08-271-1/+1
| | | | Change-Id: I795edb8889bbacdf20fc54d755034040295f281a
* Add plumbing for new surface flinger display API.Jeff Brown2012-08-271-1/+2
| | | | | | | | | | | | | | Cleaned up the implementation of Surface and SurfaceSession to use more consistent naming and structure. Added JNI for all of the new surface flinger display API calls. Enforced the requirement that all Surfaces created by the window manager be named. Updated the display manager service to use the new methods. Change-Id: I2a658f1bfd0437e1c6f9d22df8d4ffcce7284ca2
* Use new surface flinger API.Jeff Brown2012-08-271-1/+1
| | | | Change-Id: Ic888577408a59a36481a48010e19c5e77c24e211
* Move and rename user activity event type constants.Jeff Brown2012-07-271-3/+3
| | | | Change-Id: Ie565808796773b6896e71ddfac6aaaf8031de846
* Improve handling of size and orientation.Jeff Brown2012-06-252-8/+15
| | | | | | | | | | | | | Some touch device drivers report the range of ABS_MT_ORIENTATION as [0,1]. The Linux multitouch protocol spec says that the 0 value should always be considered vertical. Add a new 'box' calibration mode for size to handle the case where width and height are being provided. The 'diameter' calibration mode is inadequate because it drops one of these components. Change-Id: I7bd744fdff95acd4044d295efe8bd7186dbe8061
* Capture input dispatcher's last ANR state in bug report.Jeff Brown2012-06-172-12/+40
| | | | | | | | | | | | | | Some ANR bugs are very difficult to localize because by the time the bug report has been captured, the relevant information is gone. Work around this by capturing a log of the input dispatcher's state at the exact time of the ANR before anything has changed and include this information in the bug report. Also fixed a nit related to some format strings that had improper field widths specified. Bug: 6680398 Change-Id: I5323bf18ec5e47a767cd053209753cc46852bf4c
* Improve ANR diagnostics.Jeff Brown2012-06-112-45/+133
| | | | | | | | | | | | | | When an ANR occurs, log the associated reason. When an event takes too long to process (currently more than 2 seconds) log basic information about the event including how long it actually took. Dump the contents of the inbound, outbound and wait queues as part of dumpsys input. Bug: 6574842 Change-Id: I9ab754c320f609cb86fe266c469a61e7032dfed6
* Don't ANR on hover, scroll or if a window goes away.Jeff Brown2012-05-241-15/+24
| | | | | | | | | | Prevents ANR on hover or scroll events. Prevents ANR in the case where one finger touches a window which is subsequently removed then a second finger comes along and tries to touch something. Change-Id: I985ccb70cd86659992328f14f8a705f3f05ea2e5
* Merge "Revert "services: input events: enable debugging in EventHub (touch ↵JP Abgrall2012-05-161-16/+7
|\ | | | | | | screen issues)"" into jb-dev
| * Revert "services: input events: enable debugging in EventHub (touch screen ↵JP Abgrall2012-05-161-16/+7
| | | | | | | | | | | | | | issues)" This reverts commit df0a89daa8018f9dec53d8d766e5a045347ffc93 Get rid of the debugging for the release.
* | Minor refactoring before starting on velocity tracker changes.Jeff Brown2012-05-112-0/+3
| | | | | | | | | | Bug: 6413587 Change-Id: I5eba2bb57193bff78cb3740de5f87aca0b31d154
* | Merge "Fix bugs in fallback key handling." into jb-devJeff Brown2012-05-092-8/+35
|\ \
| * | Fix bugs in fallback key handling.Jeff Brown2012-05-092-8/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a fallback key is generated using a key plus a modifier, then it's possible we might get a different fallback key generated if the modifier has changed. PhoneWindowManager needs to remember which fallback is last generated for a given key code so that it can apply the same fallback action. When generating cancellation events, it's important to have preserved the policyFlags of the original event. Otherwise we may not dispatch the cancellation properly. For example, some actions are not performed if the POLICY_FLAG_TRUSTED is not specified. Remember the metaState associated with a key event so we can include it when canceled. Tell the policy when a fallback is being cancelled so that it can clean up its state. After a SEARCH shortcut is invoked, clear the flag indicating that a shortcut is pending. This is to prevent SEARCH from getting stuck down in the case where we might forget to send the up. (Shouldn't happen anymore after the prior fixes.) Bug: 5616255 Change-Id: I68f0a9679c7af464eaf31c099f2aa50b53fecf1f
* | | Merge "services: input events: enable debugging in EventHub (touch screen ↵JP Abgrall2012-05-091-7/+16
|\ \ \ | |/ / |/| / | |/ issues)" into jb-dev
| * services: input events: enable debugging in EventHub (touch screen issues)JP Abgrall2012-05-081-7/+16
| | | | | | | | | | | | | | | | | | | | Enable verbose logging, but limit the output of events to only those that are stale by more than 1ms. This does not overly pollute the logcat output. Bug: 6258051 Change-Id: I32012a379ca0e97c0834975482cd91f9eeb08907
* | Disable input dispatch until boot finished.Jeff Brown2012-05-081-1/+1
|/ | | | | Bug: 6263070 Change-Id: I25e15e3d8af8eb3343c7b684fec345337d9f6aab
* Use EVIOCSCLOCKID correctly.Jeff Brown2012-05-011-1/+2
| | | | | Bug: 6382031 Change-Id: I87b0887ce867a79758bcd24e2202280270faaf8c
* Improve handling of built-in keyboard.Jeff Brown2012-05-013-141/+1
| | | | | | | | | | | | | | | | | 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
* am 7086cd5c: am 5600deb7: am d26a8b73: am cda8329e: Merge "Distance max set ↵Dianne Hackborn2012-04-241-1/+1
|\ | | | | | | | | | | | | incorrectly" * commit '7086cd5c75073b75cd4a7d61aaa9f0529450e4e5': Distance max set incorrectly
| * Distance max set incorrectlyAndreas Sandblad2012-04-231-1/+1
| | | | | | | | | | | | | | | | | | The distance max used in the MotionRange is calculated incorrectly. Looks like a copy-and-paste error. Change-Id: I2b6daab088df0fb69e05682b67ca33524ff35987
| * am 5d58eb06: Merge "Fix a few memory leaks in the input dispatcher. (DO NOT ↵Jeff Brown2012-01-202-6/+27
| |\ | | | | | | | | | | | | | | | | | | MERGE)" into ics-mr1 * commit '5d58eb06bcc8671bae72fb2389a9929e106131cc': Fix a few memory leaks in the input dispatcher. (DO NOT MERGE)
| | * Fix a few memory leaks in the input dispatcher. (DO NOT MERGE)Jeff Brown2012-01-172-6/+27
| | | | | | | | | | | | | | | Bug: 5862398 Change-Id: I799ee47b6e5d6c51f45aa4296c6ab8a610b74be5
| * | Rename LOG_ASSERT to ALOG_ASSERTSteve Block2012-01-193-31/+31
| | | | | | | | | | | | Change-Id: Ie2c7ea6560656d65bad791a61996174c75677517
| * | Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF)Steve Block2012-01-194-35/+35
| | | | | | | | | | | | Change-Id: I1de629b4632a4b3187ca1a28d6416daccd35f924
| * | Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF)Steve Block2012-01-194-40/+40
| | | | | | | | | | | | Change-Id: I8fbdfa7a7581f481968dbb65aa40f7042936d7cb
| * | Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF)Steve Block2012-01-193-32/+32
| | | | | | | | | | | | Change-Id: I26f76452ac49e2890b14d133c065493d8df0fb4a
| * | Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF)Steve Block2012-01-194-160/+160
| | | | | | | | | | | | Change-Id: I44f267700356967dc51e8f85ebf457dc85cfb229
| * | Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF)Steve Block2012-01-192-13/+13
| |/ | | | | | | Change-Id: I5321ebd12e9c6248a108529e82c4e1af2a4405e3
* | Get alias for Bluetooth devices.Jeff Brown2012-04-203-6/+27
| | | | | | | | | | | | | | | | | | | | | | 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
* | When ANR happens, only remove ANR'd window.Jeff Brown2012-04-202-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The system bar uses input event injection to inject BACK keys into the application. If the receiving application ANRs, we used to clear the touch state unconditionally. Doing so would prevent the system bar from receiving the ACTION_UP event so the back button would continue to appear pressed until pressed again. Now we are more careful to only remove the specific ANR'd window from the touch state. Other windows should continue to receive touch events as usual. Change-Id: If86bfc323e2c7aed82ca1334bc67da649953168f
* | Make InputDevice.SOURCE_STYLUS meaningful.Jeff Brown2012-04-192-6/+52
| | | | | | | | | | Bug: 5424551 Change-Id: I415cb1842422e050cc41b17f5a1f13b4fab17a44
* | Don't load keyboard layout overlay for virtual keyboard.Jeff Brown2012-04-192-4/+8
| | | | | | | | | | Bug: 6110399 Change-Id: I07c85cf991790ed8766b097acc39295a8065a5ea
* | Fix build.Jeff Brown2012-04-171-1/+1
| | | | | | | | Change-Id: I277042c91b34af59e70941fd5b458581310b1c22
* | Add Dvorak keyboard layout.Jeff Brown2012-04-172-9/+24
| | | | | | | | | | | | | | | | | | Added support for mapping both scan codes and HID usages to KeyLayoutMap and KeyCharacterMap. Keyboard overlays can now influence how key events are mapped to key codes. Bug: 6110399 Change-Id: I6619fd2d3e1337c55928f89869dbc45b535c7ccf
* | Support loading keyboard layout overlays from resources.Jeff Brown2012-04-175-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-135-4/+305
| | | | | | | | | | | | | | | | | | | | 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-124-101/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-115-215/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-104-63/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Use new EVIOCSCLOCKID ioctl if supported.Jeff Brown2012-04-091-3/+20
| | | | | | | | | | Bug: 6292993 Change-Id: I718f167c2cd41298ed54847dbc5de872cd4c7e4a
* | Add a unique input device descriptor.Jeff Brown2012-04-065-43/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Add Java wrappers for new atrace functionality.Jeff Brown2012-03-092-0/+48
| | | | | | | | | | | | | | Instrument a few parts of the input dispatcher and the view hierarchy. Change-Id: I49285c9fb3502253baa1ffed60f521b8c24fccaf
* | fix libgui header locationMathias Agopian2012-02-271-3/+1
| | | | | | | | Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
* | frameworks/base refactoringMathias Agopian2012-02-202-0/+2
| | | | | | | | | | | | create the new libandroidfw from parts of libui and libutils Change-Id: I1584995616fff5d527a2aba63921b682a6194d58
* | frameworks/base refactoring.Mathias Agopian2012-02-1711-21/+21
| | | | | | | | | | | | First step. Move libui includes to their new home: androidfw. Change-Id: Ic042b52fdba72f30edc3cc6339bf30b4c1b99662
* | Clean up InputChannel file descriptor data type.Jeff Brown2012-02-141-1/+1
| | | | | | | | | | | | File descriptors are ints. Change-Id: Ie36733bf36ddfeaa9a09ef6ebd7bd2f1788f5d27
* | Don't serialize motion events.Jeff Brown2012-02-132-15/+31
| | | | | | | | | | | | | | | | | | On reflection, only key events need to be serialized. This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I028b4eac97497d012036cb60ffbac4cb22d3966c