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:
parent
ca34347089
commit
844cbbb2d3
3 changed files with 55 additions and 0 deletions
16
Android.bp
16
Android.bp
|
@ -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"],
|
||||
|
|
16
interfaces/graphics/common/1.0/types.cpp
Normal file
16
interfaces/graphics/common/1.0/types.cpp
Normal 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);
|
||||
}
|
23
interfaces/radio/1.0/types.cpp
Normal file
23
interfaces/radio/1.0/types.cpp
Normal 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);
|
||||
}
|
Loading…
Reference in a new issue