[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 55 commits - android/Bootstrap android/CustomTarget_lo_android.mk android/mobile-config.py android/README android/source bridges/Library_cpp_uno.mk bridges/source config_host.mk.in configure.ac desktop/source distro-configs/LibreOfficeAndroid.conf distro-configs/LibreOfficeAndroidX86.conf drawinglayer/source external/boost external/cairo external/cppunit external/graphite external/harfbuzz external/icu external/libmspub external/liborcus external/nss external/pdfium i18npool/source i18nutil/source include/android include/comphelper include/LibreOfficeKit include/osl javaunohelper/source Makefile.in oox/source sal/android sal/rtl solenv/bin solenv/clang-format solenv/gbuild svx/source sw/source vcl/headless xmlsecurity/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 6 09:13:49 UTC 2019


 Makefile.in                                                           |    8 
 android/Bootstrap/Makefile.shared                                     |    5 
 android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java         |   18 -
 android/Bootstrap/version.map                                         |    2 
 android/CustomTarget_lo_android.mk                                    |    2 
 android/README                                                        |   13 -
 android/mobile-config.py                                              |    4 
 android/source/build.gradle                                           |   30 +-
 android/source/gradle.properties                                      |    2 
 android/source/gradle/wrapper/gradle-wrapper.properties               |    4 
 android/source/jni/Android.mk                                         |    8 
 android/source/res/anim/fab_close.xml                                 |   15 -
 android/source/res/anim/fab_open.xml                                  |   12 -
 android/source/res/drawable/label_background.xml                      |    9 
 android/source/res/layout/activity_document_browser.xml               |  113 ++++------
 android/source/res/values/arrays.xml                                  |    1 
 android/source/res/values/dimens.xml                                  |    2 
 android/source/res/values/strings.xml                                 |   12 -
 android/source/res/values/themes.xml                                  |   12 -
 android/source/res/xml/libreoffice_preferences.xml                    |    5 
 android/source/src/java/org/libreoffice/AboutDialogFragment.java      |    5 
 android/source/src/java/org/libreoffice/InvalidationHandler.java      |   20 +
 android/source/src/java/org/libreoffice/LOKitThread.java              |   23 +-
 android/source/src/java/org/libreoffice/LOKitTileProvider.java        |   42 ++-
 android/source/src/java/org/libreoffice/ui/FileUtilities.java         |    7 
 android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java |   30 ++
 android/source/src/java/org/mozilla/gecko/gfx/RectUtils.java          |    5 
 bridges/Library_cpp_uno.mk                                            |    1 
 bridges/source/cpp_uno/gcc3_linux_arm/except.cxx                      |    7 
 bridges/source/cpp_uno/gcc3_linux_arm/share.hxx                       |   62 ++++-
 bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx                     |    7 
 bridges/source/cpp_uno/gcc3_linux_intel/except.cxx                    |   16 +
 bridges/source/cpp_uno/gcc3_linux_intel/share.hxx                     |   27 ++
 config_host.mk.in                                                     |    1 
 configure.ac                                                          |   27 +-
 desktop/source/lib/init.cxx                                           |   39 ++-
 distro-configs/LibreOfficeAndroid.conf                                |    1 
 distro-configs/LibreOfficeAndroidX86.conf                             |    1 
 drawinglayer/source/primitive2d/borderlineprimitive2d.cxx             |    1 
 external/boost/UnpackedTarball_boost.mk                               |    3 
 external/boost/boost-android-unified.patch.1                          |   28 ++
 external/cairo/cairo/cairo.GL_RGBA.patch                              |   18 +
 external/cppunit/ExternalProject_cppunit.mk                           |    2 
 external/graphite/StaticLibrary_graphite.mk                           |    9 
 external/harfbuzz/ExternalProject_harfbuzz.mk                         |    1 
 external/icu/ExternalProject_icu.mk                                   |    7 
 external/libmspub/UnpackedTarball_libmspub.mk                         |    6 
 external/libmspub/libmspub_android_arm.patch.1                        |   12 +
 external/liborcus/ExternalProject_liborcus.mk                         |    2 
 external/liborcus/UnpackedTarball_liborcus.mk                         |    6 
 external/liborcus/android-workaround.patch                            |   22 -
 external/nss/ExternalProject_nss.mk                                   |    4 
 external/nss/nss-android.patch.1                                      |    4 
 external/pdfium/Library_pdfium.mk                                     |    2 
 i18npool/source/calendar/calendar_hijri.cxx                           |    2 
 i18nutil/source/utility/paper.cxx                                     |    3 
 include/LibreOfficeKit/LibreOfficeKitInit.h                           |    4 
 include/android/compatibility.hxx                                     |   43 ---
 include/comphelper/scopeguard.hxx                                     |   28 ++
 include/osl/detail/android-bootstrap.h                                |    4 
 javaunohelper/source/javaunohelper.cxx                                |    4 
 oox/source/drawingml/textparagraph.cxx                                |    1 
 oox/source/drawingml/textparagraphpropertiescontext.cxx               |    2 
 sal/android/libreofficekit-jni.c                                      |   51 +++-
 sal/android/lo-bootstrap.c                                            |   12 +
 sal/rtl/math.cxx                                                      |    1 
 solenv/bin/native-code.py                                             |    1 
 solenv/clang-format/blacklist                                         |    1 
 solenv/gbuild/platform/android.mk                                     |   12 -
 svx/source/unodraw/unopage.cxx                                        |    3 
 sw/source/core/doc/tblrwcl.cxx                                        |    6 
 vcl/headless/CustomWidgetDraw.cxx                                     |    3 
 xmlsecurity/source/helper/xsecctl.cxx                                 |    3 
 73 files changed, 602 insertions(+), 307 deletions(-)

New commits:
commit 4ee87f7db939f5ea56d5c4d5420450974e8ef601
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 11 15:01:30 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Thu Jun 6 11:02:08 2019 +0200

    Adapt gcc3_linux_arm __cxa_exception to NDK 18 libc++abi
    
    ...which adds a member, and will be relevant when switching armeabi-v7a to
    libc++/libc++abi/libunwind (coming soon).
    
    Change-Id: I1f98f50ca299a583e73e0dbd6c8c94d973329f3a
    Reviewed-on: https://gerrit.libreoffice.org/64966
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
index 62e0feece40b..99ceecbaf81f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
@@ -64,6 +64,15 @@ public:
 namespace __cxxabiv1 {
     struct __cxa_exception
     {
+#if defined _LIBCPPABI_VERSION // detect libc++abi
+#if defined __LP64__ || defined __ARM_EABI__
+        // Quoting android-ndk-r18b/sources/cxx-stl/llvm-libc++abi/src/cxa_exception.hpp: "This is a
+        // new field to support C++ 0x exception_ptr. For binary compatibility it is at the start of
+        // this struct which is prepended to the object thrown in __cxa_allocate_exception."
+        std::size_t referenceCount;
+#endif
+#endif
+
         std::type_info *exceptionType;
         void (*exceptionDestructor)(void *);
 
commit ec66bc392277f3f35c1b4c8ca2a4afb6ce7ec622
Author:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
AuthorDate: Thu Jan 18 22:00:00 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Thu Jun 6 10:17:58 2019 +0200

    adjust path to generated apk to new defaults
    
    current android-gradle plugin creates the apk in dimension/flavor/variant
    (whatever you want to call it) specific directory
    
    Change-Id: I5514fe53c5c8c556d194a0f06ad6167b0b1cc98e

diff --git a/android/CustomTarget_lo_android.mk b/android/CustomTarget_lo_android.mk
index 05d6d4353d9f..642dfe2f569a 100644
--- a/android/CustomTarget_lo_android.mk
+++ b/android/CustomTarget_lo_android.mk
@@ -20,7 +20,7 @@ $(loandroid3_DIR)/done : $(call gb_Postprocess_get_target,AllModulesButInstsetNa
 # still looks for the .apk, and we want fresh daily builds to be uploaded.
 # Us "foo" instead of the old INPATH
 	mkdir -p $(BUILDDIR)/instsetoo_native/foo/bin; \
-	cp $(SRCDIR)/android/source/build/outputs/apk/*-debug.apk $(BUILDDIR)/instsetoo_native/foo/bin
+	cp $(SRCDIR)/android/source/build/outputs/apk/strippedUI/debug/*-debug.apk $(BUILDDIR)/instsetoo_native/foo/bin
 
 $(call gb_CustomTarget_get_clean_target,android/loandroid3) :
 	$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),MAK,2)
commit 22b913b4c016312e42c8ca25a549896ddcd02b2f
Author:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
AuthorDate: Fri Jun 29 21:15:29 2018 +0200
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Thu Jun 6 09:34:23 2019 +0200

    android: bump gradle, gradle-plugin, support libary & target versions
    
    Change-Id: I971f02c624a19ec58539738f5e736a986b5ba0d6

diff --git a/android/source/build.gradle b/android/source/build.gradle
index c2d4aeae0e56..2fa5dda5b817 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -5,9 +5,8 @@ apply from: 'liboSettings.gradle'
 project.ext.set("archivesBaseName", "LibreOfficeViewer")
 allprojects {
     repositories {
-        maven {
-            url "https://maven.google.com"
-        }
+        jcenter()
+        google()
         flatDir {
             dirs "${liboWorkdir}/UnpackedTarball/owncloud_android_lib/build/outputs/aar"
         }
@@ -17,12 +16,10 @@ allprojects {
 buildscript {
     repositories {
         jcenter()
-        maven {
-            url "https://maven.google.com"
-        }
+        google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.0.1'
+        classpath 'com.android.tools.build:gradle:3.1.3'
     }
 }
 
@@ -38,13 +35,13 @@ dependencies {
     implementation files("${liboInstdir}/${liboShareJavaFolder}/unoil.jar")
     debugImplementation(name:'owncloud_android_lib-debug', ext:'aar')
     releaseImplementation(name:'owncloud_android_lib-release', ext:'aar')
-    implementation 'com.android.support:design:27.0.1' // also pulls-in corresponding support libraries
-    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
+    implementation 'com.android.support:design:27.1.1' // also pulls-in corresponding support libraries
+    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
 }
 
 android {
     compileSdkVersion 26
-    buildToolsVersion "27.0.1"
+    buildToolsVersion "27.0.3"
     compileOptions {
         // silence some java-language features hints
         sourceCompatibility 6
@@ -64,7 +61,7 @@ android {
     }
     defaultConfig {
         minSdkVersion 14
-        targetSdkVersion 24
+        targetSdkVersion 26
         vectorDrawables.useSupportLibrary = true
     }
     buildTypes {
diff --git a/android/source/gradle/wrapper/gradle-wrapper.properties b/android/source/gradle/wrapper/gradle-wrapper.properties
index 26a7675eb5fc..1490158923d0 100644
--- a/android/source/gradle/wrapper/gradle-wrapper.properties
+++ b/android/source/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon Nov 20 19:19:05 CET 2017
+#Fri May 18 16:50:44 CEST 2018
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
commit bed9ad4c8b1ff697db8d0858650371d0f864f6e6
Author:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
AuthorDate: Wed Nov 22 20:22:00 2017 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Thu Jun 6 09:01:20 2019 +0200

    icu: don't skip building the data just because tools were disabled
    
    building for e.g. android disables the tests and requests data in a
    static library, but icu completely skips building the data directory in
    case --disable-tools was specified:
    icu/source/Makefile.in
        @TOOLS_TRUE at DATASUBDIR = data
    will become
        #DATASUBDIR = data
    and then
        SUBDIRS =  stubdata common i18n $(LAYOUTEX) $(ICUIO) $(TOOLS) $(DATASUBDIR) $(EXTRA) $(SAMPLE) $(TEST)
    will not have the data dir and make will ignore it.  Add it back by
    specifying it when invoking make and all is fine.
    
    Change-Id: I0af693f22938ebabdc189a97f1cfc3f8b1c042ee
    Reviewed-on: https://gerrit.libreoffice.org/45107
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/external/icu/ExternalProject_icu.mk b/external/icu/ExternalProject_icu.mk
index c2f6f3566318..e1ec30938bf7 100644
--- a/external/icu/ExternalProject_icu.mk
+++ b/external/icu/ExternalProject_icu.mk
@@ -58,6 +58,9 @@ icu_LDFLAGS:=" \
 	    -Wl$(COMMA)-Bsymbolic-functions -Wl$(COMMA)--dynamic-list-cpp-new -Wl$(COMMA)--dynamic-list-cpp-typeinfo) \
     $(if $(filter ANDROID,$(OS)),$(gb_STDLIBS))"
 
+# DATASUBDIR=data in cross-compiling case, because --disable-tools completely skips the
+# data directory/doesn't build the requested library in that case (icu/source/Makefile.in)
+# so we need to add it back to the list of subdirectories to build
 $(call gb_ExternalProject_get_state_target,icu,build) :
 	$(call gb_ExternalProject_run,build,\
 		CPPFLAGS=$(icu_CPPFLAGS) CFLAGS=$(icu_CFLAGS) \
@@ -73,7 +76,7 @@ $(call gb_ExternalProject_get_state_target,icu,build) :
 				--disable-static --enable-shared $(if $(filter ANDROID,$(OS)),--with-library-suffix=lo)) \
 			$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)\
 				--with-cross-build=$(WORKDIR_FOR_BUILD)/UnpackedTarball/icu/source) \
-		&& $(MAKE) \
+		&& $(MAKE) $(if $(CROSS_COMPILING),DATASUBDIR=data) \
 		$(if $(filter MACOSX,$(OS)), \
 			&& $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl \
 				URELIB \
commit 6c61e13f057814e6609cb7f554577381c74875eb
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Nov 7 11:24:03 2018 +0000
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Thu Jun 6 08:51:06 2019 +0200

    oss-fuzz build failure
    
    Change-Id: I27e822ac2432eb2746ed9181cee158012e54252e

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 7cafe1557d3f..af43b0672e66 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -663,6 +663,7 @@ print ("""/*
 
 #include <config_features.h>
 #include <osl/detail/component-mapping.h>
+#include <string.h>
 
 """)
 if not options.pure_c:
commit a0aece4bc5e6395802138a7da7c7bb18bae37a49
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Nov 11 19:44:59 2018 +0000
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:23:49 2019 +0200

    fix oss-fuzz build
    
    Change-Id: Ia32a80547cd3e3fd21791d8ef2cf717700c790a8

diff --git a/vcl/headless/CustomWidgetDraw.cxx b/vcl/headless/CustomWidgetDraw.cxx
index a8ca746b16ec..9e49390b0f3a 100644
--- a/vcl/headless/CustomWidgetDraw.cxx
+++ b/vcl/headless/CustomWidgetDraw.cxx
@@ -23,6 +23,7 @@ WidgetThemeLibrary* CustomWidgetDraw::s_pWidgetImplementation = nullptr;
 CustomWidgetDraw::CustomWidgetDraw(SvpSalGraphics& rGraphics)
     : m_rGraphics(rGraphics)
 {
+#ifndef DISABLE_DYNLOADING
     if (!s_pWidgetImplementation)
     {
         OUString aUrl("${LO_LIB_DIR}/" SVLIBRARY("vcl_widget_theme"));
@@ -45,6 +46,7 @@ CustomWidgetDraw::CustomWidgetDraw(SvpSalGraphics& rGraphics)
             pSVData->maNWFData.mbNoFocusRectsForFlatButtons = true;
         }
     }
+#endif
 }
 
 CustomWidgetDraw::~CustomWidgetDraw() {}
commit cc4a36b8b00f41ed8ae2c7047d5995cf04ea80e3
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu May 16 12:59:56 2019 +0200
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:37 2019 +0200

    javaunohelper: blind fix for Android build broken by 2d22f8bb15c1
    
    Change-Id: Ie56197b3f4a90b8f9510a1c29d0388f5f70e1d16
    Reviewed-on: https://gerrit.libreoffice.org/72408
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    Tested-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/javaunohelper/source/javaunohelper.cxx b/javaunohelper/source/javaunohelper.cxx
index 43c385bed20a..a5f0cbcf3144 100644
--- a/javaunohelper/source/javaunohelper.cxx
+++ b/javaunohelper/source/javaunohelper.cxx
@@ -40,6 +40,10 @@
 #include "juhx-export-functions.hxx"
 #include "vm.hxx"
 
+#ifdef DISABLE_DYNLOADING
+#include <osl/thread.h>
+#endif
+
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
commit a8433a4911dd0537511817b64209c71f63b3e55e
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Apr 29 16:13:36 2019 +0200
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:37 2019 +0200

    xmlsecurity: fix the Android build
    
    Change-Id: Ib04060ee4dc2a4ece2858548690e8ef182bf00b1

diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index cbff47dc75c3..8cbe75fbef44 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -33,6 +33,9 @@
 #include <com/sun/star/xml/crypto/sax/XReferenceCollector.hpp>
 #include <com/sun/star/xml/crypto/sax/XSAXEventKeeperStatusChangeBroadcaster.hpp>
 #include <com/sun/star/xml/crypto/SecurityOperationStatus.hpp>
+#ifdef ANDROID
+#include <com/sun/star/xml/crypto/XXMLSignature.hpp>
+#endif
 #include <com/sun/star/embed/XHierarchicalStorageAccess.hpp>
 #include <com/sun/star/embed/ElementModes.hpp>
 #include <com/sun/star/beans/StringPair.hpp>
commit 1a455c44efd35f7abb69381b8752eac50eeba37e
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Apr 29 11:36:51 2019 +0300
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:36 2019 +0200

    Fix Android build after commit ac419786b3244d909901db053841862abf5e7a2f
    
    ... giving this error:
    
       In file included from
       /home/android/lo/master-android-arm/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx:50:
       /home/android/lo/master-android-arm/include/comphelper/scopeguard.hxx:36:14:
       error: function 'comphelper::<deduction guide for ScopeGuard><(lambda at
       /home/android/lo/master-android-arm/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx:146:34)>'
       has internal linkage but is not defined [-Werror,-Wundefined-internal]
           explicit ScopeGuard( Func && func ) : m_func( std::move(func) ) {}
                    ^
       /home/android/lo/master-android-arm/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx:146:28:
       note: used here
           comphelper::ScopeGuard guard([&]() {
                                  ^
    
    See https://lists.freedesktop.org/archives/libreoffice/2019-April/082599.html
    
    Change-Id: If719d183d2ce15fa4877cd8bbf457d79097765be
    Reviewed-on: https://gerrit.libreoffice.org/71510
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/include/comphelper/scopeguard.hxx b/include/comphelper/scopeguard.hxx
index 47b62b5f234e..8b5ee4fa2147 100644
--- a/include/comphelper/scopeguard.hxx
+++ b/include/comphelper/scopeguard.hxx
@@ -24,6 +24,28 @@
 
 #include <functional>
 
+
+// For some reason, Android buildbot issues -Werror like this:
+//   In file included from
+//   /home/android/lo/master-android-arm/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx:50:
+//   /home/android/lo/master-android-arm/include/comphelper/scopeguard.hxx:36:14:
+//   error: function 'comphelper::<deduction guide for ScopeGuard><(lambda at
+//   /home/android/lo/master-android-arm/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx:146:34)>'
+//   has internal linkage but is not defined [-Werror,-Wundefined-internal]
+//       explicit ScopeGuard( Func && func ) : m_func( std::move(func) ) {}
+//                ^
+//   /home/android/lo/master-android-arm/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx:146:28:
+//   note: used here
+//       comphelper::ScopeGuard guard([&]() {
+//                              ^
+#ifdef ANDROID
+#if defined __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wundefined-internal"
+#endif
+#endif
+
+
 namespace comphelper {
 
 /** ScopeGuard to ease writing exception-safe code.
@@ -55,6 +77,12 @@ private:
 
 } // namespace comphelper
 
+#ifdef ANDROID
+#if defined __clang__
+#pragma clang diagnostic pop
+#endif
+#endif
+
 #endif // ! defined(INCLUDED_COMPHELPER_SCOPEGUARD_HXX)
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 26cf5cdb99b7be5afaa0bad7f3d1b7d7b8c4c783
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Wed Apr 17 19:13:30 2019 +0200
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:35 2019 +0200

    update references about selective debuginfo in android/README
    
    The second case is very likely mistaken though.
    
    Change-Id: I6bfc55800a6b26ce0ae6d3645e4179dc5f683205

diff --git a/android/README b/android/README
index 21ede90e94e4..4ebfab6594ff 100644
--- a/android/README
+++ b/android/README
@@ -200,8 +200,8 @@ Debugging
 ---------
 
 First of all, you need to configure the build with --enable-debug or
---enable-dbgutil.  You may want to provide --enable-selective-debuginfo too,
-like --enable-selective-debuginfo="sw/" or so, in order to fit into the memory
+--enable-dbgutil.  You may want to provide --enable-symbols to limit debuginfo,
+like --enable-symbols="sw/" or so, in order to fit into the memory
 during linking.
 
 Building with all symbols is also possible but the linking is currently
@@ -291,7 +291,11 @@ SAL_INFO from cppuhelper/source/shlib.cxx in logcat and therefore identify
 what services are missing. To do so, you may want add the following
 when configuring the build.
 
-    --enable-selective-debuginfo="cppuhelper/ sal/"
+    --enable-symbols="cppuhelper/ sal/"
+
+[TODO: This is nonsense. --enable-symbols enables the -g option, not SAL_INFO.
+Perhaps this was a misunderstanding of meaning of --enable-selective-debuginfo,
+the old name for the option.]
 
 Which services are combined in the android lib is determined by
 
commit c25b6bc6971564847eb34f4a3165e65eddd24aed
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Fri Apr 12 17:50:52 2019 +0200
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:35 2019 +0200

    android: Make the tiled rendering from the loolwsd actually work.
    
    Not to break the 'old' Android app, introduce a bool that can indicate
    if we are using the LOK from the 'old' (LOK-via-JNI-based) or from the
    'new' (loolwsd-based) app.
    
    Change-Id: I38bd665cc1d5bc88018574171443ecabc46763df
    Reviewed-on: https://gerrit.libreoffice.org/70678
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1360f75d6338..2bafd7dc62e4 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2563,6 +2563,13 @@ static void doc_setPartMode(LibreOfficeKitDocument* pThis,
     }
 }
 
+#if defined(ANDROID)
+/// For the distinction if the LOK is used for the 'old' (JNI-based) or the
+/// 'new' (loolwsd-based) app.  Default to the 'new', ie. not used from JNI as
+/// implemented in sal/android/libreofficekit-jni.c.
+bool android_lok_from_jni = false;
+#endif
+
 static void doc_paintTile(LibreOfficeKitDocument* pThis,
                           unsigned char* pBuffer,
                           const int nCanvasWidth, const int nCanvasHeight,
@@ -2606,10 +2613,15 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 #else
     ScopedVclPtrInstance< VirtualDevice > pDevice(nullptr, Size(1, 1), DeviceFormat::DEFAULT) ;
 
-#if !defined(ANDROID)
-    // Set background to transparent by default.
-    pDevice->SetBackground(Wallpaper(Color(COL_TRANSPARENT)));
+#if defined(ANDROID)
+    if (!android_lok_from_jni)
 #endif
+    {
+        // Set background to transparent by default.
+        // [Unless it is the 'old' (JNI-based) Android app - no idea why it
+        // needs avoiding this.]
+        pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+    }
 
     pDevice->SetOutputSizePixelScaleOffsetAndBuffer(
                 Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
diff --git a/sal/android/libreofficekit-jni.c b/sal/android/libreofficekit-jni.c
index edd56a2fec37..0f66fdc44fe0 100644
--- a/sal/android/libreofficekit-jni.c
+++ b/sal/android/libreofficekit-jni.c
@@ -37,6 +37,7 @@ extern const char* data_dir;
 extern const char* cache_dir;
 extern void* apk_file;
 extern int apk_file_size;
+extern bool android_lok_from_jni; ///< for the distinction if the LOK is used for the 'old' (JNI-based) or the 'new' (loolwsd-based) app
 AAssetManager* native_asset_manager;
 
 extern void Java_org_libreoffice_android_Bootstrap_putenv(JNIEnv* env, jobject clazz, jstring string);
@@ -157,6 +158,11 @@ jboolean Java_org_libreoffice_kit_LibreOfficeKit_initializeNative
     size_t data_dir_len;
 
     (void) clazz;
+
+    // the 'old' app needs to avoid setting the virtual device to transparent
+    // in paintTile(), so indicate we are using the 'old' app
+    android_lok_from_jni = true;
+
     libreofficekit_initialize(env, dataDir, cacheDir, apkFile, assetManager);
 
     // LibreOfficeKit expects a path to the program/ directory
commit 3f358c1f29102a6a6e548e555b18086faebb6196
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Thu Apr 11 21:17:43 2019 +0200
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:34 2019 +0200

    graphite: Force optimization on Android.
    
    The Pass.cpp triggers an infinite loop in clang when not optimizing (ie.
    with the debugging buildls), at least with this version:
    
      > ~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --version
      Android (5058415 based on r339409) clang version 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec746213857d083c0e8b0abb568790) (https://android.googlesource.com/toolchain/llvm 7a6618d69e7e8111e1d49dc9e7813767c5ca756a) (based on LLVM 8.0.2svn)
      Target: x86_64-unknown-linux-gnu
      Thread model: posix
      InstalledDir: /local/home/kendy/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin
    
    Change-Id: Ib4984f8838fc733be6da4e24eb10915d3efbf79e

diff --git a/external/graphite/StaticLibrary_graphite.mk b/external/graphite/StaticLibrary_graphite.mk
index 8c16482ba11b..75d1fe84071b 100644
--- a/external/graphite/StaticLibrary_graphite.mk
+++ b/external/graphite/StaticLibrary_graphite.mk
@@ -32,6 +32,15 @@ $(eval $(call gb_StaticLibrary_add_cxxflags,graphite,\
 endif
 endif
 
+ifeq ($(OS),ANDROID)
+# Force optimizations on Android, because otherwise Pass.cpp triggers an
+# infinite loop in clang, at least in this version:
+# Android (5058415 based on r339409) clang version 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec746213857d083c0e8b0abb568790) (https://android.googlesource.com/toolchain/llvm 7a6618d69e7e8111e1d49dc9e7813767c5ca756a) (based on LLVM 8.0.2svn)
+$(eval $(call gb_StaticLibrary_add_cxxflags,graphite,\
+     -Os \
+))
+endif
+
 $(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,graphite,cpp))
 
 $(eval $(call gb_StaticLibrary_add_generated_exception_objects,graphite,\
commit ae94f1d1b441068a1baba31eef1549ae895180ba
Author:     kaishu-sahu <kaishusahu101 at gmail.com>
AuthorDate: Sun Jan 27 15:56:02 2019 +0530
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:34 2019 +0200

    android: fix ArrayIndexOutOfBounds on selecting 'Drawings' in DefaultFileFilter setting
    
    Change-Id: I5ed924d9d79db169b11a0561b89da9b57eb078d9
    Reviewed-on: https://gerrit.libreoffice.org/66971
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/android/source/res/values/arrays.xml b/android/source/res/values/arrays.xml
index 671424bfd13b..311717574481 100644
--- a/android/source/res/values/arrays.xml
+++ b/android/source/res/values/arrays.xml
@@ -11,6 +11,7 @@
         <item >0</item>
         <item >1</item>
         <item >2</item>
+        <item >3</item>
     </string-array>
     <string-array name="SortModeStringValues">
         <item >0</item>
commit d6a9e6e665d7d250cdaa3c99753f02efd34ebcbc
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Mar 12 19:52:45 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:33 2019 +0200

    sal, android: fix -Werror,-Wreturn-type
    
    Change-Id: Ic37967dedb2378106db2f3f437781c8ad20cad56

diff --git a/sal/android/libreofficekit-jni.c b/sal/android/libreofficekit-jni.c
index c11f7dd4eb09..edd56a2fec37 100644
--- a/sal/android/libreofficekit-jni.c
+++ b/sal/android/libreofficekit-jni.c
@@ -143,6 +143,8 @@ jboolean libreofficekit_initialize(JNIEnv* env,
     }
 
     LOGI("LibreOfficeKit: libreofficekit_initialize finished");
+
+    return JNI_TRUE;
 }
 
 /// Initialize the LibreOfficeKit.
commit e1e516f233ba65460e33c39de88e318e865eb1f8
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Fri Feb 15 16:04:51 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:33 2019 +0200

    android: Set the program path sensibly when we've got nullptr.
    
    Change-Id: I4415459ca5d758d06d866faeca85e1cf154d0567
    Reviewed-on: https://gerrit.libreoffice.org/67877
    Tested-by: Jenkins
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6e65942b6101..1360f75d6338 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -24,6 +24,10 @@
 #include <postmac.h>
 #endif
 
+#ifdef ANDROID
+#include <osl/detail/android-bootstrap.h>
+#endif
+
 #include <algorithm>
 #include <memory>
 #include <iostream>
@@ -4972,11 +4976,16 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
     }
     else
     {
+#ifdef ANDROID
+        aAppPath = OUString::fromUtf8(lo_get_app_data_dir()) + "/program";
+#else
         // Fun conversion dance back and forth between URLs and system paths...
         OUString aAppURL;
         ::osl::Module::getUrlFromAddress( reinterpret_cast< oslGenericFunction >(lo_initialize),
                                           aAppURL);
         osl::FileBase::getSystemPathFromFileURL( aAppURL, aAppPath );
+#endif
+
 #ifdef IOS
         // The above gives something like
         // "/private/var/containers/Bundle/Application/953AA851-CC15-4C60-A2CB-C2C6F24E6F71/Foo.app/Foo",
commit 276c3910bd7bc5e5bacecd280db812519ac6e36c
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Fri Feb 15 16:01:55 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:32 2019 +0200

    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 at collabora.com>

diff --git a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java
index ce84b7409c1f..f6658d64806a 100644
--- a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java
+++ b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java
@@ -67,19 +67,6 @@ public final class LibreOfficeKit
         String cacheDir = activity.getApplication().getCacheDir().getAbsolutePath();
         String apkFile = activity.getApplication().getPackageResourcePath();
 
-        // If there is a fonts.conf file in the apk that can be extracted, automatically
-        // set the FONTCONFIG_FILE env var.
-        InputStream inputStream;
-        try {
-            inputStream = activity.getAssets().open("unpack/etc/fonts/fonts.conf");
-        } catch (java.io.IOException exception) {
-            inputStream = null;
-        }
-
-        if (inputStream != null) {
-            putenv("FONTCONFIG_FILE=" + dataDir + "/etc/fonts/fonts.conf");
-        }
-
         if (!initializeNative(dataDir, cacheDir, apkFile, mgr)) {
             Log.e(LOGTAG, "Initialize native failed!");
             return;
diff --git a/sal/android/libreofficekit-jni.c b/sal/android/libreofficekit-jni.c
index abbf3edaed10..c11f7dd4eb09 100644
--- a/sal/android/libreofficekit-jni.c
+++ b/sal/android/libreofficekit-jni.c
@@ -74,6 +74,9 @@ jboolean libreofficekit_initialize(JNIEnv* env,
     const char *cacheDirPath;
     const char *apkFilePath;
 
+    const char *fontsConf = "/etc/fonts/fonts.conf";
+    char *fontsConfPath;
+
     setenv("OOO_DISABLE_RECOVERY", "1", 1);
 
     native_asset_manager = AAssetManager_fromJava(env, assetManager);
@@ -89,6 +92,18 @@ jboolean libreofficekit_initialize(JNIEnv* env,
     // TMPDIR is used by osl_getTempDirURL()
     setenv("TMPDIR", cache_dir, 1);
 
+    fontsConfPath = malloc(strlen(data_dir) + sizeof(fontsConf));
+    strcpy(fontsConfPath, data_dir);
+    strcat(fontsConfPath, fontsConf);
+
+    fd = open(fontsConfPath, O_RDONLY);
+    if (fd != -1) {
+        close(fd);
+        LOGI("Setting FONTCONFIG_FILE to %s", fontsConfPath);
+        setenv("FONTCONFIG_FILE", fontsConfPath, 1);
+    }
+    free(fontsConfPath);
+
     apkFilePath =  (*env)->GetStringUTFChars(env, apkFile, NULL);
 
     fd = open(apkFilePath, O_RDONLY);
commit 0b2431e796b0a185a82b1dd6ea3cdd5003f15968
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Fri Feb 15 11:46:36 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:31 2019 +0200

    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 at collabora.com>

diff --git a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java
index c82f7b16b01a..ce84b7409c1f 100644
--- a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java
+++ b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java
@@ -76,15 +76,10 @@ public final class LibreOfficeKit
             inputStream = null;
         }
 
-        putenv("OOO_DISABLE_RECOVERY=1");
-
         if (inputStream != null) {
             putenv("FONTCONFIG_FILE=" + dataDir + "/etc/fonts/fonts.conf");
         }
 
-        // TMPDIR is used by osl_getTempDirURL()
-        putenv("TMPDIR=" + cacheDir);
-
         if (!initializeNative(dataDir, cacheDir, apkFile, mgr)) {
             Log.e(LOGTAG, "Initialize native failed!");
             return;
diff --git a/android/Bootstrap/version.map b/android/Bootstrap/version.map
index de561bfc296b..930e1e071999 100644
--- a/android/Bootstrap/version.map
+++ b/android/Bootstrap/version.map
@@ -3,7 +3,7 @@ dummy {
         Java_*;
         JNI_OnLoad;
         _ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions
-        libreofficekit_hook*;
+        libreofficekit_*;
     local:
         *;
 };
diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 5c600b5022bf..f2a6d868102d 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -250,13 +250,13 @@ typedef LibreOfficeKit *(LokHookFunction2)( const char *install_path, const char
 
 typedef int             (LokHookPreInit)  ( const char *install_path, const char *user_profile_url );
 
-#if defined(IOS)
+#if defined(IOS) || defined(ANDROID)
 LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* user_profile_path);
 #endif
 
 static LibreOfficeKit *lok_init_2( const char *install_path,  const char *user_profile_url )
 {
-#if !defined(IOS)
+#if !defined(IOS) && !defined(ANDROID)
     void *dlhandle;
     char *imp_lib;
     LokHookFunction *pSym;
diff --git a/sal/android/libreofficekit-jni.c b/sal/android/libreofficekit-jni.c
index 4cd6594780e4..abbf3edaed10 100644
--- a/sal/android/libreofficekit-jni.c
+++ b/sal/android/libreofficekit-jni.c
@@ -65,8 +65,7 @@ void Java_org_libreoffice_kit_LibreOfficeKit_redirectStdio
 
 /// Initialize the LibreOfficeKit.
 __attribute__ ((visibility("default")))
-jboolean Java_org_libreoffice_kit_LibreOfficeKit_initializeNative
-    (JNIEnv* env, jobject clazz,
+jboolean libreofficekit_initialize(JNIEnv* env,
      jstring dataDir, jstring cacheDir, jstring apkFile, jobject assetManager)
 {
     struct stat st;
@@ -75,10 +74,7 @@ jboolean Java_org_libreoffice_kit_LibreOfficeKit_initializeNative
     const char *cacheDirPath;
     const char *apkFilePath;
 
-    const char program_dir[] = "/program";
-    size_t data_dir_len;
-
-    (void) clazz;
+    setenv("OOO_DISABLE_RECOVERY", "1", 1);
 
     native_asset_manager = AAssetManager_fromJava(env, assetManager);
 
@@ -90,6 +86,9 @@ jboolean Java_org_libreoffice_kit_LibreOfficeKit_initializeNative
     cache_dir = strdup(cacheDirPath);
     (*env)->ReleaseStringUTFChars(env, cacheDir, cacheDirPath);
 
+    // TMPDIR is used by osl_getTempDirURL()
+    setenv("TMPDIR", cache_dir, 1);
+
     apkFilePath =  (*env)->GetStringUTFChars(env, apkFile, NULL);
 
     fd = open(apkFilePath, O_RDONLY);
@@ -128,6 +127,21 @@ jboolean Java_org_libreoffice_kit_LibreOfficeKit_initializeNative
         return JNI_FALSE;
     }
 
+    LOGI("LibreOfficeKit: libreofficekit_initialize finished");
+}
+
+/// Initialize the LibreOfficeKit.
+__attribute__ ((visibility("default")))
+jboolean Java_org_libreoffice_kit_LibreOfficeKit_initializeNative
+    (JNIEnv* env, jobject clazz,
+     jstring dataDir, jstring cacheDir, jstring apkFile, jobject assetManager)
+{
+    const char program_dir[] = "/program";
+    size_t data_dir_len;
+
+    (void) clazz;
+    libreofficekit_initialize(env, dataDir, cacheDir, apkFile, assetManager);
+
     // LibreOfficeKit expects a path to the program/ directory
     free(full_program_dir);
     data_dir_len = strlen(data_dir);
@@ -166,8 +180,7 @@ __attribute__ ((visibility("default")))
 AAssetManager *
 lo_get_native_assetmgr(void)
 {
-        return native_asset_manager;
+    return native_asset_manager;
 }
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit fc5199b098afe06234c9fb812f67102a20e69b35
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Mon Feb 18 13:25:40 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:30 2019 +0200

    android: Expose setting of the JavaVM.
    
    Needed when we use the liblo-native-code as a library.
    
    Change-Id: Ia4d1d72f2203a96d1196d015b521201919bbb165
    Reviewed-on: https://gerrit.libreoffice.org/67965
    Tested-by: Jenkins
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/include/osl/detail/android-bootstrap.h b/include/osl/detail/android-bootstrap.h
index 5a5c7fcbd82d..169f3efaf282 100644
--- a/include/osl/detail/android-bootstrap.h
+++ b/include/osl/detail/android-bootstrap.h
@@ -35,6 +35,10 @@ int lo_apk_closedir(lo_apk_dir *dirp);
 
 int lo_apk_lstat(const char *path, struct stat *statp);
 
+/// "libreofficekit_" prefix, because it is exported from the .so, when we are
+/// initializing the JNI externally.
+void libreofficekit_set_javavm(JavaVM *vm);
+
 JavaVM *lo_get_javavm(void);
 
 const char *lo_get_app_data_dir(void);
diff --git a/sal/android/lo-bootstrap.c b/sal/android/lo-bootstrap.c
index d1ecd810ab19..0af8cfbb4cd3 100644
--- a/sal/android/lo-bootstrap.c
+++ b/sal/android/lo-bootstrap.c
@@ -898,6 +898,13 @@ Java_org_libreoffice_android_Bootstrap_address_1of_1direct_1byte_1buffer(JNIEnv
 }
 
 __attribute__ ((visibility("default")))
+void
+libreofficekit_set_javavm(JavaVM *vm)
+{
+    the_java_vm = vm;
+}
+
+__attribute__ ((visibility("default")))
 JavaVM *
 lo_get_javavm(void)
 {
commit 683376af231091fd6b14c37eab1d1364d8270f2a
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Thu Feb 14 14:54:02 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:30 2019 +0200

    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 at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared
index f77679853d39..942f5f8179ee 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -59,7 +59,7 @@ WHOLELIBS = \
 $(OBJLOCAL)/liblo-native-code.so : native-code.cxx $(ALL_STATIC_LIBS)
 	@echo "Linking $@"
 	mkdir -p $(OBJLOCAL)
-	$(CXX) -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script=../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) -lc++_static -lc++abi -landroid_support $(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-lunwind) $(addprefix -l,$(NSSLIBS)) -lGLESv2 -landroid -ljnigraphics -llog -lz
+	$(CXX) -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script=../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -Wl,-soname,liblo-native-code.so -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) -lc++_static -lc++abi -landroid_support $(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-lunwind) $(addprefix -l,$(NSSLIBS)) -lGLESv2 -landroid -ljnigraphics -llog -lz
 
 $(SODEST)/liblo-native-code.so : $(OBJLOCAL)/liblo-native-code.so
 	mkdir -p $(SODEST)
diff --git a/android/Bootstrap/version.map b/android/Bootstrap/version.map
index 067785410a7a..de561bfc296b 100644
--- a/android/Bootstrap/version.map
+++ b/android/Bootstrap/version.map
@@ -3,6 +3,7 @@ dummy {
         Java_*;
         JNI_OnLoad;
         _ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions
+        libreofficekit_hook*;
     local:
         *;
 };
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3291767acd62..6e65942b6101 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5161,7 +5161,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
     return bInitialized;
 }
 
-SAL_DLLPUBLIC_EXPORT
+SAL_JNI_EXPORT
 LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* user_profile_url)
 {
     if (!gImpl)
@@ -5177,7 +5177,7 @@ LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* user
     return static_cast<LibreOfficeKit*>(gImpl);
 }
 
-SAL_DLLPUBLIC_EXPORT
+SAL_JNI_EXPORT
 LibreOfficeKit *libreofficekit_hook(const char* install_path)
 {
     return libreofficekit_hook_2(install_path, nullptr);
commit 842bb42189fadeb230fd9d5909ca300a2db40e54
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 11 14:33:18 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:29 2019 +0200

    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 at redhat.com>

diff --git a/android/Bootstrap/version.map b/android/Bootstrap/version.map
index e12d9985e78f..067785410a7a 100644
--- a/android/Bootstrap/version.map
+++ b/android/Bootstrap/version.map
@@ -2,6 +2,7 @@ dummy {
      global:
         Java_*;
         JNI_OnLoad;
+        _ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions
     local:
         *;
 };
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
index b4a5117b81c0..46c7f9c85a7f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
@@ -148,9 +148,6 @@ namespace CPPU_CURRENT_NAMESPACE
             rtti = (type_info *)dlsym( m_hApp, symName.getStr() );
 #else
             rtti = (type_info *)dlsym( RTLD_DEFAULT, symName.getStr() );
-            // Unfortunately dlsym for weak symbols doesn't work in
-            // Android 4.0 at least, sigh, so we will always take the
-            // else branch below.
 #endif
 
             if (rtti)
commit 7a228e8dda93e1e0398e4b34bb564c58b7c47f36
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Oct 25 15:29:26 2018 +0300
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:29 2019 +0200

    The 2nd parameter to lo_initialize() is a URL so use such naming consistently
    
    Change-Id: Id4e7f8556d6910ab43b0f7b8ba09e7be8b1ec1d1

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2342d6a8f10a..3291767acd62 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5162,14 +5162,14 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
 }
 
 SAL_DLLPUBLIC_EXPORT
-LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* user_profile_path)
+LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* user_profile_url)
 {
     if (!gImpl)
     {
         SAL_INFO("lok", "Create libreoffice object");
 
         gImpl = new LibLibreOffice_Impl();
-        if (!lo_initialize(gImpl, install_path, user_profile_path))
+        if (!lo_initialize(gImpl, install_path, user_profile_url))
         {
             lo_destroy(gImpl);
         }
@@ -5184,9 +5184,9 @@ LibreOfficeKit *libreofficekit_hook(const char* install_path)
 }
 
 SAL_JNI_EXPORT
-int lok_preinit(const char* install_path, const char* user_profile_path)
+int lok_preinit(const char* install_path, const char* user_profile_url)
 {
-    return lo_initialize(nullptr, install_path, user_profile_path);
+    return lo_initialize(nullptr, install_path, user_profile_url);
 }
 
 static void lo_destroy(LibreOfficeKit* pThis)
commit aa448403296e35a57a17a50c9a077f63dafceb5b
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 11 16:37:43 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:28 2019 +0200

    Switch Android armeabi-v7a to libc++/libc++abi/libunwind too
    
    It had been left out in 4082a18406c18af7b4fcef7bd501c3679c3be56b "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 at redhat.com>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared
index 2e1c8c163bd2..f77679853d39 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -59,7 +59,7 @@ WHOLELIBS = \
 $(OBJLOCAL)/liblo-native-code.so : native-code.cxx $(ALL_STATIC_LIBS)
 	@echo "Linking $@"
 	mkdir -p $(OBJLOCAL)
-	$(CXX) -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script=../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) $(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-lgnustl_static,-lc++_static -lc++abi -landroid_support) $(addprefix -l,$(NSSLIBS)) -lGLESv2 -landroid -ljnigraphics -llog -lz
+	$(CXX) -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script=../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) -lc++_static -lc++abi -landroid_support $(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-lunwind) $(addprefix -l,$(NSSLIBS)) -lGLESv2 -landroid -ljnigraphics -llog -lz
 
 $(SODEST)/liblo-native-code.so : $(OBJLOCAL)/liblo-native-code.so
 	mkdir -p $(SODEST)
diff --git a/configure.ac b/configure.ac
index faaed1bbe8b9..6687a8d54ff3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -486,22 +486,14 @@ if test -n "$with_android_ndk"; then
     ANDROIDCFLAGS="$ANDROIDCFLAGS -D__ANDROID_API__=$ANDROID_API_LEVEL -isystem $ANDROID_NDK_HOME/sysroot/usr/include"
     ANDROIDCFLAGS="$ANDROIDCFLAGS -isystem $ANDROID_NDK_HOME/sysroot/usr/include/$android_gnu_prefix"
     ANDROIDCFLAGS="$ANDROIDCFLAGS --sysroot=$SYSBASE -ffunction-sections -fdata-sections -Qunused-arguments"
-    if test "$ANDROID_APP_ABI" = "armeabi-v7a"; then
-    ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9/libs/$ANDROID_APP_ABI -D_GTHREAD_USE_MUTEX_INIT_FUNC=1"
-    else
     ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++/libs/$ANDROID_APP_ABI"
-    fi
     if test "$ENABLE_LTO" = TRUE; then
         # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
         # $CC and $CXX when building external libraries
         ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
     fi
 
-    if test "$ANDROID_APP_ABI" = "armeabi-v7a"; then
-    ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9/include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9/libs/$ANDROID_APP_ABI/include -std=c++11"
-    else
     ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++/include -I$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++abi/include -I$ANDROID_NDK_HOME/sources/android/support/include -std=c++11"
-    fi
 
     if test -z "$CC"; then
         CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk
index aa831e3aa7db..a21401011bde 100644
--- a/external/liborcus/UnpackedTarball_liborcus.mk
+++ b/external/liborcus/UnpackedTarball_liborcus.mk
@@ -27,12 +27,4 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
 ))
 endif
 
-# TODO: remove once switching arm to llvm-c++
-ifeq ($(ANDROID_APP_ABI),armeabi-v7a)
-$(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
-	external/liborcus/android-workaround.patch \
-))
-endif
-
-
 # vim: set noet sw=4 ts=4:
diff --git a/external/liborcus/android-workaround.patch b/external/liborcus/android-workaround.patch
deleted file mode 100644
index f9d047dc0559..000000000000
--- a/external/liborcus/android-workaround.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/parser/sax_parser_base.cpp b/src/parser/sax_parser_base.cpp
-index 743130d..2624bd5 100644
---- a/src/parser/sax_parser_base.cpp
-+++ b/src/parser/sax_parser_base.cpp
-@@ -12,6 +12,17 @@
- #include <vector>
- #include <memory>
- 
-+#ifdef __ANDROID__
-+namespace std
-+{
-+int stoi(const std::string& str, std::size_t* /*pos*/ = 0, int base = 10)
-+{
-+    char* end;
-+    return strtol(str.c_str(), &end, base);
-+}
-+}
-+#endif
-+
- namespace orcus { namespace sax {
- 
- malformed_xml_error::malformed_xml_error(const std::string& msg, std::ptrdiff_t offset) :
diff --git a/include/android/compatibility.hxx b/include/android/compatibility.hxx
index 27c99f4f2604..1dc403dc0fe8 100644
--- a/include/android/compatibility.hxx
+++ b/include/android/compatibility.hxx
@@ -27,12 +27,6 @@ namespace std
 {
 inline double fmax(double x, double y) { return ::fmax(x, y); }
 
-inline long stol(const std::string& str, std::size_t* /*pos*/ = 0, int base = 10)
-{
-    char* end;
-    return strtol(str.c_str(), &end, base);
-}
-
 template <typename T> T round(T x) { return ::round(x); }
 
 template <typename T> T trunc(T x) { return ::trunc(x); }
diff --git a/solenv/gbuild/platform/android.mk b/solenv/gbuild/platform/android.mk
index bc8ad996f8df..572a7c5b1028 100644
--- a/solenv/gbuild/platform/android.mk
+++ b/solenv/gbuild/platform/android.mk
@@ -9,25 +9,14 @@
 
 ifeq ($(DISABLE_DYNLOADING),TRUE)
 
-ifeq ($(ANDROID_APP_ABI),armeabi-v7a)
-# TODO: gnustl is deprecated/will be removed in future versions of the ndk
-gb_STDLIBS := -lgnustl_static
-else
 gb_STDLIBS := \
 	-lc++_static \
 	-lc++abi \
 	-landroid_support \
 
-endif
-
 else
 
-ifeq ($(ANDROID_APP_ABI),armeabi-v7a)
-# TODO: gnustl is deprecated/will be removed in future versions of the ndk
-gb_STDLIBS := -lgnustl_shared
-else
 gb_STDLIBS := -lc++_shared
-endif
 
 endif
 
commit 015967e5d199ce33e6d07cc5b015a0cdab89f3fd
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 11 14:03:31 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:28 2019 +0200

    Move NSSLIBS to a more sensible place on the linker command line
    
    511ae02c6457e69cb6daab871acd9c3e7d64e2e3 "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 at redhat.com>

diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared
index e0678ba8c779..2e1c8c163bd2 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -52,7 +52,6 @@ WHOLELIBS = \
   -Wl,--whole-archive \
   $(addprefix -l,$(strip \
 	juh \
-	$(NSSLIBS) \
   )) \
   -Wl,--no-whole-archive
 
@@ -60,7 +59,7 @@ WHOLELIBS = \
 $(OBJLOCAL)/liblo-native-code.so : native-code.cxx $(ALL_STATIC_LIBS)
 	@echo "Linking $@"
 	mkdir -p $(OBJLOCAL)
-	$(CXX) -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script=../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) $(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-lgnustl_static,-lc++_static -lc++abi -landroid_support) -lGLESv2 -landroid -ljnigraphics -llog -lz
+	$(CXX) -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script=../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) $(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-lgnustl_static,-lc++_static -lc++abi -landroid_support) $(addprefix -l,$(NSSLIBS)) -lGLESv2 -landroid -ljnigraphics -llog -lz
 
 $(SODEST)/liblo-native-code.so : $(OBJLOCAL)/liblo-native-code.so
 	mkdir -p $(SODEST)
commit db3cbdf116d35782c49e22b1db32dead4e95b148
Author:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
AuthorDate: Wed Nov 22 23:08:06 2017 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:27 2019 +0200

    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 at googlemail.com>
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared
index ae80db1fef98..e0678ba8c779 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -60,7 +60,7 @@ WHOLELIBS = \
 $(OBJLOCAL)/liblo-native-code.so : native-code.cxx $(ALL_STATIC_LIBS)
 	@echo "Linking $@"
 	mkdir -p $(OBJLOCAL)
-	$(CXX) -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script=../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) -lgnustl_static -lGLESv2 -landroid -ljnigraphics -llog -lz
+	$(CXX) -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script=../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) $(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-lgnustl_static,-lc++_static -lc++abi -landroid_support) -lGLESv2 -landroid -ljnigraphics -llog -lz
 
 $(SODEST)/liblo-native-code.so : $(OBJLOCAL)/liblo-native-code.so
 	mkdir -p $(SODEST)
diff --git a/android/source/build.gradle b/android/source/build.gradle
index 1950b2357de5..c2d4aeae0e56 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -17,31 +17,34 @@ allprojects {
 buildscript {
     repositories {
         jcenter()
+        maven {
+            url "https://maven.google.com"
+        }
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:2.3.3'
+        classpath 'com.android.tools.build:gradle:3.0.1'
     }
 }
 
 // compile-time dependencies
 dependencies {
-    compile fileTree(dir: "${liboInstdir}/${liboUREJavaFolder}", include: [
+    implementation fileTree(dir: "${liboInstdir}/${liboUREJavaFolder}", include: [
             "java_uno.jar",
             "juh.jar",
             "jurt.jar",
             "ridl.jar",
             "unoloader.jar"
     ])
-    compile files("${liboInstdir}/${liboShareJavaFolder}/unoil.jar")
-    debugCompile(name:'owncloud_android_lib-debug', ext:'aar')
-    releaseCompile(name:'owncloud_android_lib-release', ext:'aar')
-    compile 'com.android.support:design:26.1.0' // also pulls-in corresponding support libraries
-    compile 'com.android.support.constraint:constraint-layout:1.0.2'
+    implementation files("${liboInstdir}/${liboShareJavaFolder}/unoil.jar")
+    debugImplementation(name:'owncloud_android_lib-debug', ext:'aar')
+    releaseImplementation(name:'owncloud_android_lib-release', ext:'aar')
+    implementation 'com.android.support:design:27.0.1' // also pulls-in corresponding support libraries
+    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
 }
 
 android {
     compileSdkVersion 26
-    buildToolsVersion "26.0.1"
+    buildToolsVersion "27.0.1"
     compileOptions {
         // silence some java-language features hints
         sourceCompatibility 6
@@ -77,9 +80,11 @@ android {
             manifestPlaceholders = [installLocation: "preferExternal", extractNativeLibs: "true"]
         }
     }
+
+    flavorDimensions "default"
     productFlavors {
-        strippedUI
-        fullUI
+        strippedUI.dimension "default"
+        fullUI.dimension "default"
     }
 }
 
diff --git a/android/source/gradle.properties b/android/source/gradle.properties
index 899c9f99f396..ad1671ef57fd 100644
--- a/android/source/gradle.properties
+++ b/android/source/gradle.properties
@@ -1 +1 @@
-org.gradle.jvmargs=-Xmx2048m
+org.gradle.jvmargs=-Xmx3072m
diff --git a/android/source/gradle/wrapper/gradle-wrapper.properties b/android/source/gradle/wrapper/gradle-wrapper.properties
index 5dc276a1ab03..26a7675eb5fc 100644
--- a/android/source/gradle/wrapper/gradle-wrapper.properties
+++ b/android/source/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Tue Mar 14 19:29:07 CET 2017
+#Mon Nov 20 19:19:05 CET 2017
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
diff --git a/android/source/jni/Android.mk b/android/source/jni/Android.mk
deleted file mode 100644
index 939a1ea503bb..000000000000
--- a/android/source/jni/Android.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-# Needed just to satisfy ndk-gdb for now, but maybe later we will actually add
-# some JNI code here
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/bridges/Library_cpp_uno.mk b/bridges/Library_cpp_uno.mk
index 22ce084178b6..b64b97e6f22b 100644
--- a/bridges/Library_cpp_uno.mk
+++ b/bridges/Library_cpp_uno.mk
@@ -199,6 +199,7 @@ endif
 # it off.
 ifeq ($(COM),GCC)
 $(eval $(call gb_Library_add_cxxflags,gcc3_uno,\
+	$(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-I$(ANDROID_BINUTILS_PREBUILT_ROOT)/lib/gcc/arm-linux-androideabi/4.9.x/include) \
 	-fno-omit-frame-pointer \
 	-fno-strict-aliasing \
 	$(if $(filter TRUE,$(ENABLE_LTO)),-fno-lto) \
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
index 43e255c21cf6..b4a5117b81c0 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
@@ -309,7 +309,7 @@ namespace CPPU_CURRENT_NAMESPACE
             return;
         }
 
-        typelib_TypeDescription * pExcTypeDescr = 0;
+        typelib_TypeDescription * pExcTypeDescr = nullptr;
         OUString unoName( toUNOname( header->exceptionType->name() ) );
 #if OSL_DEBUG_LEVEL > 1
         OString cstr_unoName( OUStringToOString( unoName, RTL_TEXTENCODING_ASCII_US ) );
@@ -318,7 +318,7 @@ namespace CPPU_CURRENT_NAMESPACE
         typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData );
         if (0 == pExcTypeDescr)
         {
-            RuntimeException aRE( OUString("exception type not found: ") + unoName );
+            RuntimeException aRE( "exception type not found: " + unoName );
             Type const & rType = cppu::UnoType<decltype(aRE)>::get();
             uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
             SAL_WARN("bridges", aRE.Message);
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
index 7fddd841498b..62e0feece40b 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
@@ -23,11 +23,7 @@
 #include <typeinfo>
 #include <exception>
 #include <cstddef>
-#ifndef ANDROID
 #include <unwind.h>
-#else
-#include <unwind-arm.h>
-#endif
 
 #include <cxxabi.h>
 #ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h
@@ -37,13 +33,35 @@
 #include "config_cxxabi.h"
 #include "uno/mapping.h"
 
-namespace CPPU_CURRENT_NAMESPACE
-{
-
-    void dummy_can_throw_anything( char const * );
+#if !HAVE_CXXABI_H_CLASS_TYPE_INFO
+// <https://mentorembedded.github.io/cxx-abi/abi.html>,
+// libstdc++-v3/libsupc++/cxxabi.h:
+namespace __cxxabiv1 {
+class __class_type_info: public std::type_info {
+public:
+    explicit __class_type_info(char const * n): type_info(n) {}
+    ~__class_type_info() override;
+};
+}
+#endif
 
-    // -- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h
+#if !HAVE_CXXABI_H_SI_CLASS_TYPE_INFO
+// <https://mentorembedded.github.io/cxx-abi/abi.html>,
+// libstdc++-v3/libsupc++/cxxabi.h:
+namespace __cxxabiv1 {
+class __si_class_type_info: public __class_type_info {
+public:
+    __class_type_info const * __base_type;
+    explicit __si_class_type_info(
+        char const * n, __class_type_info const *base):
+        __class_type_info(n), __base_type(base) {}
+    ~__si_class_type_info() override;
+};
+}
+#endif
 
+#if !HAVE_CXXABI_H_CXA_EH_GLOBALS
+namespace __cxxabiv1 {
     struct __cxa_exception
     {
         std::type_info *exceptionType;
@@ -68,12 +86,26 @@ namespace CPPU_CURRENT_NAMESPACE
         _Unwind_Exception unwindHeader;
     };
 
+}
+#endif
+
+namespace CPPU_CURRENT_NAMESPACE
+{
+
+    void dummy_can_throw_anything( char const * );
+
+    // -- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h
+
     extern "C" void *__cxa_allocate_exception(
         std::size_t thrown_size ) throw();
     extern "C" void __cxa_throw (
         void *thrown_exception, std::type_info *tinfo,
         void (*dest) (void *) ) __attribute__((noreturn));
 
+}
+
+#if !HAVE_CXXABI_H_CXA_EH_GLOBALS
+namespace __cxxabiv1 {
     struct __cxa_eh_globals
     {
         __cxa_exception *caughtExceptions;
@@ -83,6 +115,7 @@ namespace CPPU_CURRENT_NAMESPACE
 #endif
     };
 }
+#endif
 
 #if !HAVE_CXXABI_H_CXA_GET_GLOBALS
 namespace __cxxabiv1 {
@@ -95,7 +128,7 @@ namespace CPPU_CURRENT_NAMESPACE
     void raiseException(
         uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
     void fillUnoException(
-        __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
+        __cxxabiv1::__cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
 }
 
 extern "C" void privateSnippetExecutor();
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
index 0f464e1ea6be..3fc2602a602b 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
@@ -571,10 +571,9 @@ static void cpp_call(
     catch (...)
     {
         // fill uno exception
-        fillUnoException(
-          reinterpret_cast< CPPU_CURRENT_NAMESPACE::__cxa_eh_globals * >(
-                    __cxxabiv1::__cxa_get_globals())->caughtExceptions,
-                    *ppUnoExc, pThis->getBridge()->getCpp2Uno());
+        CPPU_CURRENT_NAMESPACE::fillUnoException(
+             __cxxabiv1::__cxa_get_globals()->caughtExceptions,
+             *ppUnoExc, pThis->getBridge()->getCpp2Uno());
 
         // temporary params
         for ( ; nTempIndices--; )
diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx
index d5567ed6216c..f959683838f3 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx
@@ -166,6 +166,9 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr )
 #if OSL_DEBUG_LEVEL > 1
                 fprintf( stderr,"generated rtti for %s\n", rttiName );
 #endif
+// TODO: incompatible with llvm-c++ in ndk16 - no __si_class_type_info or __class_type_info
+// either do as iOS one and inline thing or find another way
+#if !defined(ANDROID)
                 if (pTypeDescr->pBaseTypeDescription)
                 {
                     // ensure availability of base
@@ -183,6 +186,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr )
                 pair< t_rtti_map::iterator, bool > insertion(
                     m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
                 SAL_WARN_IF( !insertion.second, "bridges", "### inserting new generated rtti failed?!" );
+#endif
             }
             else // taking already generated rtti
             {
@@ -257,7 +261,9 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
     }
     rtti = s_rtti->getRTTI(reinterpret_cast<typelib_CompoundTypeDescription *>(pTypeDescr));
     TYPELIB_DANGER_RELEASE( pTypeDescr );
+#if !defined(ANDROID) // see TODO above
     assert(rtti && "### no rtti for throwing exception!");
+#endif
     if (! rtti)
     {
         throw RuntimeException(
diff --git a/config_host.mk.in b/config_host.mk.in
index 4b42b38f3d64..96bd80d67868 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -20,6 +20,7 @@ export ANDROID_NDK_HOME=@ANDROID_NDK_HOME@
 export ANDROID_APP_ABI=@ANDROID_APP_ABI@
 export ANDROID_SDK_HOME=@ANDROID_SDK_HOME@
 export ANDROID_PACKAGE_NAME=@ANDROID_PACKAGE_NAME@
+export ANDROID_BINUTILS_PREBUILT_ROOT=@ANDROID_BINUTILS_PREBUILT_ROOT@
 export ANDROID_GCC_TOOLCHAIN_VERSION=@ANDROID_GCC_TOOLCHAIN_VERSION@
 export ANT=@ANT@
 export ANT_HOME=@ANT_HOME@
diff --git a/configure.ac b/configure.ac
index 9b4cad2ed394..faaed1bbe8b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -388,16 +388,16 @@ if test -n "$with_android_ndk"; then
     fi
     case $ANDROID_NDK_VERSION in
     r9*|r10*)
-        AC_MSG_ERROR([Building for Android is only supported with NDK versions above 15.x*])
+        AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x*])
         ;;
     11.1.*|12.1.*|13.1.*|14.1.*)
-        AC_MSG_ERROR([Building for Android is only supported with NDK versions above 15.x.*])
+        AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x.*])
         ;;
-    15.0.*|15.1.*)
+    16.*)
         ;;
     *)
-        AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only version 15.0.* and 15.1.* have been used successfully. Proceed at your own risk.])
-        add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only version 15.0.* and 15.1.* have been used successfully. Proceed at your own risk."
+        AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only version 16.* have been used successfully. Proceed at your own risk.])
+        add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only version 16.* have been used successfully. Proceed at your own risk."
         ;;
     esac
 
