summaryrefslogtreecommitdiff
path: root/jvmfwk/plugins
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2011-11-30 21:39:18 +0200
committerTor Lillqvist <tlillqvist@suse.com>2011-11-30 21:52:52 +0200
commit5510127e89d6971a219ce3664e4631d6c6dda2b1 (patch)
tree7e2d7d06892e086700d5b6bddc8a3ec99c476f6b /jvmfwk/plugins
parenta7fe1a0a088b2d3d68e3fc4b0d3e8d5a34f3e203 (diff)
Android code refactorig and hacking
Sorry for the large unstructured commit. But hey, the Android code is experimental so far. Extract the native lo-bootstrap code into a fairly normal library built in sal. (Previously it was the JNI part of the "Bootstrap" app.) Just linkink normally to liblo-bootstrap from C++ code that uses it works fine, no need to do a dlsym lookup. Bootstrap is still a subclass of NativeActivity and can thus still be used as an "app" (to start unit tests, or whatever), but can also be used from some other app's Java code to just get access to the lo-bootstrap native methods. Introduce a new top-level "module", android, for Bootstrap and the experiments with DocumentLoader. Note that the experimental DocumentLoader app still crashes. It can't create the com.sun.star.frame.Desktop instance. I spent lots of time debugging in the painfully inadequate ndk-gdb. (Even the newer gdb build from the "mingw-and-ndk" project is quite crappy in many ways.) I should really experiment with corresponding code on a normal platform first before even trying on Android. Basically, I think that if I just can get the concept of Java code that instantiates and uses LO components *in-process* working on a normal desktop platform, it should work on Android, too.
Diffstat (limited to 'jvmfwk/plugins')
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/makefile.mk3
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx10
2 files changed, 9 insertions, 4 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/makefile.mk b/jvmfwk/plugins/sunmajor/pluginlib/makefile.mk
index 78f1457e49d0..03c4f58e37d8 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/makefile.mk
+++ b/jvmfwk/plugins/sunmajor/pluginlib/makefile.mk
@@ -69,6 +69,9 @@ SHL1STDLIBS= \
$(SALHELPERLIB) \
$(SALLIB)
+.IF "$(OS)" == "ANDROID"
+SHL1STDLIBS+=-llo-bootstrap
+.ENDIF
.IF "$(GUI)" == "WNT"
.IF "$(COM)"!="GCC"
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 7a54b4452865..0af05d923087 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -64,6 +64,10 @@
#include "vendorlist.hxx"
#include "diagnostics.h"
+#ifdef ANDROID
+#include <lo-bootstrap.h>
+#endif
+
#if defined HAVE_VALGRIND_H
#include <valgrind.h>
#else
@@ -758,10 +762,8 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
(void) cOptions;
// On Android we always have a Java VM as we only expect this code
// to be run in an Android app anyway.
- struct JNIInvokeInterface* * (*lo_get_javavm)(void) = (struct JNIInvokeInterface* * (*)(void)) dlsym(RTLD_DEFAULT, "lo_get_javavm");
- fprintf(stderr, "Got lo_get_javavm = %p", lo_get_javavm);
- *ppVm = (JavaVM *) (*lo_get_javavm)();
- fprintf(stderr, "lo_get_javavm returns %p", (*lo_get_javavm)());
+ *ppVm = lo_get_javavm();
+ fprintf(stderr, "lo_get_javavm returns %p", *ppVm);
#endif
return errcode;