Commit Graph

16278 Commits

Author SHA1 Message Date
Jeff Brown
0cacb87f02 Fix possible race conditions during channel unregistration.
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
2010-08-17 17:03:42 -07:00
Daniel Sandler
e999003f69 Merge "Fix crash in status bar ticker." into gingerbread 2010-08-16 12:22:29 -07:00
Doug Zongker
20b1675614 Merge "add an api for getting a device serial number" into gingerbread 2010-08-16 09:19:40 -07:00
Dianne Hackborn
9521327aa2 Merge "Fix problems with determining when to kill apps for wake usage." into gingerbread 2010-08-15 17:33:02 -07:00
Irfan Sheriff
a3c918d9e5 Merge "DO NOT MERGE Fix wifi status icon" into gingerbread 2010-08-15 15:57:47 -07:00
Mathias Agopian
998831fbc3 Merge "fix a typo that prevented glTexImage2D codepath to work" into gingerbread 2010-08-13 16:29:48 -07:00
Mathias Agopian
f1c468e481 fix a typo that prevented glTexImage2D codepath to work
Change-Id: I36a3bf9d1d2eacd9b14e00b0a6c53bf88bba381c
2010-08-13 16:25:13 -07:00
Robert Greenwalt
f8d7290f08 Merge "DO NOT MERGE Always set/remove default routes." into gingerbread 2010-08-13 15:59:53 -07:00
Dianne Hackborn
cdaaf337e0 Merge "Various battery info things:" into gingerbread 2010-08-13 15:56:29 -07:00
Ying Wang
d5e43c2f3e Merge "Output proguard keep flags for fragment classes." into gingerbread 2010-08-13 15:26:21 -07:00
Jake Hamby
c55241999c Merge "Fix character count bug and Javadoc typos in SMS (with test cases)" into gingerbread 2010-08-13 15:15:36 -07:00
Eric Fischer
d507574d25 Merge "Change aapt's warning message to suggest formatted="false", not "true"." into gingerbread 2010-08-13 14:54:15 -07:00
Jake Hamby
9bdf2b0bc1 Merge "Fix typo and bug in CTS test class." into gingerbread 2010-08-13 14:51:09 -07:00
Ficus Kirkpatrick
6f931c1173 am 2abde6e0: Add --max-res-version flag to aapt.
Merge commit '2abde6e0ddaed3d2d60bad984a2adc3acbb8164c' into gingerbread

* commit '2abde6e0ddaed3d2d60bad984a2adc3acbb8164c':
  Add --max-res-version flag to aapt.
2010-08-13 14:45:39 -07:00
Ficus Kirkpatrick
999a745146 Merge "Add --max-res-version flag to aapt." into gingerbread 2010-08-13 14:22:34 -07:00
Romain Guy
f285cb0975 Merge "fix [2912927] Can't get NV_draw_path extension to work" into gingerbread 2010-08-13 14:18:55 -07:00
Mathias Agopian
4a88b52235 fix [2912927] Can't get NV_draw_path extension to work
there was a problem with eglGetProcAddress() which would only work with
GLES 1.x contexts.

Change-Id: I4747671cbf7ed469bb471a377f1d6f36550d24df
2010-08-13 14:17:58 -07:00
Erik Gilling
ae95765868 surfaceflinger: don't check HWComposer numLayers unless one exists
Change-Id: I4b83f7bf7ba1318c70054117f14e759fe0ad105c
2010-08-13 10:10:48 -07:00
Eric Laurent
a54831c55e Merge "Fix issue 2909189: System property ro.audio.silent no longer mutes system." into gingerbread 2010-08-13 08:00:14 -07:00
John Wang
dd978e3337 Merge "Update switch call and accept call." into gingerbread 2010-08-12 17:30:38 -07:00
Mike Dodd
d98ac85c79 Merge "Support getting codec, width, and height in URL for gtalk playback." into gingerbread 2010-08-12 16:45:19 -07:00
Mathias Agopian
72ca07d842 Merge "Fix a couple issues with the new hwcomposer HAL" into gingerbread 2010-08-12 15:07:29 -07:00
Mathias Agopian
45721773e1 Fix a couple issues with the new hwcomposer HAL
- we now clear the framebuffer upon request from the HAL
- the HAL list size could get out of sync with reality
- there was also an issue where sometime we could run past the list

Change-Id: Ic3a34314aed24181f2d8cc787096af83c046ef27
2010-08-12 15:03:26 -07:00
Trevor Johns
051a4e5fc9 am 4f3c5372: Merge "Fix subscribe links for Developer Forums doc." into froyo
Merge commit '4f3c5372a56ac47dac9c22c7f7ce97152128c795' into gingerbread

