Hide __system_property_add/update, deprecate find_nth

These functions are supposed to be used only by the
property service.

__system_property_find_nth is deprecated and no longer part
of NDK. Call to this function will result in abort for apps
targeting Android O.

Bug: http://b/34114501
Test: bionic-unit-tests --gtest_filter=prop*
Change-Id: I9846965bf248e2ddf45cd7b293618245bbd87145
diff --git a/libc/bionic/system_properties.cpp b/libc/bionic/system_properties.cpp
index 0f68431..06173a8 100644
--- a/libc/bionic/system_properties.cpp
+++ b/libc/bionic/system_properties.cpp
@@ -56,6 +56,7 @@
 #include "private/bionic_futex.h"
 #include "private/bionic_lock.h"
 #include "private/bionic_macros.h"
+#include "private/bionic_sdk_version.h"
 #include "private/libc_logging.h"
 
 static const char property_service_socket[] = "/dev/socket/" PROP_SERVICE_NAME;
@@ -1265,6 +1266,11 @@
 
 const prop_info *__system_property_find_nth(unsigned n)
 {
+    if (bionic_get_application_target_sdk_version() >= __ANDROID_API_O__) {
+      __libc_fatal("__system_property_find_nth is not supported since Android O,"
+                   " please use __system_property_foreach instead.");
+    }
+
     find_nth_cookie cookie(n);
 
     const int err = __system_property_foreach(find_nth_fn, &cookie);