Provide access to the Java VM on Android
authorMikko Rasa <tdb@tdb.fi>
Sun, 31 Jan 2016 15:20:54 +0000 (17:20 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 31 Jan 2016 15:20:54 +0000 (17:20 +0200)
source/core/android/mainthread.cpp
source/core/android/mainthread.h

index 255eaa3260b892f43ae5d69eb670340b6a487120..8ce484a0dee75e4a014a7440d2775c891fbe18a3 100644 (file)
@@ -51,6 +51,14 @@ void MainThread::resume_startup()
        }
 }
 
+JavaVM *MainThread::get_java_vm() const
+{
+       if(!activity)
+               return 0;
+
+       return activity->vm;
+}
+
 void MainThread::set_window_flags(unsigned set, unsigned clear)
 {
        ANativeActivity_setWindowFlags(activity, set, clear);
index 22309eee3d3d2ca47584573210ebb7a8935f7234..609300fb85a8a4db64e680c9f4dfd7f754d78bc4 100644 (file)
@@ -34,6 +34,7 @@ public:
        void wait_for_app_created();
        void resume_startup();
 
+       JavaVM *get_java_vm() const;
        AAssetManager *get_asset_manager() const { return asset_manager; }
        const FS::Path &get_internal_data_path() const { return int_data_path; }