summaryrefslogtreecommitdiffstats
path: root/libs/ui
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug where home presses were not poking user activity.Jeff Brown2010-10-181-40/+28
| | | | | | | | | | | | | | | | | We now poke user activity twice: once upon dequeueing an event for dispatch and then again just before we dispatch it. The second poke is to compensate for the fact that it can take a few seconds to identify the dispatch target (if the application is responding slowly) but we want to keep the display from going to sleep for X amount of time after the app gets a chance to actually receive the event. This mirrors pre-Gingerbread behavior. Removed some unnecessary code that filters user activity pokes when sending events to KeyGuard. We don't need this because KeyGuard already tells the power manager to disable user activity. Bug: 3101397 Change-Id: I8c3a77601fdef8f584e84cfdd11aa79da0ff51db
* Fix a native crash in input dispatcher when windows are removed.Jeff Brown2010-10-151-1/+1
| | | | | Bug: 3101826 Change-Id: I040838600a6105c8d9f3235025dc0a7b5b27da2e
* Add support for secure system overlays. (DO NOT MERGE)Jeff Brown2010-10-151-2/+3
| | | | | | | | | | This change adds a new window type for secure system overlays created by the system itself from non-secure system overlays that might be created by applications that have the system alert permission. Secure views ignore the presence of secure system overlays. Bug: 3098519 Change-Id: I8f8398f4fdeb0469e5d71124c21bedf121bd8c07
* Improve input device calibration format.Jeff Brown2010-10-141-111/+176
| | | | | | | | | Added support for calibrating touch size for devices that report size as an area measurement rather than as a width. Fixed some bugs. Bug: 3096045 Change-Id: I30a12e73752883516ed054f8af407204bca45814
* Make sure EventHub reports added/removed devices immediately.Jeff Brown2010-10-141-3/+8
| | | | | | | | Fixed a bug where EventHub would not report changes in devices until the next event. Bug: 3096147 Change-Id: Ie4c3e1d14d0ad806cfaa212611ce06034d1b94d4
* Improve the input policy handling a bit.Jeff Brown2010-10-121-8/+6
| | | | | | | Fixed some issues with Monkeys turning off their own screens. Ook ook! Added some more comments to explain what's going on. Change-Id: Id2bc0466161a642a73ef7ef97725d1c81e984b12
* Fix a bug synthesizing cancelation events for motions.Jeff Brown2010-10-111-1/+1
| | | | Change-Id: I881c0fa16c1d22c4b1b6cca24deb0105405ff5b0
* Fix an event injection bug when the policy is bypassed.Jeff Brown2010-10-111-33/+30
| | | | | | | | | | Added the concept of a "trusted" event to distinguish between events from attached input devices or trusted injectors vs. other applications. This change enables us to move certain policy decisions out of the dispatcher and into the policy itself where they can be handled more systematically. Change-Id: I4d56fdcdd31aaa675d452088af39a70c4e039970
* Added more robust tracking and cancelation of events.Jeff Brown2010-10-102-314/+389
| | | | | | | | | | | | | | | | | | | | | | This change fixes several issues where events would be dropped in the input dispatch pipeline in such a way that the dispatcher could not accurately track the state of the input device. Given more robust tracking, we can now also provide robust cancelation of input events in cases where an application might otherwise become out of sync with the event stream due to ANR, app switch, policy decisions, or forced focus transitions. Pruned some of the input dispatcher log output. Moved the responsibility for calling intercept*BeforeQueueing into the input dispatcher instead of the input reader and added support for early interception of injected events for events coming from trusted sources. This enables behaviors like injection of media keys while the screen is off, haptic feedback of injected virtual keys, so injected events become more "first class" in a way. Change-Id: Iec6ff1dd21e5f3c7feb80ea4feb5382bd090dbd9
* Minor fix for InputReader support for non-touchscreen devices.Jeff Brown2010-10-071-1/+1
| | | | Change-Id: I2256e37dd1c6f3836f82786aae14ee5d0c98f4c6
* Make secure views tolerate IME overlays.Jeff Brown2010-10-051-27/+30
| | | | Change-Id: I3cf09b9d91045f4d9c558b4aace482a7b0bbd3d8
* Wait for initial device scan to finish before updating config.Jeff Brown2010-10-012-26/+32
| | | | | | | This change narrows the opportunity for a race condition setting the resource Configuration while devices are being updated. Change-Id: I58efa563f4129ab0fce7108511d16a99dff7e451
* Minor logging changes to input dispatcher to help with debugging.Jeff Brown2010-10-013-70/+138
| | | | | | | | Added dumpsys reporting to EventHub. Made the formatting a bit clearer. Added 'Locked' suffix to some internal methods of EventHub. Change-Id: Ic449560bcce378f6361895d27c66854e9724abb0
* Support haptic feedback for virtual keys defined in key layout.Jeff Brown2010-10-011-5/+5
| | | | Change-Id: I83e4108a87332692e03791dc066206becbc7941f
* Move verbose logging of device capabilities to dumpsys.Jeff Brown2010-09-301-138/+161
| | | | Change-Id: I5d55eaebfdf049bd1ac1e7bab2758886cfefc9d7
* Fix bug in split touches.Jeff Brown2010-09-281-1/+2
| | | | Change-Id: I808c2201a06938f82817058059f4ddcc9b1a9ae2
* Fix pointer index when splitting secondary pointers.Jeff Brown2010-09-271-0/+8
| | | | Change-Id: Ib01e810ea5b64501b1303000bbef0f0a1db2114e
* Add suuport for splitting touch events across windows.Jeff Brown2010-09-262-321/+563
| | | | | | | | | | This feature is currently used to enable dragging the start and end selection handles of a TextView at the same time. Could be used for other things later. Deleted some dead code in ArrowKeyMovementMethod and CursorControllers. Change-Id: I930accd97ca1ca1917aab8a807db2c950fc7b409
* Merge "Fix sim-eng build on Hardy" into gingerbreadBrian Carlstrom2010-09-161-0/+8
|\
| * Fix sim-eng build on HardyBrian Carlstrom2010-09-161-0/+8
| | | | | | | | | | | | | | | | Older glibc version do not include BSD htole32 and htole64 which are present in bionic. This worksaround a sim-eng build issue by only using htole32/htole64 if the host is not little endian. Change-Id: Ia8d0d36285f3c34c51a331790458e52a21c2925f
* | Merge "Ensure input dispatcher and native looper handles EINTR." into ↵Jeff Brown2010-09-161-2/+9
|\ \ | | | | | | | | | gingerbread
| * | Ensure input dispatcher and native looper handles EINTR.Jeff Brown2010-09-161-2/+9
| |/ | | | | | | Change-Id: I0a42db5f273b9bfe4ab174e4ee65d5d852f9f6bc
* | Fix app switch latency optimization.Jeff Brown2010-09-161-48/+75
|/ | | | | | This optimization was broken due to recent changes in how ANRs are handled. Change-Id: Ic99248a12755fadac8d4893e7d305b773e038d3d
* Merge "Input API review." into gingerbreadJeff Brown2010-09-161-3/+0
|\
| * Input API review.Jeff Brown2010-09-141-3/+0
| | | | | | | | | | | | | | Drop currently unsupported input features. Add documentation comments. Change-Id: I407d2e1dd90c5ee82983a3ccf177430d35ee7592
* | Fix input dispatcher regression on launcher drag&drop.Jeff Brown2010-09-161-49/+30
| | | | | | | | Change-Id: I40e937bd712cd2ed6cceac95dfd1b8c8e070724f
* | Fix NPE when handling certain kinds of ANRs.Jeff Brown2010-09-161-4/+6
| | | | | | | | Change-Id: Iccef1852e52c84f6f49d30c491431460a10b33d3
* | Make input dispatcher only ANR for foreground windows.Jeff Brown2010-09-151-393/+269
|/ | | | | | | | | | | | | | Redesigned the input dispatcher's ANR timeout mechanism so it is much closer to Froyo's policy. ANR is only ever signalled if the dispatcher is waiting on a window to finish processing its previous event(s) and there is new pending input. In the old code, we tracked the dispatch timeout separately for each input channel. This was somewhat complicated and also resulted in the situation where applications could ANR long after the user had pushed them into the background. Change-Id: I666ecada0952d4b95f1d67b9f733842b745c7f4b
* Merge "Replace epoll() with poll() and rename PollLoop to Looper." into ↵Jeff Brown2010-09-141-21/+21
|\ | | | | | | gingerbread
| * Replace epoll() with poll() and rename PollLoop to Looper.Jeff Brown2010-09-141-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of this change, consolidated and cleaned up the Looper API so that there are fewer distinctions between the NDK and non-NDK declarations (no need for two callback types, etc.). Removed the dependence on specific constants from sys/poll.h such as POLLIN. Instead looper.h defines events like LOOPER_EVENT_INPUT for the events that it supports. That should help make any future under-the-hood implementation changes easier. Fixed a couple of compiler warnings along the way. Change-Id: I449a7ec780bf061bdd325452f823673e2b39b6ae
* | Add logging of various important graphics eventsMathias Agopian2010-09-133-3/+117
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are 16 events logged in the event log: SF_APP_DEQUEUE_BEFORE SF_APP_DEQUEUE_AFTER SF_APP_LOCK_BEFORE SF_APP_LOCK_AFTER SF_APP_QUEUE SF_REPAINT SF_COMPOSITION_COMPLETE SF_UNLOCK_CLIENTS SF_SWAP_BUFFERS SF_REPAINT_DONE SF_FB_POST_BEFORE SF_FB_POST_AFTER SF_FB_DEQUEUE_BEFORE SF_FB_DEQUEUE_AFTER SF_FB_LOCK_BEFORE SF_FB_LOCK_AFTER all events log the buffer conserned and a timestamp in microseconds. by default the logging is not enabled, to turn it on: adb shell service call SurfaceFlinger 1006 i31 1 adb shell setprop debug.graphic_log 1 The effect is immediate in SurfaceFlinger, but applications need to be restarted. Change-Id: Ifc2e31f7aed072d9a7dede20ff2ce59231edbec1
* Input dispatcher ANR handling enhancements.Jeff Brown2010-09-123-501/+1874
| | | | | | | | | | | | | | | | | | | | | | | This change is essentially a rewrite of the main input dispatcher loop with the target identification folded in. Since the input dispatcher now has all of the window state, it can make better decisions about when to ANR. Added a .5 second deadline for processing app switch keys. This behavior predates Gingerbread but had not previously been ported. Fixed some timing inaccuracies in the ANR accounting that could cause applications to ANR sooner than they should have. Added a mechanism for tracking key and motion events that have been dispatched to a window so that appropriate cancelation events can be synthesized when recovering from ANR. This change helps to keep applications in sync so they don't end up with stuck buttons upon recovery from ANRs. Added more comments to describe the tricky parts of PollLoop. Change-Id: I13dffca27acb436fc383980db536abc4d8b9e6f1
* Fix key repeat delay.Jeff Brown2010-09-081-4/+5
| | | | Change-Id: I6216e082324ee29bf50e37acc673350ca5417c4d
* Add support for secure views.Jeff Brown2010-09-085-30/+45
| | | | | | | | | | | | Added the MotionEvent.FLAG_WINDOW_IS_OBSCURED flag which is set by the input manager whenever another visible window is partly or wholly obscured the target of a touch event so that applications can filter touches accordingly. Added a "filterTouchesWhenObscured" attribute to View which can be used to enable filtering of touches when the view's window is obscured. Change-Id: I936d9c85013fd2d77fb296a600528d30a29027d2
* Remove incomplete input device enumeration NDK API.Jeff Brown2010-08-311-17/+0
| | | | Change-Id: I32de74ff5fcf0e29179a2aee03ddabd22fa485bb
* Input device calibration and capabilities.Jeff Brown2010-08-303-250/+827
| | | | | | | | | | | | | Finished the input device capability API. Added a mechanism for calibrating touch devices to obtain more accurate information about the touch contact area. Improved pointer location to show new coordinates and capabilities. Optimized pointer location display and formatting to avoid allocating large numbers of temporary objects. The GC churn was causing the application to stutter very badly when more than a couple of fingers were down). Added more diagnostics. Change-Id: Ie25380278ed6f16c5b04cd9df848015850383498
* Merge "remove unused pixel format" into gingerbreadMathias Agopian2010-08-191-1/+0
|\
| * remove unused pixel formatMathias Agopian2010-08-191-1/+0
| | | | | | | | Change-Id: I55bc3cc41385743c07f7e4de06335c922f746f73
* | Make the throttling more sensitive to end-to-end latency.Jeff Brown2010-08-191-1/+2
|/ | | | | | | | | The code now takes into account the time when the event was generated. So with a 60Hz throttling rate, it ensures that a motion event will not be delayed due to throttling by any more than 1/60th of second past the time it was generated. Change-Id: Iaea1d4f76e79036b4a18873485230731c3cd63c3
* Add support for throttling motion events.Jeff Brown2010-08-181-5/+77
| | | | Change-Id: I24b3a17753e91ecda60a60fe5cd2e6b3260e033d
* Only monitor recognized uevent devices.Sean McNeil2010-08-181-1/+8
| | | | | | | | | system_server can potentially monitor uevent devices that are of no use to it. For instance, an accelerometer implementation as uevents. This would cause the process to be busy when unnecessary. If a device cannot be classified, don't monitor it. Change-Id: Ib2c93105e7d746d9c1a7414bea8bab3fb8c0b70a
* Merge "Fix some input device mapping bugs with certain drivers." into ↵Jeff Brown2010-08-181-68/+92
|\ | | | | | | gingerbread
| * Fix some input device mapping bugs with certain drivers.Jeff Brown2010-08-181-68/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On single-touch devices, pointer up/down is signalled by a BTN_TOUCH key event. Previously we handled BTN_TOUCH immediately but some drivers may produce the sequence BTN_TOUCH, ABS_X, ABS_Y, SYN_REPORT on pointer down which caused us to emit a bad initial pointer down location. Now we wait for SYN_REPORT before reporting the up or down. On multi-touch devices, pointer up can be signalled by as little as the sequence SYN_MT_REPORT, SYN_REPORT. This change ensures that we handle this case. Added support for reading ABS_MT_PRESSURE when available. Corrected mapping of touchMajor/touchMinor on single touch devices. Minor code cleanup. Change-Id: Ic7ec4811241ed85a06e59b8a839ca05180d491d4
* | Keep track of remaining fd when devices are removedJens Gulin2010-08-181-8/+7
|/ | | | | | | | | | | Sometimes the wrong fd was accessed when the device was addressed by device id. The earlier implementation assumed that two arrays were in sync but one of them was compacted when devices were removed. Instead of that dependency the device now keeps track of it's file descriptor. Change-Id: Ib0f320603aafb07ded354bc3687de9759c9068f2
* Optimize EventHub reads.Jeff Brown2010-08-171-68/+88
| | | | Change-Id: Id7d09c0a6e5c741c1e29becd2b6560772c5ff372
* Fix possible race conditions during channel unregistration.Jeff Brown2010-08-171-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the input dispatcher assumed that the input channel's receive pipe file descriptor was a sufficiently unique identifier for looking up input channels in its various tables. However, it can happen that an input channel is disposed and then a new input channel is immediately created that reuses the same file descriptor. Ordinarily this is not a problem, however there is a small opportunity for a race to arise in InputQueue. When InputQueue receives an input event from the dispatcher, it generates a finishedToken that encodes the channel's receive pipe fd, and a sequence number. The finishedToken is used by the ViewRoot as a handle for the event so that it can tell the InputQueue when the event has finished being processed. Here is the race: 1. InputQueue receives an input event, assigns a new finishedToken. 2. ViewRoot begins processing the input event. 3. During processing, ViewRoot unregisters the InputChannel. 4. A new InputChannel is created and is registered with the Input Queue. This InputChannel happens to have the same receive pipe fd as the one previously registered. 5. ViewRoot tells the InputQueue that it has finished processing the input event, passing along the original finishedToken. 6. InputQueue throws an exception because the finishedToken's receive pipe fd is registered but the sequence number is incorrect so it assumes that the client has called finish spuriously. The fix is to include a unique connection id within the finishedToken so that the InputQueue can accurately confirm that the token belongs to the currently registered InputChannel rather than to an old one that happened to have the same receive pipe fd. When it notices this, it ignores the spurious finish. I've also made a couple of other small changes to avoid similar races elsewhere. This patch set also includes a fix to synthesize a finished signal when the input channel is unregistered on the client side to help keep the server and client in sync. Bug: 2834068 Change-Id: I1de34a36249ab74c359c2c67a57e333543400f7b
* Fix safe mode and KeyEvent.getMaxKeyCode().Jeff Brown2010-08-101-0/+8
| | | | | Bug: 2901731 Change-Id: I78617c1b9dee3790fc590e5af4b5083368873184
* Improve thread safety of input mappers.Jeff Brown2010-07-301-423/+496
| | | | | | | | | Also fixed bug where old touch screen size could be reported by getMotionRange if an orientation change occurred but the user has not yet touched the screen. Bug: 2877345 Change-Id: I7878f47458f310ed6ebe6a5d1b2c9bec2c598ab9
* Fix touch input in landscape mode.Jeff Brown2010-07-291-4/+4
| | | | Change-Id: I7d47e9b02e6443ed604a6bf842028a5db934d90d
* DO NOT MERGE: Fix input event injection ANRs on UI thread.Jeff Brown2010-07-292-31/+86
| | | | | | | Added a new asynchronous injection mode and made the existing synchronization mechanism more robust. Change-Id: Ia4aa04fd9b75ea2461a844c5b7933c831c1027e6