Do not reinitialize system properties to fake their values

Reinitializing system properties can result in crashes later in the
program, and is generally not recommended or even supported.  Instead,
this change uses a very rudamentary approach to mocking out the system
property functions.

Bug: 62197783
Test: unit tests
Change-Id: I99c57e1d87490926e4839ee154c862ee8a199e26
diff --git a/include/nativehelper/JniInvocation.h b/include/nativehelper/JniInvocation.h
index fc2ed0a..58beec5 100644
--- a/include/nativehelper/JniInvocation.h
+++ b/include/nativehelper/JniInvocation.h
@@ -45,6 +45,8 @@
   static const char* GetLibrary(const char* library, char* buffer);
 
  private:
+  static const char* GetLibrary(const char* library, char* buffer, bool (*is_debuggable)(),
+                                int (*get_library_system_property)(char* buffer));
 
   bool FindSymbol(void** pointer, const char* symbol);
 
@@ -64,6 +66,8 @@
   friend jint JNI_GetDefaultJavaVMInitArgs(void* vm_args);
   friend jint JNI_CreateJavaVM(JavaVM** p_vm, JNIEnv** p_env, void* vm_args);
   friend jint JNI_GetCreatedJavaVMs(JavaVM** vms, jsize size, jsize* vm_count);
+  friend class JNIInvocation_Debuggable_Test;
+  friend class JNIInvocation_NonDebuggable_Test;
 };
 
 #endif  // JNI_INVOCATION_H_included