Commit graph

55 commits

Author SHA1 Message Date
Sebastiano Barezzi
543ade588a compat: interfaces: backend: radio: config: Use a macro to declare the libs
Change-Id: I03251612315270d15474b740078ada17e17e522d
2024-05-06 18:05:22 +00:00
R0rt1z2
00551f44d6
compat: Add camera provider shim
* Namespace V1_0::helper has been deprecated in [1]. Wrap old symbols to
  accommodate this change.

[1] I8c3160497c1e2fe7a0a7155641f0e1f5e47ec32e

Change-Id: I4c9094add5c2484fd00b04e6236ba86ac693dbfd
2024-05-04 19:12:07 +02:00
Yumi Yukimura
201615cf7c compat: Add android.hardware.radio.c_shim@1.{0..3}
* They're copied from `android.hardware.radio.config@1.{0..3}.so`,
  renamed to `android.hardware.radio.c_shim@1.{0..3}.so`, and
  hexedited hidl interface descriptor to
  `lineage.hardware.radio.config@1.{0..3}::IRadioConfig`
* For making stock RIL service register radio.config service to
  `lineage.hardware.radio.config` interface instead, so that we can
  add a wrapper that registers to `android.hardware.radio.config`
* Example usage on extract-files.sh:
```
        vendor/lib64/libril-qc-hal-qmi.so)
            for v in 1.{0..2}; do
                sed -i "s|android.hardware.radio.config@${v}.so|android.hardware.radio.c_shim@${v}.so|g" "${2}"
            done
            ;;
```

Change-Id: Ie8c48c0164c1787c851d4b3c0ccd334e0d405cd4
2024-03-28 06:12:21 +08:00
basamaryan
1522a475d9
compat: Drop libprotobuf-cpp-lite-3.9.1-vendorcompat
The prebuilt exists in prebuilts/misc as of QPR2 e50c7362ef

