These functions were already exposed as part of libandroid_net,
but that is not really part of the NDK.
Expose them in libandroid as well, so apps can actually use them.
This is consistent with all the other native networking APIs,
which are exposed in both libandroid_net and libandroid.
Test: atest CtsNativeNetPlatformTestCases
Test: strings out/target/product/bramble/system/lib64/libandroid.so | grep android_tag
Change-Id: I2273cdd48b30a88b82eb3af838031d9fe8897442
The original java implementation just passed along whatever the server
returns which is -1 on unsupported devices. So do that here as well.
Test: PerformanceHintManagerTest passes on unsupported device
Bug: 194691581
Change-Id: I8ac07737e6ce52debf55478880d71f038f258056
Missed toXYZD50 usage last time. Still assume sRGB if null.
Bug: 187798471
Test: Manually tested setting color_space_ptr to null in
GL/VKFunctorDrawable
Change-Id: Idee2660d368dd55e45f5d07d52839105ba951ff3
isDataspaceValid is problematic in that it prevents
applications from being able to pass-through dataspaces
they receive from other APIs, and it also assumes that
the display's capabilities are the only things that are supported.
Although it's recommended that applications stick to dataspaces
that the display can handle, it's not strictly required. RenderEngine
can handle more dataspaces than the display can, applying appropriate
color conversion. Similarly this could be going to a virtual display
instead, in which case the physical display's capabilities are not
necessarily relevant.
Bug: 149931223
Test: make
Change-Id: I475f4e4dcbcdb4765670f6a8eb4cc047a9babb43
Also tweak how webview's plat_support creates the functor
sruct to be thread-safe, avoids any potential race conditions
even though WebView itself is stated to be thread-hostile in
general. It's too easy to have this just be defined-safe instead.
Bug: 186814981
Test: build & boot, no crashes in real-webview apps
Change-Id: I06f02a279e248fee375ce133c5ce9a2250665ad9
In order to simplify some of the geometry logic in BufferStateLayer,
and unify with the rest of the layer in SurfaceFlinger we translate the
concept of source and dest frame into crop, scale and position. This is
currently done on the client side.
But if there is buffer rotation transform, we will generate an
additional scale, to scale the buffer size to the new orientation. This
causes issues with rounded corners because the additional scale
stretches the rounded corner incorrectly. And translating the buffer
rotation into a rotation matrix affects child layers.
This solution only adjusts the buffer size based on the rotation
matrix and the scale is generated based on the rotated buffer.
This cannot be done in the client side because we do not have
the current display orientation to unflip the buffer if the client
sets the transformToDisplayInverse flag.
In the future the plan is to drive the transform hint and the
display orientation down from WM so this calculation can go
back to the client.
Also fixes incorrect additional scaling from source frame to dest frame
in ASurfaceTransaction_setGeometry.
Test: atest SurfaceControlTest ASurfaceControlTest libgui_test SurfaceFlinger_test
Test: go/wm-smoke
Bug: 185597146
Change-Id: I38adbc72c7567510c953cfd362a94b2b38d7fda7
When we call incStrong like this, it won't work if the
caller of ANativeWindow_fromSurface later calls
ANativeWindow_release and so we leak the reference indefinitely.
We change to call acquire so that the caller can call release.
Bug: 186190571
Test: Existing tests pass
Change-Id: I647a856923c891da2d305471f5ff84103d1f9ed5
When setFrame was removed, it required some changes to setGeometry.
However, this created some behavior changes between R and S. Modified
setGeometry to restore old behavior.
1. Destination can't have negative left and top. If negative values are
set, it will revert to (0,0,w,h)
2. If invalid source is set, an invalid rect for crop will be sent to SF
which would normally mean crop is ignored.
Test: ASurfaceControlTest
Bug: 185533162
Change-Id: I5c86da7327f97e82c63ae1f1c985829b8a4dbaef
The crop being sent to SF is in layer space where the setGeometry API is
getting buffer space crop. This breaks the API behavior so call
setBufferCrop instead of setCrop
Test: ASurfaceControlTest
Fixes: 186266903
Change-Id: I8f2567aa41b9525c3c3dc08855d14d8a9b11c7e2
Remove the vestigial llndk_library and replace it with properties
in the llndk clause of the implementation cc_library.
Bug: 170784825
Test: m checkbuild
Test: compare out/soong/build.ninja
Change-Id: I960d7592fc71482e547f3617d0e55503c36cb63a
Introduce a new callback for SurfaceControl transactions that
fire after we commit a transaction in SurfaceFlinger. This
will help some clients pace when they should apply the next
transaction so it get applied on the next vsync. If they wait for
the existing transaction complete callback, there may not be
enough time between when the client applies the transaction
and surface flinger waking up and apply it on the new vsync.
This would mean the update would arrive a frame late.
Bug: 185843251
Test: atest ASurfaceControlTest
Change-Id: If0d5d01a1d5c2029eb81667356e666d7297376d4
Updated setPosition, setCrop, setBufferTransform, and added setScale
to native SurfaceControl API. The new functions should be pass through
calls to SurfaceComposerClient that sends it to SurfaceFlinger.
Test: ASurfaceControlTest
Bug: 170765639
Change-Id: I214c5ae998d8f896200f3010cf2de6754d1e8510
(manual cherry-pick from AOSP to fix merge conflict)
Minimizing cost for using libbinder.
Bug: 183654927
Test: boot
Change-Id: I1a4785a58afcaf2d312ef52a07f41fe3dd3a8fa6
Revert "Remove setFrame from BufferStateLayer"
Revert "Update tests to reflect the new behavior for setGeometry"
Revert submission 13843937-sc_remove_set_frame
Reason for revert: Candidate CL for b/184807094
Reverted Changes:
Iffbd955a3:Remove setFrame
I27f17bc61:Update tests to reflect the new behavior for setGe...
I5720276c1:Remove setFrame from surface_control setGeometry
I32ee0e3e4:Remove setFrame from BufferStateLayer
Bug: 184807094
Change-Id: I7f6f0d7799e6e2858af2ce2e8acb5c67db8714f8
Expose the backpressure flag to NDK. See comment in
header file for extensive discussion.
Bug: 177458703
Test: Need new CTS
Change-Id: I97cdaef5d499f57a270972f001517b8a520aa2fe
Change the shouldBeSeamless parameter to an enum
in order to make the API easier to understand.
This changes
- SurfaceControl.setFrameRate
- Surface.setFrameRate
- ANativeWindow_setFrameRateWithChangeStrategy
- ASurfaceTransaction_setFrameRateWithChangeStrategy
Bug: 179116474
Test: atest SetFrameRateTest
Change-Id: I55265399238e2c95fbb90fd33a4c2513d1fc5cec
The API allows callers to control the default network that is used for
DNS hostname resolution.
Test: atest CtsNetTestCases
Tests in change I00143cafcd3eb1d71e8d5c7ea9c839a99dc6f4ce
Bug: 171540887
Change-Id: I42f0d9b17b3058f6e10fd2e651278b290f26667f
The API is the getter couterpart for setprocnetwork.
Use it in NetworkUtils so that the NDK API can be the source of truth
for the process network.
Bug: 171540887
Test: atest CtsNetTestCases
Tests in change I311b58585033c2ca50ce5477ea9cd94b6f127507
Change-Id: Ie8f68cf1fa57deddb63324c1abf3d6fd5b0ef500