gralloc1: Changes to align to new ion api requirements

Update ion handling in gralloc to align to new ion api
requirements.
Based on compile time flag TARGET_ION_ABI_VERSION,
gralloc will call old ion api or new libion apis

Change-Id: I9905a6a6edade9bcd70fa6e20b5593a26d088457
CRs-Fixed: 2185970
diff --git a/libgralloc1/gr_allocator.cpp b/libgralloc1/gr_allocator.cpp
index 066ac34..6f57a98 100644
--- a/libgralloc1/gr_allocator.cpp
+++ b/libgralloc1/gr_allocator.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2018, The Linux Foundation. All rights reserved.
 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -49,6 +49,10 @@
 #define ION_FLAG_CP_CAMERA_PREVIEW 0
 #endif
 
+#ifndef ION_SECURE
+#define ION_SECURE ION_FLAG_SECURE
+#endif
+
 #ifdef MASTER_SIDE_CP
 #define CP_HEAP_ID ION_SECURE_HEAP_ID
 #define SD_HEAP_ID ION_SECURE_DISPLAY_HEAP_ID
@@ -137,9 +141,10 @@
   return -EINVAL;
 }
 
-int Allocator::CleanBuffer(void *base, unsigned int size, unsigned int offset, int handle, int op) {
+int Allocator::CleanBuffer(void *base, unsigned int size, unsigned int offset, int handle, int op,
+                           int fd) {
   if (ion_allocator_) {
-    return ion_allocator_->CleanBuffer(base, size, offset, handle, op);
+    return ion_allocator_->CleanBuffer(base, size, offset, handle, op, fd);
   }
 
   return -EINVAL;