summaryrefslogtreecommitdiffstats
path: root/include/ui
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Refactor input reader to support new device types more easily.Jeff Brown2010-07-285-544/+770
| | | | | | | | | | | | | | | | | | | | | | Refactored the input reader so that each raw input protocol is handled by a separate subclass of the new InputMapper type. This way, behaviors pertaining to keyboard, trackballs, touchscreens, switches and other devices are clearly distinguished for improved maintainability. Added partial support for describing capabilities of input devices (incomplete and untested for now, will be fleshed out in later commits). Simplified EventHub interface somewhat since InputReader is taking over more of the work. Cleaned up some of the interactions between InputManager and WindowManagerService related to reading input state. Fixed swiping finger from screen edge into display area. Added logging of device information to 'dumpsys window'. Change-Id: I17faffc33e3aec3a0f33f0b37e81a70609378612
* Fix individual pointer id up/down reporting.Jeff Brown2010-07-161-1/+2
| | | | | | Fix a minor threading bug in InputManager dump. Change-Id: Ic2eecf7df5a8dc9f40561fcb03ebe58a2c073778
* Implement native key pre-dispatching to IMEs.Dianne Hackborn2010-07-151-0/+2
| | | | | | | | | | | | | | | | This significantly re-works the native key dispatching code to allow events to be pre-dispatched to the current IME before being processed by native code. It introduces one new public API, which must be called after retrieving an event if the app wishes for it to be pre-dispatched. Currently the native code will only do pre-dispatching of system keys, to avoid significant overhead for gaming input. This should be improved to be smarted, filtering for only keys that the IME is interested in. Unfortunately IMEs don't currently provide this information. :p Change-Id: Ic1c7aeec8b348164957f2cd88119eb5bd85c2a9f
* Add support for new input sources.Jeff Brown2010-07-155-23/+109
| | | | | | | | | | | | | | | | | | | | | | | | | Added several new coordinate values to MotionEvents to capture touch major/minor area, tool major/minor area and orientation. Renamed NDK input constants per convention. Added InputDevice class in Java which will eventually provide useful information about available input devices. Added APIs for manufacturing new MotionEvent objects with multiple pointers and all necessary coordinate data. Fixed a bug in the input dispatcher where it could get stuck with a pointer down forever. Fixed a bug in the WindowManager where the input window list could end up containing stale removed windows. Fixed a bug in the WindowManager where the input channel was being removed only after the final animation transition had taken place which caused spurious WINDOW DIED log messages to be printed. Change-Id: Ie55084da319b20aad29b28a0499b8dd98bb5da68
* IME events are now dispatched to native applications.Dianne Hackborn2010-07-132-27/+3
| | | | | | | | | | | | | | | And also: - APIs to show and hide the IME, and control its interaction with the app. - APIs to tell the app when its window resizes and needs to be redrawn. - API to tell the app the content rectangle of its window (to layout around the IME or status bar). There is still a problem with IME interaction -- we need a way for the app to deliver events to the IME before it handles them, so that for example the back key will close the IME instead of finishing the app. Change-Id: I37b75fc2ec533750ef36ca3aedd2f0cc0b5813cd
* Add initial gamepad support.Jeff Brown2010-07-133-409/+358
| | | | Change-Id: I0439648f6eb5405f200e4223c915eb3a418b32b9
* Add ANativeWindow API for directly drawing to the surface bits.Dianne Hackborn2010-07-091-18/+15
| | | | | | | | | | | Also other cleanup and fixes: - We now properly set the default window format to 565. - New APIs to set the window format and flags from native code. - Tweaked glue for simpler handling of the "destroy" message. - Um, other stuff. Change-Id: Id7790a21a2fa9a19b91854d225324a7c1e7c6ade
* Merge "More native input dispatch work." into gingerbreadChris Tate2010-07-071-5/+10
|\
| * More native input dispatch work.Jeff Brown2010-07-031-5/+10
| | | | | | | | | | | | | | | | | | | | Removed old input dispatch code. Refactored the policy callbacks. Pushed a tiny bit of the power manager state down to native. Fixed long press on MENU. Made the virtual key detection and cancelation a bit more precise. Change-Id: I5d8c1062f7ea0ab3b54c6fadb058c4d5f5a9e02e
* | Add new native Looper API.Dianne Hackborn2010-07-021-0/+5
|/ | | | | | | | | | | This allows us to avoid exposing the file descriptor of the event queue; instead, you attach an event queue to a looper. This will also should allow native apps to be written without the need for a separate thread, by attaching the event queue to the main thread's looper and scheduling their own messages there. Change-Id: I38489282635895ae2cbfacb88599c1b1cad9b239
* Merge "Introduce official public NativeWindow type." into gingerbreadDianne Hackborn2010-06-302-26/+30
|\
| * Introduce official public NativeWindow type.Dianne Hackborn2010-06-302-26/+30
| | | | | | | | | | | | | | Not yet hooked up to anything in the NDK, but requires renaming the existing android_native_window_t type everywhere. Change-Id: Iffee6ea39c93b8b34e20fb69e4d2c7c837e5ea2e
* | Fix injection of specially intercepted keys like HOME.Jeff Brown2010-06-302-7/+0
|/ | | | | | | | This change mainly unwinds a premature optimization in the dispatch pipeline. To test HOME injection, run 'adb shell input keyevent 3'. Change-Id: I1c4b7377c205da7c898014b8b07fc6dc1d46e4dd
* Implement default key handling for native code.Dianne Hackborn2010-06-302-2/+12
| | | | | | | | | The native code now maintains a list of all keys that may use default handling. If the app finishes one of these keys without handling it, the key will be passed back off to Java for default treatment. Change-Id: I6a842a0d728eeafa4de7142fae573f8c11099e18
* Fix native input dispatch in the emulator.Jeff Brown2010-06-291-0/+9
| | | | | | | | | | Set a default orientation of ROTATION_0. Added some more careful checks based on whether we have valid absolute axis information from the driver. Reset key repeating during configuration changes since the keyboard device may have been removed. Change-Id: I685960828acffcb17595fc5683309e8064a76714
* Update native activity & event APIs to follow correct conventions.Dianne Hackborn2010-06-292-5/+5
| | | | Change-Id: Ie64fb3a9c68bc9c117fa5621b75d1f609e304e0e
* Native input event dispatching.Jeff Brown2010-06-284-5/+34
| | | | | | | | | Target identification is now fully native. Fixed a couple of minor issues related to input injection. Native input enabled by default, can be disabled by setting WindowManagerPolicy.ENABLE_NATIVE_INPUT_DISPATCH to false. Change-Id: I7edf66ed3e987cc9306ad4743ac57a116af452ff
* First stab at attaching native event dispatching.Dianne Hackborn2010-06-222-2/+25
| | | | | | | | | | | | Provides the basic infrastructure for a NativeActivity's native code to get an object representing its event stream that can be used to read input events. Still work to do, probably some API changes, and reasonable default key handling (so that for example back will still work). Change-Id: I6db891bc35dc9683181d7708eaed552b955a077e
* More native input event dispatching.Jeff Brown2010-06-213-25/+124
| | | | | | | | | | | Added ANRs handling. Added event injection. Fixed a NPE ActivityManagerServer writing ANRs to the drop box. Fixed HOME key interception. Fixed trackball reporting. Fixed pointer rotation in landscape mode. Change-Id: I50340f559f22899ab924e220a78119ffc79469b7
* Even more native input dispatch work in progress.Jeff Brown2010-06-172-13/+44
| | | | | | | | | | | | | | | | | Added more tests. Fixed a regression in Vector. Fixed bugs in pointer tracking. Fixed a starvation issue in PollLoop when setting or removing callbacks. Fixed a couple of policy nits. Modified the internal representation of MotionEvent to be more efficient and more consistent. Added code to skip/cancel virtual key processing when there are multiple pointers down. This helps to better disambiguate virtual key presses from stray touches (such as cheek presses). Change-Id: I2a7d2cce0195afb9125b23378baa94fd2fc6671c
* More work in progress on native events.Jeff Brown2010-06-155-278/+408
| | | | | | | | Refactored the code to eliminate potential deadlocks due to re-entrant calls from the policy into the dispatcher. Also added some plumbing that will be used to notify the framework about ANRs. Change-Id: Iba7a10de0cb3c56cd7520d6ce716db52fdcc94ff
* Native input dispatch rewrite work in progress.Jeff Brown2010-06-137-44/+1967
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old dispatch mechanism has been left in place and continues to be used by default for now. To enable native input dispatch, edit the ENABLE_NATIVE_DISPATCH constant in WindowManagerPolicy. Includes part of the new input event NDK API. Some details TBD. To wire up input dispatch, as the ViewRoot adds a window to the window session it receives an InputChannel object as an output argument. The InputChannel encapsulates the file descriptors for a shared memory region and two pipe end-points. The ViewRoot then provides the InputChannel to the InputQueue. Behind the scenes, InputQueue simply attaches handlers to the native PollLoop object that underlies the MessageQueue. This way MessageQueue doesn't need to know anything about input dispatch per-se, it just exposes (in native code) a PollLoop that other components can use to monitor file descriptor state changes. There can be zero or more targets for any given input event. Each input target is specified by its input channel and some parameters including flags, an X/Y coordinate offset, and the dispatch timeout. An input target can request either synchronous dispatch (for foreground apps) or asynchronous dispatch (fire-and-forget for wallpapers and "outside" targets). Currently, finding the appropriate input targets for an event requires a call back into the WindowManagerServer from native code. In the future this will be refactored to avoid most of these callbacks except as required to handle pending focus transitions. End-to-end event dispatch mostly works! To do: event injection, rate limiting, ANRs, testing, optimization, etc. Change-Id: I8c36b2b9e0a2d27392040ecda0f51b636456de25
* split surface management from surface's buffers managementMathias Agopian2010-06-041-6/+7
| | | | Change-Id: If3c5655d1231f8f0c49ba68f972b1b20c93b3f87
* added the notion of fixed-size buffersMathias Agopian2010-05-241-0/+21
| | | | | | | | | the new native_window_set_buffers_geometry allows to specify a size and format for all buffers to be dequeued. the buffer will be scalled to the window's size. Change-Id: I2c378b85c88d29cdd827a5f319d5c704d79ba381
* added native_window_set_buffer_count()Mathias Agopian2010-05-211-8/+22
| | | | | | | this method can be used to change the number of buffers associated to a native window. the default is two. Change-Id: I608b959e6b29d77f95edb23c31dc9b099a758f2f
* Merge "Add incStrong and decStrong methods to ↵Jamie Gennis2010-05-112-0/+27
|\ | | | | | | android_native_{window,buffer}_t." into kraken
| * Add incStrong and decStrong methods to android_native_{window,buffer}_t.Jamie Gennis2010-05-102-0/+27
| | | | | | | | | | | | | | | | | | This change adds the methods necessary to use sp<> to handle refcounting android_native_window_t and android_native_buffer_t. The new methods forward the refcounting operations to the corresponding android_native_base_t functions. Change-Id: I7de8e262728e439bc1efdf69374a2a9f6f432ced
* | am f7896449: merge from open-source masterThe Android Open Source Project2010-05-051-1/+5
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | Merge commit 'f78964490d8098387d51444c87bf520ad3f674e2' into kraken * commit 'f78964490d8098387d51444c87bf520ad3f674e2': Add new keycodes for the convenience of Japanese IMEs Call register_localized_collators() with the current locale. Fixed deserialization problem in DatePicker. Fix for bug 2467152 files with spaces fail to open. Set alpha value for newly created dim surface. telephony: Fix CID when CID is unknown
| * merge from open-source masterThe Android Open Source Project2010-05-051-1/+5
| |\ | | | | | | | | | Change-Id: Ia9e1f4e049f5870386ea29ddb6e3ef028ea918da
| | * Add new keycodes for the convenience of Japanese IMEsmogimo2010-05-051-1/+5
| | | | | | | | | | | | Change-Id: Ibd308cef11261147856258595f6ca0137e03e05c
* | | added setCrop() to android_native_window_tMathias Agopian2010-04-201-5/+33
| | | | | | | | | | | | | | | | | | | | | hooked up the new method up to Surface.cpp the actual crop is not implemented in SF yet Change-Id: Ic6e313c98fd880f127a051a0ccc71808bd689751
* | | when a zero dimension buffer is allocated, turn the allocation intoMathias Agopian2010-04-151-1/+1
|/ / | | | | | | | | | | a 1x1 buffer instead of Nx1 (or 1xN) Change-Id: I27eeb15e83e13002dd9405f4e52b54f7dffc0fe7
* | merge from open-source masterThe Android Open Source Project2010-04-081-1/+5
|\ \ | |/ | | | | Change-Id: I975030d9572463bc69245bcffa25c47d7acb2b51
| * Add keycodes PageUp and PageDownChih-Wei Huang2010-04-021-1/+5
| | | | | | | | | | | | This is useful for applications like web browser. Change-Id: Ie9262d5b75de87ecd0971407a7c3ce9aa6e4998e
* | fix [2545826] calling into gralloc with external lock heldMathias Agopian2010-03-251-1/+0
| | | | | | | | Change-Id: I2d0e017382404c684c768a0dd0423d574213f10a
* | Add a new connect/disconnect API to android_native_window_tMathias Agopian2010-03-111-1/+37
| | | | | | | | | | | | it's used to keep track of which API owns the surface. Change-Id: I1021c5905c020efc3c428e561b38189377168b22
* | remove a dependency of GraphicBuffer (libui) on Parcel (libbinder).Mathias Agopian2010-02-211-5/+12
| | | | | | | | | | | | | | | | | | Add a Flattenable interface to libutils which can be used to flatten an object into bytestream + filedescriptor stream. Parcel is modified to handle Flattenable. And GraphicBuffer implements Flattenable. Except for the overlay classes libui is now independent of libbinder.
* | Remove a dependency of Region (libui) on Parcel (libbinder).Mathias Agopian2010-02-171-6/+0
| |