Commit Graph
220 Commits
Author SHA1 Message Date
Michael Weghorn 7084da45dd android: Explicitly load libc++_shared
While it works just fine without that in newer
Android versions, trying to open any doc in an
x86 AVD with API level 16 failed like this:

> E/AndroidRuntime( 2999): java.lang.ExceptionInInitializerError
> E/AndroidRuntime( 2999):        at org.libreoffice.TileProviderFactory.initialize(TileProviderFactory.java:23)
> E/AndroidRuntime( 2999):        at org.libreoffice.LOKitThread.<init>(LOKitThread.java:39)
> E/AndroidRuntime( 2999):        at org.libreoffice.LibreOfficeMainActivity.onCreate(LibreOfficeMainActivity.java:149)
> E/AndroidRuntime( 2999):        at android.app.Activity.performCreate(Activity.java:5008)
> E/AndroidRuntime( 2999):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
> E/AndroidRuntime( 2999):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
> E/AndroidRuntime( 2999):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
> E/AndroidRuntime( 2999):        at android.app.ActivityThread.access$600(ActivityThread.java:130)
> E/AndroidRuntime( 2999):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
> E/AndroidRuntime( 2999):        at android.os.Handler.dispatchMessage(Handler.java:99)
> E/AndroidRuntime( 2999):        at android.os.Looper.loop(Looper.java:137)
> E/AndroidRuntime( 2999):        at android.app.ActivityThread.main(ActivityThread.java:4745)
> E/AndroidRuntime( 2999):        at java.lang.reflect.Method.invokeNative(Native Method)
> E/AndroidRuntime( 2999):        at java.lang.reflect.Method.invoke(Method.java:511)
> E/AndroidRuntime( 2999):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
> E/AndroidRuntime( 2999):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
> E/AndroidRuntime( 2999):        at dalvik.system.NativeStart.main(Native Method)
> E/AndroidRuntime( 2999): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1891]:  1176 could not load needed library 'libc++_shared.so' for 'liblo-native-code.so' (load_library[1093]: Library 'libc++_shared.so' not found)
> E/AndroidRuntime( 2999):        at java.lang.Runtime.loadLibrary(Runtime.java:370)
> E/AndroidRuntime( 2999):        at java.lang.System.loadLibrary(System.java:535)
> E/AndroidRuntime( 2999):        at org.libreoffice.kit.NativeLibLoader.load(LibreOfficeKit.java:105)
> E/AndroidRuntime( 2999):        at org.libreoffice.kit.LibreOfficeKit.<clinit>(LibreOfficeKit.java:82)
> E/AndroidRuntime( 2999):        ... 17 more
> W/ActivityManager( 1421):   Force finishing activity org.libreoffice/.LibreOfficeMainActivity
> W/ActivityManager( 1421):   Force finishing activity org.libreoffice/.ui.LibreOfficeUIActivity

Change-Id: I6e383e624b9e66c0daa9ecfda4a3b176c8fa0d94
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133263
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-04-21 20:57:55 +02:00
Michael Weghorn c6fada2bfe android: Use android.ndkPath property to set path to NDK
Quoting from

    commit 128de1949f
    Date:   Tue Apr 19 15:18:49 2022 +0200

        android: Use property instead of ANDROID_NDK_HOME env var

which ported from an obsolete (no longer supported by
current Gradle versions) way of setting the NDK path to a
deprecated but still supported one as an intermediate step
to allow upgrading Gradle:

> Note however, that with this approach of using the `ndk.dir`
> property instead of the suggested `android.ndkVersion`
> (with the latter having the stricter requirement that
> the `ndk` dir would have to be a subdir of the SDK dir),
> doing the actual upgrade to a newer Gradle (plugin) version
> in follow-up commit
> Change-Id Ia982d72d877e229c3006c6d528b830d16c88481f
> "android: Update Android Gradle Plugin to 7.1.3"
> revealed that the use of the `ndk.dir` property
> is deprecated in newer Gradle (plugin) versions as well,
> resulting in this warning.
>
> > > Task :stripStrippedUIDebugDebugSymbols
> > [CXX5106] NDK was located by using ndk.dir property. This method is
> > deprecated and will be removed in a future release. Please delete
> > ndk.dir from local.properties and set android.ndkVersion to
> > [20.0.5594570] in all native modules in the project.
> > https://developer.android.com/r/studio-ui/ndk-dir
>
> It might make sense to address that in a follow-up step,
> but for now, it's an improvement and keeps it working
> after the upgrade without potentially causing any incompatibility
> problems with existing autogen configurations,
> while support for the `ANDROID_NDK_HOME` env var that was
> used so far seems to have been dropped, [...].