@@ -431,6 +431,7 @@ if test -n "$with_android_ndk"; then
         android_gnu_prefix=i686-linux-android
         LLVM_TRIPLE=i686-none-linux-android
         ANDROID_APP_ABI=x86
+        ANDROID_ARCH=$android_cpu
         ANDROIDCFLAGS="-march=atom"
     fi
 
@@ -469,6 +470,7 @@ if test -n "$with_android_ndk"; then
     esac
     ANDROID_COMPILER_BIN=$ANDROID_COMPILER_DIR/prebuilt/$ndk_build_os-x86_64/bin
     ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_BINUTILS_DIR/prebuilt/$ndk_build_os-x86_64
+    AC_SUBST(ANDROID_BINUTILS_PREBUILT_ROOT)
 
     test -z "$SYSBASE" && SYSBASE=$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}
     test -z "$AR" && AR=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-ar
@@ -477,16 +479,29 @@ if test -n "$with_android_ndk"; then
     test -z "$RANLIB" && RANLIB=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-ranlib
     test -z "$STRIP" && STRIP=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-strip
 
-    ANDROIDCFLAGS="$ANDROIDCFLAGS -gcc-toolchain $ANDROID_BINUTILS_PREBUILT_ROOT -target $LLVM_TRIPLE -no-canonical-prefixes"
+    ANDROIDCFLAGS="$ANDROIDCFLAGS -gcc-toolchain $ANDROID_BINUTILS_PREBUILT_ROOT -target $LLVM_TRIPLE$ANDROID_API_LEVEL -no-canonical-prefixes"
+    # android is using different sysroots for compilation and linking, but as
+    # there is no full separation in configure and elsewehere, use isystem for
+    # compilation stuff and sysroot for linking
+    ANDROIDCFLAGS="$ANDROIDCFLAGS -D__ANDROID_API__=$ANDROID_API_LEVEL -isystem $ANDROID_NDK_HOME/sysroot/usr/include"
+    ANDROIDCFLAGS="$ANDROIDCFLAGS -isystem $ANDROID_NDK_HOME/sysroot/usr/include/$android_gnu_prefix"
     ANDROIDCFLAGS="$ANDROIDCFLAGS --sysroot=$SYSBASE -ffunction-sections -fdata-sections -Qunused-arguments"
