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
- 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
The patch creates RAW type in PlaneLayoutComponentType to make list
complete.
Bug: b/157534008
Test: VtsHalGraphicsMapperV4_0TargetTest
Change-Id: I871f90756eafb848cf7489b9710f4df47f8f8ec2
When we render on a framebuffer with smaller size than the
currently active mode the destination clip can get outside
of the display bounds. For examlple, if the currently
active display mode is 4K, but we render on a 1080p framebuffer,
dest clip = 4k, but display bounds =1080p. As a result of that
only the top left quarter of the image is visible on screen.
Bug: 153991408
Test: manually make sure the image is properly displayed on sreen
1. boot device
2. turn off HWC with adb shell service call SurfaceFlinger 1008 i32 1
3. turn on HWC with adb shell service call SurfaceFlinger 1008 i32 1
4. start a youtube video and repeat 2 and 3.
Test: take a screenshot and check it's correctly displayed
Test: atest libsurfaceflinger_unittest librenderengine_test
Merged-In: Ia7b6ebd311c1b751c1966a34a9294b9b85a2aa0b
Change-Id: Ia7b6ebd311c1b751c1966a34a9294b9b85a2aa0b
(cherry picked from commit fcfe1360a4)
Layers that voted with FrameRateCompatibility::ExactOrMultiple
will still allow touch boost as those layers are typically not
interactive and therefore touch is probably meant for a different
layer. For the same reasoning, we should continue to heuristically
calculate frame rate for layers in the same tree.
Bug: 157254751
Test: run Swappy with statistics overlay and observe refresh rate
Test: run YouTube, play a video, scrolling the recommended videos and observe refresh rate
Change-Id: I9311512a663eba61dfcae6277a52c077e135a244
vkGetInstanceProcAddr(nullptr, ...) is valid and is effectively a
globally dispatched function, so it's consistent to support querying
vkGetInstanceProcAddr from itself without an instance.
This is required in Vulkan 1.2 and is supported for all Vulkan versions
by the loader on other platforms. To maximize app compatibility and
minimize surprises, this makes it work on Android also, even for pre-1.2
versions where the result is undefined by the spec.
Bug: 157173922
Test: dEQP-VK.api.version_check.entry_points with
https://gerrit.khronos.org/#/c/5490/ applied and modified to
check even on pre-1.2 implementations.
Change-Id: I820dd1239df54a415b7ff5db47cf2c2b349f6155
A layer will be considered frequent unless proven otherwise, in order
to make sure animations will change the refresh rate as soon as possible.
In addition, if a layer is classified infrequent, then we will keep it
infrequent until we get a burst of frames. These two policies combined
allow us to differentiate between an animating layer and a layer that
usually doesn't animate.
Bug: 157096772
Test: Play 24fps video in YouTube PIP mode and rotate the device - no jank
Test: Chrome playing video - no refresh rate switching
Test: Cursor blinking on Messages - switch to lowest refresh rate quickly
Change-Id: I3629b6e4786cd43919f51465e347f2abb52234d9
Tune the threshold for detecting inactive layers to treat 24fps
videos without presentation timestamps as frequent.
Bug: 157110371
Test: Chrome playing video and observe systrace
Change-Id: I6908761ef2af7e40cd40eda6e1e66c8e1a01393f
Some devices might takes a few frames to change the refresh rate.
Calculating the frame rate should ignore frames sent while changing
the refresh rate as those might result in an inaccurate frame rate
due to frame misses.
Bug: 156530990
Test: Running Hay Day and observing refresh rate.
Change-Id: I99f364cd1816c3ce2ba3c3145331eb618dcaea71
When DMS enforces a fixed refresh rate to hide user-visible flickering,
we must respect that refresh rate to avoid unnecessary switches during
scenarios such as idle and touch boost.
We must still respect app votes when they explicitly provide a frame
rate.
Bug: 156315203
Test: Exoplayer
Test: Modified version of SetFrameRateTest to simulate 60hz video
Test: libsurfaceflinger_unittest
Change-Id: I5fe974ddaff30e2f02e381cb63e0a6418834fdb5
Since vndservicemanager is no longer installed by default, this gets hit
on those devices.
Fixes: 156571068
Test: TH
Change-Id: I31af865326e9a69042e5c53b63637b95d6de9ad1
(cherry picked from commit 39a572183a)
Merged-In: I31af865326e9a69042e5c53b63637b95d6de9ad1
The actual problem is that default implementation is set globally.
setDefaultImpl might not work as expected when it is called twice with
different instances.
Because we don't have a proper solution for the problem, we prevent
calling setDefaultImpl() twice by aborting.
Exempt-From-Owner-Approval: approved
Bug: 140139809
Test: ./runtests.sh (in /system/tools/aidl)
Merged-In: I659d3eaad3a45dcba608fa79a08f083f84bc4d58
Change-Id: I659d3eaad3a45dcba608fa79a08f083f84bc4d58
(cherry picked from commit 81087399e9)
When using PROXIMITY_SCREEN_OFF_WAKE_LOCK and screen was turned off by proximity sensor,
input service should generate ACTION_CANCEL, same as display turned off by pressing power button.
Bug: 154074380
Test: atest libgui_test
Change-Id: I72a10c98adad4a236dbd445cefe5f37c4ec3fd81
Merged-In: I72a10c98adad4a236dbd445cefe5f37c4ec3fd81
When content detection is off, or when we have no layer information to
make a decision, prefer the default frame rate.
Bug: 154648391
Test: - Modified a Pixel 4 to turn off content detection, idle, touch,
and power boost. Confirmed that, without this CL, we have bad
behavior where calls to setFrameRate() persist after the layer
goes away, and that this CL fixes that behavior.
- Modified and enhanced the "no layers" unit test in
RefreshRateConfigsTest.cpp.
Change-Id: I2fd0d64a6ad369580cbb2ebf91cbbed7c31e0281
Change the algorithm that chooses the refresh rate to treat layers as
infrequent unless proven otherwise. This change helps with multiple
switches during scenarios of blinking cursor where the detection of
infrequent layer is too long. The down side on this change is that
animations will be considered infrequent as well for the first few frames.
However the touch boost is a good mitigation of this.
Test: Typing in Messages and observe refresh rate
Test: Settings->About->up time and observe refresh rate
Bug: 155062712
Bug: 156654519
Change-Id: I317c69bd063df5d70f2d5705163cf61c1c9b1fff
Let linux clean it up, since this may be accessed by some threads after
the main thread is destructed.
Bug: 154507808 # longterm
Bug: 156785633
Test: w/ repro which calls defaultServiceManager off main thread
Change-Id: Ic109f4bdca3893e6b0b192ac27f3ff03ada6f9e2
(cherry picked from commit 1698ffd088)
Merged-In: Ic109f4bdca3893e6b0b192ac27f3ff03ada6f9e2
Revert submission 11485868-reland-libbinder
Testing potential culprit for b/156778943 ("pthread_mutex_destroy called on a destroyed mutex" inside libstagefright).
Reason for revert: broken above test
Exempt-From-Owner-Approval: revert due to test breakage.
Reverted Changes:
I045836e10:Use NO_IMEMORY version of libstagefright_foundatio...
I23f41fece:Revert "Revert "Make libbinder not available to me...
bug: 156778943
Change-Id: Idfea55e47cd80dc80c58bfef20e7e274f944dcaf
Add thread annotations to display state and accessors. Add macros and
RAII helpers as escape hatches that are stricter and more meaningful
than NO_THREAD_SAFETY_ANALYSIS, and emit error on use of the latter.
Bug: 123715322
Test: Build
Change-Id: Ibada81998d70c940c7406ef292b2d487fb02189d
Merged-In: Ibada81998d70c940c7406ef292b2d487fb02189d