compat: Add some HIDL interfaces types shims

* toString is a static function, do some magic to export it to the
  vtable

Change-Id: Iae53ef6e9c02c526218ae8b8de981130473b9f67
This commit is contained in:
R0rt1z2 2023-07-17 16:16:11 +02:00 committed by Sebastiano Barezzi
parent ca34347089
commit 844cbbb2d3
No known key found for this signature in database
GPG key ID: 763BD3AE91A7A13F
3 changed files with 55 additions and 0 deletions

View file

@ -200,6 +200,22 @@ cc_library_shared {
vendor_available: true,
}
cc_library_shared {
name: "android.hardware.graphics.common@1.0_types",
srcs: ["interfaces/graphics/common/1.0/types.cpp"],
shared_libs: ["android.hardware.graphics.common@1.0"],
system_ext_specific: true,
vendor_available: true,
}
cc_library_shared {
name: "android.hardware.radio@1.0_types",
srcs: ["interfaces/radio/1.0/types.cpp"],
shared_libs: ["android.hardware.radio@1.0"],
system_ext_specific: true,
vendor_available: true,
}
cc_library_shared {
name: "android.hidl.base@1.0",
shared_libs: ["libhidlbase"],

View file

@ -0,0 +1,16 @@
/*
* Copyright (C) 2023 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <android/hardware/graphics/common/1.0/types.h>
using android::hardware::graphics::common::V1_0::PixelFormat;
using android::hardware::graphics::common::V1_0::toString;
std::string toStringNotInlined(PixelFormat format) asm(
"_ZN7android8hardware8graphics6common4V1_08toStringENS3_11PixelFormatE");
std::string toStringNotInlined(PixelFormat format) {
return toString(format);
}

View file

@ -0,0 +1,23 @@
/*
* Copyright (C) 2023 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <android/hardware/radio/1.0/types.h>
using android::hardware::radio::V1_0::CallState;
using android::hardware::radio::V1_0::PersoSubstate;
using android::hardware::radio::V1_0::toString;
std::string toStringNotInlined(CallState state) asm(
"_ZN7android8hardware5radio4V1_08toStringENS2_9CallStateE");
std::string toStringNotInlined(CallState state) {
return toString(state);
}
std::string toStringNotInlined(PersoSubstate state) asm(
"_ZN7android8hardware5radio4V1_08toStringENS2_13PersoSubstateE");
std::string toStringNotInlined(PersoSubstate state) {
return toString(state);
}