The release notes for Android Gradle Plugin version 4.1.0
mention yet another way of setting an explicit NDK path
instead of just a version and that one is still supported
and not deprecated [1]:

> # Set the NDK path
> You can set the path to your local NDK installation using the
> android.ndkPath property in your module's build.gradle file.
>
> android {
>    ndkPath "your-custom-ndk-path"
> }
>
> If you use this property together with the android.ndkVersion property,
> then this path must contain an NDK version that matches
> android.ndkVersion.

Therefore, switch to setting the NDK path using the `android.ndkPath`
property in liboSettings.gradle instead of the deprecated `ndk.dir`
in local.properties.

[1] https://developer.android.com/studio/releases/gradle-plugin?buildsystem=ndk-build#ndk-path

Change-Id: I34690ca8e15ff4742bab9a716a58b9ad85fa86e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133197
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-04-20 10:46:22 +02:00
Michael Weghorn 19363c84e0 android: Set archivesBaseName differently after gradle update
Setting the archive base name in build.gradle using

    project.ext.set("archivesBaseName", "LibreOfficeViewer")

no longer worked after

    commit 39326bc7d4
    Date:   Tue Apr 19 15:49:53 2022 +0200

        android: Update Android Gradle Plugin to 7.1.3

        ... and gradle to 7.2, which is what Android Studio suggested
        and did automatically when confirming.

As a consequence, the generated .apk or .aar files
would no longer have the app name in them, but be
called e.g. "source-strippedUIEditing-release-unsigned.apk"
instead of
"LibreOfficeViewer-strippedUIEditing-release-unsigned.apk".

Setting `archivesBaseName` in `android.defaultConfig`
in libOSettings.gradle works, so move it there.

Change-Id: Id03cbe10681aca85c35aeef64527bc7707c95736
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133191
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-04-20 10:45:59 +02:00
Michael Weghorn 76d50f8327 android: Stop using ANDROID_SDK_HOME env variable
Otherwise, upgrading to Android Gradle Plugin 7.1.3 and
gradle 7.2 (which will be done in a follow-up commit)
would make the build fail like this:

> FAILURE: Build failed with an exception.
>
> * Where:
> Build file '/home/michi/development/git/libreoffice-WORKTREE-for-android-x86/android/source/build.gradle' line: 1
>
> * What went wrong:
> A problem occurred evaluating root project 'source'.
> > Failed to apply plugin 'com.android.internal.application'.
>    > ANDROID_SDK_HOME is set to the root of your SDK: /home/michi/Android/Sdk
>      ANDROID_SDK_HOME was meant to be the parent path of the preference folder expected by the Android tools.
>      It is now deprecated.
>
>      To set a custom preference folder location, use ANDROID_USER_HOME.
>
>      It should NOT be set to the same directory as the root of your SDK.
>      To set a custom SDK location, use ANDROID_HOME.

We don't actually rely on `ANDROID_SDK_HOME` being evaluated
by the Android toolchain, but it used to be set in configure.ac,
and the value was then assigned to the `sdk.dir` property written to
`android/source/local.properties`.

Just use a new variable name `ANDROID_SDK_DIR`
and keep the mechanism otherwise unchanged for now.

Change-Id: I44826621a1342119d40036fb704d8ff1eeed7c77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133178
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-04-20 05:19:20 +02:00
Michael Weghorn 128de1949f android: Use property instead of ANDROID_NDK_HOME env var
Write an `ndk.dir` property with the directory path to
`android/source/local.properties` instead, similar
to how it's done for `sdk.dir`.

Also, rename the `ANDROID_NDK_HOME` variable that's
assigned in configure.ac that holds the corresponding
value to `ANDROID_NDK_DIR`, because the gradle warning
still shows up if that environment variable is set in
addition to having an `ndk.dir` property in `local.properties`.

This makes the following gradle warning disappear:

> > Task :stripStrippedUIDebugDebugSymbols
> WARNING: Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead.
> Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead.

Note however, that with this approach of using the `ndk.dir`
property instead of the suggested `android.ndkVersion`
(with the latter having the stricter requirement that
the `ndk` dir would have to be a subdir of the SDK dir),
doing the actual upgrade to a newer Gradle (plugin) version
in follow-up commit
Change-Id Ia982d72d877e229c3006c6d528b830d16c88481f
"android: Update Android Gradle Plugin to 7.1.3"
revealed that the use of the `ndk.dir` property
is deprecated in newer Gradle (plugin) versions as well,
resulting in this warning.

