Commit Graph

57 Commits

Author SHA1 Message Date
62badf3828 Move to MPLv2 license headers, with ESC decision and author's permission. 2013-04-22 09:37:38 +01:00
50bab8605e -Werror=unused-macros
Change-Id: I3c64ed78577988767a7da859e68a7f63f890f7dc
2013-03-27 10:21:38 +01:00
e4bad391fc createWindowFoo is unused
Change-Id: Ia61efc5d5ee65178fd7d868cb57eed9ba3c0519e
2013-02-26 23:48:54 +02:00
d372af0897 No NativeActivity, so native_app_glue and struct android_app are meaningless
Leave the NativeActivity-related code in androidinst.cxx for reference for
now.

Change-Id: I760c02ea361361be2d2b69c4cad1e38311f51247
2013-02-23 00:31:24 +02:00
dfd17e881b remove un-conditional 20 second sleep on-start for now.
Change-Id: I37ff2164b1f0fcdc4f3fad41f344b0d73105a2c1
2013-02-21 22:54:36 +02:00
4d25878755 android: finally starting and rendering at least something again.
Only renders on very-first-start after install (oddly).
We initialize vcl in it's own thread to avoid problems.
Thanks to tml for fixing a linking issue.
Change-Id: I960d11c6098681356fea0634970545aa9af9bacb
2013-02-21 22:54:36 +02:00
52a8744afe Revert "Clean up remains of NativeActivity-based Android app support"
This reverts commit cecc926070ee3d2ad6296fc5e0cfcde8642bb140.

Conflicts:
	sal/android/lo-bootstrap.c
	sal/inc/osl/detail/android-bootstrap.h
2013-02-21 22:54:36 +02:00
9cb4f96790 Add lo_get_app_data_dir()
Change-Id: I13ab54ce5c6d67f1623b7f1923678091660d202d
2012-11-22 14:06:06 +02:00
cecc926070 Clean up remains of NativeActivity-based Android app support
We haven't been able to build NativeActivity-based apps (like the
android/qa/sc and anroid/qa/desktop thingies) since we switched to
DISABLE_DYNLOADING and a single DSO liblo-native-code.so anyway.

No lo_main() any more. <sal/main.h> should not be included ever when
compiling for Android of iOS now.

Lots of stuff binned from vcl's androidinst.cxx, in the (vain?) hope
that it will reduce the amount of never invoked GUI code that gets
linked in.

Change-Id: I25f584864c40110774c728a23151e089620442d9
2012-11-21 23:03:57 +02:00
f78a2bcce8 re-base on ALv2 code. Includes:
Patch contributed by Herbert Duerr:
    #i118662# remove berkeleyDB from module xmlhelp (author=orwitt)
    http://svn.apache.org/viewvc?view=revision&revision=1213188
    #i119141# remove ISCII converter for now
    http://svn.apache.org/viewvc?view=revision&revision=1306246
    make exceptions for cppunittester verbose
    http://svn.apache.org/viewvc?view=revision&revision=1174831

    Patches contributed by Pedro Giffuni:
    Avoid some uses of non portable #!/bin/bash in shell scripts.
    http://svn.apache.org/viewvc?view=revision&revision=1235297

    Patch contributed by Oliver-Rainer Wittmann
    88652: applied patch, remove unicows deps
    http://svn.apache.org/viewvc?view=revision&revision=1177585

drop OS/2 code, remove in-line assembler ARM atomics,
and obsolete armarch header.
2012-11-21 14:52:11 +00:00
ae81246917 We don't need the library search path anymore
As we don't use any dlopen() etc wrappers now with just one single
DSO, we have no use for the library search path either.

Change-Id: Ifaf11c4785a90fe5c7dafb3310bc7933ea31238c
2012-11-21 15:22:27 +02:00
970b53e050 Enable storing some files gzipped in the .apk
We gzip them separately in the Makefile and the gzipped result will be
stored without (further) compression in the .apk.

Use this to store the ttf font files. Shaves off a bit .apk size.

This might seem a bit odd way to do it, why not store these files in
the normal Zip compressed fashion in the .apk? It seems hard to tell
Ant (based on path, not extension) what files to compress and what
not, so we have to keep telling it to not (further) compress any files
at all.

Change-Id: I0d40d8811e6c9df6b28c285845b1db225507f5d4
2012-11-21 15:05:13 +02:00
4b7e701024 Use DISABLE_DYNLOADING on Android
IN this branch these changes are not conditional. Unclear yet whether
this is what we finally will want to use or not. Maybe should make
these changes conditional and do this stuff in master instead?

