It's not correct to only check the diagonal of the transform matrix
for scaling. The scale will be distributed across four components
when the layer is rotated.
Test: manual
Test: atest LayerTypeAndRenderTypeTransaction
Fixes: 147415720
Change-Id: I140b373efd7fad705d0cd54aa6e86b4142e190e5
Sensors that derive their output from physical sensors and effectively
apply an irreversible filter onto their data. Requantizing this
information has little benefit and can potentially increase floating
point inaccuracy due to the additional math.
Bug: 157986376
Test: presubmits
Change-Id: I4158739abb6b74d978abe75bd8e03ac32ad4e998
There is a bug where the sensor is not properly deactivated
when ann app becomes idle. This CL fixes the issue, and also
avoids calling batch() if no active clients exist.
Bug: 157934995
Test: Flash, verify sensor is disabled when app goes idle
and re-enabled when app becomes active again
Change-Id: I403b02a20dc89c5ce0630de6ddfd6242bf38ec37
This change includes two separate fixes to make waking up from idle more
robust when using a kernel idle timer:
1) Always reconfirm the refresh rate when we resync to hardware vsync.
This is because if the kernel idle timer is enabled, we may not
immediately be in the refresh rate we expect to be.
2) Ignore the refresh rate reported by the hardware vsync callbacks,
since that refresh rate may not reflect the actual refresh rate
when the kernel idle timer is in effect.
Bug: 154303580
Test: systrace
Test: libsurfaceflinger_unittest
Change-Id: I79c66faeaed262acd9c5925fe2202a9fb3f10b7b
When we still have pending transactions (e.g. we are waiting on the
other side of a deferred transaction), we need to set the transaction
flags on SurfaceFlinger, so SurfaceFlinger will continue to call
doTransaction and give us a chance to process them. However when
we set the transaction flags, we trigger a wake up! This isn't
desirable, as the frame might have not come in. If the frame did come
in we will get to INVALIDATE, and from INVALIDATE observe the
transaction flags. This means we can set the transaction flags without
scheduling a wakeup and rely on the incoming frame to eventually wake
us up. I also considered triggering the transaction processing from
onFrameAvailable but at that point we are too late in the composition
cycle.
Bug: 157685525
Test: Existing tests pass
Change-Id: Ia54bc9f48a80906fc8f21c46debc72fabadd3e07
If a transaction is posted with ISurfaceComposer::eAnimation flag,
record it with layer history. Layers with eAnimation are considered
animating and will vote for peak refresh rate.
Bug: 157695685
Test: Play 24fps video in YouTube PIP mode with setFrameRate and rotate the device - no jank
Test: Chrome playing video - no refresh rate switching
Test: Hide/Show keyboard when inputting text
Test: Running Hay Day and observing refresh rate
Change-Id: If62e11b395c44d9e5fd40b74864fefd068953413
To reduce the delta of the upcoming ANR refactor, add a basic ANR test
here. This will also help highlight the difference in behaviour from the
current code to the new code.
To cause an ANR today, the socket needs to be blocked, which means that
we need to send ~ 50 events to the unresponsive window.
These workarounds will be removed when the ANRs are refactored.
Bug: 143459140
Test: adb shell -t /data/nativetest64/inputflinger_tests/inputflinger_tests --gtest_filter="*InputDispatcherSingleWindowAnr*" --gtest_repeat=1000
--gtest_break_on_failure
Change-Id: I0a1b28c2785d03d8870691641e0f7c6b1ca3b85e
Merged-In: I0a1b28c2785d03d8870691641e0f7c6b1ca3b85e
The current implementation of layer history discards all the history
if a layer is considered inactive. This leads to an issue in the scenario
that a layer is posting infrequent updates so slow, that by the time we
get the next buffer, the layer is considered inactive, and we bump the
refresh rate to Max, instead of detecting that layer as infrequent.
As a fix, we keep around the layer history even if it is inactive.
To avoid cases where detect animations too late, we clear the history
on touch event.
Bug: 156654519
Test: add a new unit test that simulates the buffer pattern
of a Netflix playback
Change-Id: Ie076891806d74dde814fbbb3b1a73c38e0b2ae34
This change allows creating an effect layers without a color fill so
we can avoid an additional sf transactions when creating effect
layers.
Fixes: 157646690
Test: go/wm-smoke
Test: atest SurfaceFlinger_test
Change-Id: I3d8a4f4820d7b8fb05daab697c25cff8def612c1
While refactoring ANR logic, we discovered that an existing Q behaviour
was broken by the focus refactoring. The behaviour aims to prevent keys
from being sent to incorrect windows.
The desired behaviour is as follows: if there are any unfinished events,
then do not process key events (keep them pending), which would allow
these key events to go to a new window, if one becomes focused. The
intent is that if the user hits "Alt+Tab" to switch to another window,
and starts typing right away, we want to make sure that we have
processed the focus event for the new window prior to determining where
to send the new key events after Alt+Tab.
The behaviour is broken today because we put the focus events at the
back of the queue. So even if we process the focus event first, it would
still go to the app after the key event, which would mean that the new
window may receive it, but would drop it because that window does not
yet have focus (since we haven't sent the focused event to it).
The proposed solution is to always put the focus events in the front of
the queue. But, we still need to preserve the relative order of focus
events. To account for that, we put a new focus event always at the
front of the queue, but behind any other focus events that may be there.
Bug: 143459140
Test: added in ANR CL because this behaviour is updated there.
Change-Id: I95256bd3f57988d1990cf1f21267c8f405892e8e
Merged-In: I95256bd3f57988d1990cf1f21267c8f405892e8e
InputReader was already responsible to bind device/event and display. It
makes sense to further extend it to control the display where mouse
cursor is shown.
Bug: 146385350
Test: Mouse cursor shows up at expected display.
Test: atest inputflinger_tests
Change-Id: Ie7a9546550b70c8834462b06de929472196fe713
Merged-In: Ie7a9546550b70c8834462b06de929472196fe713
- Restructure the code in RefreshRateConfigs to be able to clear
LayerHistory frames on the first touch event. Without this change we
clear the history on every frame as long as the touch timer hasn't
expired.
- Add log prints for debugging
Test: Play 24fps video in YouTube PIP mode and rotate the device - no jank
Test: Chrome playing video - no refresh rate switching
Test: Hide/Show keyboard when inputting text
Test: Running Hay Day and observing refresh rate
Bug: 157096772
Change-Id: I7cabecd6ea27ec335e773aa22bb111fa8ec89195
This reverts commit 1adbb72759.
Reason for revert: Causing regression with b/157096772
Change-Id: Ib2009f7a4ecbd268ea69304853a91bd22674ec1e
Test: Play 24fps video in YouTube PIP mode and rotate the device - no jank
Test: Chrome playing video - no refresh rate switching
Test: Hide/Show keyboard when inputting text
Test: Running Hay Day and observing refresh rate
Bug: 157096772
Bug: 155062712
Bug: 156654519
This reverts commit eeb74561b6.
Reason for revert: Causing regression with b/157096772
Change-Id: I031219588cedf5cfcb75255430f707428ed59f72
Test: Play 24fps video in YouTube PIP mode and rotate the device - no jank
Test: Chrome playing video - no refresh rate switching
Test: Hide/Show keyboard when inputting text
Test: Running Hay Day and observing refresh rate
Bug: 157096772
Bug: 157110371
This reverts commit 39db2c9b07.
Reason for revert: Causing regression with b/157096772
Change-Id: I058d6f8efa637cb36371276761281f51b7aa3dd3
Test: Play 24fps video in YouTube PIP mode and rotate the device - no jank
Test: Chrome playing video - no refresh rate switching
Test: Hide/Show keyboard when inputting text
Test: Running Hay Day and observing refresh rate
Bug: 157096772
The Layer lifecycle is tied to BufferLayerConsumer so when the Layer is
removed, the BufferLayerConsumer is abandoned. However, abandoned
doesn't necessarily mean it was cleaned up yet. Therefore, we need to
check whether the BufferLayerConsumer was abandoned before accessing the
raw pointer mLayer. If the BufferLayerConsumer was not abandoned, then
mLayer will be valid.
Test: Builds and runs. Hard to reproduce race condition
Fixes: 157535966
Fixes: 155679049
Change-Id: I8b309c9e1fe57746bceabab1deda56248087b189
Preparation for removing implicit include paths for jni.h from soong.
Bug: 152482542
Test: m checkbuild
Change-Id: I06873e61e519b6e54d7325f90231bce732790366
Merged-In: I06873e61e519b6e54d7325f90231bce732790366
Exempt-From-Owner-Approval: build clean-up
(cherry picked from commit e32877afcc)