* commit '4f3c5372a56ac47dac9c22c7f7ce97152128c795':
  Fix subscribe links for Developer Forums doc.
2010-08-12 14:30:11 -07:00
Trevor Johns
6d79df722b Merge "Fix subscribe links for Developer Forums doc." into froyo 2010-08-12 14:27:33 -07:00
Wu-cheng Li
26105cad7c Merge "Improve camera documentation." into gingerbread 2010-08-12 14:04:07 -07:00
Andreas Huber
240c79ec67 Merge "Fix the h.263 assembler to properly subset a buffer's range if it already has a range applied." into gingerbread 2010-08-12 11:02:17 -07:00
Andreas Huber
9f2c93d025 Merge "APacketSource is too verbose." into gingerbread 2010-08-12 11:02:06 -07:00
James Dong
ca901d984d Merge "Handle large audio lost" into gingerbread 2010-08-12 10:07:51 -07:00
James Dong
ce49115a25 Merge "Fix a crash due to unnecessary check on the codec config data for H263 video track" into gingerbread 2010-08-12 10:07:38 -07:00
James Dong
28988defd2 Merge "Fix all fd leaks in authoring engine" into gingerbread 2010-08-12 09:13:14 -07:00
Mathias Agopian
ce6d43a32a Merge "should fix sim build, hopefully" into gingerbread 2010-08-11 17:32:25 -07:00
Mathias Agopian
f1352df47f should fix sim build, hopefully
Change-Id: I5390bd34dcca36fef43b5169386fff1b04cc842b
2010-08-11 17:31:33 -07:00
Jeff Brown
f2a67c067d Merge "Fix ViewRoot bug attempting to finish synthetic KeyEvents." into gingerbread 2010-08-11 17:22:17 -07:00
Mathias Agopian
e9ba52c9c3 Merge "call into hwcomposer HAL when present" into gingerbread 2010-08-11 16:24:46 -07:00
Mathias Agopian
dca13144a3 Merge "don't handle the transparent region of a layer in draw()" into gingerbread 2010-08-11 16:21:01 -07:00
Mathias Agopian
b5983b03fd Merge "get rid of our LayerVector implementation" into gingerbread 2010-08-11 16:20:38 -07:00
Mathias Agopian
c726179839 Merge "keep a list of visible sorted surfaces" into gingerbread 2010-08-11 16:19:16 -07:00
Jeff Brown
2f09a77659 Merge "Add support for the PointerLocation overlay." into gingerbread 2010-08-11 16:15:48 -07:00
Mathias Agopian
a350ff9869 call into hwcomposer HAL when present
Change-Id: I70f31c69a9436a43860e78977442863ecba6d27b
2010-08-11 16:08:45 -07:00
Mathias Agopian
bc7e31a84b don't handle the transparent region of a layer in draw()
this is already taken into consideration in computeVisibleRegion
and therefore not needed at draw time.

Change-Id: I3fc7336d22f1147dfcd3a20fd71bf79b946d971f
2010-08-11 16:05:06 -07:00
Mathias Agopian
f6679fc6f7 get rid of our LayerVector implementation
we now use SortedVector<> with a special compare implementation.

Change-Id: I910459cf3b3c8993b55ad0786a8c348369262de5
2010-08-11 16:05:05 -07:00
Mathias Agopian
4da7519993 keep a list of visible sorted surfaces
Change-Id: Ib815eeff894f8a3b1e79fbbf8186d5d91bb60285
2010-08-11 16:04:51 -07:00
Dianne Hackborn
0aa32b9dc9 Merge "New system property "sys.boot_completed" set to 1 when boot completed." into gingerbread 2010-08-11 15:16:01 -07:00
Jeff Brown
3f9ff2076c Add support for the PointerLocation overlay.
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
2010-08-11 14:46:32 -07:00
Kenny Root
b6acda2f80 Merge "Initial tool for OBB manipulation" into gingerbread 2010-08-11 14:06:51 -07:00
Kenny Root
cc440b377b Merge "Move OBB file reading to DefaultContainerService" into gingerbread 2010-08-11 14:06:39 -07:00
Andreas Huber
58f81d841b Merge "This code in CameraSource really should hold the lock." into gingerbread 2010-08-11 13:20:59 -07:00
Kenny Root
1dfd9f8a97 Initial tool for OBB manipulation
Add "obbtool" host command for adding, removing, and querying Opaque
Binary Blob (OBB) information from a file.

Change-Id: Id2ac41e687ad2a500c362616d6738a8ae7e8f5c3
2010-08-11 11:24:41 -07:00
Dianne Hackborn
76263ffc88 Merge "More native work." into gingerbread 2010-08-11 00:45:44 -07:00