> > Task :stripStrippedUIDebugDebugSymbols
> [CXX5106] NDK was located by using ndk.dir property. This method is
> deprecated and will be removed in a future release. Please delete
> ndk.dir from local.properties and set android.ndkVersion to
> [20.0.5594570] in all native modules in the project.
> https://developer.android.com/r/studio-ui/ndk-dir

It might make sense to address that in a follow-up step,
but for now, it's an improvement and keeps it working
after the upgrade without potentially causing any incompatibility
problems with existing autogen configurations,
while support for the `ANDROID_NDK_HOME` env var that was
used so far seems to have been dropped, resulting in

> > Task :stripStrippedUIDebugDebugSymbols
> Unable to strip the following libraries, packaging them as they are:
> libc++_shared.so, libfreebl3.so, liblo-native-code.so, libnspr4.so,
> libnss3.so, libnssckbi.so, libnssdbm3.so, libnssutil3.so,
> libplc4.so, libplds4.so, libsmime3.so, libsoftokn3.so,
> libsqlite3.so, libssl3.so.

instead if upgrading gradle without switching to the use of the property.

Change-Id: I4a090e8736dac80777f69b0e12819b9c056f582b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133177
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-04-20 05:19:03 +02:00
Pranam Lashkari c4b9341289 LOK: maintain blocked command list per view
Conflicts:
	include/LibreOfficeKit/LibreOfficeKitEnums.h
	include/sfx2/viewsh.hxx
	libreofficekit/source/gtk/lokdocview.cxx
	sfx2/source/view/viewsh.cxx

Change-Id: I7c621accd84f49447ab3e08a4bb662a9b91b834a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124049
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-22 17:49:20 +02:00
Ilhan Yesil e72a7368b3 tdf#131548 Android: jump to cell
Added LOK_CALLBACK_SC_FOLLOW_JUMP: fire this signal to jump to cell
cursor in android viewer. Payload format same as
LOK_CALLBACK_INVALIDATE_TILES.

Change-Id: Ic896baccf1327d6ccdf104811446e3454a42679e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116448
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-09-03 11:45:21 +02:00
Stephan Bergmann 095b2da8c0 Make sure $(SODEST)/libc++_shared.so target dir exists
...similar to how this is done for the other $(SODEST)/... targets above (and
which has presumably been missing accidentally from
eb050ae015 "tdf#123290 fix android tinderbox
builds/properly package libc++_shared.so".

Saw <https://ci.libreoffice.org/job/gerrit_android_x86/830/> fail once with

> cp: cannot create regular file ‘/home/tdf/lode/jenkins/workspace/android_x86/android/jniLibs/x86/libc++_shared.so’: No such file or directory
> ../Bootstrap/Makefile.shared:75: recipe for target '/home/tdf/lode/jenkins/workspace/android_x86/android/jniLibs/x86/libc++_shared.so' failed
> make[2]: *** [/home/tdf/lode/jenkins/workspace/android_x86/android/jniLibs/x86/libc++_shared.so] Error 1
> make[2]: *** Waiting for unfinished jobs....
> /home/tdf/lode/jenkins/workspace/android_x86/android/CustomTarget_lo_android.mk:17: recipe for target '/home/tdf/lode/jenkins/workspace/android_x86/workdir/CustomTarget/android/source/done' failed
> make[1]: *** [/home/tdf/lode/jenkins/workspace/android_x86/workdir/CustomTarget/android/source/done] Error 2

Change-Id: Ief6b6274ad789d441c2692b941ba0aa8df276e40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106119
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-19 11:50:31 +01:00
Michael Weghorn bc6c034ba0 tdf#134846 Android Viewer: Include native libs again
commit 0dffc65236
    Date:   Fri Jun 5 08:59:26 2020 -0400

        android: fix the build output directory

submitted on 2020-07-07 had changed the output directory
for native libraries, so the directory used by
Android Viewer was empty, and native libs no longer
contained in the package/APK.

Store the actual/new directory in a variable and
use that one in build.gradle to make things work
again.

Change-Id: I5a051342278ab14e71edf47dd93e8dacdb9f3cb6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98970
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-07-17 14:35:34 +02:00
Henry Castro 0dffc65236 android: fix the build output directory
When compiling in a different build output directory,
the "liblo-native-code.so" file is created in the source directory and
it fails compiling the "online" project

Change-Id: I4782a69796fb298e9c1a6c4370720b18587735e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95602
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98290
Tested-by: Jenkins
2020-07-07 21:21:09 +02:00
Michael Weghorn 51b700af34 android: Fix linking of liblo-native-code.so on x86_64
This is similar to commit c6dadf5035
("commit android: Fix linking of liblo-native-code.so on aarch64.").

Build previously failed with

    Linking obj/local/x86_64/liblo-native-code.so
    .../x86_64-linux-android/bin/ld.gold: error: cannot find -landroid_support
    clang++: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [../Bootstrap/Makefile.shared:62: obj/local/x86_64/liblo-native-code.so] Error 1
    make[1]: *** [.../android/CustomTarget_lo_android.mk:18: .../workdir/CustomTarget/android/source/done] Error 2
    make: *** [Makefile:282: build] Error 2

I quickly checked that the app actually runs on an x86_64 AVD
and is able to open and display documents after successfully
building with this commit in place.

Change-Id: I92b3759af6a86a6717c287d035b6a1add3a9af7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85204
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-01-17 10:24:54 +01:00
Jan Holesovsky c6dadf5035 android: Fix linking of liblo-native-code.so on aarch64.
Forces gold as the linker; but according to the switches that were used,
I suppose gold was used previously anyway, so hopefully not really a
problem.

Change-Id: I7bc54abf0d3b4b3d86d53e4ea6f01146cf196216
Reviewed-on: https://gerrit.libreoffice.org/81905
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit fa145a035fbab652ec8f3ee870e44e43dd1d770a)
Reviewed-on: https://gerrit.libreoffice.org/81915
2019-12-02 09:14:37 +01:00
Christian Lohmaier eb050ae015 tdf#123290 fix android tinderbox builds/properly package libc++_shared.so
While it might not be the original problem, at least that is the current
problem the tinderbox provided builds have and should make it work again

Change-Id: Ifaedb3304622286cfe7a6cb49e862a359b53f892
2019-11-07 15:06:00 +01:00
Jan Holesovsky f68a36b62e android: Fix problems with unwinding in the Online-based Android app.
This partially reverts a7f6338875.  The
problem is that with that approach, the problems with unwinding as
described in 312eeeee42 were plaguing the
Online-based Android app, leading to mysterious crashes with stack
traces like:

 #00 pc 0005f2b6  /apex/com.android.runtime/lib/bionic/libc.so (abort+166) (BuildId: 68c87e04526a60689ecb5deb329804a0)
 #01 pc 05caaae7  /data/app/libreoffice.debug-fBEOIUwPHY3_k3eQid159Q==/lib/arm/liblo-native-code.so (BuildId: 1c3d0e6336ddfc3578e1c186944160252a750b8b)
 ...
 #06 pc 07452e43  /data/app/libreoffice.debug-fBEOIUwPHY3_k3eQid159Q==/lib/arm/liblo-native-code.so (BuildId: 1c3d0e6336ddfc3578e1c186944160252a750b8b)
 #07 pc 0005a37c  /apex/com.android.runtime/lib/bionic/libc.so (__restore_rt) (BuildId: 68c87e04526a60689ecb5deb329804a0)
 #08 pc 0005f2b2  /apex/com.android.runtime/lib/bionic/libc.so (abort+162) (BuildId: 68c87e04526a60689ecb5deb329804a0)
 #09 pc 07565d3b  /data/app/libreoffice.debug-fBEOIUwPHY3_k3eQid159Q==/lib/arm/liblo-native-code.so (BuildId: 1c3d0e6336ddfc3578e1c186944160252a750b8b)
 ...
 #11 pc 07565641  /data/app/libreoffice.debug-fBEOIUwPHY3_k3eQid159Q==/lib/arm/liblo-native-code.so (BuildId: 1c3d0e6336ddfc3578e1c186944160252a750b8b)
 #12 pc 0001e394  /apex/com.android.runtime/lib/bionic/libm.so (__gnu_Unwind_RaiseException+108) (BuildId: 0ee3a75927e0da4fa0fe29469ccf8b39)
 #13 pc 0001eee8  /apex/com.android.runtime/lib/bionic/libm.so (_Unwind_RaiseException+20) (BuildId: 0ee3a75927e0da4fa0fe29469ccf8b39)