-    ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/$ANDROID_GCC_TOOLCHAIN_VERSION/libs/$ANDROID_APP_ABI"
+    if test "$ANDROID_APP_ABI" = "armeabi-v7a"; then
+    ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9/libs/$ANDROID_APP_ABI -D_GTHREAD_USE_MUTEX_INIT_FUNC=1"
+    else
+    ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++/libs/$ANDROID_APP_ABI"
+    fi
     if test "$ENABLE_LTO" = TRUE; then
         # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
         # $CC and $CXX when building external libraries
         ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
     fi
 
-    ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/$ANDROID_GCC_TOOLCHAIN_VERSION/include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/$ANDROID_GCC_TOOLCHAIN_VERSION/libs/$ANDROID_APP_ABI/include -I$ANDROID_NDK_HOME/sources/cxx-stl/gabi++/include"
+    if test "$ANDROID_APP_ABI" = "armeabi-v7a"; then
+    ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9/include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9/libs/$ANDROID_APP_ABI/include -std=c++11"
+    else
+    ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++/include -I$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++abi/include -I$ANDROID_NDK_HOME/sources/android/support/include -std=c++11"
+    fi
 
     if test -z "$CC"; then
         CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
diff --git a/distro-configs/LibreOfficeAndroid.conf b/distro-configs/LibreOfficeAndroid.conf
index 6259daa68d95..9cc574909d66 100644
--- a/distro-configs/LibreOfficeAndroid.conf
+++ b/distro-configs/LibreOfficeAndroid.conf
@@ -8,3 +8,4 @@
 --without-export-validation
 --without-helppack-integration
 --without-junit
