Commit graph

27 commits

Author SHA1 Message Date
Tor Lillqvist
e14fea9f37 Work around the fact that empty directories are not present in an .apk
The SDK tooling that constructs .apk packages doesn't put empty
directories in them. Which makes sense I guess. "Hidden" files (like
.gitignore) are also skipped. So a directory like
sc/qa/unit/qpro/indeterminate does not show up at all.

So, we must pretend that any opendir() of a directory under /assets
succeeds. If the .apk doesn't contain any files in such a directory,
treat it as existing but empty. We can't know if the corresponding
directory from which /assets was constructed actually does exist but
is empty or if it doesn't exist.
2012-02-20 20:07:35 +02:00
Tor Lillqvist
2c11a8fed6 Add lo_dlclose() 2012-01-31 16:19:17 +02:00
Tor Lillqvist
6e2e4c4c67 Log time taken by dlopen() 2012-01-31 15:24:06 +02:00
Tor Lillqvist
513e187c43 Drop accidental #include 2012-01-27 20:15:06 +02:00
Tor Lillqvist
0a1fb4b618 Tweak the st_mode returned by lo_apk_lstat() to match reality better 2012-01-27 20:15:04 +02:00
Michael Meeks
5174166859 android: attach as daemon with given JNI version, and don't exit. 2012-01-27 14:50:21 +00:00
Michael Meeks
76bdcb53a5 android: push the redraw-needed command into the app thread & wait 2012-01-27 14:48:55 +00:00
Tor Lillqvist
04fbc6be65 Use lo-bootstrap as the log tag 2012-01-26 21:25:06 +02:00
Tor Lillqvist
052fe1a770 Call the JavaVM's AttachCurrentThread(), can't hurt... 2012-01-26 13:32:14 +02:00
Tor Lillqvist
85f0cd34db Move the sleep earlier, and log it 2012-01-26 13:32:13 +02:00
Michael Meeks
7c4c1832cc android: move lo-bootstrap to osl/detail, Attach threads as created 2012-01-26 10:29:38 +00:00
Michael Meeks
a6c5b24b0c WaE: unwind possible undefined warnings 2012-01-25 20:34:55 +00:00
Tor Lillqvist
25f78344e8 Bin global_android_app and instead use lo-bootstrap API
Instead of introducing a global variable, use the already existing
saved android_app pointer in lo-bootstrap.c, and just add a function
to retrieve it from there. Store it in the AndroidSalInstance.

Reanme osl/detail/android.h back to android_native_app_glue.h, which
is the name of that file in NDK/sources. "android.h" sounded to me too
grand, as if it was some universal Android header. But if we do start
to modify the android_native_app_glue stuff heavily, then it indeed
makes sense to call it something else. Until then, revert also some
whitespace changes to android_native_app_glue.c for it to be as close
as possible to the "upstream" one in the NDK, for clarity.
2012-01-25 19:39:06 +02:00
Michael Meeks
c2112c7ce1 android: rename native_app_glue.h and install as osl/detail/android.h 2012-01-24 22:37:08 +00:00
Tor Lillqvist
e580fd501b Fill in more struct stat fields in lo_apk_lstat()
Set uid and gid to that of the process, atime to current time, mtime
and ctime to the modification timestamp of the archive entry.
2012-01-24 21:35:01 +02:00
Tor Lillqvist
72baf88773 Comment out the verbose logging of code that seems to work fine 2012-01-13 14:40:58 +02:00
Tor Lillqvist
4a8666cc68 Add unpacking of files from assets/unpack to the data dir 2012-01-12 01:28:03 +02:00
Tor Lillqvist
f923d1889f Make the apk dirent functions work properly
We must build a directory tree structure corresponding to the files in
the .apk, and use that then in lo_apk_opendir()/readdir().

We can't just return the same subdirectory once for each time we come
across an entry that has it as a prefix in the zip directory.

Use the BSD-licensed "uthash" library (just one .h file actually) from
http://uthash.sourceforge.net/ .
2012-01-04 22:29:38 +02:00
Tor Lillqvist
36ce37def3 Fix the monkey patching to work for an arbitrary offset
We used to patch in a simple "b" instruction with a relative offset
that has to fit in 24(+2) bits. Which was not enough in practice.

Now patch in a "ldr pc, [pc, #-4]" instead which loads PC from the
next word; in ARM code PC cotains the address of the executing
instruction + 8), and put the full address of the replacement code
into the next word.
2012-01-04 15:31:18 +02:00
Tor Lillqvist
7cc28bae3a Fixes for the lo-bootstrap apk element code
Fix some off-by-one style errors, add a new lo_apk_lstat() function,
and (temporarily) add some debugging logging.
2012-01-04 00:15:26 +02:00
Tor Lillqvist
e685a684eb Initial untested implementation of dirent style functions for the .apk 2011-12-22 15:45:34 +02:00
Tor Lillqvist
5e3059834e Need visibility markup for ANativeActivity_onCreate() too 2011-12-21 00:46:02 +02:00
Tor Lillqvist
6e07d605f3 Use visibility attributes as we get compiled with -fvisibility=hidden 2011-12-20 01:12:26 +02:00
Tor Lillqvist
a6eb07b239 Fix compiler warnings for Android 2011-12-20 01:12:22 +02:00
Matúš Kukan
a9e130ab82 sal: convert to gbuild 2011-12-19 10:14:53 +01:00
Tor Lillqvist
895d23328e Fix build breaker thinko 2011-11-30 22:48:21 +02:00
Tor Lillqvist
5510127e89 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.
2011-11-30 21:52:52 +02:00