Change-Id: Ie4e7b20380c9104770229a8d30036ad76093283d
Reviewed-on: https://gerrit.libreoffice.org/81485
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2019-10-25 13:46:01 +02:00
Christian Lohmaier a7f6338875 android: support NDK 19 and above (20 as of this commit)
support for targeting API 14 and 15 was removed in NDK 18, so set
minimum version to 16
mips support was removed in NDK 17

Clang now takes care about correct linking with libc++ shared or
static, so don't manually specify them anymore.
Same with __ANDROID_API_LEVEL__ define and the sysroot / isystem
handling, that is all covered by a single -target <triple><version>
simplifying things quite a bit.

also align ownloud sdk values with main build.gradle

Change-Id: Ib3ae4484e52214677e826270b731ecf7c5c15445
Reviewed-on: https://gerrit.libreoffice.org/77104
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2019-08-08 15:59:29 +02:00
Jan Holesovsky bd050920ff android: Set the FONTCONFIG_FILE envvar to the fonts.conf (if exists).
Change-Id: Ic9fd97a2ff8a6d96ffcc7ad300ef30201d786528
Reviewed-on: https://gerrit.libreoffice.org/67876
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2019-03-11 17:46:09 +01:00
Jan Holesovsky cb6d77987c android: Separate the Android-specific setup from the actual LOK init.
Change-Id: I433376dfea0a43c63827ba15308a614f3466fb71
Reviewed-on: https://gerrit.libreoffice.org/67875
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2019-03-11 17:45:56 +01:00
Jan Holesovsky 35cae83fd9 android: Generate liblo-native-code.so so that it can be linked against.
And used for LibreOfficeKit directly, without a JNI wrapper.

Change-Id: If4231f53b579417b6c9c90b39541193bf2e8f27c
Reviewed-on: https://gerrit.libreoffice.org/67874
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-03-11 17:42:48 +01:00
Jan Holesovsky c02a78b55a android: Add a missing dependency.
Useful when you switch sdk to a different location.

Change-Id: I95301cc9adf50a0bbd918cc7562b8871093625b8
Reviewed-on: https://gerrit.libreoffice.org/67873
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2019-02-18 19:16:28 +01:00
Stephan Bergmann 312eeeee42 Switch Android armeabi-v7a to libc++/libc++abi/libunwind too
It had been left out in 4082a18406 "android: use
unified headers and llvm-c++ STL (x86) with NDK 16" because "arm unfortunately
crashes with llvm-c++, so keep with gnustl for now/fix that later".

Making armeabi-v7a work with libc++ etc. required a number of changes, listed
below, in this commit and in preceding ones.  At least 32-bit x86 already worked
with libc++ etc. prior to these changes in view mode, though it crashed in the
experimental editing mode (enabled with strippedUIEditing in
android/soruce/Makefile) as soon as one types in something,  But it is not
entirely clear to me why 32-bit x86 view mode didn't also fail similar to how I
saw armeabi-v7a fail.  (On 32-bit x86, these changes appear to neither improve
nor worsen the current state, view mode still appears to work fine while editing
still crashes upon typing anything.  With these changes, editing mode on
armeabi-v7a appears to work fine.  But I tested armeabi-v7a only with a real
device and 32-bit x86 only with an emulator, in case that might make a
difference.)

* Preceding <https://gerrit.libreoffice.org/#/c/64964/> "Move NSSLIBS to a more
  sensible place on the linker command line" plus this change's addition of
  -lunwind to the liblo-native-code.so linker command line make sure that
  liblo-native-code.so uses _Unwind_* functions from libunwind.a, instead of
  erroneously picking up the ones from libgcc.a that happen to be included in
  NSSLIB's nspr4 (-lgcc is automatically added to the end of the linker command
  line by the invoking compiler, that's how libgcc.a's _Unwind_* end up in
  NSSLIB's nspr4; it is neither clear to me why NSSLIB's nspr4, being a pure C
  library, uses _Unwind_* functions, nor why exception handling in
  liblo-native-code.so fails when using _Unwind_* functions from libgcc.a
  instead of from libunwind on armeabi-v7a, nor why that would work on 32-bit
  x86, but that's what I observed: ModuleManager::identify
  (framework/source/services/modulemanager.cxx) throws a
  css::lang::IllegalArgumentException, which calls __cxa_throw ->
  _Unwind_RaiseException, which ultimately lead to odd misbehavior and
  std::abort during stack unwinding when using _Unwind_RaiseException from
  libgcc.a instead of from libunwind).  (There is no libunwind.* in
  android-ndk-r16b for 32-bit x86 at least, so is presumably using _Unwind_*
  functions from libgcc.a.  It doesn't appear to make a difference if it
  indirectly uses those _Unwind_* functions from NSSLIB's nspr4, or directly
  from libgcc.a included in liblo-native-code.so if the

    $(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-lunwind)

  had a ",-lgcc" else branch.)