+--disable-largefile
diff --git a/distro-configs/LibreOfficeAndroidX86.conf b/distro-configs/LibreOfficeAndroidX86.conf
index cacd45941ecb..7a2586989391 100644
--- a/distro-configs/LibreOfficeAndroidX86.conf
+++ b/distro-configs/LibreOfficeAndroidX86.conf
@@ -8,3 +8,4 @@
 --without-export-validation
 --without-helppack-integration
 --without-junit
+--disable-largefile
diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
index 168c7f8e87d1..56a85cd65038 100644
--- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
@@ -26,7 +26,6 @@
 #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
 #include <svtools/borderhelper.hxx>
 #include <editeng/borderline.hxx>
-#include <android/compatibility.hxx>
 
 #include <algorithm>
 #include <cmath>
diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk
index b4211bb2fe73..adb0a8f4ae1f 100644
--- a/external/boost/UnpackedTarball_boost.mk
+++ b/external/boost/UnpackedTarball_boost.mk
@@ -37,6 +37,9 @@ boost_patches += clang-cl.patch.0
 boost_patches += boost_1_60_0.undef.warning.patch
 boost_patches += boost_1_63_0.undef.warning.patch.1
 
+# https://svn.boost.org/trac10/ticket/13230
+boost_patches += boost-android-unified.patch.1
+
 boost_patches += windows-no-utf8-locales.patch.0
 
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,boost))
diff --git a/external/boost/boost-android-unified.patch.1 b/external/boost/boost-android-unified.patch.1
new file mode 100644
index 000000000000..458482a37c28
--- /dev/null
+++ b/external/boost/boost-android-unified.patch.1
@@ -0,0 +1,28 @@
+https://svn.boost.org/trac10/ticket/13230 unified headers causing trouble with that..
+diff -ur boost.org/libs/filesystem/src/operations.cpp boost/libs/filesystem/src/operations.cpp
+--- boost.org/libs/filesystem/src/operations.cpp	2017-11-22 02:21:33.724304181 +0100
++++ boost/libs/filesystem/src/operations.cpp	2017-11-22 02:21:59.686302450 +0100
+@@ -11,23 +11,6 @@
+ //--------------------------------------------------------------------------------------// 
+ 
+ //  define 64-bit offset macros BEFORE including boost/config.hpp (see ticket #5355) 
+-#if !(defined(__HP_aCC) && defined(_ILP32) && !defined(_STATVFS_ACPP_PROBLEMS_FIXED))
+-#define _FILE_OFFSET_BITS 64 // at worst, these defines may have no effect,
+-#endif
+-#if !defined(__PGI)
+-#define __USE_FILE_OFFSET64 // but that is harmless on Windows and on POSIX
+-      // 64-bit systems or on 32-bit systems which don't have files larger 
+-      // than can be represented by a traditional POSIX/UNIX off_t type. 
+-      // OTOH, defining them should kick in 64-bit off_t's (and thus 
+-      // st_size)on 32-bit systems that provide the Large File
+-      // Support (LFS)interface, such as Linux, Solaris, and IRIX.
+-      // The defines are given before any headers are included to
+-      // ensure that they are available to all included headers.
+-      // That is required at least on Solaris, and possibly on other
+-      // systems as well.
+-#else
+-#define _FILE_OFFSET_BITS 64
+-#endif
+ 
+ // define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
+ // the library is being built (possibly exporting rather than importing code)
diff --git a/external/cppunit/ExternalProject_cppunit.mk b/external/cppunit/ExternalProject_cppunit.mk
index c03b15cac7b0..d4f063b989b3 100644
--- a/external/cppunit/ExternalProject_cppunit.mk
+++ b/external/cppunit/ExternalProject_cppunit.mk
@@ -52,7 +52,7 @@ $(call gb_ExternalProject_get_state_target,cppunit,build) :
 			$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________NONE) \
 			$(if $(filter WNT,$(OS)),LDFLAGS="-Wl$(COMMA)--enable-runtime-pseudo-reloc-v2") \
 			$(if $(filter SOLARIS,$(OS)),LIBS="-lm") \
