summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Looper: Drop default parameters in favor of a safer overload.Jeff Brown2010-09-161-6/+9
| | | | | | | | | | | The idea is that if you're writing code that wants fd/events/data on return from pollOnce() / pollAll() you should really pass in all of those arguments. When I changed the Looper API earlier, it was difficult to ensure that all callers were passing the right parameters since they were relying on default parameters to some degree so usage mistakes would not have been caught by the compiler. Change-Id: I1f2812894270aaf1515017ac1616b6b312d9b565
* 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-145-227/+217
|\ | | | | | | gingerbread
| * Replace epoll() with poll() and rename PollLoop to Looper.Jeff Brown2010-09-145-227/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-125-156/+513
| | | | | | | | | | | | | | | | | | | | | | | 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
* Modify native ALooper to take an explicit ident.Dianne Hackborn2010-09-071-3/+11
| | | | | | | | The ALooper API now uses an explicit "identifier" for the integer that is returned rather than implicitly using the fd. This allows the APIs that had the fd to be a little more sane. Change-Id: I8507f535ad484c0bdc4a1bd016d87bb09acd7ff0
* Remove incomplete input device enumeration NDK API.Jeff Brown2010-08-311-23/+0
| | | | Change-Id: I32de74ff5fcf0e29179a2aee03ddabd22fa485bb
* Don't propagate StrictMode over one-way Binder calls.Brad Fitzpatrick2010-08-311-1/+5
| | | | | | | | | | | | | | | | | This was causing stack stitching problems where a one-way call with violations followed by a two-way call without violations was getting the previous one-way call's violation stack stitched on to the second caller's stack. The solution is a little more indirect than I would've liked (preserving the binder's onTransact flags until enforceInterface) but was seemingly necessary to work without changing the AIDL compiler. It should also be sufficiently cheap, since no new calls to thread-local IPCThreadState lookups were required. The additional work is just same-thread getter/setters on the existing IPCThreadState. Change-Id: I4b6db1d445c56e868e6d0d7be3ba6849f4ef23ae
* 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 a race in SF buffer managementMathias Agopian2010-08-261-1/+5
| | | | | | also remove some unused code. Change-Id: Iae2c3309b7a08055f3e13a5b866c5c084993e352
* fix [2931513] Add support for setting the orientation of an ANativeWindowMathias Agopian2010-08-243-8/+42
| | | | | | Also implement support for cropping. Change-Id: Iba5888dd242bf2feaac9e9ce26e404c1f404c280
* Merge "Add OBB flags to support overlays" into gingerbreadKenny Root2010-08-191-4/+31
|\
| * Add OBB flags to support overlaysKenny Root2010-08-181-4/+31
| | | | | | | | | | | | | | | | | | | | | | * Add flags field in OBB footer to support overlays. * Remove unused 'crypto' and 'filesystem' fields in obbtool (could later be supported in the "flags" field of the OBB footer). * Add notes to document OBB classes before shipping. Change-Id: I386b43c32c5edef55210acb5d3322639c08010ba
* | 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
* Merge "Add support for the PointerLocation overlay." into gingerbreadJeff Brown2010-08-111-1/+2
|\
| * Add support for the PointerLocation overlay.Jeff Brown2010-08-111-1/+2
| | | | | | | | | | | | | | | | | | | | This change involves adding a new method to IWindowManager, monitorInput() that returns an InputChannel to receive a copy of all input that is dispatched to applications. The caller must have the READ_INPUT_STATE permission to make this request (similar to other window manager methods such as getKeycodeState). Change-Id: Icd14d810174a5b2928671ef16de73af88302aea0
* | Initial tool for OBB manipulationKenny Root2010-08-111-0/+4
| | | | | | | | | | | | | | Add "obbtool" host command for adding, removing, and querying Opaque Binary Blob (OBB) information from a file. Change-Id: Id2ac41e687ad2a500c362616d6738a8ae7e8f5c3
* | More native work.Dianne Hackborn2010-08-112-57/+64
|/ | | | | | | Implement save/restore of state, and add native APIs for configuration information. Change-Id: I2a3ddc2ba605db58d7c8b2b31b9215fb323f90b5
* Fix safe mode and KeyEvent.getMaxKeyCode().Jeff Brown2010-08-101-0/+2
| | | | | Bug: 2901731 Change-Id: I78617c1b9dee3790fc590e5af4b5083368873184
* Fix String8::operator+Kenny Root2010-08-061-2/+2
| | | | | | | | | | | The LHS was ignored when using: String8 + String8 String8 + (const char*) Add unit tests for above. Bug: 2898473 Change-Id: Ic8fe7be668b665c36aaaa3fc3c3ffdfff0fbba25
* 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
* Added SensorManager.getMinDelay()Mathias Agopian2010-07-292-1/+3
| | | | | | | | | | | | | Exposed the new "min delay" sensor property through native and java sensor apis. This allows the caller to know what is the maximum rate at which a sensor can return events, or, if a sensor works in "update" mode (events returned only when the value changes). Also augmented SensorManager.regusterSensorEvent() so that it can accept a value in microsecond in addition to the 4 constants already defined. Change-Id: If425e9979892666df8c989d7de3c362230fa19e0
* 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
* Merge "fix [2873058] Surface::dequeueBuffer blocks on last buffer, i.e. ↵Mathias Agopian2010-07-281-8/+0
|\ | | | | | | cannot dequeue all allocated buffers at once." into gingerbread
| * fix [2873058] Surface::dequeueBuffer blocks on last buffer, i.e. cannot ↵Mathias Agopian2010-07-271-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dequeue all allocated buffers at once. this situation happened when the last buffer needed to be resized (or allocated, the first time). the assumption was that the buffer was in use by SF itself as the current buffer (obviously, this assumption made no sense when the buffer had never been allocated, btw). the system would wait until some other buffer became the "front" buffer. we fix this problem by entirely removing the requirement that the buffer being resized cannot be the front buffer. instead, we just allocate a new buffer and replace the front buffer by the new one. the downside is that this uses more memory (an extra buffer) for a brief amount of time while the old buffer is being reallocated and before it has actually been replaced. Change-Id: I022e4621209474ceb1c671b23deb4188eaaa7285
* | Merge "Support streaming of compressed assets > 1 megabyte" into gingerbreadChristopher Tate2010-07-282-9/+84
|\ \
| * | Support streaming of compressed assets > 1 megabyteChristopher Tate2010-07-282-9/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compressed assets larger than one megabyte are now decompressed on demand rather than being decompressed in their entirety and held in memory. Reading the data in order is relatively efficient, as is seeking forward in the stream. Seeking backwards is supported, but requires reprocessing the compressed data from the beginning, so is very inefficient. In addition, the size limit on compressed assets has been eliminated. Change-Id: I6e68247957e6c53e7e8ba70d12764695f1723bad
* | | 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
* | Replace several IPCThreadState::get() lookups with one.Brad Fitzpatrick2010-07-271-4/+8
|/ | | | | | Also, make StrictMode's ThreadLocal final. Change-Id: I08d400ed254fa67bb7a3dae1227f205a54c00df0
* propagate sensor event rate properlyMathias Agopian2010-07-211-2/+4
| | | | Change-Id: I32e67d30e4295285a6827956cc8161b2025d70bc
* new SensorServiceMathias Agopian2010-07-194-5/+15
| | | | | | | remove old sensor service and implement SensorManager on top of the new (native) SensorManger API. Change-Id: Iddb77d498755da3e11646473a44d651f12f40281
* Merge "Re-use existing Surface objects when reading them from parcels." into ↵Jamie Gennis2010-07-161-2/+8
|\ | | | | | | gingerbread
| * Re-use existing Surface objects when reading them from parcels.Jamie Gennis2010-07-161-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | This change adds a process-global cache of previously deserialized Surface objects so that if a Surface object wrapping the same ISurface gets received again the same Surface can be used. This is important because the 'tail' pointer in the SharedBufferClient is stored only on the client side, and needs to be the same for all the Surface objects wrapping an ISurface instance. This solves the problem by making there only be one Surface object wrapping an ISurface per process. Change-Id: I4bf0b8787885c56277622fca053022d2bb638902
* | Fix individual pointer id up/down reporting.Jeff Brown2010-07-161-1/+2
|/ | | | | | Fix a minor threading bug in InputManager dump. Change-Id: Ic2eecf7df5a8dc9f40561fcb03ebe58a2c073778
* Fix bug with phantom input windows.Jeff Brown2010-07-161-0/+2
| | | | | | | | | | | Add dumpsys integration for the native input dispatcher. Add some InputDevice API stubs. Add an appendFormat helper method to String8 for printf style string formatting mainly for debugging purposes. Use generic ArrayList<WindowState> everywhere in WindowManagerService to eliminate unnecessary casts all over. Change-Id: I9d1e3bd90eb7222d10620200477f11b7bfd25e44
* 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