android/README | 66 +++ android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java | 115 +++--- android/lib/build.gradle | 11 android/lib/src/main/cpp/CMakeLists.txt.in | 14 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java | 50 --- configure.ac | 166 +++++++--- wsd/Storage.cpp | 8 7 files changed, 271 insertions(+), 159 deletions(-)
New commits: commit ec2eda99444b216a5006367d49fad58bd5afc9e4 Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Thu Jul 2 09:28:31 2020 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jul 2 10:16:42 2020 +0200 android: Default to building just the simple case: armeabi-v7a... ... unless more builddirs are provided in --with-lo-builddir, separated by colons. Change-Id: I49946cd932ec22804ecb51aba86f3dae2aba05f5 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97719 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/configure.ac b/configure.ac index fedd92644..27b8d887b 100644 --- a/configure.ac +++ b/configure.ac @@ -368,7 +368,7 @@ fi # to the Mac. # Android: We need these to setup the CMakeLists.txt properly. LOBUILDDIR= -ANDROID_ABI= +ANDROID_ABI="armeabi-v7a" LOBUILDDIR_ARM64_V8A= LOBUILDDIR_X86= LOBUILDDIR_X86_64= @@ -385,10 +385,12 @@ CORE_VERSION_HASH="" if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_androidapp" = "yes" \); then if test "$enable_androidapp" = "yes" ; then AC_MSG_CHECKING([for Android ABI to build for]) - if test -z "$with_android_abi" ; then - ANDROID_ABI="armeabi-v7a arm64-v8a x86 x86_64" - else + if test -n "$with_android_abi" ; then ANDROID_ABI=`echo $with_android_abi | sed 's/:/ /g'` + else + if echo "$with_lo_builddir" | grep -qs ':' ; then + ANDROID_ABI="armeabi-v7a arm64-v8a x86 x86_64" + fi fi AC_MSG_RESULT([$ANDROID_ABI]) fi commit f8f566260fcfa2af16077f1c19acc1d9b82b9129 Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Wed Jul 1 21:05:42 2020 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jul 2 10:16:38 2020 +0200 android: No need to copy fonts from system any more. After the update of fontconfig, the hack to not to use the Noto fonts is not needed any more, they load quickly now. Change-Id: Iebd2c944e9fcc04d6976002f24a3a47f0b49f2ad Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97659 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97718 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java index 5074d637a..8465ff5e1 100644 --- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java +++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java @@ -203,54 +203,6 @@ public class LOActivity extends AppCompatActivity { } } - /** - * Copies fonts except the NotoSans from the system to our location. - * This is necessary because the NotoSans is huge and fontconfig needs - * ages to parse them. - */ - private static boolean copyFonts(String fromPath, String targetDir) { - try { - File target = new File(targetDir); - if (!target.exists()) - target.mkdirs(); - - File from = new File(fromPath); - File[] files = from.listFiles(); - for (File fontFile : files) { - String fontFileName = fontFile.getName(); - if (!fontFileName.equals("Roboto-Regular.ttf")) { - Log.i(TAG, "Ignored font file: " + fontFile); - continue; - } else { - Log.i(TAG, "Copying font file: " + fontFile); - } - - // copy the font file over - InputStream in = new FileInputStream(fontFile); - try { - OutputStream out = new FileOutputStream(targetDir + "/" + fontFile.getName()); - try { - byte[] buffer = new byte[4096]; - int len; - while ((len = in.read(buffer)) > 0) { - out.write(buffer, 0, len); - } - } finally { - out.close(); - } - } finally { - in.close(); - } - } - } catch (Exception e) { - e.printStackTrace(); - Log.e(TAG, "copyFonts failed: " + e.getMessage()); - return false; - } - - return true; - } - private Handler getMainHandler() { if (mMainHandler == null) { mMainHandler = new Handler(getMainLooper()); @@ -289,7 +241,7 @@ public class LOActivity extends AppCompatActivity { @Override protected Void doInBackground(Void... voids) { // copy the new assets - if (copyFromAssets(getAssets(), "unpack", getApplicationInfo().dataDir) && copyFonts("/system/fonts", getApplicationInfo().dataDir + "/user/fonts")) { + if (copyFromAssets(getAssets(), "unpack", getApplicationInfo().dataDir)) { sPrefs.edit().putString(ASSETS_EXTRACTED_GIT_COMMIT, BuildConfig.GIT_COMMIT).apply(); } return null; commit ecb1a639b763f2ebb36d2848936ea9a44183a56b Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Wed Jul 1 20:41:41 2020 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jul 2 10:16:33 2020 +0200 android: Use the system fonts. Now that we have upgraded the fontconfig to a version that can process the Noto fonts in reasonable time, use them. Change-Id: I7e46bef6827f5e257a0d583137aa9a26c2a22ed3 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97658 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Tested-by: Jenkins Reviewed-by: Jan Holesovsky <ke...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97717 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/android/lib/build.gradle b/android/lib/build.gradle index 50cb2fc43..b4a45fefd 100644 --- a/android/lib/build.gradle +++ b/android/lib/build.gradle @@ -117,17 +117,6 @@ task copyUnpackAssets(type: Copy) { String line -> line.replaceAll( '@@APPLICATION_ID@@', new String("${liboApplicationId}") - ).replaceAll( - // FIXME Avoid the Android system fonts for the moment, - // the huge Noto Sans fonts have terrible impact on the 1st - // start performance. - // The real solution would be to either make fontconfig - // faster, or at least find a way to avoid only the Noto - // Sans, or present a progressbar or something. - // For the moment, we just copy the Roboto font (needed - // for the dialogs; see LOActivity.copyFonts()) and - // remove the system fonts from the config. - '<dir>/system/fonts</dir>', new String("") ) } } commit a57bd547de0e212812a073fd933f444465ae0d3c Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Wed Jul 1 11:10:01 2020 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jul 2 10:16:29 2020 +0200 android: Add support for x86 ABI too. Turns out that the ChromeOS uses the x86 Android runtime, not x86-64. Change-Id: Ic3b6f7a65d35d2298daa731f46e57068eaf2583d Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97607 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <ke...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97716 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/android/README b/android/README index 7223e121e..5cffa4b4f 100644 --- a/android/README +++ b/android/README @@ -68,6 +68,22 @@ build the native parts on Windows. # install PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=arm64-v8a CC=aarch64-linux-android21-clang CXX=aarch64-linux-android21-clang++ SYSLIBS=-static-libstdc++ install INSTALLDIR=/opt/poco-android-64bit +* Poco for x86 (if you want to add the support for that into the APK too): + + # checkout the 1.10.1 in yet another location + git clone https://github.com/pocoproject/poco poco-android-x86 + cd poco-android-x86 + git checkout -b poco-1.10.1 origin/poco-1.10.1 + + # configure + ./configure --config=Android --no-samples --no-tests --omit=Crypto,NetSSL_OpenSSL,Zip,Data,Data/SQLite,Data/ODBC,Data/MySQL,MongoDB,PDF,CppParser,PageCompiler,JWT + + # build + PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=x86 CC=i686-linux-android21-clang CXX=i686-linux-android21-clang++ SYSLIBS=-static-libstdc++ + + # install + PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=x86 CC=i686-linux-android21-clang CXX=i686-linux-android21-clang++ SYSLIBS=-static-libstdc++ install INSTALLDIR=/opt/poco-android-x86 + * Poco for x86_64 (if you want to add the support for that into the APK too): # checkout the 1.10.1 in yet another location diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in b/android/lib/src/main/cpp/CMakeLists.txt.in index fa9ed42a5..08a80ac47 100644 --- a/android/lib/src/main/cpp/CMakeLists.txt.in +++ b/android/lib/src/main/cpp/CMakeLists.txt.in @@ -34,6 +34,10 @@ elseif(${ANDROID_ABI} STREQUAL "arm64-v8a") set(LOBUILDDIR_ABI @LOBUILDDIR_ARM64_V8A@) set(POCOINCLUDE_ABI @POCOINCLUDE_ARM64_V8A@) set(POCOLIB_ABI @POCOLIB_ARM64_V8A@) +elseif(${ANDROID_ABI} STREQUAL "x86") + set(LOBUILDDIR_ABI @LOBUILDDIR_X86@) + set(POCOINCLUDE_ABI @POCOINCLUDE_X86@) + set(POCOLIB_ABI @POCOLIB_X86@) elseif(${ANDROID_ABI} STREQUAL "x86_64") set(LOBUILDDIR_ABI @LOBUILDDIR_X86_64@) set(POCOINCLUDE_ABI @POCOINCLUDE_X86_64@) diff --git a/configure.ac b/configure.ac index fad7e1f6f..fedd92644 100644 --- a/configure.ac +++ b/configure.ac @@ -168,12 +168,14 @@ AC_ARG_WITH(android-package-versioncode, AC_ARG_WITH(android-abi, AS_HELP_STRING([--with-android-abi=x86_64], - [Allows specification of a concrete ABI that is to be built for. By default, builds for all the 3 - supported ABIs at the same time: armeabi-v7a, arm64-v8a and x86_64. + [Allows specification of a concrete ABI that is to be built for, defaults to armeabi-v7a + (when only one build dir is provided in --with-lo-builddir) or to all 4 supported ABIs at + the same time (when there are more builddirs provided in --with-lo-builddir, separated + by colons). The supported ABIs are: armeabi-v7a, arm64-v8a, x86 and x86_64. Please note that you need to specify the parameters for --with-lo-builddir, - --with-poco-includes and --with-poco-libs in the order of armeabi-v7a:arm64-v8a:x86_64. For - example, when you use --with-android-abi=x86_64, - you have to specify --with-lo-builddir=::/path/to/x86-64/builddir]), + --with-poco-includes and --with-poco-libs in the order of armeabi-v7a:arm64-v8a:x86:x86_64. + For example, when you use --with-android-abi=x86_64, + you have to specify --with-lo-builddir=:::/path/to/x86-64/builddir]), ,) AC_ARG_WITH([app-name], @@ -368,12 +370,15 @@ fi LOBUILDDIR= ANDROID_ABI= LOBUILDDIR_ARM64_V8A= +LOBUILDDIR_X86= LOBUILDDIR_X86_64= POCOINCLUDE= POCOINCLUDE_ARM64_V8A= +POCOINCLUDE_X86= POCOINCLUDE_X86_64= POCOLIB= POCOLIB_ARM64_V8A= +POCOLIB_X86= POCOLIB_X86_64= POCODEBUG= CORE_VERSION_HASH="" @@ -381,7 +386,7 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a if test "$enable_androidapp" = "yes" ; then AC_MSG_CHECKING([for Android ABI to build for]) if test -z "$with_android_abi" ; then - ANDROID_ABI="armeabi-v7a arm64-v8a x86_64" + ANDROID_ABI="armeabi-v7a arm64-v8a x86 x86_64" else ANDROID_ABI=`echo $with_android_abi | sed 's/:/ /g'` fi @@ -398,7 +403,8 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a if echo "$LOBUILDDIR" | grep -qs ':' ; then LOBUILDDIR=`echo $with_lo_builddir | cut -d: -f1` LOBUILDDIR_ARM64_V8A=`echo $with_lo_builddir | cut -d: -f2` - LOBUILDDIR_X86_64=`echo $with_lo_builddir | cut -d: -f3` + LOBUILDDIR_X86=`echo $with_lo_builddir | cut -d: -f3` + LOBUILDDIR_X86_64=`echo $with_lo_builddir | cut -d: -f4` fi fi @@ -420,6 +426,14 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a fi fi + if test -n "$LOBUILDDIR_X86" ; then + if test -f "$LOBUILDDIR_X86/workdir/LinkTarget/StaticLibrary/liblibpng.a" ; then + AC_MSG_RESULT([$LOBUILDDIR_X86]) + else + AC_MSG_ERROR([This is not a LibreOffice x86 core build directory: $LOBUILDDIR_X86]) + fi + fi + if test -n "$LOBUILDDIR_X86_64" ; then if test -f "$LOBUILDDIR_X86_64/workdir/LinkTarget/StaticLibrary/liblibpng.a" ; then AC_MSG_RESULT([$LOBUILDDIR_X86_64]) @@ -438,7 +452,8 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a if echo "$POCOINCLUDE" | grep -qs ':' ; then POCOINCLUDE=`echo $with_poco_includes | cut -d: -f1` POCOINCLUDE_ARM64_V8A=`echo $with_poco_includes | cut -d: -f2` - POCOINCLUDE_X86_64=`echo $with_poco_includes | cut -d: -f3` + POCOINCLUDE_X86=`echo $with_poco_includes | cut -d: -f3` + POCOINCLUDE_X86_64=`echo $with_poco_includes | cut -d: -f4` fi fi @@ -457,6 +472,14 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a fi fi + if test -n "$POCOINCLUDE_X86" ; then + if test -f "$POCOINCLUDE_X86/Poco/Poco.h"; then + AC_MSG_RESULT([$POCOINCLUDE_X86]) + else + AC_MSG_ERROR([This is not a Poco x86 include directory: $POCOINCLUDE_X86]) + fi + fi + if test -n "$POCOINCLUDE_X86_64" ; then if test -f "$POCOINCLUDE_X86_64/Poco/Poco.h"; then AC_MSG_RESULT([$POCOINCLUDE_X86_64]) @@ -475,7 +498,8 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a if echo "$POCOLIB" | grep -qs ':' ; then POCOLIB=`echo $with_poco_libs | cut -d: -f1` POCOLIB_ARM64_V8A=`echo $with_poco_libs | cut -d: -f2` - POCOLIB_X86_64=`echo $with_poco_libs | cut -d: -f3` + POCOLIB_X86=`echo $with_poco_libs | cut -d: -f3` + POCOLIB_X86_64=`echo $with_poco_libs | cut -d: -f4` fi fi @@ -494,6 +518,14 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a fi fi + if test -n "$POCOLIB_X86" ; then + if test -f "$POCOLIB_X86/libPocoFoundation.a"; then + AC_MSG_RESULT([$POCOLIB_X86]) + else + AC_MSG_ERROR([This is not a Poco x86 lib directory: $POCOLIB_X86]) + fi + fi + if test -n "$POCOLIB_X86_64" ; then if test -f "$POCOLIB_X86_64/libPocoFoundation.a"; then AC_MSG_RESULT([$POCOLIB_X86_64]) @@ -509,12 +541,15 @@ fi AC_SUBST(LOBUILDDIR) AC_SUBST(ANDROID_ABI) AC_SUBST(LOBUILDDIR_ARM64_V8A) +AC_SUBST(LOBUILDDIR_X86) AC_SUBST(LOBUILDDIR_X86_64) AC_SUBST(POCOINCLUDE) AC_SUBST(POCOINCLUDE_ARM64_V8A) +AC_SUBST(POCOINCLUDE_X86) AC_SUBST(POCOINCLUDE_X86_64) AC_SUBST(POCOLIB) AC_SUBST(POCOLIB_ARM64_V8A) +AC_SUBST(POCOLIB_X86) AC_SUBST(POCOLIB_X86_64) AC_SUBST(POCODEBUG) AC_SUBST([CORE_VERSION_HASH]) commit 014a6b2c31db183a4decee615749da61ba4c34c4 Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Tue Jun 30 11:55:47 2020 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jul 2 10:16:25 2020 +0200 android: Intent.EXTRA_MIME_TYPES does not work on ChromeOS. From some reason, when we limit the mime types the same way as on normal Android, the ChromeOS file picker shows no files by default; the user has to use the dropdown in the bottom left to switch to All files, and then they can choose something to open. [Interestingly, the only other working choice is SVGZ/SVG; but the rest of the mime types are empty in the dropdown.] I haven't found any advice anywhere, so just disabled this for ChromeOS. Change-Id: I95195077ab936670050d980f4180d4b22bfa35d7 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97483 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97715 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java index c1d9df818..f44723861 100644 --- a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java +++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java @@ -678,6 +678,11 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings return true; } + /** True if the App is running under ChromeOS. */ + private boolean isChromeOS() { + return getPackageManager().hasSystemFeature("org.chromium.arc.device_management"); + } + /** Start an ACTION_OPEN_DOCUMENT Intent to trigger opening a document. */ private void openDocument() { collapseFabMenu(); @@ -689,57 +694,65 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings // NOTE: If updating the list here, also check the AndroidManifest.xml, // I didn't find a way how to do it from one central place :-( i.setType("*/*"); - final String[] mimeTypes = new String[] { - // ODF - "application/vnd.oasis.opendocument.text", - "application/vnd.oasis.opendocument.graphics", - "application/vnd.oasis.opendocument.presentation", - "application/vnd.oasis.opendocument.spreadsheet", - "application/vnd.oasis.opendocument.text-flat-xml", - "application/vnd.oasis.opendocument.graphics-flat-xml", - "application/vnd.oasis.opendocument.presentation-flat-xml", - "application/vnd.oasis.opendocument.spreadsheet-flat-xml", - - // ODF templates - "application/vnd.oasis.opendocument.text-template", - "application/vnd.oasis.opendocument.spreadsheet-template", - "application/vnd.oasis.opendocument.graphics-template", - "application/vnd.oasis.opendocument.presentation-template", - - // MS - "application/rtf", - "text/rtf", - "application/msword", - "application/vnd.ms-powerpoint", - "application/vnd.ms-excel", - "application/vnd.visio", - "application/vnd.visio.xml", - "application/x-mspublisher", - - // OOXML - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - "application/vnd.openxmlformats-officedocument.presentationml.presentation", - "application/vnd.openxmlformats-officedocument.presentationml.slideshow", - "application/vnd.openxmlformats-officedocument.wordprocessingml.document", - - // OOXML templates - "application/vnd.openxmlformats-officedocument.wordprocessingml.template", - "application/vnd.openxmlformats-officedocument.spreadsheetml.template", - "application/vnd.openxmlformats-officedocument.presentationml.template", - - // other - "text/csv", - "text/comma-separated-values", - "application/vnd.ms-works", - "application/vnd.apple.keynote", - "application/x-abiword", - "application/x-pagemaker", - "image/x-emf", - "image/x-svm", - "image/x-wmf", - "image/svg+xml" - }; - i.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes); + + // from some reason, the file picker on ChromeOS is confused when it + // gets the EXTRA_MIME_TYPES; to the user it looks like it is + // impossible to choose any files, unless they notice the dropdown in + // the bottom left and choose "All files". Interestingly, SVG / SVGZ + // are shown there as an option, the other mime types are just blank + if (!isChromeOS()) { + final String[] mimeTypes = new String[] { + // ODF + "application/vnd.oasis.opendocument.text", + "application/vnd.oasis.opendocument.graphics", + "application/vnd.oasis.opendocument.presentation", + "application/vnd.oasis.opendocument.spreadsheet", + "application/vnd.oasis.opendocument.text-flat-xml", + "application/vnd.oasis.opendocument.graphics-flat-xml", + "application/vnd.oasis.opendocument.presentation-flat-xml", + "application/vnd.oasis.opendocument.spreadsheet-flat-xml", + + // ODF templates + "application/vnd.oasis.opendocument.text-template", + "application/vnd.oasis.opendocument.spreadsheet-template", + "application/vnd.oasis.opendocument.graphics-template", + "application/vnd.oasis.opendocument.presentation-template", + + // MS + "application/rtf", + "text/rtf", + "application/msword", + "application/vnd.ms-powerpoint", + "application/vnd.ms-excel", + "application/vnd.visio", + "application/vnd.visio.xml", + "application/x-mspublisher", + + // OOXML + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "application/vnd.openxmlformats-officedocument.presentationml.presentation", + "application/vnd.openxmlformats-officedocument.presentationml.slideshow", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + + // OOXML templates + "application/vnd.openxmlformats-officedocument.wordprocessingml.template", + "application/vnd.openxmlformats-officedocument.spreadsheetml.template", + "application/vnd.openxmlformats-officedocument.presentationml.template", + + // other + "text/csv", + "text/comma-separated-values", + "application/vnd.ms-works", + "application/vnd.apple.keynote", + "application/x-abiword", + "application/x-pagemaker", + "image/x-emf", + "image/x-svm", + "image/x-wmf", + "image/svg+xml" + }; + i.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes); + } // TODO remember where the user picked the file the last time // TODO and that should default to Context.getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS) commit 37327c3b0d25f0c64d67791df92af681cab8f4da Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Mon Jun 29 16:13:19 2020 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jul 2 10:16:21 2020 +0200 android: The location of liblo-native-code.so has changed. By mistake, the commit 526db8b1bdb6007ad3ab7e69c7c193e164e58892 was a wrong version of the patch; update it slightly. Change-Id: I1c0148a7195a577a14440453688d506b83aa6ab4 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97381 Tested-by: Jan Holesovsky <ke...@collabora.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97714 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in b/android/lib/src/main/cpp/CMakeLists.txt.in index c0b08d1fa..fa9ed42a5 100644 --- a/android/lib/src/main/cpp/CMakeLists.txt.in +++ b/android/lib/src/main/cpp/CMakeLists.txt.in @@ -42,7 +42,7 @@ else() MESSAGE(FATAL_ERROR "Cannot build for ABI ${ANDROID_ABI}, please add support for that.") endif() -set(LIBLO_NATIVE_CODE ${LOBUILDDIR_ABI}/android/source/jniLibs/${ANDROID_ABI}/liblo-native-code.so) +set(LIBLO_NATIVE_CODE ${LOBUILDDIR_ABI}/android/jniLibs/${ANDROID_ABI}/liblo-native-code.so) target_include_directories(androidapp PRIVATE . # path to androidapp.h commit 881e2a696ab787b50de25cae80c9d39c3ce275d8 Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Mon Jun 29 15:35:07 2020 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jul 2 10:16:17 2020 +0200 android: The location of liblo-native-code.so has changed. Don't try to look it up at the old location, that'll only cause problems. Change-Id: I6376770ce09c5a19cfe1514e1fd12c508a5fc3d0 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97420 Tested-by: Jan Holesovsky <ke...@collabora.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97713 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in b/android/lib/src/main/cpp/CMakeLists.txt.in index 02e2bbb3f..c0b08d1fa 100644 --- a/android/lib/src/main/cpp/CMakeLists.txt.in +++ b/android/lib/src/main/cpp/CMakeLists.txt.in @@ -42,6 +42,8 @@ else() MESSAGE(FATAL_ERROR "Cannot build for ABI ${ANDROID_ABI}, please add support for that.") endif() +set(LIBLO_NATIVE_CODE ${LOBUILDDIR_ABI}/android/source/jniLibs/${ANDROID_ABI}/liblo-native-code.so) + target_include_directories(androidapp PRIVATE . # path to androidapp.h ../../../../.. # path to config.h @@ -92,8 +94,8 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/lib/${ANDROID_ABI}/liblo- COMMAND ${CMAKE_COMMAND} -E copy ${LOBUILDDIR_ABI}/instdir/program/libssl3.so "${CMAKE_CURRENT_SOURCE_DIR}/lib/${ANDROID_ABI}" DEPENDS ${LOBUILDDIR_ABI}/instdir/program/libssl3.so - COMMAND ${CMAKE_COMMAND} -E copy ${LOBUILDDIR_ABI}/android/source/jniLibs/${ANDROID_ABI}/liblo-native-code.so "${CMAKE_CURRENT_SOURCE_DIR}/lib/${ANDROID_ABI}" - DEPENDS ${LOBUILDDIR_ABI}/android/source/jniLibs/${ANDROID_ABI}/liblo-native-code.so + COMMAND ${CMAKE_COMMAND} -E copy ${LIBLO_NATIVE_CODE} "${CMAKE_CURRENT_SOURCE_DIR}/lib/${ANDROID_ABI}" + DEPENDS ${LIBLO_NATIVE_CODE} COMMENT "Copied liblo-native-code.so and its dependencies to the tree." ) commit d52cb77740a0f357ec7ebdc39582432fd416d9b6 Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Mon Jun 29 15:16:35 2020 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jul 2 10:16:12 2020 +0200 android: Update POCO instructions to 1.10.1. Change-Id: Iff8c7145e0372086bfa6a4c4f47e8d964244abc0 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97419 Tested-by: Jenkins Tested-by: Jan Holesovsky <ke...@collabora.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97712 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/android/README b/android/README index 7b525e357..7223e121e 100644 --- a/android/README +++ b/android/README @@ -21,11 +21,11 @@ build the native parts on Windows. git clone https://github.com/pocoproject/poco poco-android cd poco-android - # use the 1.9.1 branch - git checkout -b poco-1.9.1 origin/poco-1.9.1 + # use the 1.10.1 branch + git checkout -b poco-1.10.1 origin/poco-1.10.1 # configure - ./configure --config=Android --no-samples --no-tests --minimal + ./configure --config=Android --no-samples --no-tests --omit=Crypto,NetSSL_OpenSSL,Zip,Data,Data/SQLite,Data/ODBC,Data/MySQL,MongoDB,PDF,CppParser,PageCompiler,JWT # make it PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=armeabi-v7a CC=armv7a-linux-androideabi21-clang CXX=armv7a-linux-androideabi21-clang++ SYSLIBS=-static-libstdc++ @@ -35,7 +35,7 @@ build the native parts on Windows. * 64bit POCO for Android - # checkout the 1.9.1 in a different location and apply the following patch: + # checkout the 1.10.1 in a different location and apply the following patch: --- a/build/config/Android +++ b/build/config/Android @@ -21,6 +21,11 @@ TOOL = arm-linux-androideabi @@ -59,7 +59,10 @@ build the native parts on Windows. # # Define Tools - # configure as above and make it: + # configure as above: + ./configure --config=Android --no-samples --no-tests --omit=Crypto,NetSSL_OpenSSL,Zip,Data,Data/SQLite,Data/ODBC,Data/MySQL,MongoDB,PDF,CppParser,PageCompiler,JWT + + # and make it: PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=arm64-v8a CC=aarch64-linux-android21-clang CXX=aarch64-linux-android21-clang++ SYSLIBS=-static-libstdc++ # install commit 7ce2c854dcf5c8bed6f2f34dbef344ecb36e958b Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Fri Jun 26 14:25:48 2020 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jul 2 10:15:30 2020 +0200 android: Add x86-64 build too. This will make it possible to create AAB's that contain 3 ABIs: armeabi-v7a, arm64-v8a and x86_64. If you want to build for just one ABI, use --with-android-abi=... where the value is one of those three above. Change-Id: I553b8ca941db67eddc1d712a96b818f9cfedd0fa Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97227 Tested-by: Jan Holesovsky <ke...@collabora.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97711 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/android/README b/android/README index f4d737c94..7b525e357 100644 --- a/android/README +++ b/android/README @@ -65,6 +65,43 @@ build the native parts on Windows. # install PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=arm64-v8a CC=aarch64-linux-android21-clang CXX=aarch64-linux-android21-clang++ SYSLIBS=-static-libstdc++ install INSTALLDIR=/opt/poco-android-64bit +* Poco for x86_64 (if you want to add the support for that into the APK too): + + # checkout the 1.10.1 in yet another location + git clone https://github.com/pocoproject/poco poco-android-x86-64 + cd poco-android-x86-64 + git checkout -b poco-1.10.1 origin/poco-1.10.1 + + # and apply the following patch: + diff --git a/build/config/Android b/build/config/Android + index 9227a3352..1abf6df7c 100644 + --- a/build/config/Android + +++ b/build/config/Android + @@ -25,10 +25,14 @@ ifeq ($(ANDROID_ABI),x86) + TOOL = i686-linux-android + ARCHFLAGS = -march=i686 -msse3 -mstackrealign -mfpmath=sse + else + +ifeq ($(ANDROID_ABI),x86_64) + +TOOL = x86_64-linux-android + +else + $(error Invalid ABI specified in ANDROID_ABI) + endif + endif + endif + +endif + + # + # Define Tools + + # configure + ./configure --config=Android --no-samples --no-tests --omit=Crypto,NetSSL_OpenSSL,Zip,Data,Data/SQLite,Data/ODBC,Data/MySQL,MongoDB,PDF,CppParser,PageCompiler,JWT + + # build + PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=x86_64 CC=x86_64-linux-android21-clang CXX=x86_64-linux-android21-clang++ SYSLIBS=-static-libstdc++ + + # install + PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=x86_64 CC=x86_64-linux-android21-clang CXX=x86_64-linux-android21-clang++ SYSLIBS=-static-libstdc++ install INSTALLDIR=/opt/poco-android-x86-64 + * Configure the online.git (eg. in online-android folder) Don't forget to change --with-lo-builddir in the following: diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in b/android/lib/src/main/cpp/CMakeLists.txt.in index ad43e806c..02e2bbb3f 100644 --- a/android/lib/src/main/cpp/CMakeLists.txt.in +++ b/android/lib/src/main/cpp/CMakeLists.txt.in @@ -34,6 +34,10 @@ elseif(${ANDROID_ABI} STREQUAL "arm64-v8a") set(LOBUILDDIR_ABI @LOBUILDDIR_ARM64_V8A@) set(POCOINCLUDE_ABI @POCOINCLUDE_ARM64_V8A@) set(POCOLIB_ABI @POCOLIB_ARM64_V8A@) +elseif(${ANDROID_ABI} STREQUAL "x86_64") + set(LOBUILDDIR_ABI @LOBUILDDIR_X86_64@) + set(POCOINCLUDE_ABI @POCOINCLUDE_X86_64@) + set(POCOLIB_ABI @POCOLIB_X86_64@) else() MESSAGE(FATAL_ERROR "Cannot build for ABI ${ANDROID_ABI}, please add support for that.") endif() diff --git a/configure.ac b/configure.ac index ea5509450..fad7e1f6f 100644 --- a/configure.ac +++ b/configure.ac @@ -166,6 +166,16 @@ AC_ARG_WITH(android-package-versioncode, [Set the versionCode for the Android package.]), ,) +AC_ARG_WITH(android-abi, + AS_HELP_STRING([--with-android-abi=x86_64], + [Allows specification of a concrete ABI that is to be built for. By default, builds for all the 3 + supported ABIs at the same time: armeabi-v7a, arm64-v8a and x86_64. + Please note that you need to specify the parameters for --with-lo-builddir, + --with-poco-includes and --with-poco-libs in the order of armeabi-v7a:arm64-v8a:x86_64. For + example, when you use --with-android-abi=x86_64, + you have to specify --with-lo-builddir=::/path/to/x86-64/builddir]), +,) + AC_ARG_WITH([app-name], AS_HELP_STRING([--with-app-name=<name>], [Set the user-visible name of the app you build.])) @@ -356,15 +366,28 @@ fi # to the Mac. # Android: We need these to setup the CMakeLists.txt properly. LOBUILDDIR= -ANDROID_ABI="armeabi-v7a" +ANDROID_ABI= LOBUILDDIR_ARM64_V8A= +LOBUILDDIR_X86_64= POCOINCLUDE= POCOINCLUDE_ARM64_V8A= +POCOINCLUDE_X86_64= POCOLIB= POCOLIB_ARM64_V8A= +POCOLIB_X86_64= POCODEBUG= CORE_VERSION_HASH="" if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_androidapp" = "yes" \); then + if test "$enable_androidapp" = "yes" ; then + AC_MSG_CHECKING([for Android ABI to build for]) + if test -z "$with_android_abi" ; then + ANDROID_ABI="armeabi-v7a arm64-v8a x86_64" + else + ANDROID_ABI=`echo $with_android_abi | sed 's/:/ /g'` + fi + AC_MSG_RESULT([$ANDROID_ABI]) + fi + AC_MSG_CHECKING([for LibreOffice build tree to build against]) if test -z "$with_lo_builddir"; then AC_MSG_ERROR([You MUST use the --with-lo-builddir option when configuring the mobile app build tree.]) @@ -372,20 +395,11 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a LOBUILDDIR="$with_lo_builddir" if test "$enable_androidapp" = "yes" ; then - if echo "$LOBUILDDIR" | grep -qs ':' ; then - ANDROID_ABI="armeabi-v7a arm64-v8a" - LOBUILDDIR=`echo $with_lo_builddir | sed 's/:.*//'` - LOBUILDDIR_ARM64_V8A=`echo $with_lo_builddir | sed 's/^.*://'` - fi - - # Sanity check, just a random object file in the LibreOffice build tree - 64bit - if test "$ANDROID_ABI" != "armeabi-v7a" ; then - if test -f "$LOBUILDDIR_ARM64_V8A/workdir/LinkTarget/StaticLibrary/liblibpng.a" ; then - AC_MSG_RESULT([$LOBUILDDIR_ARM64_V8A]) - else - AC_MSG_ERROR([This is not a LibreOffice 64bit core build directory: $LOBUILDDIR_ARM64_V8A]) - fi - fi + if echo "$LOBUILDDIR" | grep -qs ':' ; then + LOBUILDDIR=`echo $with_lo_builddir | cut -d: -f1` + LOBUILDDIR_ARM64_V8A=`echo $with_lo_builddir | cut -d: -f2` + LOBUILDDIR_X86_64=`echo $with_lo_builddir | cut -d: -f3` + fi fi # Get the git hash of the core build @@ -398,6 +412,22 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a AC_MSG_ERROR([This is not a LibreOffice core build directory: $LOBUILDDIR]) fi + if test -n "$LOBUILDDIR_ARM64_V8A" ; then + if test -f "$LOBUILDDIR_ARM64_V8A/workdir/LinkTarget/StaticLibrary/liblibpng.a" ; then + AC_MSG_RESULT([$LOBUILDDIR_ARM64_V8A]) + else + AC_MSG_ERROR([This is not a LibreOffice ARM64 core build directory: $LOBUILDDIR_ARM64_V8A]) + fi + fi + + if test -n "$LOBUILDDIR_X86_64" ; then + if test -f "$LOBUILDDIR_X86_64/workdir/LinkTarget/StaticLibrary/liblibpng.a" ; then + AC_MSG_RESULT([$LOBUILDDIR_X86_64]) + else + AC_MSG_ERROR([This is not a LibreOffice x86-64 core build directory: $LOBUILDDIR_X86_64]) + fi + fi + AC_MSG_CHECKING([for Poco include directory to build against]) if test -z "$with_poco_includes"; then AC_MSG_ERROR([You MUST use the --with-poco-includes option when configuring the mobile app build tree.]) @@ -405,19 +435,11 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a POCOINCLUDE="$with_poco_includes" if test "$enable_androidapp" = "yes" ; then - if echo "$POCOINCLUDE" | grep -qs ':' ; then - POCOINCLUDE=`echo $with_poco_includes | sed 's/:.*//'` - POCOINCLUDE_ARM64_V8A=`echo $with_poco_includes | sed 's/^.*://'` - fi - - # Sanity check - 64bit - if test "$ANDROID_ABI" != "armeabi-v7a" ; then - if test -f "$POCOINCLUDE_ARM64_V8A/Poco/Poco.h"; then - AC_MSG_RESULT([$POCOINCLUDE_ARM64_V8A]) - else - AC_MSG_ERROR([This is not a Poco 64bit include directory: $POCOINCLUDE_ARM64_V8A]) - fi - fi + if echo "$POCOINCLUDE" | grep -qs ':' ; then + POCOINCLUDE=`echo $with_poco_includes | cut -d: -f1` + POCOINCLUDE_ARM64_V8A=`echo $with_poco_includes | cut -d: -f2` + POCOINCLUDE_X86_64=`echo $with_poco_includes | cut -d: -f3` + fi fi # Sanity check @@ -427,6 +449,22 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a AC_MSG_ERROR([This is not a Poco include directory: $POCOINCLUDE]) fi + if test -n "$POCOINCLUDE_ARM64_V8A" ; then + if test -f "$POCOINCLUDE_ARM64_V8A/Poco/Poco.h"; then + AC_MSG_RESULT([$POCOINCLUDE_ARM64_V8A]) + else + AC_MSG_ERROR([This is not a Poco ARM64 include directory: $POCOINCLUDE_ARM64_V8A]) + fi + fi + + if test -n "$POCOINCLUDE_X86_64" ; then + if test -f "$POCOINCLUDE_X86_64/Poco/Poco.h"; then + AC_MSG_RESULT([$POCOINCLUDE_X86_64]) + else + AC_MSG_ERROR([This is not a Poco x86-64 include directory: $POCOINCLUDE_X86_64]) + fi + fi + AC_MSG_CHECKING([for Poco lib directory to build against]) if test -z "$with_poco_libs"; then AC_MSG_ERROR([You MUST use the --with-poco-libs option when configuring the mobile app build tree.]) @@ -434,19 +472,11 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a POCOLIB="$with_poco_libs" if test "$enable_androidapp" = "yes" ; then - if echo "$POCOLIB" | grep -qs ':' ; then - POCOLIB=`echo $with_poco_libs | sed 's/:.*//'` - POCOLIB_ARM64_V8A=`echo $with_poco_libs | sed 's/^.*://'` - fi - - # Sanity check - 64bit - if test "$ANDROID_ABI" != "armeabi-v7a" ; then - if test -f "$POCOLIB_ARM64_V8A/libPocoFoundation.a"; then - AC_MSG_RESULT([$POCOLIB_ARM64_V8A]) - else - AC_MSG_ERROR([This is not a Poco 64bit lib directory: $POCOLIB_ARM64_V8A]) - fi - fi + if echo "$POCOLIB" | grep -qs ':' ; then + POCOLIB=`echo $with_poco_libs | cut -d: -f1` + POCOLIB_ARM64_V8A=`echo $with_poco_libs | cut -d: -f2` + POCOLIB_X86_64=`echo $with_poco_libs | cut -d: -f3` + fi fi # Sanity check @@ -456,6 +486,22 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a AC_MSG_ERROR([This is not a Poco lib directory: $POCOLIB]) fi + if test -n "$POCOLIB_ARM64_V8A" ; then + if test -f "$POCOLIB_ARM64_V8A/libPocoFoundation.a"; then + AC_MSG_RESULT([$POCOLIB_ARM64_V8A]) + else + AC_MSG_ERROR([This is not a Poco ARM64 lib directory: $POCOLIB_ARM64_V8A]) + fi + fi + + if test -n "$POCOLIB_X86_64" ; then + if test -f "$POCOLIB_X86_64/libPocoFoundation.a"; then + AC_MSG_RESULT([$POCOLIB_X86_64]) + else + AC_MSG_ERROR([This is not a Poco x86-64 lib directory: $POCOLIB_X86_64]) + fi + fi + if test "$ENABLE_DEBUG" = "true" ; then POCODEBUG=d fi @@ -463,10 +509,13 @@ fi AC_SUBST(LOBUILDDIR) AC_SUBST(ANDROID_ABI) AC_SUBST(LOBUILDDIR_ARM64_V8A) +AC_SUBST(LOBUILDDIR_X86_64) AC_SUBST(POCOINCLUDE) AC_SUBST(POCOINCLUDE_ARM64_V8A) +AC_SUBST(POCOINCLUDE_X86_64) AC_SUBST(POCOLIB) AC_SUBST(POCOLIB_ARM64_V8A) +AC_SUBST(POCOLIB_X86_64) AC_SUBST(POCODEBUG) AC_SUBST([CORE_VERSION_HASH]) commit 1b4f604d264999dd24c0db6f90737eeeab66a513 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Wed Jul 1 01:29:58 2020 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jul 2 10:15:26 2020 +0200 Improve logging failed lock request using X-WOPI-LockFailureReason Change-Id: Ia521422d033861cd002e7eb2123ccc18e9cd0071 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97555 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> (cherry picked from commit 6de63613fb7ec00370caa7e3efce4405b688279e) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97570 Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp index 66028aa05..a27240bf1 100644 --- a/wsd/Storage.cpp +++ b/wsd/Storage.cpp @@ -816,8 +816,11 @@ bool WopiStorage::updateLockState(const Authorization& auth, const std::string& } else { + std::string sMoreInfo = response.get("X-WOPI-LockFailureReason", ""); + if (!sMoreInfo.empty()) + sMoreInfo = ", failure reason: \"" + sMoreInfo + "\""; LOG_WRN("Un-successful " << wopiLog << " with status " << response.getStatus() << - " and response: " << responseString); + sMoreInfo << " and response: " << responseString); } } catch (const Poco::Exception& pexc) commit 5cb2de4dd31aa3dcc88a3ae328df9cd2cdde9a70 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Tue Jun 30 16:37:40 2020 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jul 2 10:15:22 2020 +0200 IIS requires content-length for POST requests Without the content-length, LOCK requests result in 411 response with the message: "The request must be chunked or have a content length". Ref: https://forums.iis.net/t/1119456.aspx Change-Id: Ieceb2bcf478c5f6baf97ee6b89d37622da168df5 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97524 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> (cherry picked from commit dd8e852b63598f180d9045214fa7cfc9e90fee24) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97500 Reviewed-by: Michael Meeks <michael.me...@collabora.com> diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp index 7e262b1cd..66028aa05 100644 --- a/wsd/Storage.cpp +++ b/wsd/Storage.cpp @@ -794,6 +794,9 @@ bool WopiStorage::updateLockState(const Authorization& auth, const std::string& addStorageReuseCookie(request, cookies); addWopiProof(request, uriObject, params["access_token"]); + // IIS requires content-length for POST requests: see https://forums.iis.net/t/1119456.aspx + request.setContentLength(0); + psession->sendRequest(request); Poco::Net::HTTPResponse response; std::istream& rs = psession->receiveResponse(response); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits