summaryrefslogtreecommitdiff
path: root/sal/osl/unx/file.cxx
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 /sal/osl/unx/file.cxx
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 'sal/osl/unx/file.cxx')
-rw-r--r--sal/osl/unx/file.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index ccc87e3ed7b7..1bf76a81f08e 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -56,6 +56,10 @@
#endif /* MACOSX */
+#ifdef ANDROID
+#include <lo-bootstrap.h>
+#endif
+
#ifdef DEBUG_OSL_FILE
# define OSL_FILE_TRACE osl_trace
# define PERROR( a, b ) perror( a ); fprintf( stderr, b )
@@ -917,8 +921,7 @@ SAL_CALL osl_openFile( rtl_uString* ustrFileURL, oslFileHandle* pHandle, sal_uIn
{
void *address;
size_t size;
- void *(*lo_apkentry)(const char *, size_t *) = (void *(*)(const char *, size_t *)) dlsym(RTLD_DEFAULT, "lo_apkentry");
- address = (*lo_apkentry)(buffer, &size);
+ address = lo_apkentry(buffer, &size);
return osl_openMemoryAsFile(address, size, pHandle);
}
#endif