Commit Graph

1715 Commits

Author SHA1 Message Date
Manoj Kumar AVM e54506b81a sf: Fix incorrect state reporting in dumpsys
Dumpsys utility accesses layer compositionType variable
with out proper protection. These variables are modified
during hwc_prepare call. Existing HAL lock protection is not
sufficient to address this issue. Failure to do this will
result in incorrect state reporting in dumpsys.

A new displayLock mutex in HWComposer will be used in both
dumpsys and draw calls to ensure correct state is accessed.

Change-Id: I8a57de59525adc0e089b3bed95c067c01e42b666
2015-06-11 18:21:18 -04:00
Tatenda Chipeperekwa 40da48bfdf sf: Add a NULL check in getDisplayConfigs
Validate the display binder by adding a NULL check in getDisplayConfigs.
This will prevent a false match if the caller queries the display
configs for an inactive display (whose binder is NULL by default).

Without this change we might end up attempting to index the display
config array, which is unpopulated for inactive displays, and this will
result in a crash. (See getDisplayInfo in SurfaceComposerClient.cpp for
an example of this scenario)

Change-Id: Ib32a7dc8378d3438df0dba1ecd608bbcfc837717
2015-06-11 12:28:41 -07:00
Tatenda Chipeperekwa 0abd853a68 am c1d4662f: am 23e16bb5: sf: Add a NULL check in getDisplayConfigs
* commit 'c1d4662f0e596021e0d8360cd1c5d213c3c8c4ba':
  sf: Add a NULL check in getDisplayConfigs
2015-06-11 19:09:30 +00:00
Tatenda Chipeperekwa c1d4662f0e am 23e16bb5: sf: Add a NULL check in getDisplayConfigs
* commit '23e16bb5dae277cd20a739ca56553ae931c43ccf':
  sf: Add a NULL check in getDisplayConfigs
2015-06-11 18:57:28 +00:00
Tatenda Chipeperekwa 23e16bb5da sf: Add a NULL check in getDisplayConfigs
Validate the display binder by adding a NULL check in getDisplayConfigs.
This will prevent a false match if the caller queries the display
configs for an inactive display (whose binder is NULL by default).

Without this change we might end up attempting to index the display
config array, which is unpopulated for inactive displays, and this will
result in a crash. (See getDisplayInfo in SurfaceComposerClient.cpp for
an example of this scenario)

Change-Id: I1a12f43b7c375b9c01998dadd5b658275c733fb2
(cherry picked from commit ac71c26e9180d9d181be5ec9e45da72d39144a8b)
2015-06-11 10:40:21 -07:00
Aravind Akella cd2e238ead am ce5af4b2: am 52720f45: Merge "Use LOCATION_HARDWARE permission for data injection." into mnc-dev
* commit 'ce5af4b234ed6f5d6c39d47426d4e961bf3c2858':
  Use LOCATION_HARDWARE permission for data injection.
2015-06-11 02:35:26 +00:00
Aravind Akella ce5af4b234 am 52720f45: Merge "Use LOCATION_HARDWARE permission for data injection." into mnc-dev
* commit '52720f45098e9aed57c906e64a13e4a4a2173ce8':
  Use LOCATION_HARDWARE permission for data injection.
2015-06-11 02:08:19 +00:00
Aravind Akella 52720f4509 Merge "Use LOCATION_HARDWARE permission for data injection." into mnc-dev 2015-06-10 22:56:27 +00:00
Aravind Akella a8814ce478 Use LOCATION_HARDWARE permission for data injection.
Change-Id: Ie81cb0d5f537d5431f2127891cca1d39c969ee7b
2015-06-10 15:15:57 -07:00
Dan Stoza d1adebc2da am 355950c1: am d177e044: Merge "SF: Swap w/h when capturing rotated screenshots" into mnc-dev
* commit '355950c1fc19c35c75203ea761882168f0980181':
  SF: Swap w/h when capturing rotated screenshots
2015-06-10 18:08:31 +00:00
Dan Stoza 355950c1fc am d177e044: Merge "SF: Swap w/h when capturing rotated screenshots" into mnc-dev
* commit 'd177e044d129bbecc3900a7fcd442b354de768df':
  SF: Swap w/h when capturing rotated screenshots