-			$(if $(filter ANDROID,$(OS)),LIBS="-lgnustl_shared -lm") \
+			$(if $(filter ANDROID,$(OS)),LIBS="$(gb_STDLIBS)") \
 			CXXFLAGS="$(cppunit_CXXFLAGS)" \
 		&& cd src \
 		&& $(MAKE) \
diff --git a/external/icu/ExternalProject_icu.mk b/external/icu/ExternalProject_icu.mk
index 1a9c5ff90602..c2f6f3566318 100644
--- a/external/icu/ExternalProject_icu.mk
+++ b/external/icu/ExternalProject_icu.mk
@@ -56,7 +56,7 @@ icu_LDFLAGS:=" \
     $(if $(SYSBASE),-L../lib -L../../lib -L../stubdata -L../../stubdata -L$(SYSBASE)/usr/lib) \
     $(if $(filter TRUE,$(HAVE_LD_BSYMBOLIC_FUNCTIONS)),\
 	    -Wl$(COMMA)-Bsymbolic-functions -Wl$(COMMA)--dynamic-list-cpp-new -Wl$(COMMA)--dynamic-list-cpp-typeinfo) \
-    $(if $(filter ANDROID,$(OS)),-lgnustl_shared -lm)"
+    $(if $(filter ANDROID,$(OS)),$(gb_STDLIBS))"
 
 $(call gb_ExternalProject_get_state_target,icu,build) :
 	$(call gb_ExternalProject_run,build,\
diff --git a/external/liborcus/ExternalProject_liborcus.mk b/external/liborcus/ExternalProject_liborcus.mk
index 01c7c050d04a..928c78e3a267 100644
--- a/external/liborcus/ExternalProject_liborcus.mk
+++ b/external/liborcus/ExternalProject_liborcus.mk
@@ -44,7 +44,7 @@ else
 liborcus_LIBS+=-L$(gb_StaticLibrary_WORKDIR) -lboost_system -lboost_iostreams -lboost_filesystem
 endif
 ifeq ($(OS),ANDROID)
-liborcus_LIBS+=-lgnustl_shared -lm
+liborcus_LIBS+=$(gb_STDLIBS)
 endif
 
 liborcus_CPPCLAGS=$(CPPFLAGS)
diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk
index 6941760cd71a..aa831e3aa7db 100644
--- a/external/liborcus/UnpackedTarball_liborcus.mk
+++ b/external/liborcus/UnpackedTarball_liborcus.mk
@@ -26,7 +26,9 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
 	external/liborcus/windows-constants-hack.patch \
 ))
 endif