* Preceding <https://gerrit.libreoffice.org/#/c/64965/> "Export RTTI symbols
  from liblo-native-code.so, for binary UNO bridge" makes sure that excpetions
  thrown from the binary UNO bridge can be caught by compiled catch clauses.
  Not sure why the corresponding state of
  bridges/source/cpp_uno/gcc3_linux_intel shouldn't have run into the same
  issue.

* Preceding <https://gerrit.libreoffice.org/#/c/64966/> "Adapt gcc3_linux_arm
  __cxa_exception to NDK 18 libc++abi" makes sure that our version of
  __cxa_exception matches the version from libc++abi.  This is clearly not
  relevant for 32-bit x86.  (The comment there android-ndk-r18b, but the
  additional member is already present in
  android-ndk-r16b/sources/cxx-stl/llvm-libc++abi/src/cxa_exception.hpp, too.)

The remainder of this change just drops old armeabi-v7a--specific workarounds
that are no longer needed/no longer work.

Change-Id: Ief4c2d562c5032abe6c3b94ca3b3394be6fcd4d3
Reviewed-on: https://gerrit.libreoffice.org/64973
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-13 07:17:02 +01:00
Stephan Bergmann 357112d74c Export RTTI symbols from liblo-native-code.so, for binary UNO bridge
This will become important when switching armeabi-v7a to
libc++/libc++abi/libunwind (coming soon) which uses address instead of string
comparison when checking for type equality, so that exceptions thrown from the
binary UNO bridge will need to use the exact same RTTI objects as referenced
from the compiled catch clauses.

Change-Id: If8bcb39212b5f5e154aee215cb5f471fe2dc4a7b
Reviewed-on: https://gerrit.libreoffice.org/64965
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-13 07:16:29 +01:00
Stephan Bergmann e465f9ae17 Move NSSLIBS to a more sensible place on the linker command line
511ae02c64 "Android: Enable HAVE_FEATURE_NSS and
package the NSS libraries with apk" had added them to WHOLELIBS probably just
because that already had the $(addprefix -l,...), even though --whole-archive
doesn't make any sense for shared libraries.  Better place them later on the
linker command line (after all our own archives and compiler support libraries),
so that switching armeabi-v7a to libc++/libc++abi/libunwind (coming soon) will
be able to override erroneously picking _Unwind_* symbols from NSSLIBS's nspr4
instead of libunwind.

Change-Id: Ie0c0b7a55da3eabe1bb427232d698b2a4af63e78
Reviewed-on: https://gerrit.libreoffice.org/64964
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-13 07:16:21 +01:00
dennisroczek e39c75b05c use https links for api.libreoffice.org and opengrok
Change-Id: I74dd0142562cb8698f19b2715fa1d514f82bd749
Reviewed-on: https://gerrit.libreoffice.org/52262
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2018-04-02 22:25:53 +02:00
Mert Tümer fc88892e99 .uno:Save callback for the Android Viewer
Change-Id: Ic2e16985e52869092faa2a31a59a85cb77b8e28c
Signed-off-by: Mert Tümer <merttumer7@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/51506
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-03-27 16:25:46 +02:00
Mert Tümer e5bc7fa4e8 tdf#96796 - Added clipboard actions for the Android Viewer
Change-Id: I52e134532ab70e765b6ccd929f189be84f9c9a90
Signed-off-by: Mert Tümer <merttumer7@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/51286
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-03-15 00:28:31 +01:00
Thorsten Behrens b203e78a69 Revert "tdf#96796 - Added clipboard actions for the Android Viewer"
Breaks Android tinderbox

This reverts commit 31e939c9f4.

Change-Id: Id565c9ef8330c0b3bce2c678facb7605dcf3e356
2018-03-14 15:24:38 +01:00
Mert Tümer 31e939c9f4 tdf#96796 - Added clipboard actions for the Android Viewer
Change-Id: I2779ef9a9f68dcf08c3072ffe83b9f2450b7257e
Signed-off-by: Mert Tümer <merttumer7@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/50757
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-03-14 00:35:21 +01:00
Christian Lohmaier 4082a18406 android: use unified headers and llvm-c++ STL (x86) with NDK 16
gnustl (and others) are to be removed in future versions of the ndk
also bump gradle and build-tools to current versions along with it