2015-06-10 17:52:50 +00:00
Michael Wright a393c62f22 am f8b34319: am 043bd36b: Merge "Only log dropped input when disabled for the first event." into mnc-dev
* commit 'f8b34319a4c1ccce63b5a8e4732f162d228085cb':
  Only log dropped input when disabled for the first event.
2015-06-10 17:47:58 +00:00
Dan Stoza 65dc7eeff0 SF: Swap w/h when capturing rotated screenshots
Swaps width and height when capturing a screenshot that is rotated by
90 or 270 degrees.

Bug: 8433742
Change-Id: Ibf0b604f541e3cc271e56fe0ad04dc366beb5d79
(cherry picked from commit 3502416204)
2015-06-10 10:33:21 -07:00
Michael Wright f8b34319a4 am 043bd36b: Merge "Only log dropped input when disabled for the first event." into mnc-dev
* commit '043bd36b0d50efa81d010c64009317af160d5fec':
  Only log dropped input when disabled for the first event.
2015-06-10 17:32:41 +00:00
Dan Stoza d177e044d1 Merge "SF: Swap w/h when capturing rotated screenshots" into mnc-dev 2015-06-10 17:28:33 +00:00
Michael Wright 043bd36b0d Merge "Only log dropped input when disabled for the first event." into mnc-dev 2015-06-10 17:08:03 +00:00
Tim Kilbourn 82cdd76e60 Merge "Mock out more inputflinger host functions" 2015-06-10 16:38:42 +00:00
Michael Wright 3a98172289 Only log dropped input when disabled for the first event.
Bug: 19851495
Change-Id: I8cb8076723c1ca1732c3bc37f283d8eb48b7bee0
2015-06-10 15:26:13 +01:00
Dan Stoza 3502416204 SF: Swap w/h when capturing rotated screenshots
Swaps width and height when capturing a screenshot that is rotated by
90 or 270 degrees.

Bug: 8433742
Change-Id: Ibf0b604f541e3cc271e56fe0ad04dc366beb5d79
2015-06-09 16:46:20 -07:00
Dan Stoza 074a13a3cb SF: Don't crop surface damage against viewport
Apply the display transform to surface damage, but don't intersect it
with the viewport.

Bug: 21486007
Change-Id: I94e697cea52096a960385d5f3b89609fdcf30a02
(cherry picked from commit 17833a1b0d)
2015-06-09 13:27:45 -07:00
Dan Stoza 53a2e97a78 libgui/SurfaceFlinger: Add getConsumerName
Adds a getConsumerName method to IGraphicBufferProducer and Surface.
Currently, the name is cached inside of IGBP and is update on connect
and dequeueBuffer, which should be good enough for most uses.

Bug: 6667401
Change-Id: I22c7881d778e495cf8276de7bbcd769e52429915
(cherry picked from commit c6f30bdee1)
2015-06-09 11:28:37 -07:00
Tim Kilbourn c472986d4c Mock out more inputflinger host functions
Change-Id: I3de1e95930578410d8f7c1e77329c00f05b72325
2015-06-08 14:44:33 -07:00
Dan Stoza 271b69c4df am bcb868db: am c6f30bde: libgui/SurfaceFlinger: Add getConsumerName
* commit 'bcb868db922b7114e2a295282da723e1bad585f3':
  libgui/SurfaceFlinger: Add getConsumerName
2015-06-08 18:38:53 +00:00
Dan Stoza 993772a60a libgui: Add generation numbers to BufferQueue
This change allows producers to set a generation number on a
BufferQueue. This number will be embedded in any new GraphicBuffers
created in that BufferQueue, and attempts to attach buffers which have
a different generation number will fail.

It also plumbs the setGenerationNumber method through Surface, with the
additional effect that any buffers attached to the Surface after
setting a new generation number will automatically be updated with the
new number (as opposed to failing, as would happen on through IGBP).

Bug: 20923096
Change-Id: I32bf726b035f99c3e5834beaf76afb9f01adcbc2
(cherry picked from commit 812ed0644f)
2015-06-08 11:18:16 -07:00
Dan Stoza bcb868db92 am c6f30bde: libgui/SurfaceFlinger: Add getConsumerName
* commit 'c6f30bdee1f634eb90d68cb76efe935b6535a1e8':
  libgui/SurfaceFlinger: Add getConsumerName
2015-06-08 17:18:52 +00:00
Dan Stoza c6f30bdee1 libgui/SurfaceFlinger: Add getConsumerName
Adds a getConsumerName method to IGraphicBufferProducer and Surface.
Currently, the name is cached inside of IGBP and is update on connect
and dequeueBuffer, which should be good enough for most uses.

Bug: 6667401
Change-Id: I22c7881d778e495cf8276de7bbcd769e52429915
2015-06-08 09:40:49 -07:00
Dan Stoza 57f50e6a1e am d7214d62: am 9d2c5a7c: Merge "libgui: Add generation numbers to BufferQueue" into mnc-dev
* commit 'd7214d62639f02db9a420eb3f97259a4c909da45':
  libgui: Add generation numbers to BufferQueue
2015-06-05 16:07:35 +00:00
Dan Stoza a697ab7088 am 37fea879: am 17833a1b: SF: Don\'t crop surface damage against viewport
* commit '37fea879609963703e75f46cb3267fa86d1f2bd2':
  SF: Don't crop surface damage against viewport
2015-06-05 16:07:34 +00:00
Dan Stoza d7214d6263 am 9d2c5a7c: Merge "libgui: Add generation numbers to BufferQueue" into mnc-dev
* commit '9d2c5a7c678bd384df0fb29952cf8943e7b1b160':
  libgui: Add generation numbers to BufferQueue
2015-06-05 16:00:13 +00:00
Dan Stoza 37fea87960 am 17833a1b: SF: Don\'t crop surface damage against viewport
* commit '17833a1b0d70cd5cea342cadea9fdbbf16748bc6':
  SF: Don't crop surface damage against viewport
2015-06-05 16:00:12 +00:00
Dan Stoza 9d2c5a7c67 Merge "libgui: Add generation numbers to BufferQueue" into mnc-dev 2015-06-05 15:38:35 +00:00
Dan Stoza 17833a1b0d SF: Don't crop surface damage against viewport
Apply the display transform to surface damage, but don't intersect it
with the viewport.

Bug: 21486007
Change-Id: I94e697cea52096a960385d5f3b89609fdcf30a02
2015-06-04 19:41:06 -07:00
Tim Kilbourn 895a1bfc60 Merge "Basic implementation of input device properties." 2015-06-03 21:26:07 +00:00
Dan Stoza 812ed0644f libgui: Add generation numbers to BufferQueue
This change allows producers to set a generation number on a
BufferQueue. This number will be embedded in any new GraphicBuffers
created in that BufferQueue, and attempts to attach buffers which have
a different generation number will fail.

It also plumbs the setGenerationNumber method through Surface, with the
additional effect that any buffers attached to the Surface after
setting a new generation number will automatically be updated with the
new number (as opposed to failing, as would happen on through IGBP).

Bug: 20923096
Change-Id: I32bf726b035f99c3e5834beaf76afb9f01adcbc2
2015-06-03 11:09:33 -07:00
Dan Stoza 407cabe503 am 958e9bbd: am 75145aa2: Merge "SF: Reduce resync samples without present"
* commit '958e9bbdc6a048da386c62a71adcde5ec8a78cdd':
  SF: Reduce resync samples without present
2015-06-01 18:43:57 +00:00
Dan Stoza ef78916d86 SF: Reduce resync samples without present
Reduces the number of resync samples that DispSync will attempt to
collect without an intervening present from 12 to 4. The former value
was causing excessive power draw for some vendors' implementations, and
reducing it doesn't seem to harm anything.

Bug: 20724456
Change-Id: Ifd6e0490be67756ed001d509a38e8a36953b4618
(cherry picked from commit 9c64757f65)
2015-06-01 11:26:34 -07:00
Tim Kilbourn 3e38aad022 Basic implementation of input device properties.
The input host can load an idc file and pass the resulting property
map to a HAL module.

Change-Id: Ic8188c9eca193c78686ff67680cf37be91c47526
2015-06-01 10:54:47 -07:00
Dan Stoza 9c64757f65 SF: Reduce resync samples without present
Reduces the number of resync samples that DispSync will attempt to
collect without an intervening present from 12 to 4. The former value
was causing excessive power draw for some vendors' implementations, and
reducing it doesn't seem to harm anything.