Change-Id: Ia5fbb4b41ccae255f2de3230bb84a0a3fcccdf20
2024-03-20 01:26:59 -04:00
LuK1337
353e696c1b
compat: Provide libcrypto-v33
Copied from prebuilts/vndk/v33/arm64/*/shared/vndk-core and changed
SONAME using the following command:
* patchelf-0_9 --set-soname libcrypto-v33.so libcrypto-v33.so

Change-Id: I545f58b4119f735385fa0f389ef87c6e9d2c100e
2024-03-18 18:21:01 +01:00
Michael Bestas
ba33c37b07
libprotobuf-cpp-lite-3.9.1-vendorcompat: Fix build for x86/x86_64 targets
Change-Id: I2bebcbc93edb0695095a8bced405c11ac52d953e
2023-11-22 16:35:11 +02:00
LuK1337
6c54b85fa8 libhidlbase: Add SPDX license
Change-Id: Ic5cc6616bc2b7ca45f7ad2bca25fa494650a69b7
2023-11-13 13:19:56 +01:00
LuK1337
23f094c484 libhidlbase: Run clang format
Change-Id: I8bff92f14ae582e4208a7b3e5c4aaec28a883b76
2023-11-12 16:13:29 +01:00
Bruno Martins
770258c025 compat: Provide libprotobuf-cpp vendorcompat prebuilts from v29 VNDK
Android moved to a versioned approach in R and vendorcompat libs were
still possible to build, but not anymore with the Android U release.

Change-Id: Ibe06bf8d22ab0ce24ac5d5d9f3394b8593ee46cb
2023-11-10 15:57:30 +00:00
Dominik Baronelli
25a12c76a8 compat: libhidlbase: add shim for missing constructor map symbol
gBn/sConstructorMap symbols were removed from libhidl:
- https://android.googlesource.com/platform/system/libhidl/+/e29b2ad

However, some prebuilts still make use of them.

In some cases, for example when using GSI, libhidl can not be patched
directly, which requires modifying affected blobs to depend on this shim
library.

Change-Id: I097c75ac210a9c3f50a9725da0b910d819c85b9a
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2023-11-04 15:12:56 +00:00
LuK1337
e8f0e4b7a0 compat: Add libprotobuf-cpp-lite-3.9.1-vendorcompat
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
Change-Id: I5e3a64036907ee5d8495333de2da6bb93f295730
2023-10-10 01:16:00 +02:00
bengris32
015d90baa5 libbase: Shim old StartsWith function prototype
* The str parameter StartsWith function in libbase got changed
  from std::string to std::string_view in later android versions [1].

* Create a shim that provides the older StartsWith function.

[1]: ef973cee17

Change-Id: I116a32a739d6fa34ecc0d1a4acf8b2e3756910ea
2023-10-03 08:31:35 +00:00
R0rt1z2
d549dba0e3 compat: Add GNSS interface type shim
Change-Id: I2c1afc2be03871efb391a65ae775f2f4632a5731
2023-09-25 16:58:58 +00:00
Sebastiano Barezzi
aea5a5fba5 compat: Add libsensor -> libsensorndkbridge wrapper
Change-Id: I62c27463af385dc791dde64731a39e9ebadfd587
2023-09-25 16:58:58 +00:00
me-cafebabe
ac25b3eb52 compat: libc: Convert to Android.bp
While we're at it:
* Rename to libc_*_shim
* Move the source files to /libc/

Change-Id: I7eb08ae8ab7ff5349814d4475ab08fcfc95e8854
2023-09-25 16:58:50 +00:00
Nich
ca8a75680f compat: libc: Add pthread_mutex_destroy hack for camera
In Pie, Google added checks to prevent destroying of the same mutexes
consecutively, and aborts the program on fortify fatal call.

Our camera blobs trigger this check when tearing down an ISP session,
destroying the same mutex consecutively by adding a destroy instruction
in a loop. This causes the whole daemon to crash and fail.

(Specifically, the violating instructions were from isp_module_stop_session
and when isp_module_start_session fails to create a thread.)

Workaround the issue by shimming the function; catching destroyed
mutexes and returning -EBUSY without passing on the bad mutexes to libc.

Change-Id: I4f8542a496dc25c53f8208a647cc0d6acc8662eb
2023-09-25 16:58:50 +00:00
Nich
ae85aa2b64 compat: libc: Trim down pthread_cond_timedwait hack
Change-Id: Ie53c8358dd0fd3d05c56353d3b388467d082241c
2023-09-25 16:58:50 +00:00
Nich
5c6ed67f4e compat: libc: compile shim with GCC again..
Change-Id: Ib4f5f8874919554493b67a3467aee8a32daf5486
2023-09-25 16:58:50 +00:00
Nich
53e071b8d3 compat: libc: Specific naming of libc shim library
* The shim is only used for converting timespecs, rename the shim lib
   to suggest such.
 * Build it with Clang since it doesn't break anything.

Change-Id: I8cfed10b73655f9aa1f4780dffc5106347441c3e
2023-09-25 16:58:50 +00:00
Nich
33327b651f compat: libc: Bring libc hax inline with the latest sources
-> [1] added tests to ensure nano timespecs are below 1000000000
-> Legacy blobs before N were able to use tv_nsec > 100000000
-> One such example would be our libmmcamera2_sensor_modules.so, which
have instances of timeouts of 5000000000 nsecs.
-> The previous workaround was to shim the old libc functions to
skip these tests, but that was really ugly since we leave out bug fixes
and security patches introduced from MM up till Oreo.
-> Current workaround is applied on the latest bionic code by correcting
the invalid timespecs, taking out each second from tv_nsec, and then
adding them to tv_sec, until tv_nsec goes below 1 second.
-> Due to bionic's tight security, we've got no choice but to copy-paste
its functions here.

[1]: https://android.googlesource.com/platform/bionic/+/c9a659c

Change-Id: I271f2899db54a252d0d2a018cf4eb7877b97a02a
2023-09-25 16:58:50 +00:00
Arne Coucheron
3825e72a3c compat: libc: Transition to OSS libc shim
Change-Id: I607a6016bb3e290713b0faa10c6ee2f875d61158
2023-09-25 16:58:50 +00:00
Alessandro Astone
bfad08e532 compat: Add libcomparetf2 shim
Provide __lttf2 to various blobs

Change-Id: Idb8309fcdc969e9954f0b8b4ca7a39ab261e64de
2023-09-18 15:33:36 +00:00
Sebastiano Barezzi
07607db7a4
libui: Move to system_ext
* No functional changes, but system should only contain AOSP files

Change-Id: I99392905acabcdc294b5b4fd9cd867b9bdcf156d
2023-07-19 21:35:26 +02:00
R0rt1z2
118bd4294f
compat: Add libutils shim
* This is required because some old libraries still rely on the
  strncpy16() function.

Change-Id: I77da329d1296d946f43ffe6708444b1d25607342
2023-07-19 21:32:21 +02:00
R0rt1z2
895a614971 compat: Provide shim with IPermissionController stubs
* All the IPermissionController related functions are guarded by
  `if !defined(__ANDROID_VNDK__)` [1], meaning they're not fully
  accessible to vendors.

* Since we know these are mainly used to check whether an app or
  process has a required permission, simply provide an stub that
  returns true no matter what the permission / caller are.

- [1]: https://github.com/LineageOS/android_frameworks_native/blob/lineage-20.0/libs/binder/IServiceManager.cpp#L170

Change-Id: I898bf8eb577faecb8bc0f007498b835816dddb93
2023-07-18 18:10:41 +00:00
Sebastiano Barezzi
5c54e69ef0
compat: Add libtinyxml2 shim
Change-Id: I2bc7963086f7f5df453e135819ed8b28c4d6a0d5
2023-07-18 12:10:42 +02:00
R0rt1z2
844cbbb2d3
compat: Add some HIDL interfaces types shims
* toString is a static function, do some magic to export it to the
  vtable

Change-Id: Iae53ef6e9c02c526218ae8b8de981130473b9f67
2023-07-17 21:53:55 +02:00
Sebastiano Barezzi
ca34347089
compat: Keep only one copy of clang-format style
* When --style=file is specified, clang-format will look for a
  .clang-format on file's parent dirs automatically

Change-Id: If94fe4915cd434b3f5901b8830cbdb90976ae4b7
2023-07-17 20:51:56 +02:00
R0rt1z2
efa7303881
libui: Add android::GraphicBufferMapper::lock shims
Change-Id: I9f4da2bb1260d53ec4bb6604a89e78c495ad539a
2023-07-17 20:51:56 +02:00
Sebastiano Barezzi
6be2ac19ee
libui: Move every symbol under extern C block
Change-Id: I19370532134f3ff84759177a1d6adcbd9da10a8d
2023-07-17 20:51:56 +02:00
Sebastiano Barezzi
2318cd6f47
libui: Fix android::GraphicBuffer::lock return value
Change-Id: I2c439c74d594959f1612c672ac685388a5386d4d
2023-07-17 20:51:56 +02:00
Ivan Vecera
d67ae54f8e compat: Fix ABI issues
Several constructor shims are implemented incorrectly because
they completely ignore the fact that constructors have 'this-call'
calling convention and should pass 'this ptr' as the first argument [1]
as well as its return value, at least according ARM ABI [2].

Additionally android::SurfaceComposerClient::Transaction::apply(bool)
shim has void return value instead of status_t so the caller retrieves
random value.

[1] https://review.lineageos.org/c/LineageOS/android_device_xiaomi_sdm710-common/+/360011/comments/eb6600df_3e2fb434
[2] 617079d8a0/cppabi32/cppabi32.rst (L576)

Change-Id: I7b14b5d3ca6008c1e4b3f5fcbaece5021b3cbb82
Signed-off-by: Ivan Vecera <ivan@cera.cz>
2023-06-26 15:20:07 +02:00
LuK1337
e386376f9c
compat: Add libcamera_metadata shim for stripping out system camera cap
Change-Id: I8f7772fc9ec15a00c4b630866aa7fc162a52c1aa
2022-11-25 22:27:26 +02:00
Nolen Johnson
e4fbaa32d3 compat: Provide a libip_checksum shim
* * In Android T, AOSP moved `libnetutils` to an APEX that is inaccessible
  to the vendor namespace - and it can't be built to vendor in any
  treble-compliant way.

* Our `wfc-pkt-router` blob lives on vendor, and relies on `libnetutils.so`.

* Upon further analysis, we only reply on a few checksum related functions,
  such as the symbol `ipv4_pseudo_header_checksum`, which lives in the (now)
  staticly included dependency of `libnetutils.so`, `libip_checksum`.

* To work around this, we enabled building `libip_checksum` as a stand-alone
  vendor_available library called `libip_checksum_shim.so`, and `patchelf`
  `wfc-pkt-router` to depend on `libipp_checksum_shim.so`.

Change-Id: I7dff9ec6c8ff146f6090e9519ece7844b4a057eb
2022-11-10 15:19:21 -05:00
Nolen Johnson
f25f2ec083 compat: libcutils_shim: Make it vendor_available
Change-Id: I9796ab3db63988837e843105ebec93cc27a6c194
2022-11-03 00:13:35 -04:00
Michael Bestas
ce8f7cfed4
libgui: Add SurfaceComposerClient shim
Change-Id: Ie0ce6a17cebd079584a3121524eb79bf64a88df3
2022-11-02 04:25:13 +02:00
Nolen Johnson
fd79adbaeb compat: libui_shim: Allow building 32-bit versions
* msm8998 camera stacks need this.

Change-Id: I87b69209bf73120e11d7d5c3b686d3b0a989abb9
2022-11-02 01:01:32 +01:00
Nolen Johnson
eb2e7226b8 compat: libui_shim: Make vendor available
* msm8998 camera stacks need this.

Change-Id: I5046eab287e3f14f024cd88293dfe4c5279f6667
2022-11-02 02:01:26 +02:00
Arian
861345fd7f compat: libpiex_shim: Improve shim
Change-Id: Id11965102d7d5dce50f989c99810cda6a43aa1ec
2022-11-01 10:35:17 +00:00
daniml3
b6e1983240
compat: Add GetPreviewImageData shim for camera
Signed-off-by: daniml3 <daniel@danielml.dev>
Change-Id: Iad9d37b992775b6d7b9b52ed4637c70fd13ede7f
2022-11-01 15:23:42 +05:30
Ethan Chen
f0f1e67f41 compat: Add shim for Fence destructor
* This was replaced with a default destructor which has no visible
  linkage. No-op the destructor call and hope the actual destructor is
  called from underneath.

Change-Id: Id039e916c24959e9f60391bc10886df878f4d265
2022-10-27 17:21:16 +01:00
Ethan Chen
e2f889da0b compat: Add shim for libbase LogMessage functions
Change-Id: I4d1db75e5407586c9b69d94803af0ef9a9a91037
2022-10-19 11:40:51 +02:00
Nolen Johnson
51e834f21f libcutils_shim: jstring: Import strcpy8to16 definition
Change-Id: Ieb1d53d667aafa333dc2b846f81bf3c51f854cd1
2022-09-21 13:10:09 -04:00
LuK1337
c3f51682eb libgui/libui: Switch to SPDX license identifiers
Change-Id: Iaf4cbd3ea8cdbf74bff42466a51f81af88b82c81
2022-09-21 18:20:58 +02:00
LuK1337
8c9cff232b libgui/libui: Add and run clang-format
Change-Id: I34ad46b99904e48be1a273486a42e0dc7edea48f
2022-09-21 18:19:26 +02:00
LuK1337
039f81353b libgui: Remove namespace android
Change-Id: I8cb93369d22ffc2fb61f58c570580b8c19898bfd
2022-09-21 18:19:26 +02:00
LuK1337
edf122ea20 Add missing commas to Android.bp
Change-Id: I5ebb4758e4609fcb971a3d507829f0bc91db8dcd
2022-09-21 18:19:26 +02:00
Nolen Johnson
12973d5ad4 Provide a shim for libui
Co-authored-by: Erfan Abdi <erfangplus@gmail.com>
Co-authored-by: Quallenauge <Hamsi2k@freenet.de>
Change-Id: I27d511340f0f2497bbeb2b046c18b66606610040
2022-09-21 16:42:55 +01:00
Jan Altensen
20c7906710 Provide shim for android_memset32
* memset32.S and android_memset.S taken from Q where this still existed.

Change-Id: Iaf59389e32b87d181f6dccc34e9174da25171f4f
2022-09-21 16:26:12 +01:00
dianlujitao
004fc53230 Provide shim for libcutils strdup8to16/strdup16to8
Co-authored-by: Demon000 <demonsingur@gmail.com>
Co-authored-by: Arian <arian.kulmer@web.de>
Change-Id: Ic5d732f3e98ba45c886db9646d6ef30eb0d42bf4
2022-09-21 16:25:02 +01:00