summaryrefslogtreecommitdiffstats
path: root/include/ui
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Add support for secure system overlays. (DO NOT MERGE)Jeff Brown2010-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Add support for calibrating touch position.Jeff Brown2010-10-181-0/+10
| | | | | | | | | | | | | | | | | | | | | Useful for tweaking touch screen alignment without having to modify the kernel device driver x/y axis bounds. Change-Id: I6ca43d3c138548f9dfb76aa33150a0c853698fb6
* | | am 5f0cbfce: am c1e7b218: Merge "Improve input device calibration format." ↵Jeff Brown2010-10-161-24/+31
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | into gingerbread Merge commit '5f0cbfcecc4db20f897507c826296b3aac70c592' * commit '5f0cbfcecc4db20f897507c826296b3aac70c592': Improve input device calibration format.
| * | Improve input device calibration format.Jeff Brown2010-10-141-24/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Fix an event injection bug when the policy is bypassed.Jeff Brown2010-10-112-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Add support for secure system overlays.Jeff Brown2010-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manual merge from Gingerbread. 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: Id876736fd8bf332ff9a5428bde59f5268aa49c3a
* | | Add keycodes and meta-key modifiers to support external keyboards.Jeff Brown2010-10-154-6/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new key maps for external keyboards. These maps are intended to be shared across devices by inheriting the "keyboards.mk" product makefile as part of the device's product definition. One of the trickier changes here was to unwind some code in MetaKeyKeyListener that assumed that only the low 8 bits of the meta key state were actually used. The new code abandons bitshifts in favor of simple conditionals that are probably easier to read anyways. The special meta key state constants used by MetaKeyKeyListener are now (@hide) defined in KeyEvent now so as to make it clearer that they share the same code space even if those codes are not valid for KeyEvents. The EventHub now takes care of detecting the appropriate key layout map and key character map when the device is added and sets system properties accordingly. This avoids having duplicate code in KeyCharacterMap to probe for the appropriate key character map although the current probing mechanism has been preserved for legacy reasons just in case. Added support for tracking caps lock, num lock and scroll lock and turning their corresponding LEDs on and off as needed. The key character map format will need to be updated to correctly support PC style external keyboard semantics related to modifier keys. That will come in a later change so caps lock doesn't actually do anything right now except turn the shiny LEDs on and off... Added a list of symbolic key names to KeyEvent and improved the toString() output for debug diagnosis. Having this list in a central place in the framework also allows us to remove it from Monkey so there is one less thing to maintain when we add new keycodes. Bug: 2912307 Change-Id: If8c25e8d50a7c29bbf5d663c94284f5f86de5da4
* | | Track input state when transferring touch focus.Jeff Brown2010-10-111-0/+3
| | | | | | | | | | | | | | | | | | | | | Copies the input state to the destination window and sends synthesic cancelation events to the source window. Change-Id: Ia75820b0d756ed5d6cd22dce7830251ac85141ed
* | | Fix an event injection bug when the policy is bypassed.Jeff Brown2010-10-112-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Cherry pick of b931a1b4 from gingerbread into master. Change-Id: I700a5f07b8b227878cea9437a289a45a245c0424
* | | am 41aabeb5: am 1e6a3a53: Merge "Added more robust tracking and cancelation ↵Jeff Brown2010-10-113-70/+74
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | of events." into gingerbread Merge commit '41aabeb51305d19747687f246080f44fc2a74435' * commit '41aabeb51305d19747687f246080f44fc2a74435': Added more robust tracking and cancelation of events.
| * | Added more robust tracking and cancelation of events.Jeff Brown2010-10-103-70/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Move binder magic from the Surface class to GraphicBuffer.Jamie Gennis2010-10-101-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | - Register buffers with Gralloc when unflattening a GraphicBuffer (rather than doing it in the Surface class). - Add support for a GraphicBuffer that wraps an android_native_window_t*. Change-Id: I029ac086111bbac800e5ca37eb505f558b718cd8
* | | am 56364bcd: am 78d15acf: Merge "Make secure views tolerate IME overlays." ↵Jeff Brown2010-10-071-2/+9
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | into gingerbread Merge commit '56364bcd0d1a1b064db3e83fdb64f948ce5c2ad7' * commit '56364bcd0d1a1b064db3e83fdb64f948ce5c2ad7': Make secure views tolerate IME overlays.
| * | Make secure views tolerate IME overlays.Jeff Brown2010-10-051-2/+9
| | | | | | | | | | | | Change-Id: I3cf09b9d91045f4d9c558b4aace482a7b0bbd3d8
* | | am ff04e97f: am f4619308: Merge "fix [2835280] Add support for cancelling ↵Mathias Agopian2010-10-061-1/+11
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | buffers to ANativeWindow" into gingerbread Merge commit 'ff04e97faf75c435e453d4c1caf7eeac8b9c1ceb' * commit 'ff04e97faf75c435e453d4c1caf7eeac8b9c1ceb': fix [2835280] Add support for cancelling buffers to ANativeWindow
| * | fix [2835280] Add support for cancelling buffers to ANativeWindowMathias Agopian2010-10-041-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a new ANativeWindow::cancelBuffer() API that can be used to cancel any dequeued buffer, BEFORE it's been enqueued. The buffer is returned to the list of availlable buffers. dequeue and cancel are not mutually thread safe, they must be called from the same thread or external synchronization must be used. Change-Id: I86cc7985bace8b6a93ad2c75d2bef5c3c2cb4d61
* | | am ea58d1ba: am e951ef07: Merge "Wait for initial device scan to finish ↵Jeff Brown2010-10-012-8/+14
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | before updating config." into gingerbread Merge commit 'ea58d1bac2960c1794f048bfa5d1a60b1a3d23a1' * commit 'ea58d1bac2960c1794f048bfa5d1a60b1a3d23a1': Wait for initial device scan to finish before updating config.
| * | Wait for initial device scan to finish before updating config.Jeff Brown2010-10-012-8/+14
| | | | | | | | | | | | | | | | | | | | | This change narrows the opportunity for a race condition setting the resource Configuration while devices are being updated. Change-Id: I58efa563f4129ab0fce7108511d16a99dff7e451
* | | am e11b76d3: am f6295b35: Merge "Minor logging changes to input dispatcher ↵Jeff Brown2010-10-011-2/+6
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | to help with debugging." into gingerbread Merge commit 'e11b76d3efb056edea301d53a354d0730adf3520' * commit 'e11b76d3efb056edea301d53a354d0730adf3520': Minor logging changes to input dispatcher to help with debugging.
| * | Minor logging changes to input dispatcher to help with debugging.Jeff Brown2010-10-011-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Added dumpsys reporting to EventHub. Made the formatting a bit clearer. Added 'Locked' suffix to some internal methods of EventHub. Change-Id: Ic449560bcce378f6361895d27c66854e9724abb0
* | | am 57fa3e8b: am 9e32a438: Merge "Support haptic feedback for virtual keys ↵Jeff Brown2010-10-013-5/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | defined in key layout." into gingerbread Merge commit '57fa3e8b4c94125ddb5be015dd7fbde4a458894f' * commit '57fa3e8b4c94125ddb5be015dd7fbde4a458894f': Support haptic feedback for virtual keys defined in key layout.
| * | Support haptic feedback for virtual keys defined in key layout.Jeff Brown2010-10-013-5/+5
| | | | | | | | | | | | Change-Id: I83e4108a87332692e03791dc066206becbc7941f
* | | am 5d3cef8a: am e0c12c88: Merge "Move verbose logging of device capabilities ↵Jeff Brown2010-09-301-7/+10
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | to dumpsys." into gingerbread Merge commit '5d3cef8a6d1baec29512764b9e0ba240ccd7fcfe' * commit '5d3cef8a6d1baec29512764b9e0ba240ccd7fcfe': Move verbose logging of device capabilities to dumpsys.
| * | Move verbose logging of device capabilities to dumpsys.Jeff Brown2010-09-301-7/+10
| | | | | | | | | | | | Change-Id: I5d55eaebfdf049bd1ac1e7bab2758886cfefc9d7
* | | Add support for transferring touch focus.Jeff Brown2010-09-271-0/+11
|/ / | | | | | | | | | | Prerequisite for drag and drop. Change-Id: Iedbe93ed0f3e1c4083130fe66b4ba06d416afce0
* | Add suuport for splitting touch events across windows.Jeff Brown2010-09-263-50/+84
| | | | | | | | | | | | | | | | | | | | 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
* | Fix app switch latency optimization.Jeff Brown2010-09-161-6/+6
| | | | | | | | | | | | 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-2/+2
|\ \
| * | Input API review.Jeff Brown2010-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | | Drop currently unsupported input features. Add documentation comments. Change-Id: I407d2e1dd90c5ee82983a3ccf177430d35ee7592
* | | Make input dispatcher only ANR for foreground windows.Jeff Brown2010-09-151-89/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | fix a typo where the eventtags code were wrongMathias Agopian2010-09-151-16/+16
|/ / | | | | | | Change-Id: I517112a1475c10b71009a0aa9c3894c76a1f270f
* | Merge "Replace epoll() with poll() and rename PollLoop to Looper." into ↵Jeff Brown2010-09-142-5/+4
|\ \ | | | | | | | | | gingerbread
| * | Replace epoll() with poll() and rename PollLoop to Looper.Jeff Brown2010-09-142-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-132-0/+74
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-124-144/+487
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+4
| | | | | | | | Change-Id: I6216e082324ee29bf50e37acc673350ca5417c4d
* | Add support for secure views.Jeff Brown2010-09-083-8/+31
| | | | | | | | | | | | | | | | | | | | | | | | 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-23/+0
| | | | | | | | Change-Id: I32de74ff5fcf0e29179a2aee03ddabd22fa485bb
* | Input device calibration and capabilities.Jeff Brown2010-08-303-23/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | fix [2931513] Add support for setting the orientation of an ANativeWindowMathias Agopian2010-08-241-0/+29
| | | | | | | | | | | | Also implement support for cropping. Change-Id: Iba5888dd242bf2feaac9e9ce26e404c1f404c280
* | Add support for throttling motion events.Jeff Brown2010-08-181-0/+19
| | | | | | | | Change-Id: I24b3a17753e91ecda60a60fe5cd2e6b3260e033d
* | Merge "Fix some input device mapping bugs with certain drivers." into ↵Jeff Brown2010-08-181-14/+4
|\ \ | | | | | | | | | gingerbread
| * | Fix some input device mapping bugs with certain drivers.Jeff Brown2010-08-181-14/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+1
|/ / | | | | | | | | | | | | | | | | | | | | 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-0/+6
| | | | | | | | Change-Id: Id7d09c0a6e5c741c1e29becd2b6560772c5ff372
* | Fix possible race conditions during channel unregistration.Jeff Brown2010-08-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+2
| | | | | | | | | | Bug: 2901731 Change-Id: I78617c1b9dee3790fc590e5af4b5083368873184
* | Enhanced VelocityTracker for > 5 pointers and fixed bugs.Jeff Brown2010-07-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Improved PointerLocation tool to use VelocityTracker more efficiently and correctly when multiple pointers are down. Fixed a bug in TouchInputMapper where it was not correctly copying the id to index map in the last touch data. This could cause strange behavior on secondary pointer up events. Also added finished callback pooling in InputQueue. Change-Id: Ia85e52ac2fb7350960ea1d7edfbe81a1b3e8267b
* | Improve thread safety of input mappers.Jeff Brown2010-07-301-67/+83
| | | | | | | | | | | | | | | | | | 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
* | DO NOT MERGE: Fix input event injection ANRs on UI thread.Jeff Brown2010-07-292-17/+37
| | | | | | | | | | | | | | Added a new asynchronous injection mode and made the existing synchronization mechanism more robust. Change-Id: Ia4aa04fd9b75ea2461a844c5b7933c831c1027e6