[Base] GetAndroidThreadJniEnv capitals, move JNI usage tips there

This commit is contained in:
Triang3l
2022-02-01 21:33:20 +03:00
parent 009f709ad4
commit c6fc8f706a
4 changed files with 14 additions and 13 deletions

View File

@@ -38,9 +38,18 @@ void ShutdownAndroidAppFromMainThread();
// configuration.
int32_t GetAndroidApiLevel();
// Useful notes about JNI usage on Android within Xenia:
// - All static libraries defining JNI native functions must be linked to shared
// libraries via LOCAL_WHOLE_STATIC_LIBRARIES.
// - If method or field IDs are cached, a global reference to the class needs to
// be held - it prevents the class from being unloaded by the class loaders
// (in a way that would make the IDs invalid when it's reloaded).
// - GetStringUTFChars (UTF-8) returns null-terminated strings, GetStringChars
// (UTF-16) does not.
// May return null if not in a Java VM process, or in case of a failure to
// attach on a non-main thread.
JNIEnv* GetAndroidThreadJNIEnv();
JNIEnv* GetAndroidThreadJniEnv();
// Returns the global reference if in an application context, or null otherwise.
// This is the application context, not the activity one, because multiple
// activities may be running in one process.