arm unfortunately crashes with llvm-c++, so keep with gnustl for now/fix
that later

Change-Id: Ic794c3293b599b77ec48096bf3283a99c09cbb79
Reviewed-on: https://gerrit.libreoffice.org/45163
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-01-18 14:44:25 +01:00
Christian Lohmaier 2e8e0b213a android: drop workarounds for ndk-gdb support (can still run manually)
packing gdbserver into apk conflicts with extractNativeLibs="false", as
the gradle pugin compresses it (which could be disabled using
aaptOptions), but furthermore it doesn't page-align it, breaking
installation.
So instead let the user manually push the gdbserver tool to device and
remove the hardcoded values that were only there to please the ndk-gdb
scripts.
Using lldb from within Android Studio is more comfortable anyway :-)

Change-Id: I31c3af4847a479c56b3fcd6b5bed114e004bf0d2
Reviewed-on: https://gerrit.libreoffice.org/41950
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2017-09-07 22:03:10 +02:00
Miklos Vajna fa7e150241 android: remove a hard to address TODO
NSS upstream doesn't seem to support building static libs. The benefit
of avoiding a few lines of extra java code doesn't appear to outweigh
the cost of patching NSS to provide static libs & carry on those patches
in our LO-bundled NSS.

Change-Id: I01fc0b1ff076923fec64b469529d1b920c1d91c2
2017-09-01 11:18:50 +02:00
Christian Lohmaier 0aad6244eb need to manuall load all native-libs on e.g. Jellybean
511ae02c64 introduced additional libraries
that are not merged to the single liblo-native-code.so
These need to be manually loaded in correct order. See
https://stackoverflow.com/questions/11058898/loading-shared-libs-that-depend-on-other-shared-libs
for details.

Change-Id: I34b279b69de8a0f8f58f8f980e5b3a7347cd0439
2017-08-31 18:29:07 +02:00
Ximeng Zu 43f5161991 [Android Viewer] Password support
Added password support for documents.

Change-Id: Ifd9cf86894ddaf2fd5ad97510d2ac1b5850611ad
Reviewed-on: https://gerrit.libreoffice.org/40458
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2017-08-27 20:12:52 +02:00
Gautam Prajapati 511ae02c64 Android: Enable HAVE_FEATURE_NSS and package the NSS libraries with apk
This commit enables HAVE_FEATURE_NSS for Android and fixes the svl/ vcl/
and xmlsecurity/ module to use NSS.

xmlsecurity/ wasn't built for Android previously, this commit enables
building xmlsecurity/ for Android and disables the support of gpgme
in the same module(Only for Android).

It also enables the linking of NSS shared libraries with
liblo-native-code.so and adds a rule to package them along with the apk.

Change-Id: I7d0341688ac979ae92e9145c37dd107670417fe1
Reviewed-on: https://gerrit.libreoffice.org/41308
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-08-23 17:50:55 +02:00
Ximeng Zu 063db6b5a0 [Android Viewer] Correct LOK Enums
Corrected LOKit Enum names in Document.java.

Change-Id: I890bca0712a650b2454807fa11f43f7db14aad6b
Reviewed-on: https://gerrit.libreoffice.org/39831
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2017-07-23 23:03:38 +02:00
Ximeng Zu c746468607 Add LOKit Enums to Document.java
Added LOKit callback enums to Document.java.

Change-Id: I46b7b5fe0ceb40a89fd121082706acdf539ff916
Reviewed-on: https://gerrit.libreoffice.org/39375
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2017-06-28 23:44:09 +02:00
Ximeng Zu 662a1b0a52 Fix typo: inticator -> indicator
The related code is not being used now...
So, it's safe to just correct it before it is put
to use.

Change-Id: I1ba5f1d6d511c965c0ce08dd08bfcabc567da2c3
Reviewed-on: https://gerrit.libreoffice.org/36103
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-04-05 07:14:23 +00:00
brainbreaker 1503769fe1 tdf#106325 - No way to create a new Document
This commit will add the ability to create a new document.
A FAB is used in home screen which on expansion gives
four options namely new writer document, new impress,
new Sheet or new Draw. Two new events loadNewDocument
and saveDocumentAs have been added.
Another major change includes the use of constraint layout
in LOUIActivity layout as it decreases nesting of views and
improves the app performance. This was needed because
of the new FAB layouts being added.
Support for vector drawables has been enabled.