Change-Id: I379d570a0e00648d295c675fd90eba6594ba3182
2012-10-11 10:07:05 +03:00
963c98a65e Guard against lack of slashes in dli_fname
Change-Id: Id9c452d9c1034f2e7969a9eae7588f2eb81a8813
2012-09-21 14:18:13 +03:00
e989d16748 dung out no longer needed initUCBHelper methods; thanks to sberg. 2012-09-19 18:41:45 +01:00
2c619267d6 Detach thread before returning from android_main()
Change-Id: I593e94e90971b6be681de48dce74f7df2293c10e
2012-09-05 16:12:13 +03:00
8b5cf7fb57 For kicks, enable cross-building for Android on MIPS
Change-Id: I6fa2b9a50c525fb2d8666a144409eb9a3ad2698a
2012-08-16 21:05:14 +03:00
69207d1f69 android: expose dummy JNI gnustl patching method for x86 2012-08-06 10:33:47 +01:00
d3c4d9a0f8 android: x86 porting work. 2012-07-20 16:40:21 +01:00
3ea3c6afa2 Use XToolkit2::createScreenCompatibleDeviceUsingBuffer
Render directly to a direct ByteBuffer allocated on the Java side.

Change-Id: I2d66e4146df77e92260918a78ef22cd9b8c95384
2012-06-12 13:50:50 +03:00
8ae077379e Use 32bpp bitmaps on Android (and iOS)
Modify DocumentLoader correspondingly. Take Android bug 32588 into
account.

Ideal would be to extend the XDevice stuff, or something, so that one
could hand it a pre-allocated RGBA buffer into which the
drawing/rendering would go. Then one could get rid of the silly
convert-to-BMP phase, which prefixes the bitmap data with BMP and DIB
headers (and thus, I guess, has to copy and allocate another
copy). Will see.

Change-Id: I4597cd933db8faa8105dc8f19638d712d5d2238a
2012-06-05 17:17:41 +03:00
9776138e97 Add a BGR to RGBA twiddling JNI function
Change-Id: Iafa2c1805eea2f521479dc97d5668d82b1c91bef
2012-05-31 16:20:53 +03:00
c9f5b8a334 Add temporary test JNI method createWindowFoo()...
Change-Id: I8f99399faa3b0762bdea2aac09f1b849639cd191
2012-05-30 00:02:18 +03:00
fcbfccdeb0 Create the redirection thread in detached state
Change-Id: I293fa84452f00a41f4a33d4a45eee6d1a32ff761
2012-05-16 18:37:39 +03:00
c53c665de3 Add stdout and stderr redirection to the Android log
On a (non-rooted) device it is not possible to set the
log.redirect-stdio property so that it would be effective (i.e. read
by the Zygote process when it starts). Such redirection has to be done
in-process.

Add a (JNI-callable) method to set it up: Point file descriptors 1 and
2 at pipes that are read by a thread that logs each line through the
Android logging API. Code based on Android's own logwrapper.c.

Change-Id: Id5308293595096a44a2ffed2dbc0c252be109de7
2012-05-16 10:12:25 +03:00
a9a50cd9ff Refactor where patch_libgnustl_shared() and extract_files() are called 2012-04-02 12:39:52 +03:00
d975f4aab2 Add a JNI_OnLoad() to store the JavaVM* also from non-NativeActivity apps 2012-04-02 12:39:52 +03:00
bef7a8c054 Use correct JNI name mangling of underscores 2012-03-30 19:52:32 +03:00
6db50818c1 Add JNI wrapper for InitUCBHelper() and call it 2012-03-28 16:57:59 +03:00
5814229948 Add JNI wrappers for InitVCL and osl_setCommandArgs 2012-03-22 22:49:48 +02:00
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
2c11a8fed6 Add lo_dlclose() 2012-01-31 16:19:17 +02:00
6e2e4c4c67 Log time taken by dlopen() 2012-01-31 15:24:06 +02:00
513e187c43 Drop accidental #include 2012-01-27 20:15:06 +02:00
0a1fb4b618 Tweak the st_mode returned by lo_apk_lstat() to match reality better 2012-01-27 20:15:04 +02:00
5174166859 android: attach as daemon with given JNI version, and don't exit. 2012-01-27 14:50:21 +00:00
76bdcb53a5 android: push the redraw-needed command into the app thread & wait 2012-01-27 14:48:55 +00:00
04fbc6be65 Use lo-bootstrap as the log tag 2012-01-26 21:25:06 +02:00
052fe1a770 Call the JavaVM's AttachCurrentThread(), can't hurt... 2012-01-26 13:32:14 +02:00
85f0cd34db Move the sleep earlier, and log it 2012-01-26 13:32:13 +02:00
7c4c1832cc android: move lo-bootstrap to osl/detail, Attach threads as created 2012-01-26 10:29:38 +00:00
a6c5b24b0c WaE: unwind possible undefined warnings 2012-01-25 20:34:55 +00:00
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
c2112c7ce1 android: rename native_app_glue.h and install as osl/detail/android.h 2012-01-24 22:37:08 +00:00
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
72baf88773 Comment out the verbose logging of code that seems to work fine 2012-01-13 14:40:58 +02:00
4a8666cc68 Add unpacking of files from assets/unpack to the data dir 2012-01-12 01:28:03 +02:00
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
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
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