-ifeq ($(OS),ANDROID)
+
+# TODO: remove once switching arm to llvm-c++
+ifeq ($(ANDROID_APP_ABI),armeabi-v7a)
 $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
 	external/liborcus/android-workaround.patch \
 ))
diff --git a/external/nss/ExternalProject_nss.mk b/external/nss/ExternalProject_nss.mk
index 8ce10b0a4ee9..e83054ca79b7 100644
--- a/external/nss/ExternalProject_nss.mk
+++ b/external/nss/ExternalProject_nss.mk
@@ -49,9 +49,9 @@ $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecuta
 			RANLIB="$(RANLIB)" \
 			NMEDIT="$(NM)edit" \
 			COMMA=$(COMMA) \
-			CC="$(CC)" CCC="$(CXX)" \
+			CC="$(CC)$(if $(filter ANDROID,$(OS)), -D_PR_NO_LARGE_FILES=1 -DSQLITE_DISABLE_LFS=1)" CCC="$(CXX)" \
 			$(if $(CROSS_COMPILING),NSINSTALL="$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py") \
-			$(if $(filter ANDROID,$(OS)),OS_TARGET=Android OS_TARGET_RELEASE=14 ARCHFLAG="" DEFAULT_COMPILER=clang ANDROID_NDK=$(ANDROID_NDK_HOME) ANDROID_TOOLCHAIN_VERSION=$(ANDROID_GCC_TOOLCHAIN_VERSION)) \
+			$(if $(filter ANDROID,$(OS)),OS_TARGET=Android OS_TARGET_RELEASE=14 ARCHFLAG="" DEFAULT_COMPILER=clang ANDROID_NDK=$(ANDROID_NDK_HOME) ANDROID_TOOLCHAIN_VERSION=$(ANDROID_GCC_TOOLCHAIN_VERSION) ANDROID_PREFIX=$(HOST_PLATFORM) ANDROID_SYSROOT=$(SYSBASE) ANDROID_TOOLCHAIN=$(ANDROID_BINUTILS_PREBUILT_ROOT)) \
 			nss_build_all \
 		&& rm -f $(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/*.a \
 		$(if $(filter MACOSX,$(OS)),\
diff --git a/external/nss/nss-android.patch.1 b/external/nss/nss-android.patch.1
index 0e91502bdfd0..50c549303604 100644
--- a/external/nss/nss-android.patch.1
+++ b/external/nss/nss-android.patch.1
@@ -39,10 +39,10 @@ diff -ur nss.org/nspr/configure nss/nspr/configure
 diff -ur nss.org/nss/Makefile nss/nss/Makefile
 --- nss.org/nss/Makefile	2017-09-07 15:29:44.933245745 +0200
 +++ nss/nss/Makefile	2017-09-07 15:32:04.347181076 +0200
-@@ -62,6 +62,7 @@
+@@ -62,6 +62,6 @@
  ifeq ($(OS_TARGET),Android)
  NSPR_CONFIGURE_OPTS += --with-android-ndk=$(ANDROID_NDK) \
-                        --target=$(ANDROID_PREFIX) \
+-                       --target=$(ANDROID_PREFIX) \
 +                       --with-arch=toolchain-default \
                         --with-android-version=$(OS_TARGET_RELEASE) \
                         --with-android-toolchain=$(ANDROID_TOOLCHAIN) \
diff --git a/i18nutil/source/utility/paper.cxx b/i18nutil/source/utility/paper.cxx
index c12ac29704ef..de73723bd231 100644
--- a/i18nutil/source/utility/paper.cxx
+++ b/i18nutil/source/utility/paper.cxx
@@ -290,7 +290,8 @@ PaperInfo PaperInfo::getSystemDefaultPaper()
         }
 #endif
 
-#if defined(LC_PAPER) && defined(_GNU_SOURCE)
+// _NL_PAPER_WIDTH / HEIGHT not available with android unified headers
+#if defined(LC_PAPER) && defined(_GNU_SOURCE) && !defined(ANDROID)
         // try LC_PAPER
         locale_t loc = newlocale(LC_PAPER_MASK, "", static_cast<locale_t>(0));
         if (loc != static_cast<locale_t>(0))
diff --git a/include/android/compatibility.hxx b/include/android/compatibility.hxx
index 0926358caf6f..27c99f4f2604 100644
--- a/include/android/compatibility.hxx
+++ b/include/android/compatibility.hxx
@@ -19,47 +19,25 @@
 
 #include <math.h>
 
-#if defined(ANDROID)
+#if defined(ANDROID) && defined(ARM)
 #include <string>
 #include <sstream>
 
 namespace std
 {
+inline double fmax(double x, double y) { return ::fmax(x, y); }
 
-inline double fmax(double x, double y)
-{
-    return ::fmax(x, y);
-}
-
-inline long stol( const std::string& str, std::size_t* /*pos*/ = 0, int base = 10 )
+inline long stol(const std::string& str, std::size_t* /*pos*/ = 0, int base = 10)
 {
     char* end;
     return strtol(str.c_str(), &end, base);
 }
 