Change-Id: Ia3ea17f73c0d8514f8ddb7b9a1cbd2ce7de6ac08
Reviewed-on: https://gerrit.libreoffice.org/35183
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2017-03-30 19:59:10 +00:00
Mert Tumer 088fb93a7b tdf#106369 added toggle status ability for the list buttons
Change-Id: Ic3132441bac57abf36e3588e6871c5b14a47c25d
Reviewed-on: https://gerrit.libreoffice.org/35427
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2017-03-19 21:45:20 +00:00
aleksandar-stefanovic 11e443bfe1 Removed unnecessary imports
Import redundancy reported by Android Studio.

Change-Id: If46a43bb18268877d41d4957094acc543c4588fd
Reviewed-on: https://gerrit.libreoffice.org/32496
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2017-01-11 06:53:14 +00:00
Christian Lohmaier f6a74ce9bb no need for IPC on Android, removes the need for the cache-hack
removing the cache on each launch prevented opening files via intents
(i.e. from your mail application) unless the viewer was already running,
as it also deleted the temporary file that was created from the intent.

Change-Id: I0a4d9432f475e8434902ae11fc2b0c35fd25a71f
2016-03-23 15:50:17 +01:00
Peter Foley 2879dceaf5 improve android build status reporting
Change-Id: I29f404dc5aee27b592eac7585c5142b91060fe5c
Reviewed-on: https://gerrit.libreoffice.org/21589
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-01-21 07:26:38 +00:00
Mihai Varga 96cd2abd74 LOK: setClientZoom() - sets the client zoom level
We need to know the client's view level to correctly handle the mouse
events in calc. PaintTile() set a zoom level that corresponds to the
requested tiles and previously postMouseEvent would call SetZoom(1,1).
Now we can make use of knowing the client's view level and call
SetZoom() with the correct parameters

Change-Id: I34b5afcdcc06a671a8ac92c03e87404e42adf4cd

Conflicts:
	sc/source/ui/unoobj/docuno.cxx
2015-11-13 09:55:19 +02:00
Tomaž Vajngerl 6d9124de6f android: update JNI facade, rename mouse/keyboard event flags
Change-Id: Ia2b9a812717d05c7d98d47bf0fe5fd293029d045
2015-11-01 22:59:04 +01:00
Tomaž Vajngerl f70254caf4 android: remove CommandLine.java as we don't use it anymore
Change-Id: Ib487d4f948dde2027bebc914bb3fe43b55c6d50b
2015-11-01 22:59:03 +01:00
Tomaž Vajngerl c8dcec9247 android: remove the native DirectBufferAllocator
Change-Id: I41d25d288253f1b35c268ba70b8384812fa567e5
2015-10-21 15:17:10 +02:00
Christian Lohmaier 8840a66fac allow using Android Studio with lldb to debug native part
and of course also for the Java part

Using build-id linker flag allows lldb to map the installed .so to the
non-stripped version on the buildhost.

Also ndk-gdb supports specifying a different package name on the
commandline, so no need for the error in configure anymore.

Change-Id: If6887a27cc8ab15ee6ab612502cacf0a22ade737
2015-10-14 21:24:52 +02:00
Christian Lohmaier 143fb0a4b5 move extracting assets to Java & use AssetManager to access assets
using AssetsManager in both java as well as native parts allows to
handle files both with and without compression transparently

Change-Id: If02f1159c498be7ea965fd9c217410722f2dca1f
2015-10-11 02:03:43 +02:00
Christian Lohmaier ee8257a1c7 migrate android build to gradle
move preparation tasks (creating assets/processing files) from the
makefile into the gradle script

This allows much easier integration into android-studio (just open
android/source with android studio after running make to compile the
native library)

Change-Id: I9a9d6832797c24a7e195a1c7954cd6d20f5a8496
2015-10-11 02:03:13 +02:00
Christian Lohmaier 1a6ec13d08 tdf#93281 clean cache directory on each start
to avoid segfault in native lib.

It's only a workaround, but I couldn't see what's wrong with the
cache...

Change-Id: Iceeee1e190bbbd6efe336d84ddcbd8c4d3a1c621
2015-10-03 22:54:39 +02:00
Christian Lohmaier de376cb1c4 android: remove no longer used files
Change-Id: Id3b71ac50e3c8ce9705f6df18edaaaa6ba8ad3fd
2015-10-03 22:54:37 +02:00