Bug: 20724456
Change-Id: Ifd6e0490be67756ed001d509a38e8a36953b4618
2015-05-29 13:00:23 -07:00
Dan Stoza 42ace4b5c6 SurfaceFlinger: Tweak whitespace in DdmConnection
Change-Id: I99e7b09e4bc3611ffb790eddfbb9b3c8b9bc5d4c
2015-05-28 14:23:54 -07:00
Jeff Brown 8b04725f14 Bypass surface flinger permission check for calls from system.
Early during the boot, before activity manager is ready to handle
permission checks, the system needs to be able to change the display
state.  Added a hardcoded exemption for AID_SYSTEM (which already
has permission to talk to surface flinger anyhow).

Bug: 19029490
Change-Id: I6222edcab8e394e5fb6adf7a982be446e4505a1e
(cherry picked from commit 3bfe51d790)
2015-05-28 14:19:22 -07:00
Ajay Dudani ae569747b6 surfaceflinger: Fix range check for getFormat
Fix potential buffer overflow error in getFormat with indices
greater than MAX_HWC_DISPLAYS.

Change-Id: I5e5b69d8d043e900f5e33ca9a62e94ae5f857b68
(cherry picked from commit 4e3e30c2d5)
2015-05-28 14:19:10 -07:00
Dan Stoza 8e8eba5091 SF: Skip render-to-texture for color transforms
In cases where SurfaceFlinger is applying a color matrix (usually for
accessibility features), we previously would perform a render-to-
texture for the initial composition, and then apply the matrix during
a copy to the framebuffer. This changes that behavior to just apply the
matrix during composition without a render-to-texture pass.

This may result in a perceived change of the image in cases with alpha
blending, since the blending is performed at a different stage of the
pipeline and the system effectively performs non-linear blends.
However, neither this nor the prior render-to-texture pass is strictly
correct in that regard, and this approach is less error-prone and
likely faster.

Change-Id: I2110ff0374f61d76df7b087dde8a1ed98990440c
(cherry picked from commit f008799d37)
2015-05-28 13:35:39 -07:00
Michael Lentine d74ba85c6f Add hotplug support for primary display.
When the primary is connected/disconnected on tv devices HWComposer updates
it's display parameters but doesn't destroy or recreate the display.

Bug: 18698244

Change-Id: I759c8f75d3e3a7462b85eb51973fb5072b71a702
(cherry picked from commit 10613dc3b5)
2015-05-28 13:35:24 -07:00
Michael Lentine b64d875152 Fix surfaceflinger tests.
Update the screenshot code and add correct return values to surface flinger's
capturescreenshot function.

Buf: 18138368

Change-Id: Ieb42d289088589f941502fbd69da7aa939265e07
(cherry picked from commit 5a16a62950)
2015-05-28 13:33:25 -07:00
Dan Stoza 4808980eec am f008799d: SF: Skip render-to-texture for color transforms
* commit 'f008799d3753e52c10849824ff8146985ea66284':
  SF: Skip render-to-texture for color transforms
2015-05-28 18:26:40 +00:00
Dan Stoza f008799d37 SF: Skip render-to-texture for color transforms
In cases where SurfaceFlinger is applying a color matrix (usually for
accessibility features), we previously would perform a render-to-
texture for the initial composition, and then apply the matrix during
a copy to the framebuffer. This changes that behavior to just apply the
matrix during composition without a render-to-texture pass.

This may result in a perceived change of the image in cases with alpha
blending, since the blending is performed at a different stage of the
pipeline and the system effectively performs non-linear blends.
However, neither this nor the prior render-to-texture pass is strictly
correct in that regard, and this approach is less error-prone and
likely faster.

Change-Id: I2110ff0374f61d76df7b087dde8a1ed98990440c
2015-05-27 13:32:51 -07:00
Michael Lentine a71c03e9fa am 7fc3ef0e: Merge "Add hotplug support for primary display." into mnc-dev
* commit '7fc3ef0eb0077eedaa09a7b505b6ec067e814170':
  Add hotplug support for primary display.
2015-05-27 20:24:54 +00:00
Michael Lentine a6d93f5573 am 20828e63: Merge "Fix surfaceflinger tests." into mnc-dev
* commit '20828e633dd929b87c0297dadcdebb867f2b41d4':
  Fix surfaceflinger tests.
