aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcodeworkx <daniel.hillenbrand@codeworkx.de>2017-01-27 21:55:55 +0100
committerBenjamin Legrand <android@legrand.ws>2017-09-19 15:30:24 +0200
commit7fcb3c382df66ead62bd57970099be7eb1e07d2a (patch)
tree7fac4b7f0f963fab872e5cf6c8456f65e3eb07dc
parented0bddaf13bbe73cc74f6f64d4e3fbe55fa6469a (diff)
A6020: add shim for IMS
This is a mix of various commits https://github.com/yu-community-os/android_vendor_volte/commit/e3f4c1e23d56600e34f46da63d1c232b77f7f422 https://review.lineageos.org/#/c/190340/ Change-Id: I595575b3f4f17fe073fb525f73e7b150fdfecd6c
-rw-r--r--libshims/Android.mk9
-rw-r--r--libshims/ICameraClient.cpp32
-rw-r--r--libshims/MediaBuffer.cpp76
-rwxr-xr-xrootdir/etc/init.qcom.rc2
4 files changed, 118 insertions, 1 deletions
diff --git a/libshims/Android.mk b/libshims/Android.mk
index deae7c0..7af6701 100644
--- a/libshims/Android.mk
+++ b/libshims/Android.mk
@@ -48,3 +48,12 @@ LOCAL_SRC_FILES := rild_socket.c
LOCAL_MODULE := rild_socket
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
+
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := MediaBuffer.cpp
+LOCAL_SHARED_LIBRARIES := libstagefright_foundation libui libgui
+LOCAL_CFLAGS := -Wno-unused-private-field
+LOCAL_MODULE := libshims_ims
+LOCAL_MODULE_TAGS := optional
+include $(BUILD_SHARED_LIBRARY)
diff --git a/libshims/ICameraClient.cpp b/libshims/ICameraClient.cpp
new file mode 100644
index 0000000..6e583e1
--- /dev/null
+++ b/libshims/ICameraClient.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2015 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdlib.h>
+#include <utils/Errors.h>
+
+namespace android {
+
+extern "C" {
+
+#ifdef __aarch64__
+status_t _ZNK7android13ICameraClient22getInterfaceDescriptorEv(const char16_t* str, size_t len);
+
+status_t _ZNK7android13ICameraClient22getInterfaceDescriptorEv(const char16_t* str, size_t len) {
+ return _ZNK7android13ICameraClient22getInterfaceDescriptorEv(str, len);
+}
+#endif
+}
+};
diff --git a/libshims/MediaBuffer.cpp b/libshims/MediaBuffer.cpp
new file mode 100644
index 0000000..41dec03
--- /dev/null
+++ b/libshims/MediaBuffer.cpp
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2016 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <ui/GraphicBuffer.h>
+#include <media/stagefright/MediaBuffer.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#if defined(__LP64__)
+extern void _ZN7android13GraphicBufferC1EPK13native_handleNS0_16HandleWrapMethodEjjijmj(
+ void *self, const native_handle_t* handle,
+ android::GraphicBuffer::HandleWrapMethod method,
+ uint32_t width, uint32_t height, android::PixelFormat format,
+ uint32_t layerCount, uint64_t usage, uint32_t stride);
+
+void _ZN7android13GraphicBufferC1EP19ANativeWindowBufferb(
+ void *self, ANativeWindowBuffer* buffer, bool keepOwnership)
+{
+ _ZN7android13GraphicBufferC1EPK13native_handleNS0_16HandleWrapMethodEjjijmj(
+ self, buffer->handle,
+ keepOwnership ? android::GraphicBuffer::TAKE_HANDLE : android::GraphicBuffer::WRAP_HANDLE,
+ buffer->width, buffer->height, buffer->format, (uint32_t)buffer->layerCount,
+ buffer->usage, buffer->stride);
+}
+#else
+extern void _ZN7android13GraphicBufferC1EPK13native_handleNS0_16HandleWrapMethodEjjijyj(
+ void *self, const native_handle_t* handle,
+ android::GraphicBuffer::HandleWrapMethod method,
+ uint32_t width, uint32_t height, android::PixelFormat format,
+ uint32_t layerCount, uint64_t usage, uint32_t stride);
+
+void _ZN7android13GraphicBufferC1EP19ANativeWindowBufferb(
+ void *self, ANativeWindowBuffer* buffer, bool keepOwnership)
+{
+ _ZN7android13GraphicBufferC1EPK13native_handleNS0_16HandleWrapMethodEjjijyj(
+ self, buffer->handle,
+ keepOwnership ? android::GraphicBuffer::TAKE_HANDLE : android::GraphicBuffer::WRAP_HANDLE,
+ buffer->width, buffer->height, buffer->format, buffer->layerCount,
+ buffer->usage, buffer->stride);
+}
+#endif
+
+extern void _ZN7android11BufferQueue17createBufferQueueEPNS_2spINS_22IGraphicBufferProducerEEEPNS1_INS_22IGraphicBufferConsumerEEEb(
+ void* outProducer, void* outConsumer, bool consumerIsSurfaceFlinger);
+
+void _ZN7android11BufferQueue17createBufferQueueEPNS_2spINS_22IGraphicBufferProducerEEEPNS1_INS_22IGraphicBufferConsumerEEERKNS1_INS_19IGraphicBufferAllocEEE(
+ void* outProducer, void* outConsumer, void* allocator __unused, bool consumerIsSurfaceFlinger)
+{
+ _ZN7android11BufferQueue17createBufferQueueEPNS_2spINS_22IGraphicBufferProducerEEEPNS1_INS_22IGraphicBufferConsumerEEEb(
+ outProducer, outConsumer, consumerIsSurfaceFlinger);
+}
+
+int _ZNK7android11MediaBuffer8refcountEv(android::MediaBuffer *self)
+{
+ return self->refcount();
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc
index d7ad4fc..91837f5 100755
--- a/rootdir/etc/init.qcom.rc
+++ b/rootdir/etc/init.qcom.rc
@@ -46,7 +46,7 @@ on init
# Set permissions for persist partition
mkdir /persist 0771 system system
- export LD_SHIM_LIBS /system/lib64/libril.so|libshim_ril.so:/system/vendor/lib/libmmcamera2_stats_modules.so|libshim_gui.so:/system/vendor/lib/libmmcamera2_stats_modules.so|libshim_atomic.so:/system/lib/hw/camera.vendor.msm8916.so|libshim_atomic.so:/system/lib/libmmjpeg_interface.so|libshim_atomic.so:/system/vendor/lib64/libril-qc-qmi-1.so|rild_socket.so
+ export LD_SHIM_LIBS /system/lib64/libril.so|libshim_ril.so:/system/vendor/lib/libmmcamera2_stats_modules.so|libshim_gui.so:/system/vendor/lib/libmmcamera2_stats_modules.so|libshim_atomic.so:/system/lib/hw/camera.vendor.msm8916.so|libshim_atomic.so:/system/lib/libmmjpeg_interface.so|libshim_atomic.so:/system/vendor/lib64/libril-qc-qmi-1.so|rild_socket.so:/system/vendor/lib64/lib-imsvt.so|libshims_ims.so
# Enable power-on alarm
write /sys/module/qpnp_rtc/parameters/poweron_alarm 1