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)
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
This CL renames the variables so they are more readable and changes
snake case to camel case.
Test: m
Bug: 153991408
Change-Id: I80faa91ab514395dbf53c52282d62444c9aa579a
The Steam controller has 2 large 'paddle' buttons on the back. When used
in USB mode with hid-steam, this sends BTN_GEAR_DOWN and BTN_GEAR_UP to
the user space.
But today, these events never reach the apps, even if they have proper
mappings. This is because these buttons are not considered to be
"keyboard or gamepad". Adjust the checks to include these 2 buttons in
KeyboardInputMapper.
Test: connect Steam controller over USB and check that the paddle
buttons produce events visible in the "gamepad tester" app
Test: atest inputflinger_tests
Bug: 147434575
Change-Id: I43f221c546ccc1277d578a185465bd5eadac9e8e
When compiling BufferQueueCore for host linux, the following
warning/error occurs:
error: ignoring return value of function declared with
'warn_unused_result' attribute [-Werror,-Wunused-result]
Add a simple null check to avoid this error. This is a no-op in terms of
functionality.
Bug: 156675939
Test: m -j libgui
Change-Id: I460731ebaf0272fd5376f244e65b763da44e14f0
We keeps around layers that explicitly voted with
setFrameRate API even if those are not visible. This is to be able
to react when those become visible.
However there is a bug in that logic that causes SurfaceFlinger to treat
explicit invisible layers as Max.
Bug: 153111478
Bug: 156506455
Test: adb shell /data/nativetest64/libsurfaceflinger_unittest/libsurfaceflinger_unittest
Change-Id: I15dde0b79bf670874edee90336caa812f791cf26
The variables inside the policy are being called from the test thread
and the InputDispatcher thread. They are being accessed without a lock
today. This is OK because we are waiting for dispatcher to go to idle
today, but in ag/10847700 we will have dispatcher not idle, and need to
have a way to wait for a policy callback from the test thread with a
certain timeout.
Add locks to the policy variables here to reduce the diff.
Bug: 143459140
Test: atest inputflinger_tests
Change-Id: I77f5ec15cdfd55ce4c4dfcb501071b2c7c961b1b
When an app uses a TextureView (or any other hwui based view)
hwui will attach presentation timestamps to each buffer for
for implementing its render ahead logic. SurfaceFlinger looks at
those timestamps and based on the frame rate it may decide to switch
to a refresh rate that better matches the content. When the refresh rate
changes, hwui may stop doing render ahead and therefore stop attaching
presentation timestamps. The way SurfaceFlinger handles that is by
calculating the content refresh rate by looking at the time the buffer
was queued. SurfaceFlinger will look at the queue time only if this
layer was providing presentation timestamps in the past.
Bug: 155710271
Test: Facebook feed playing video
Test: YouTube video with 24, 25, 30, 60 fps content
Change-Id: I3e981d192ec569087aa16d4c952ef9565d6fb234
This reverts commit 38601a9beb.
Reason for revert: Different fix was applied to b/155710271
Change-Id: Icfa0774f1cf412aa3d7122b0bc7046cf8a0b1077
Bug: 155710271
This reverts commit 49e65e422d.
Reason for revert: Different fix was applied to b/155710271
Change-Id: Ic70812309b3acbd85ece80fce7e9769e19126d13
Bug: 155710271
Currently, there are a lot of uses of goto statements in
InputDispatcher, which makes the code hard to follow. Instead, remove
some unused code and reduce the goto usage.
Bug: 143459140
Test: presubmit
Change-Id: I0ef0b3a0820ce643486cec5d9cbeb0f593344ee6
Merged-In: I0ef0b3a0820ce643486cec5d9cbeb0f593344ee6
(cherry picked from commit 767917f075)
1. Remove DisplayDevice in LayerCreationArgs and updateTransformHint.
2. Pass DisplayDevice to dumping functions instead of calling back into SF.
Bug: 123715322
Test: Print transform hint in ConsumerBase
Change-Id: If41f3506de10f2799b52a73f7a54969b8ef1e960
We move our nullptr check to before our dereference of the pointer.
Test: TreeHugger
Bug: 154874011
Change-Id: If1e51b8fb88f72b6b4cbda52543bf093e6c76ca9
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.
For now setting min_sdk_version doesn't change build outputs.
But build-time checks will be added soon.
Exempt-From-Owner-Approval: cherry-pick from aosp
Bug: 152655956
Test: m
Merged-In: Ifea5ed988fad2e0d29271e6e9cbf0e12100b37d9
Change-Id: Ifea5ed988fad2e0d29271e6e9cbf0e12100b37d9
(cherry picked from commit a395c8d9aa)
Prior benchmarks shows that this should take 2.6-2.7 micros, but there
exist traces showing that the current slice can take ~700 micros, and
even up to 8 milliseconds, which confounds with the debug log that is
also expected to be cheap. There is evidence that logd occasionally
causes preemption in flinger, so isolate the two calls so that the next
time a bad trace comes in we know what the cause is.
Bug: 144289346
Test: builds
Change-Id: I899e9f99107fad1f5e501b783ce57bfd12300b85
The transform hint is used to prevent allocating a buffer of a
different size when a layer is rotated. The producer can choose to
consume the hint and allocate the buffer with the same size.
Provide the graphic producer a transform hint if the layer and its
children are in an orientation different from the display's
orientation. The caller is responsible for clearing this transform
hint if the layer is no longer in a fixed orientation.
Bug: 152919661
Test: atest VulkanPreTransformTest
Test: confirm with winscope trace, buffers are allocated taking into
account the transform hint in fixed orientation scenarios
Test: go/wm-smoke
Change-Id: Iea9dcf909921802a5be5c44dd61be3274f36bbd8
When calculating refresh rate, we want to make sure that the refresh
rate of a layer is "stable", meaning that the average we calculated
is correct for all the samples we have. If the app stops frame
production and then resumes we don't want to calculate the refresh
rate average across a different group of frames. This change enhances
the detection of when the app stops to produce a frame by looking at
the queue time of a frame if this frame doesn't have a timestamp.
Bug: 155710271
Test: Start an animation not driven by touch
Change-Id: Icef63a1ba86c1ad063592717115addd700e22cad
Some 32-bit kernels use a binder kernel interface with a different API
controlled by the kernel configuration CONFIG_ANDROID_BINDER_IPC_32BIT.
This changes builds versions of these tests built for this bitness
specially so that they can run and work on these devices.
Test: atest --all binderLibTest{,_IPC_32} binderDriverInterfaceTest{,_IPC_32}
Bug: 154755898
Change-Id: I82b47e8064564a037bf8ed453e9ae7b8901b5667