Merge "Restore the libsync __ANDROID_API__ guard" am: 7af64cbbbe
am: 9b97896a74

Change-Id: I3d6eaa76578e4ef11fbe2d0c08fb0f3d2066bf34
Cr-Mirrored-From: https://chromium.googlesource.com/aosp/platform/system/core
Cr-Mirrored-Commit: acd1f81dfe7d6812c8ba7bcc3ec84bfb041d63bb
diff --git a/include/ndk/sync.h b/include/ndk/sync.h
index 49f01e1..ba7d8c4 100644
--- a/include/ndk/sync.h
+++ b/include/ndk/sync.h
@@ -27,11 +27,14 @@
 #define ANDROID_SYNC_H
 
 #include <stdint.h>
+#include <sys/cdefs.h>
 
 #include <linux/sync_file.h>
 
 __BEGIN_DECLS
 
+#if __ANDROID_API__ >= 26
+
 /* Fences indicate the status of an asynchronous task. They are initially
  * in unsignaled state (0), and make a one-time transition to either signaled
  * (1) or error (< 0) state. A sync file is a collection of one or more fences;
@@ -88,6 +91,8 @@
 /** Free a struct sync_file_info structure */
 void sync_file_info_free(struct sync_file_info* info) __INTRODUCED_IN(26);
 
+#endif /* __ANDROID_API__ >= 26 */
+
 __END_DECLS
 
 #endif /* ANDROID_SYNC_H */