Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
surface_control: Replace C++ constructs with C-compatible code
This header currently cannot be processed by a C compiler as it contains C++ patterns, which prevent us from generating bindings in the [Rust `ndk-sys` crate]. This was originally reported at https://github.com/ android/ndk/issues/1920. The compatibility changes are as follows: - Remove `= -1` default-argument; - Suffix `ADataSpace` usage with `enum` tag. A word of warning: other bindings take this as an `int`, which is less descriptive. What is correct for these APIs, and can we unify it?; - Replace `&` references with `*` pointers, and marked them as `_Nonnull`. Confusingly lots of headers and functions here are lacking `_Nonnull`/`_Nullable` annotations, making our mapping "job" in Rust pretty terrible. Some improvements to the bindings: - Make HDR metadata struct pointers `const` as they are only used for reading; - Remove the duplicate `Available since API level 34.` on `ASurfaceTransaction_setExtendedRangeBrightness()` that was introduced in the wrong place in I62df5447bc547be52f6b00fedf1006c8d66a5faf, and later added again _after_ the parameter list in I8bebb31f0bd38e36139026a539030e5b61b75b4c. Note that the other notions _above_ the parameter list (also added by the first linked change) are kept; - Fix a typo reference to `SurfaceControlStats` as reported in [comment 14]. [Rust `ndk-sys` crate]: https://github.com/rust-mobile/ndk [comment 14]: https://issuetracker.google.com/issues/300602767#comment14 Change-Id: I9186df4abe7cb8246b2d10c1b41ab13664bad3ec Signed-off-by: Marijn Suijten <[email protected]>
- Loading branch information