Add the CheckIonSupport() API to the C Wrapper as well. am: b968e73649

Original change: https://android-review.googlesource.com/c/platform/system/memory/libdmabufheap/+/1706409

Change-Id: Ia5d9dc5535a8aa5463c279687816fce827842319
diff --git a/BufferAllocatorWrapper.cpp b/BufferAllocatorWrapper.cpp
index 6e2ebed..59bf08b 100644
--- a/BufferAllocatorWrapper.cpp
+++ b/BufferAllocatorWrapper.cpp
@@ -68,4 +68,8 @@
         return -EINVAL;
     return buffer_allocator->CpuSyncEnd(dmabuf_fd, sync_type, legacy_ion_cpu_sync, custom_data);
 }
+
+bool CheckIonSupport() {
+    return BufferAllocator::CheckIonSupport();
+}
 }
diff --git a/include/BufferAllocator/BufferAllocatorWrapper.h b/include/BufferAllocator/BufferAllocatorWrapper.h
index 5d62de6..b2e0903 100644
--- a/include/BufferAllocator/BufferAllocatorWrapper.h
+++ b/include/BufferAllocator/BufferAllocatorWrapper.h
@@ -49,6 +49,8 @@
                          SyncType sync_type, int (*legacy_ion_cpu_sync)(int, int, void*),
                          void* legacy_ion_custom_data);
 
+bool CheckIonSupport();
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/tests/dmabuf_heap_test.c b/tests/dmabuf_heap_test.c
index 55e6788..e61e0c3 100644
--- a/tests/dmabuf_heap_test.c
+++ b/tests/dmabuf_heap_test.c
@@ -143,6 +143,12 @@
 int main(int argc, char* argv[]) {
     (void)argc;
     (void)argv;
+
+    if (CheckIonSupport())
+        printf("ION support detected\n");
+    else
+        printf("No ION support detected\n");
+
     custom_callback_data data = {.a = 1, .b = 2};
     printf("*****running with custom legacy ion cpu sync callback, with custom data****\n");
     libdmabufheaptest(true, &data);