2015-05-22 22:09:01 +00:00
Michael Lentine 10613dc3b5 Add hotplug support for primary display.
When the primary is connected/disconnected on tv devices HWComposer updates
it's display parameters but doesn't destroy or recreate the display.

Bug: 18698244

Change-Id: I759c8f75d3e3a7462b85eb51973fb5072b71a702
2015-05-22 13:14:57 -07:00
Michael Lentine 5a16a62950 Fix surfaceflinger tests.
Update the screenshot code and add correct return values to surface flinger's
capturescreenshot function.

Buf: 18138368

Change-Id: Ieb42d289088589f941502fbd69da7aa939265e07
2015-05-22 13:14:57 -07:00
Michael Wright baaeb2b83f am 7c000280: Merge changes from topic \'button_actions\' into mnc-dev
* commit '7c000280a57f352c2485dcaea1d5bfe20f7bfe63':
  Fix input tests to work with new MotionEvent member
  Revert "Revert "Add new MotionEvent actions for button press and release.""
2015-05-14 19:29:01 +00:00
Michael Wright c01f5d2e19 am c921ce26: Merge "Revert "Add new MotionEvent actions for button press and release."" into mnc-dev
* commit 'c921ce268155e8e1d75bd423514bb5a3ee363440':
  Revert "Add new MotionEvent actions for button press and release."
2015-05-14 19:28:18 +00:00
Michael Wright 9897516aba am f27e6681: Merge "Add new MotionEvent actions for button press and release." into mnc-dev
* commit 'f27e6681048f3ee7a589ab824a1041667ff838e0':
  Add new MotionEvent actions for button press and release.
2015-05-14 19:28:10 +00:00
Dan Stoza 7472fa996a am 81103f12: am 553cbb25: Merge "SurfaceFlinger: Handle EGL errors more cleanly"
* commit '81103f128d651d705c90b3ab9fe55bff674320ef':
  SurfaceFlinger: Handle EGL errors more cleanly
2015-05-14 18:19:03 +00:00
Dan Stoza 59bfd2bbed SurfaceFlinger: Handle EGL errors more cleanly
Adds some more safety checking for cases where we get an error while
trying to create the EGLImage. The checking puts the Layer into a
failed state after detecting an error, since the shadow queue may no
longer be synchronized.

Bug: 20957332
Change-Id: I68b4c40eab3e58731b875ed5752f2c7d17f14bcb
(cherry picked from commit 65476f3332)
2015-05-14 10:43:07 -07:00
Dan Stoza 4794879186 Merge "SurfaceFlinger: Handle EGL errors more cleanly" into mnc-dev 2015-05-14 17:42:21 +00:00
Dan Stoza 65476f3332 SurfaceFlinger: Handle EGL errors more cleanly
Adds some more safety checking for cases where we get an error while
trying to create the EGLImage. The checking puts the Layer into a
failed state after detecting an error, since the shadow queue may no
longer be synchronized.

Bug: 20957332
Change-Id: I68b4c40eab3e58731b875ed5752f2c7d17f14bcb
2015-05-14 09:48:19 -07:00
Michael Wright 7c000280a5 Merge changes from topic 'button_actions' into mnc-dev
* changes:
  Fix input tests to work with new MotionEvent member
  Revert "Revert "Add new MotionEvent actions for button press and release.""
2015-05-14 15:31:21 +00:00
Michael Wright 7b159c9a4f Revert "Revert "Add new MotionEvent actions for button press and release.""
This reverts commit 70b41ef580.
2015-05-14 14:48:03 +01:00
Michael Wright c921ce2681 Merge "Revert "Add new MotionEvent actions for button press and release."" into mnc-dev 2015-05-14 13:47:13 +00:00
Michael Wright 70b41ef580 Revert "Add new MotionEvent actions for button press and release."
This reverts commit 48a8a0e432.
2015-05-14 14:46:17 +01:00
Michael Wright f27e668104 Merge "Add new MotionEvent actions for button press and release." into mnc-dev 2015-05-14 13:31:25 +00:00
Michael Wright 48a8a0e432 Add new MotionEvent actions for button press and release.
Introduce ACTION_BUTTON_PRESS and ACTION_BUTTON_RELEASE as actions to
signal a button press or release. If these actions happen
simulanteously with a DOWN or UP event then they're explicitly
ordered to happen after the DOWN or preceding the UP in order to send
them to the most recently targeted view.

