Remove toStringArray from libnativehelper_api.h

Bug: 151443957
Test: m
Change-Id: Ie94e8ffb5e5aeb600102014413421d9c50e4fc29
diff --git a/include/nativehelper/libnativehelper_api.h b/include/nativehelper/libnativehelper_api.h
index a38d1a9..92756a1 100644
--- a/include/nativehelper/libnativehelper_api.h
+++ b/include/nativehelper/libnativehelper_api.h
@@ -166,7 +166,7 @@
  * Returns a new array on success or nullptr in case of failure. This method raises an
  * OutOfMemoryError exception if allocation fails.
  */
-jobjectArray jniCreateStringArray(JNIEnv* env, size_t count);
+jobjectArray jniCreateStringArray(C_JNIEnv* env, size_t count);
 
 /*
  * Log a message and an exception.
@@ -237,17 +237,6 @@
  */
 const char* JniInvocationGetLibrary(const char* library, char* buffer);
 
-/* ---------------------------------- C API for toStringArray.h --------------------------------- */
-
-/*
- * Converts an array of C strings into a managed array of Java strings. The size of the C array is
- * determined by the presence of a final element containing a nullptr.
- *
- * Returns a new array on success or nullptr in case of failure. This method raises an
- * OutOfMemoryError exception if allocation fails.
- */
-jobjectArray toStringArray(JNIEnv* env, const char* const* strings);
-
 #ifdef __cplusplus
 }
 #endif  // __cplusplus
diff --git a/include/nativehelper/toStringArray.h b/include/nativehelper/toStringArray.h
index 80ea797..df53b19 100644
--- a/include/nativehelper/toStringArray.h
+++ b/include/nativehelper/toStringArray.h
@@ -27,7 +27,7 @@
 
 template <typename StringVisitor>
 jobjectArray toStringArray(JNIEnv* env, size_t count, StringVisitor&& visitor) {
-    jobjectArray result = jniCreateStringArray(env, count);
+    jobjectArray result = jniCreateStringArray(static_cast<C_JNIEnv*>(&env->functions), count);
     if (result == nullptr) {
         return nullptr;
     }