-template<typename T>
-T round(T x)
-{
-    return ::round(x);
-}
-
-template<typename T>
-T trunc(T x)
-{
-    return ::trunc(x);
-}
+template <typename T> T round(T x) { return ::round(x); }
 
-template<typename T>
-T lround(T x)
-{
-    return ::lround(x);
-}
+template <typename T> T trunc(T x) { return ::trunc(x); }
 
-template<typename T>
-T copysign(T x, T y)
-{
-    return ::copysign(x, y);
-}
+template <typename T> T lround(T x) { return ::lround(x); }
 
 template <typename T> std::string to_string(const T& rNumber)
 {
diff --git a/sal/android/lo-bootstrap.c b/sal/android/lo-bootstrap.c
index 7a2da48eb93b..d1ecd810ab19 100644
--- a/sal/android/lo-bootstrap.c
+++ b/sal/android/lo-bootstrap.c
@@ -37,6 +37,11 @@
 
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
 
+// TODO: workaround for unified headers migration - only made available when
+// __USE_BSD or __BIONIC__ are defined, so just add those here...
+#define letoh16(x) (x)
+#define letoh32(x) (x)
+
 struct engine {
     int dummy;
 };
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index d7d60551c62a..f6e2c9e1b485 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -5828,7 +5828,6 @@ include/LibreOfficeKit/LibreOfficeKitEnums.h
 include/LibreOfficeKit/LibreOfficeKitGtk.h
 include/LibreOfficeKit/LibreOfficeKitInit.h
 include/LibreOfficeKit/LibreOfficeKitTypes.h
-include/android/compatibility.hxx
 include/animations/animationnodehelper.hxx
 include/apple_remote/RemoteControl.h
 include/apple_remote/RemoteMainController.h
diff --git a/solenv/gbuild/platform/android.mk b/solenv/gbuild/platform/android.mk
index ae1a9ea0b618..bc8ad996f8df 100644
--- a/solenv/gbuild/platform/android.mk
+++ b/solenv/gbuild/platform/android.mk
@@ -8,15 +8,26 @@
 #
 
 ifeq ($(DISABLE_DYNLOADING),TRUE)
-# Link with -lgnustl_static
-gb_STDLIBS := \
-	-lgnustl_static \
-	-lm
 
+ifeq ($(ANDROID_APP_ABI),armeabi-v7a)
+# TODO: gnustl is deprecated/will be removed in future versions of the ndk
+gb_STDLIBS := -lgnustl_static
 else
-# Link almost everything with -lgnustl_shared
 gb_STDLIBS := \
-	-lgnustl_shared \
+	-lc++_static \
+	-lc++abi \
+	-landroid_support \
+
+endif
+
+else
+
+ifeq ($(ANDROID_APP_ABI),armeabi-v7a)
+# TODO: gnustl is deprecated/will be removed in future versions of the ndk
+gb_STDLIBS := -lgnustl_shared
+else
+gb_STDLIBS := -lc++_shared
+endif
 
 endif
 
commit 133af7066e671fbb2feb0016dac9305d291d7d90
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Sat Feb 9 17:34:58 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:26 2019 +0200

    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 at collabora.com>

diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared
index 332192918e9c..ae80db1fef98 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -21,7 +21,7 @@ OBJLOCAL=obj/local/$(ANDROID_APP_ABI)
 # Helpful rules ...
 #
 
-local.properties:
+local.properties: $(BUILDDIR)/config_host.mk
 	echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties
 
 #
commit 0cacb0dfc089a2345deb2facfd19f55c0f27cb28
Author:     Deve <deveee at gmail.com>
AuthorDate: Wed Jan 9 00:10:27 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:26 2019 +0200

    Don't build dconf on Android and iOS.
    
    Without that modification, it finds dconf in linux system and then compilation fails when it tries to build configmgr/source/dconf.cxx because dconf headers are not found in Android NDK.
    
    Change-Id: I25ab7f1ce66ed491f08a526e462e00957135b0c2
    Reviewed-on: https://gerrit.libreoffice.org/65987
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/configure.ac b/configure.ac
index c90fe5e14c9d..9b4cad2ed394 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10020,7 +10020,7 @@ dnl =================================================
 dnl Check whether to build with dconf support.
 dnl =================================================
 
-if test "$enable_dconf" != no; then
+if test $_os != Android -a $_os != iOS -a "$enable_dconf" != no; then
     PKG_CHECK_MODULES([DCONF], [dconf >= 0.15.2], [], [
         if test "$enable_dconf" = yes; then
             AC_MSG_ERROR([dconf not found])
@@ -10029,7 +10029,7 @@ if test "$enable_dconf" != no; then
         fi])
 fi
 AC_MSG_CHECKING([whether to enable dconf])
-if test "$enable_dconf" = no; then
+if test $_os = Android -o $_os = iOS -o "$enable_dconf" = no; then
     DCONF_CFLAGS=
     DCONF_LIBS=
     ENABLE_DCONF=
commit 86560e6a675ea409c1f8408c38facfdfb904be72
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Dec 13 07:23:04 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:25 2019 +0200

    Fix getRTTI for Android x86
    
    First, make sure existing compiler-generated RTTI from liblo-native-code.so is
    found (so that catching bridge-synthesized exceptions in native code works with
    libc++abi, which checks type equivalence by address instead of string
    comparsion), by using the dlsym(RTLD_DEFAULT,...) mechanism as in the ANDROID
    gcc3_linux_arm bridge case.  And second, if that should fail, synthesize the
    type_info even if the included cxxabi.h doesn't provide the relevant type
    declarations, by using copies from the ABI specification, as also done on other
    platforms.
    
    Instead of always having getRTTI fail and raiseException throw a non-synthesized
    css::uno::RuntimeException("no rtti for type ...").  Which explains the mystery
    discussed in the commit message of 312eeeee42cb4a1e356943e17305555e41afc4ef
    "Switch Android armeabi-v7a to libc++/libc++abi/libunwind too", why the observed
    misbehavior on x86 was so different from that on armeabi-v7a.
    
    Change-Id: I9308654c5c2b88b4d27e0e8e9edda1849133a161
    Reviewed-on: https://gerrit.libreoffice.org/65070
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx
index 6bbcfb2565c1..d5567ed6216c 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx
@@ -90,7 +90,9 @@ class RTTI
     t_rtti_map m_rttis;
     t_rtti_map m_generatedRttis;
 
+#if defined ANDROID
     void * m_hApp;
+#endif
 
 public:
     RTTI();
@@ -100,13 +102,17 @@ public:
 };
 
 RTTI::RTTI()