Also, introduce new stylus button constants that differ from the
constants we use for mouse buttons.

Bug: 20704355
Change-Id: Ib960a5004db5429ad2fc8db020704773e2978327
2015-05-14 13:25:41 +01:00
Michael Wright 9e40093346 am 4866f087: Merge "Use previous pressure value if the current fusion data is zero." into mnc-dev
* commit '4866f087181af02e870b2d2fc1d4be8d38c2f36e':
  Use previous pressure value if the current fusion data is zero.
2015-05-13 17:15:46 +00:00
Michael Wright eab5a1ed7c am 4eed0f8f: Merge "Synthesize events for pressure and button changes." into mnc-dev
* commit '4eed0f8f8dd3673e55a93c0b62b8b9ebefa135cf':
  Synthesize events for pressure and button changes.
2015-05-13 17:15:46 +00:00
Dan Stoza 119a03c5a2 am 09d561db: Merge "Fix PTS handling for buffer replacement" into mnc-dev
* commit '09d561dbee9a28db9632ff3d51f633c18aefe023':
  Fix PTS handling for buffer replacement
2015-05-13 17:15:45 +00:00
Michael Wright 4866f08718 Merge "Use previous pressure value if the current fusion data is zero." into mnc-dev 2015-05-13 16:56:07 +00:00
Michael Wright 4eed0f8f8d Merge "Synthesize events for pressure and button changes." into mnc-dev 2015-05-13 16:55:48 +00:00
Dan Stoza e64a79cd85 Fix PTS handling for buffer replacement
This changes the way that SurfaceFlinger's shadow buffer management
works such that instead of tracking the size of the shadow queue in the
BufferQueue, SF tracks the last frame number it has seen, and passes
that into the acquireBuffer call. BufferQueueConsumer then ensures that
it never returns a buffer newer than that frame number, even if that
means that it must return PRESENT_LATER for an otherwise valid buffer.

Change-Id: I3fcb45f683ed660c3f18a8b85ae1f8a962ba6f0e
(cherry picked from commit a4650a50a0)
2015-05-13 09:43:35 -07:00
Dan Stoza 09d561dbee Merge "Fix PTS handling for buffer replacement" into mnc-dev 2015-05-13 16:34:07 +00:00
Dan Stoza a4650a50a0 Fix PTS handling for buffer replacement
This changes the way that SurfaceFlinger's shadow buffer management
works such that instead of tracking the size of the shadow queue in the
BufferQueue, SF tracks the last frame number it has seen, and passes
that into the acquireBuffer call. BufferQueueConsumer then ensures that
it never returns a buffer newer than that frame number, even if that
means that it must return PRESENT_LATER for an otherwise valid buffer.

Change-Id: I3fcb45f683ed660c3f18a8b85ae1f8a962ba6f0e
2015-05-12 13:10:17 -07:00
Aravind Akella d0e95fed02 am af8ed3f0: Merge "Improve logging in SensorService dump output." into mnc-dev
* commit 'af8ed3f06cf5a0fd37357b438da803f53f33fa56':
  Improve logging in SensorService dump output.
2015-05-12 19:30:30 +00:00
Aravind Akella af8ed3f06c Merge "Improve logging in SensorService dump output." into mnc-dev 2015-05-12 19:12:43 +00:00
Aravind Akella 444f267572 Improve logging in SensorService dump output.
Maintain a per sensor circular buffer of last 10 sensor_events and the wall clock time
at which each event is received.

Change-Id: Ia50c825ab5a7aaf0932ce7dce7ac8b9be7071e77
2015-05-12 11:44:01 -07:00
Dan Stoza c340dc0a75 am dc13c5b8: libgui: Hook up onFrameReplaced
* commit 'dc13c5b85b099050c73297a19f1ef89308f7620b':
  libgui: Hook up onFrameReplaced
2015-05-12 16:49:10 +00:00
Dan Stoza a3b6693272 libgui: Hook up onFrameReplaced
This completes the plumbing from ConsumerListener::onFrameReplaced into
SurfaceFlinger (and other consumers that may care).

