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>
* 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
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
* 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
-> [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
* 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
* When --style=file is specified, clang-format will look for a
.clang-format on file's parent dirs automatically
Change-Id: If94fe4915cd434b3f5901b8830cbdb90976ae4b7
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>
* * 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
* 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
This has been removed in frameworks/av commit
a03603523a5ec96c75153d39a2369c306f88fa70
but older vendor omx blobs still depend on it.
Change-Id: I49f7756a1fd3c76f650a1ae5c22053553c8cfd9d