+#if !defined ANDROID
     : m_hApp( dlopen(nullptr, RTLD_LAZY) )
+#endif
 {
 }
 
 RTTI::~RTTI()
 {
+#if !defined ANDROID
     dlclose( m_hApp );
+#endif
 }
 
 
@@ -135,7 +141,11 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr )
         buf.append( 'E' );
 
         OString symName( buf.makeStringAndClear() );
+#if !defined ANDROID
         rtti = static_cast<type_info *>(dlsym( m_hApp, symName.getStr() ));
+#else
+        rtti = static_cast<type_info *>(dlsym( RTLD_DEFAULT, symName.getStr() ));
+#endif
 
         if (rtti)
         {
diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx b/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx
index d167bf25c584..5b9792405462 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx
@@ -33,6 +33,33 @@
 #include <uno/any2.h>
 #include "uno/mapping.h"
 
+#if !HAVE_CXXABI_H_CLASS_TYPE_INFO
+// <https://mentorembedded.github.io/cxx-abi/abi.html>,
+// libstdc++-v3/libsupc++/cxxabi.h:
+namespace __cxxabiv1 {
+class __class_type_info: public std::type_info {
+public:
+    explicit __class_type_info(char const * n): type_info(n) {}
+    ~__class_type_info() override;
+};
+}
+#endif
+
+#if !HAVE_CXXABI_H_SI_CLASS_TYPE_INFO
+// <https://mentorembedded.github.io/cxx-abi/abi.html>,
+// libstdc++-v3/libsupc++/cxxabi.h:
+namespace __cxxabiv1 {
+class __si_class_type_info: public __class_type_info {
+public:
+    __class_type_info const * __base_type;
+    explicit __si_class_type_info(
+        char const * n, __class_type_info const *base):
+        __class_type_info(n), __base_type(base) {}
+    ~__si_class_type_info() override;
+};
+}
+#endif
+
 namespace CPPU_CURRENT_NAMESPACE
 {
 
commit a4c882dc7dfc3f2578fea57b97441ec1a11db3d6
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 11 12:47:54 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:25 2019 +0200

    Make android/mobile-config.py compatible with Python 3
    
    Change-Id: I079c4efd28e7e0d10ca6edf242ddd85b9294db08
    Reviewed-on: https://gerrit.libreoffice.org/64962
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/android/mobile-config.py b/android/mobile-config.py
index c4be1e3c4028..ba892846e548 100755
--- a/android/mobile-config.py
+++ b/android/mobile-config.py
@@ -65,14 +65,14 @@ if __name__ == '__main__':
         size = len(ET.tostring(child));
         key = '%s/%s' % (package, section)
         if key in main_xcd_discard:
-            print 'removed %s - saving %d' % (key, size)
+            print('removed %s - saving %d' % (key, size))
             saved = saved + size
             to_remove.append(child)
 
     for child in to_remove:
         root.remove(child)
 
-    print "saved %d of %d bytes: %2.f%%" % (saved, total, saved*100.0/total)
+    print("saved %d of %d bytes: %2.f%%" % (saved, total, saved*100.0/total))
 
     # Don't do pointless Word -> Writer and similar conversions when we have no UI.
     nsDict = {
commit 4845f01f99c3962603e07972f1ef959b5e3beb6d
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Tue Nov 13 17:44:11 2018 +0000
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:24 2019 +0200

    android: harfbuzz refuses to compile using mmap.
    
    Not ideal not to use mmap on a small device though, but disable for now.
    
    Change-Id: Id595cbc87c93679c1ce186f91ad36a961aee4132
    Reviewed-on: https://gerrit.libreoffice.org/63342
    Tested-by: Jenkins
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/external/harfbuzz/ExternalProject_harfbuzz.mk b/external/harfbuzz/ExternalProject_harfbuzz.mk
index adc3e4c1bf59..995b4dbd1b1c 100644
--- a/external/harfbuzz/ExternalProject_harfbuzz.mk
+++ b/external/harfbuzz/ExternalProject_harfbuzz.mk
@@ -43,6 +43,7 @@ $(call gb_ExternalProject_get_state_target,harfbuzz,build) :
 			--libdir=$(call gb_UnpackedTarball_get_dir,harfbuzz/src/.libs) \
 			$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
 			CXXFLAGS=' \
+				$(if $(filter ANDROID,$(OS)),-DHB_NO_MMAP=1,) \
 				$(if $(filter $(true),$(gb_SYMBOL)),$(gb_DEBUGINFO_FLAGS)) \
 				$(if $(ENABLE_OPTIMIZED), \
 					$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
commit 03a48aa74c089c1c4d1e23e5dca5d0b01d299d08
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Tue Nov 13 17:44:44 2018 +0000
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 22:19:24 2019 +0200

    android: remove redundant header causing build failure.
    
    Change-Id: I857224b551ff6e5959ffe31e872ec4e4993bc174
    Reviewed-on: https://gerrit.libreoffice.org/63343
    Tested-by: Jenkins
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/vcl/headless/CustomWidgetDraw.cxx b/vcl/headless/CustomWidgetDraw.cxx
index 1414b6f4f510..a8ca746b16ec 100644
--- a/vcl/headless/CustomWidgetDraw.cxx
+++ b/vcl/headless/CustomWidgetDraw.cxx
@@ -10,7 +10,6 @@
 
 #include <cairo.h>
 #include <headless/CustomWidgetDraw.hxx>
-#include <sal/main.h>
 #include <sal/config.h>
 #include <rtl/bootstrap.hxx>
 #include <tools/svlibrary.h>
commit 11934c1156cabbf5abf912e9726b11668e59cb22
Author:     Mert Tumer <merttumer at outlook.com>
AuthorDate: Fri Aug 3 07:13:00 2018 -0700
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 21:46:23 2019 +0200

    tdf#119082 Exception wrong thread on Android Viewer
    
    Change-Id: I58a8d104b24c7cf2d021e2dce700e25592c8a605
    Signed-off-by: Mert Tumer <merttumer at outlook.com>
    Reviewed-on: https://gerrit.libreoffice.org/58563
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/android/source/src/java/org/libreoffice/LOKitThread.java b/android/source/src/java/org/libreoffice/LOKitThread.java
index d327bd3c59b3..766ef2159c3f 100644
--- a/android/source/src/java/org/libreoffice/LOKitThread.java
+++ b/android/source/src/java/org/libreoffice/LOKitThread.java
@@ -230,7 +230,12 @@ class LOKitThread extends Thread {
         if (mTileProvider.isReady()) {
             LOKitShell.showProgressSpinner(mContext);
             updateZoomConstraints();
-            refresh();
+            LOKitShell.getMainHandler().post(new Runnable() {
+                @Override
+                public void run() {
+                    refresh();
+                }
+            });
             LOKitShell.hideProgressSpinner(mContext);
         } else {
             closeDocument();
commit e2ff5a51e23174a2b9817b4adcdf500e73ed49f4
Author:     Mert Tumer <merttumer at outlook.com>
AuthorDate: Fri Jul 6 08:58:56 2018 -0700
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 21:46:23 2019 +0200

    tdf#118585 Fix exception when closing Android Viewer
    
    Change-Id: I9d87168dce4b5c6e503d41366aa35d5dadf89dae
    Reviewed-on: https://gerrit.libreoffice.org/57081
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index e6b629ee6f50..394a89c7a989 100644
--- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -944,6 +944,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
     @Override
     protected void onDestroy() {
         super.onDestroy();
+        unregisterReceiver(mUSBReceiver);
         Log.d(LOGTAG, "onDestroy");
     }
 
commit 22be288eec0b70f33c6137c9fcf1d958542a9f0f
Author:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
AuthorDate: Fri Jun 29 21:40:20 2018 +0200
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 21:46:22 2019 +0200

    android: simplify boolean statement
    
    Change-Id: I92cdccfe7b97d9baf29b1155990a38b26579e365

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/RectUtils.java b/android/source/src/java/org/mozilla/gecko/gfx/RectUtils.java
index 8c1670f0f11f..e7fa540a390c 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/RectUtils.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/RectUtils.java
@@ -89,10 +89,9 @@ public final class RectUtils {
     public static boolean fuzzyEquals(RectF a, RectF b) {
         if (a == null && b == null)
             return true;
-        else if ((a == null && b != null) || (a != null && b == null))
-            return false;
         else
-            return FloatUtils.fuzzyEquals(a.top, b.top)
+            return a != null && b != null
+                && FloatUtils.fuzzyEquals(a.top, b.top)
                 && FloatUtils.fuzzyEquals(a.left, b.left)
                 && FloatUtils.fuzzyEquals(a.right, b.right)
                 && FloatUtils.fuzzyEquals(a.bottom, b.bottom);
commit e820fbb1eb7fc5c7f99c4131036dcad9917be6c2
Author:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
AuthorDate: Fri Jun 29 21:20:10 2018 +0200
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 21:46:21 2019 +0200

    android: suppress deprecation warning for Html.toHtml(String)
    
    deprecated since 24/Nougat, but we still want to support devices running
    Marshmallow and older..
    
    Change-Id: Iedcf8a56028eff44134b548dc07a89573cb2210d

diff --git a/android/source/src/java/org/libreoffice/AboutDialogFragment.java b/android/source/src/java/org/libreoffice/AboutDialogFragment.java
index 9b9a6c7b348f..6c944bae7ef1 100644
--- a/android/source/src/java/org/libreoffice/AboutDialogFragment.java
+++ b/android/source/src/java/org/libreoffice/AboutDialogFragment.java
@@ -21,6 +21,7 @@ import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.v4.app.DialogFragment;
 import android.text.Html;
+import android.text.Spanned;
 import android.text.method.LinkMovementMethod;
 import android.view.View;
 import android.widget.TextView;
@@ -56,7 +57,9 @@ public class AboutDialogFragment extends DialogFragment {
             {
                 String version = String.format(versionView.getText().toString().replace("\n", "<br/>"),
                         tokens[0], "<a href=\"https://hub.libreoffice.org/git-core/" + tokens[1] + "\">" + tokens[1] + "</a>");
-                versionView.setText(Html.fromHtml(version));
+                @SuppressWarnings("deprecation") // since 24 with additional option parameter
+                Spanned versionString = Html.fromHtml(version);
+                versionView.setText(versionString);
                 versionView.setMovementMethod(LinkMovementMethod.getInstance());
                 String vendor = vendorView.getText().toString();
                 vendor = vendor.replace("$VENDOR", tokens[2]);
commit 4e60feaa429934c4f59cdf8b57f1fedc37d6aac4
Author:     Mert Tümer <merttumer7 at gmail.com>
AuthorDate: Thu May 24 17:28:08 2018 +0300
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 5 21:46:20 2019 +0200

    tdf#117777 fix show hidden files/folders option on Android
    
    Change-Id: Ic80ca7f8ebb93f78a58cc0ad778db90deb0c51ba
    Signed-off-by: Mert Tümer <merttumer7 at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/54771
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>


... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list