Change-Id: I376e78ace95d6748e8662e6b4d47c0dfa697a300
(cherry picked from commit dc13c5b85b)
2015-05-12 09:35:29 -07:00
Michael Wright 53dca3aadd Use previous pressure value if the current fusion data is zero.
Occasionally we'll receive the stylus up signal (pressure = 0) before
we receive the touch screen up signal. Rather than giving pointer a
pressure value of 0 (which is one of the signals of hovering) or
falling back to the touchscreen pressure values (which would make for
an inconsistent stream), use the previous pressure value which should
always be non-zero for a stream of fused data.

Bug: 20449776
Change-Id: I71eb97e7c4ea53e42b0eb54fc1f8ae7f89aad9d1
2015-05-12 14:17:42 +01:00
Michael Wright 43fd19fd1a Synthesize events for pressure and button changes.
Even when there isn't movement on the touchscreen we should produce
events for pressure and button state changes generated by external
stylii.

Change-Id: I9fd7ba85902d5d6bfb28d5e5ff5d8f340a94c2bf
2015-05-12 14:08:47 +01:00
Dan Stoza dc13c5b85b libgui: Hook up onFrameReplaced
This completes the plumbing from ConsumerListener::onFrameReplaced into
SurfaceFlinger (and other consumers that may care).

Change-Id: I376e78ace95d6748e8662e6b4d47c0dfa697a300
2015-05-11 15:33:01 -07:00
Aravind Akella adc3b4cd8f am be451b57: Merge "Fix the arguments to memcpy." into mnc-dev
* commit 'be451b57b97c21747c637f4af06743318d42c36c':
  Fix the arguments to memcpy.
2015-05-09 00:41:56 +00:00
Aravind Akella be451b57b9 Merge "Fix the arguments to memcpy." into mnc-dev 2015-05-09 00:17:40 +00:00
Aravind Akella 08f04bf36c Fix the arguments to memcpy.
Change-Id: Ieaee26f46f43a9d412537047566178985370198b
2015-05-08 15:59:23 -07:00
Dan Stoza 98a13a1475 Merge "SF: Apply pending transactions to new sidebands" into mnc-dev 2015-05-08 16:32:27 +00:00
Pat Tjin 814e728b33 am deb6baa6: Merge "surfaceflinger: Fix range check for getFormat" into mnc-dev
* commit 'deb6baa6b349cc5c176b911bcd1e551d15404bf7':
  surfaceflinger: Fix range check for getFormat
2015-05-07 21:21:13 +00:00
Ajay Dudani 4e3e30c2d5 surfaceflinger: Fix range check for getFormat
Fix potential buffer overflow error in getFormat with indices
greater than MAX_HWC_DISPLAYS.

Change-Id: I5e5b69d8d043e900f5e33ca9a62e94ae5f857b68
2015-05-07 13:23:32 -07:00
Dan Stoza e63633e53d am c037ca7f: am c4e98c40: Merge "SF: Apply pending transactions to new sidebands"
* commit 'c037ca7fb1c0163c58e8707d1184bb73aabc0730':
  SF: Apply pending transactions to new sidebands
2015-05-06 23:48:07 +00:00
Dan Stoza 12e0a27aa3 SF: Apply pending transactions to new sidebands
When a Layer's sideband stream is set, apply any pending transactions.
Otherwise they would never be applied since sideband streams don't
trigger updates by pushing new buffers.

Bug: 20125898
Change-Id: I0c7a91cdf84e6205801f4ab64eee0b09e4c0b3e0
(cherry picked from commit 3b04e1383eca6cb1d43ebe23a421c427007690c7)
2015-05-05 16:05:32 -07:00
Dan Stoza 8afb76731a SF: Apply pending transactions to new sidebands
When a Layer's sideband stream is set, apply any pending transactions.
Otherwise they would never be applied since sideband streams don't
trigger updates by pushing new buffers.

Bug: 20125898
Change-Id: I0c7a91cdf84e6205801f4ab64eee0b09e4c0b3e0
(cherry picked from commit 3b04e1383eca6cb1d43ebe23a421c427007690c7)
2015-05-05 14:21:20 -07:00
Sasha Levitskiy 7cb57cee21 am b0474e78: SensorServiceTest: Fix build, warnings.
* commit 'b0474e78df2a778c42c6746da815f397bb2df374':
  SensorServiceTest: Fix build, warnings.
2015-05-04 00:14:28 +00:00
Sasha Levitskiy b0474e78df SensorServiceTest: Fix build, warnings.
Change-Id: I3ed5247d3eb6c43d185049cf9011c2ee01b5662e
Signed-off-by: Sasha Levitskiy <sanek@google.com>
2015-05-02 21:03:44 -07:00
Svetoslav 04db89b7aa am c28fe8f5: Merge "Add body sensors app op - framework native" into mnc-dev
* commit 'c28fe8f5c54c5e98be7664dcffdbd5b324b850d6':
  Add body sensors app op - framework native
2015-05-01 23:40:51 +00:00
Svetoslav c28fe8f5c5 Merge "Add body sensors app op - framework native" into mnc-dev 2015-05-01 23:10:56 +00:00
Svetoslav b412f6e203 Add body sensors app op - framework native
Change-Id: I727a2bb1e28ae9158f2df9c74dd0aee977dfd47f
2015-05-01 13:51:45 -07:00
Dan Stoza cb155bbb52 am a0162542: am bb58111c: Merge "SurfaceFlinger: Fix PTS on stale buffers"
* commit 'a0162542609b1dcd8158644e7ba5ae92e84b95d5':
  SurfaceFlinger: Fix PTS on stale buffers
2015-05-01 20:51:40 +00:00
Dan Stoza bb58111c22 Merge "SurfaceFlinger: Fix PTS on stale buffers" 2015-05-01 20:28:47 +00:00
Dan Stoza ecc504043f SurfaceFlinger: Fix PTS on stale buffers
SurfaceFlinger's (Layer's) shadow copy of the BufferQueue queue was
getting out of sync for a few reasons. This change fixes these by
doing the following:

- Adds a check to re-synchronize the shadow copy every time we
  successfully acquire a buffer by first dropping stale buffers before
  removing the current buffer.
- Avoids trying to perform updates for buffers which have been rejected
  (for incorrect dimensions) by SurfaceFlinger.
- Adds IGraphicBufferConsumer::setShadowQueueSize, which allows the
  consumer to notify the BufferQueue that it is maintaining a shadow
  copy of the queue and prevents it from dropping so many buffers
  during acquireBuffer that it ends up returning a buffer for which the
  consumer has not yet received an onFrameAvailable call.

Bug: 20096136
Change-Id: I78d0738428005fc19b3be85cc8f1db498043612f
(cherry picked from commit 2e36f2283f)
2015-05-01 12:23:44 -07:00
Dan Stoza 2e36f2283f SurfaceFlinger: Fix PTS on stale buffers
SurfaceFlinger's (Layer's) shadow copy of the BufferQueue queue was
getting out of sync for a few reasons. This change fixes these by
doing the following:

- Adds a check to re-synchronize the shadow copy every time we
  successfully acquire a buffer by first dropping stale buffers before
  removing the current buffer.
- Avoids trying to perform updates for buffers which have been rejected
  (for incorrect dimensions) by SurfaceFlinger.
- Adds IGraphicBufferConsumer::setShadowQueueSize, which allows the
  consumer to notify the BufferQueue that it is maintaining a shadow
  copy of the queue and prevents it from dropping so many buffers
  during acquireBuffer that it ends up returning a buffer for which the
  consumer has not yet received an onFrameAvailable call.

Bug: 20096136
Change-Id: I78d0738428005fc19b3be85cc8f1db498043612f
2015-04-30 15:29:05 -07:00
Dan Stoza f7a862a1d6 am 6dbfc87d: am 32d4b6c8: Merge "SurfaceFlinger: Limit to 4k Layers"
* commit '6dbfc87da5b07547b7ce7a0218fef3a90d23a6c4':
  SurfaceFlinger: Limit to 4k Layers
2015-04-30 22:28:54 +00:00
Dan Stoza e8f454fd6e am c8ffe5a6: am 676d10b2: Merge "SurfaceFlinger: Fix integer overflow in Mesh ctor"
* commit 'c8ffe5a662d3e436beb05e14d2976925b86e26fd':
  SurfaceFlinger: Fix integer overflow in Mesh ctor
2015-04-30 22:16:32 +00:00
Dan Stoza 7b2fc93007 Merge "SurfaceFlinger: Limit to 4k Layers" into mnc-dev 2015-04-30 22:12:46 +00:00