summaryrefslogtreecommitdiff
path: root/android
AgeCommit message (Collapse)Author
2021-03-23Related tdf#129833 android: Drop android.permission.INTERNETMichael Weghorn
The permission was requested since ownCloud support was added in commit 69773f54bbac08953f0fbce16eecea0816e04338 ("Android: initial implementation of ownCloud provider.", 2015-01-21). Since the custom ownCloud support has been dropped in commit 6012599e17206ee7be9a83477654e7bd194079c3 ("tdf#129833 android: Drop non-working ownCloud/nextCloud support"), there should no longer be any need to require Internet access, so drop the permission again. Access to ownCloud and other Internet services providing file access now goes via DocumentProviders, and the corresponding apps providing those should take care of being allowed to access the internet by themselves. I tested that opening and editing a file located on a NextCloud share still works OK when the NextCloud app is installed and set up. Change-Id: Id8425e7afcd5ecc26d14ba9f42018f536d0a6a6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112879 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-22tdf#141111 android: Don't crash trying to edit read-only sectionMichael Weghorn
Trying to type in a read-only Writer section in Android Viewer led to a crash due to '/assets//config/soffice.cfg/modules/swriter/ui/inforeadonlydialog.ui' not being present. Include the .ui file to avoid this. (Trying to type now doesn't do anything, no warning about this being read-only is shown.) Change-Id: I616d41c312187fa7855430715a47e80477ef2188 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112771 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-22tdf#129833 android: Move reading file to separate threadMichael Weghorn
Reading the input file from the main thread is problematic when that happens over the network. For example, trying to opening a file in a NextCloud share using the system file picker from within the LO Android Viewer app (with NextCloud app 3.15.1 serving as DocumentsProvider for the NextCloud share in the file chooser) previously resulted in a crash, with this in ADB log: I DownloadFileOperation: Download of /Documents/five_pages.odt to /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/<USERNAME>@demo2.nextcloud.com/Documents/five_pages.odt: Unexpected exception E DocumentsStorageProvider: RemoteOperationResult(mSuccess=false, mHttpCode=-1, mHttpPhrase=null, mException=android.os.NetworkOnMainThreadException, mCode=HOST_NOT_AVAILABLE, message=null, getLogMessage=Unexpected exception) Moving this to a separate thread fixes the NetworkOnMainThreadException and made opening, editing and saving the modified file back work successfully for that scenario. (Using a separate thread when writing back does not seem to be necessary, but could be added in a similar way.) This just moves the IO to a new thread and then waits for its completion. For a better user experience in cases where the copy operation may be slow, providing some additional feedback in the UI might be useful. Change-Id: I58e2c4bb1dcd2d59383fba0f216c9614f5d3e3a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112769 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-22tdf#129833 android: Allow opening files using system file pickerMichael Weghorn
Extend Android Viewer with the possibility to select a file to open using the "system file picker", which can be opened by an Intent that has the action 'Intent.ACTION_OPEN_DOCUMENT' (or 'Intent.ACTION_GET_CONTENT' for API level < 19) set. This way, all locations supported by currently installed and set up DocumentsProviders [1] are generally supported. In a test, opening local files worked just fine, but trying to open a file located in a NextCloud share failed (with the corresponding app [2] installed), showing this in ADB log: I DownloadFileOperation: Download of /Documents/five_pages.odt to /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/<USERNAME>@demo2.nextcloud.com/Documents/five_pages.odt: Unexpected exception E DocumentsStorageProvider: RemoteOperationResult(mSuccess=false, mHttpCode=-1, mHttpPhrase=null, mException=android.os.NetworkOnMainThreadException, mCode=HOST_NOT_AVAILABLE, message=null, getLogMessage=Unexpected exception) This will be dealt with in a separate commit. For now, this way to open files (and a corresponding menu entry) is added in addition to the existing ones, but since that method should in general be able to cover all of the other use cases as well, the other options may be dropped in the future. [1] https://developer.android.com/reference/android/provider/DocumentsProvider [2] https://github.com/nextcloud/android Change-Id: I684a4aa770c0df7cc9fc35ff92445230405885f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112768 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-22tdf#129833 android: Allow editing writable docs passed by IntentMichael Weghorn
When a document is passed by an Intent in Android Viewer, allow editing if the Intent has flag 'Intent.FLAG_GRANT_WRITE_URI_PERMISSION' set. Since LibreOffice operates on a temporary copy in this case, write the content of the temporary file back to the original URI when saving. This in particular allows editing documents passed from third-party apps, e.g. opened from Android's "Files" app or the NextCloud app. The online-based Android app already does something similar. Change-Id: Icf252a95dd9a8089ca8610ccf3edfbeee2682e1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112767 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-22tdf#129833 android: Drop non-working ownCloud/nextCloud supportMichael Weghorn
As mentioned in tdf#129833 comment 3, the idea is to use Android's "system file dialog" to select files rather than maintain a separate ownCloud/nextCloud connector in the Android Viewer app. This way, everything for which a DocumentsProvider [1] is available will be available from within the app, once Android Viewer has been adapted to support those, which is planned for a subsequent step. Corresponding DocumentsProviders for ownCloud [2] and nextCloud [3] exist. [1] https://developer.android.com/reference/android/provider/DocumentsProvider [2] https://github.com/owncloud/android [3] https://github.com/nextcloud/android Change-Id: I6581ce36672f582f91d47598afdfd32c3a4a58da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112765 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-19android: Update obj path in READMEMichael Weghorn
... according to the changes done in commit 0dffc65236fbacf98047d6dbfc82b4efe7dd959b Date: Fri Jun 5 08:59:26 2020 -0400 android: fix the build output directory When compiling in a different build output directory, the "liblo-native-code.so" file is created in the source directory and it fails compiling the "online" project Change-Id: I886231034bbe3937748d9b5ef56239aea3cf7b8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112702 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-19android: Don't allow editing for read-only docsMichael Weghorn
Previously when experimental mode was enabled in Android Viewer, a "This file is read-only, saving is disabled." info was shown to the user when opening a file read-only, e.g. when the file was passed from a third-party app. However, editing the document was still possible, a dialog asking whether or not to save the modified doc was shown when existing and only then saving would fail. Disable editing completely for this case, rather than having the user lose changes in the end. Change-Id: Ie523971949d11909223aeac4f99023ecf28cb56c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112693 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-19android: Don't show message for readonly files in non-experimental modeMichael Weghorn
Since editing is disabled in Android Viewer for non-experimental mode anyway, there's no need to tell the user it's not possible to edit a specific document if it's readonly. Replace the 'usesTemporaryFile' method with a more explicit 'isReadOnlyMode' method since ToolbarController shouldn't have to worry about implementation details like whether temporary files are used and the new method will be reused in other places in a follow-up commit as well. Change-Id: Iaccf5b40bd19887b9e76b982ce7252368871c716 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112692 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-18tdf#125318 android: Allow copying with editing disabledMichael Weghorn
Don't make the possibility to select and copy text depending on editing being enabled, i.e. experimental mode being enabled in Android Viewer. In a quick test, this worked just fine in read-only mode as well, so tapping on text in a document now shows two cursors around the tapped word, and allows adapting the selection using these and copying to the clipboard by using the corresponding toolbar entry. Change-Id: Icbd9d055a6cc700b78711df178f594c7a9c5cfbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112673 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-18android: Show original instead of temp file nameMichael Weghorn
When a temporary file is created in Android Viewer (e.g. when a file is passed from another app, like a file explorer or an email app), still show the original file name in the toolbar, instead of the name of the temporary file (like "LibreOffice1588848072959345750.tmp"). Change-Id: I86f5cebfa8e2986fe812ace16c0df324d1420955 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112643 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-16tdf#141052 android: Include 'tabbuttons.ui' and 'tabviewbar.ui'Michael Weghorn
... which have been added in commit e00fd78e6e454491014f03370e14efa5ebc2eefe Date: Thu Oct 22 19:41:17 2020 +0100 weld impress TabBarControl and commit aa0657e2983007c505b1223281df4a3a4eb6e73a Date: Fri Nov 20 15:59:17 2020 +0000 weld ImplTabButtons and are now needed by Impress in Android Viewer as well. Change-Id: I7fd89fa78a277d9da2121a47765107166ada1fd3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112557 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-15tdf#141044 android: Update included .ui filesMichael Weghorn
... according to changes in commit 51379fb3d46e5891bdaea0122bd62b0753663da3 Date: Thu Dec 3 15:54:45 2020 +0000 weld writer's FrameControl MenuButtons and commit a39a3f1ad1e5e39b09ce474c0f4c0f9f4e174bbe Date: Tue Feb 9 12:07:27 2021 +0000 weld impress annotation window Change-Id: I635a6ce74844d08cafa8c50c090ba04b2aefc287 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112490 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-01-09Fixed few grammar mistakesViKrAm-Baisclear
Change-Id: I772d24df6aefc441380379c2a2f075e879aafa29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108936 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-11-19Make sure $(SODEST)/libc++_shared.so target dir existsStephan Bergmann
...similar to how this is done for the other $(SODEST)/... targets above (and which has presumably been missing accidentally from eb050ae015300e850553f71b4ebbd80f40f4c3f3 "tdf#123290 fix android tinderbox builds/properly package libc++_shared.so". Saw <https://ci.libreoffice.org/job/gerrit_android_x86/830/> fail once with > cp: cannot create regular file ‘/home/tdf/lode/jenkins/workspace/android_x86/android/jniLibs/x86/libc++_shared.so’: No such file or directory > ../Bootstrap/Makefile.shared:75: recipe for target '/home/tdf/lode/jenkins/workspace/android_x86/android/jniLibs/x86/libc++_shared.so' failed > make[2]: *** [/home/tdf/lode/jenkins/workspace/android_x86/android/jniLibs/x86/libc++_shared.so] Error 1 > make[2]: *** Waiting for unfinished jobs.... > /home/tdf/lode/jenkins/workspace/android_x86/android/CustomTarget_lo_android.mk:17: recipe for target '/home/tdf/lode/jenkins/workspace/android_x86/workdir/CustomTarget/android/source/done' failed > make[1]: *** [/home/tdf/lode/jenkins/workspace/android_x86/workdir/CustomTarget/android/source/done] Error 2 Change-Id: Ief6b6274ad789d441c2692b941ba0aa8df276e40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106119 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-30android: "make run" works also for debug configurationVasily Melenchuk
In debug mode Android package name is "org.example.libreoffice" and "make run" said that there is no such intent to launch. Change-Id: I6d8eac85dedf3e387a9dd4a228605f79ca0d5aee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103287 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-08-19Remove BuildVersion also from Android and iOS version ini filesStephan Bergmann
...after 5fdf2009d21fa220dfee70ea755bd698c16257a7 "tdf#134522 remove --with-build-version ./configure flag", 00fa759dc9f13eb4618a7762be9ca6eaf3fd37f7 "tdf#135133: Don't try to read BuildVersion", and 6ee46adb446f5350df2b1efc7fc3ffe2506dfaa0 "Remove BuildVersion from installation set version ini files" already removed it from anywhere else Change-Id: I42ccf35d6952ad0a826517ecadfe0ebb3bb704a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101003 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-17Update paths in Makefile.in and android/.gitignoreMichael Weghorn
commit 0dffc65236fbacf98047d6dbfc82b4efe7dd959b Date: Fri Jun 5 08:59:26 2020 -0400 android: fix the build output directory had changed the output directory, so adapt the paths in .gitignore and Makefile.in accordingly. Change-Id: I9c145e359e20167185ae2f7b055fa3b1dac870f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98971 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-07-17tdf#134846 Android Viewer: Include native libs againMichael Weghorn
commit 0dffc65236fbacf98047d6dbfc82b4efe7dd959b Date: Fri Jun 5 08:59:26 2020 -0400 android: fix the build output directory submitted on 2020-07-07 had changed the output directory for native libraries, so the directory used by Android Viewer was empty, and native libs no longer contained in the package/APK. Store the actual/new directory in a variable and use that one in build.gradle to make things work again. Change-Id: I5a051342278ab14e71edf47dd93e8dacdb9f3cb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98970 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-07-07android: fix the build output directoryHenry Castro
When compiling in a different build output directory, the "liblo-native-code.so" file is created in the source directory and it fails compiling the "online" project Change-Id: I4782a69796fb298e9c1a6c4370720b18587735e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95602 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Henry Castro <hcastro@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98290 Tested-by: Jenkins
2020-07-01tdf#134405 android: Add null checkMichael Weghorn
Without it, Android Viewer crashes in experimental editing mode when e.g. opening the sample doc and clicking into the text area. E AndroidRuntime: FATAL EXCEPTION: main E AndroidRuntime: Process: org.libreoffice, PID: 6152 E AndroidRuntime: java.lang.NullPointerException: Attempt to read from field 'float android.graphics.RectF.left' on a null object reference E AndroidRuntime: at org.mozilla.gecko.gfx.RectUtils.scale(RectUtils.java:45) E AndroidRuntime: at org.libreoffice.overlay.DocumentOverlayView.convertToScreen(DocumentOverlayView.java:194) E AndroidRuntime: at org.libreoffice.overlay.DocumentOverlayView.repositionWithViewport(DocumentOverlayView.java:184) E AndroidRuntime: at org.libreoffice.overlay.DocumentOverlayView.changeGraphicSelection(DocumentOverlayView.java:157) E AndroidRuntime: at org.libreoffice.overlay.DocumentOverlay$11.run(DocumentOverlay.java:199) E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:883) E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:100) E AndroidRuntime: at android.os.Looper.loop(Looper.java:214) E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7356) E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Change-Id: Ibff148a5d83413b4eed8a054b0143c9dae4e5537 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97632 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-06-11Make it possible to just build the native code for Android, no Java bitsTor Lillqvist
Change-Id: Ic25b8d72c9e60c0bee04765d51565c2864ec25ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95850 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-05-19don't hardcode /usr/bin/python3 in android scriptsChristian Lohmaier
Change-Id: Id26422e8398da7674d5da22df97a03bee0b0b189
2020-05-06Move all public Java classes to libreoffice.jarSamuel Mehrbrodt
This moves the classes from juh.jar and ridl.jar to libreoffice.jar The goal is to have one single jar (and Java module, will be added later) which developers can include to work with LO. juh.jar and ridl.jar are kept as basically empty jars with libreoffice.jar on its classpath to keep backwards compatibility. This is a continuation of ae855bf48163ff64d94cfc34aff8e37abdb5518d and a preparation to have Java 9 module support. Change-Id: Ifbbfb97f60373d14256e62ae3122913bd17d5bbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91930 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-08tdf#116243 android: Include headerfootermenu.uiMichael Weghorn
Otherwise, Android Viewer crashes when clicking inside a header or footer, failing to access the file: E libo:sal/osl/unx/file: failed to open /assets//config/soffice.cfg/modules/swriter/ui/headerfootermenu.ui W vcl.builder: 2:vcl/source/window/builder.cxx:481: DBG_UNHANDLED_EXCEPTION in VclBuilder::VclBuilder(vcl::Window *, const rtl::OUString &, const rtl::OUString &, const rtl::OString &, const css::uno::Reference<css::frame::XFrame> &, bool, const NotebookBarAddonsItem *) W vcl.builder: when: Unable to read .ui file exception: com.sun.star.container.NoSuchElementException message: file:///assets//config/soffice.cfg/modules/swriter/ui/headerfootermenu.ui I stderr : terminating with uncaught exception of type com::sun::star::container::NoSuchElementException Change-Id: Iaf95e3dd2dbd9c471c8e1b3facabe21c93c47622 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91865 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-04-01tdf#131195 android: Don't destroy doc while loading itMichael Weghorn
Since the 'refresh()' in 'LOKitThread::loadDocument' is not executed synchronously but posted to the main handler, this needs to be synchronized to prevent the document from being deleted while it's being used. The problem when pressing the "back" button while loading the document was that LOKitThread::closeDocument would cause the document to be deleted while it was still being used, causing a crash on C++ side when using the dangling pointer to the document in function 'doc_getDocumentType' (desktop/source/lib/init.cxx). Change-Id: I37da4c4cf8d787327d72c2f449d9cef5d79223c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91460 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-27tdf#131622 android: Extract native libs againMichael Weghorn
Commit 66518ead516e90d606e87c6ce58ec11fea6d172e ("use extractNativeLibs="false" for less disk usage and faster installation", 2017-08-31) had set 'extractNativeLibs="false"' in Android's manifest for the debug build case, which prevented the shared native libraries from being extracted on the device. However, while e.g. liblo-native-code.so can be handled just fine when it is in the APK in uncompressed form, the NSS library tries to load modules at runtime by using an explicit path to the module (like '/data/user/0/org.libreoffice/lib/libnssckbi.so'; due to 'LO_LIB_DIR=file://$APP_DATA_DIR/lib/' set in fundamentalrc (as defined in build.gradle)), but the library was no longer there, so NSS initalization failed (s. 'nsscrypto_initialize'). As a result, Android Viewer was unable to open encrypted/password-protected files. Therefore, extract the libs again for the debug case as well to make that work again. (Release mode still had 'extractNativeLibs="true"' anyway.) Side note 1: According to [1], it should in general also be possible to use 'dlopen()' for dynamic libraries inside zip files (like the APK): > Note that in API level 23 and above dlopen(3) will > open a library from any zip file, not just your APK. > Just give dlopen(3) a path of the form > "my_zip_file.zip!/libs/libstuff.so". As with APKs, > the library must be page-aligned and stored uncompressed > for this to work. In any case, if that approach were to be taken, that would need some closer look to make it work, e.g. how to retrieve the actual location of the APK file, how to treat the different architecturs, whether that works for all supported Android versions,... Side note 2: To debug into the NSS library, temporarily avoiding stripping the debug information as follows helped: --- a/android/Bootstrap/Makefile.shared +++ b/android/Bootstrap/Makefile.shared @@ -68,7 +68,7 @@ $(SODEST)/liblo-native-code.so : $(OBJLOCAL)/liblo-native-code.so $(SODEST)/nss-libraries : mkdir -p $(SODEST) - $(foreach lib,$(NSSLIBS),$(STRIP) -o $(SODEST)/lib$(lib).so $(INSTDIR)/$(LIBO_LIB_FOLDER)/lib$(lib).so;) + $(foreach lib,$(NSSLIBS),cp $(INSTDIR)/$(LIBO_LIB_FOLDER)/lib$(lib).so $(SODEST)/lib$(lib).so;) $(SODEST)/libc++_shared.so : $(ANDROID_NDK_HOME)/sources/cxx-stl/llvm-libc++/libs/$(ANDROID_APP_ABI)/libc++_shared.so cp $< $@ [1] https://github.com/aosp-mirror/platform_bionic/blob/master/android-changes-for-ndk-developers.md#opening-shared-libraries-directly-from-an-apk Change-Id: I7631e4a1e5e3d7b3b589ba09d62b52dc5c55836c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91229 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-27tdf#131622 android: Handle password callback for non-editing case, tooMichael Weghorn
'CALLBACK_DOCUMENT_PASSWORD' needs to be handled when opening a password-protected file, so don't ignore it for the plain viewer case. This makes a password prompt appear as expected when trying to open a password-protected (encrypted) file with Android Viewer, regardless of whether the experimental editing option is enabled or not. Change-Id: Ib7e969a53a484df3e2c7be1a0df4c81a48668045 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91228 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-13android: Pass Intent's action in ctor alreadyMichael Weghorn
This also prevents some static analysis tool from issuing a false positive that "The application uses implicit intent that may be insecure under certain conditions". Change-Id: I1d4198b1c26c764c927d99c9a9e144da96ebc109 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90457 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-11android: Fix asset handling in build.gradleMichael Weghorn
... after commit 367431b6987b75e7a201499bfbd25a41c92a4a59 ("tdf#126909 android: include icons into APK") had accidently not only added the icon zip file to the 'assets/share/config' folder, but also caused the assets mentioned below in build.gradle to be copied there instead of the proper places, leading to a crash when trying to access them. (The problem did not show up in an incremental build, since "the old copies" of the assets were still present where expected.) Change-Id: I7d9cf89c399d6415ce97ac8af4a98610555c5f17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90344 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-11tdf#126909 android: include icons into APKMichael Weghorn
While default build config for Android Viewer caused the zip file(s) containing the icons to be built (e.g. 'distro-configs/LibreOfficeAndroid.conf' contains '--with-theme=colibre'), icons were not included in the APK. Do so now, which among others also makes page breaks shown in Android Viewer (as requested in tdf#126909). Change-Id: Ie16ff4b483287367b9f892ee614b3e5aa4d31820 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90330 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-06android: Update gradleMichael Weghorn
The previous version e.g. did not support building Android App Bundles yet. Drop explicit 'buildToolsVersion', as suggested in the warning during build: > WARNING: The specified Android SDK Build Tools version (27.0.3) is ignored, > as it is below the minimum supported version (28.0.3) for Android Gradle > Plugin 3.6.1. > Android SDK Build Tools 28.0.3 will be used. > To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle > file, as each version of the Android Gradle Plugin now has a default > version of the build tools. Change-Id: Iea5018366969fcefde1e9f4e8cb9836f5a09b41e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90099 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-06android: Escape apostrophe in Turkish stringMichael Weghorn
Missing escaping became apparent after a local gradle update, after which the build failed with > Android resource compilation failed .../android/source/res/values-tr/strings.xml:231:5-73: AAPT: error: unescaped apostrophe in string .../android/source/res/values-tr/strings.xml:231:5-73: AAPT: error: not a valid string. .../android/source/build/intermediates/incremental/mergeStrippedUIReleaseResources/merged.dir/values-tr/values-tr.xml: AAPT: error: file failed to compile. Change-Id: Iaffabfe82ce1a1255919e48dc15bd40ad89d1f90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90098 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-06android: Bump compileSdkVersion, targetSdkVersionMichael Weghorn
... to meet Google Play's current target API level requirement of level 28 [1]. [1] https://support.google.com/googleplay/android-developer/answer/113469#targetsdk Change-Id: I71e8380db3ce6bb11847492b132880375509138a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90097 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-06android: Move "Display language" setting to "General" sectionMichael Weghorn
This fits better than the "File Explorer Settings" one. The whole "General" section was hidden before when editing mode was disabled for the build ('!BuildConfig.ALLOW_EDITING'). Since the language setting is unrelated to this, no longer do so, but explicitly remove the two other entries in this group, namely "ENABLE_DEVELOPER" and "ENABLE_EXPERIMENTAL". Change-Id: I64d1abef38d7669fc1072b380f497ca83e23f265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90096 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-06tdf#131179 android: Support docs containing commentsMichael Weghorn
UI file 'annotationmenu.ui' is needed to make documents with comments work, rather than crashing Android Viewer. This not just fixes the crash, but actually makes the comments show up. Change-Id: I68abc21f6d442549a8a8304d861e1c3223644fbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90094 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-06android: Hide cursor again when selection was done due to searchMichael Weghorn
... in which case the handling of the previous three callbacks makes the cursor (that can be used to do a manual selection) shown in addition to the selection rectangle. As a side note, the cursor previously shown in Calc was incorrect anyway when doing a search, it was always at the top-left, and spanning nothing (instead of the actual cell that was highlighted by the "selection rectangle"). In a quick test, this worked as expected in Writer with editing capability enabled: * when doing a search, the search result was highlighted, but no cursor shown * when long-tapping on a word, that word was highlighted and the cursor was shown, allowing to adapt text selection as needed (e.g. to do copy & paste in the next step). Since the cursor is shown by handling the other callbacks, and it is just hidden again, the cursor can still show up for a short moment before being hidden again, but I see no easy way to avoid this, since there seems to be no easy way to determine in the 'CALLBACK_TEXT_SELECTION{,_START,_END}' handling whether this was called due to a search or some other event (like long-tapping on a word in Writer with editing feature enabled). Change-Id: I0ae85cd10b91582b2bd8ec9891bae5c832161710 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90093 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-06android: Make keyboard in search bar show "search button"Michael Weghorn
... instead of "Enter" key that inserted a newline when clicked. Instead, start a search in downward direction when the search button is clicked, which makes using the search feature more intuitive. I quickly tested with both, Writer and Calc. Change-Id: Iffc9f6115e558721b34d8fb4ae2ed4a36c4a7aa5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90092 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-06android: Fix inverted naming for up/down in searchMichael Weghorn
The naming for the directions UP and DOWN were used the wrong way around, which was also apparent when looking at 'android/source/res/layout/toolbar_bottom.xml', where icon '"@drawable/ic_search_direction_down"' was assigned to the button with ID "@+id/button_search_up" (and vice versa). Adapt the naming to avoid confusion. Change-Id: I5cf59f1789f2c12651ce6a5638d559658d9d4deb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90091 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-06android: Avoid a crash when recently used file has unknown typeMichael Weghorn
I cannot tell how to reproduce (how to open a file of "invalid type"?), but had a crash with this stacktrace in adb log at some point when testing various scenarios with the Android Viewer app. It shows that no proper value was assigned for the resource ID, leaving the default 0. Just don't set an icon in this case. E AndroidRuntime: FATAL EXCEPTION: main E AndroidRuntime: Process: org.libreoffice, PID: 8749 E AndroidRuntime: android.content.res.Resources$NotFoundException: Resource ID #0x0 E AndroidRuntime: at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:246) E AndroidRuntime: at android.content.res.Resources.getDrawableForDensity(Resources.java:905) E AndroidRuntime: at android.content.res.Resources.getDrawable(Resources.java:845) E AndroidRuntime: at android.content.Context.getDrawable(Context.java:687) E AndroidRuntime: at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:358) E AndroidRuntime: at org.libreoffice.ui.RecentFilesAdapter.onBindViewHolder(RecentFilesAdapter.java:73) E AndroidRuntime: at org.libreoffice.ui.RecentFilesAdapter.onBindViewHolder(RecentFilesAdapter.java:25) E AndroidRuntime: at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6673) E AndroidRuntime: at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6714) E AndroidRuntime: at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5647) E AndroidRuntime: at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5913) E AndroidRuntime: at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5752) E AndroidRuntime: at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5748) E AndroidRuntime: at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2232) E AndroidRuntime: at android.support.v7.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:556) E AndroidRuntime: at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1519) E AndroidRuntime: at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:614) E AndroidRuntime: at android.support.v7.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170) E AndroidRuntime: at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3812) E AndroidRuntime: at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3225) [...] Change-Id: I05594c3da26125a18be9226f290430aa9c7fa14c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90090 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-06android: LOKitThread::refresh: Add null checkMichael Weghorn
This fixes as another crash with Android Viewer that could (ocassionaly) be observed by * open some ODT document * press the "back button" while the document is still being loaded * repeat steps 1-2 until the crash occurs Corresponding 'adb logcat' output: I LibreOfficeMainActivity: onDestroy.. I LOKitTileProvider: Document destroyed: /storage/emulated/0/Download/simple.odt D LOKitThread: mTileProvider==null when calling updatePartPageRectangles D AndroidRuntime: Shutting down VM E AndroidRuntime: FATAL EXCEPTION: main E AndroidRuntime: Process: org.libreoffice, PID: 9190 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke interface method 'boolean org.libreoffice.TileProvider.isSpreadsheet()' on a null object reference E AndroidRuntime: at org.libreoffice.LOKitThread.refresh(LOKitThread.java:159) E AndroidRuntime: at org.libreoffice.LOKitThread.access$000(LOKitThread.java:26) E AndroidRuntime: at org.libreoffice.LOKitThread$1.run(LOKitThread.java:239) E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:883) E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:100) E AndroidRuntime: at android.os.Looper.loop(Looper.java:214) E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7356) E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Change-Id: I9787a13b3485a87a133f8b5e4e03bbf3618fb2f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90089 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-06android: LibreOfficeMainActivity::onStop: Add null checkMichael Weghorn
'mTileProvider' can be null here, e.g. while loading the document. This fixes a crash that could be reproduced e.g. by * open a document * press the "back button" while the document is still being loaded (Most easily reproducibly right after app installation, since loading the first doc takes a very long time then.) Relevant log messages from `adb logcat` output: E AndroidRuntime: java.lang.RuntimeException: Unable to stop activity {org.libreoffice/org.libreoffice.LibreOfficeMainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.libreoffice.LOKitTileProvider.cacheDocument()' on a null object reference E AndroidRuntime: at android.app.ActivityThread.callActivityOnStop(ActivityThread.java:4624) E AndroidRuntime: at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4594) E AndroidRuntime: at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4669) E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:233) E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201) E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173) E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:107) E AndroidRuntime: at android.os.Looper.loop(Looper.java:214) E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7356) E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.libreoffice.LOKitTileProvider.cacheDocument()' on a null object reference E AndroidRuntime: at org.libreoffice.LibreOfficeMainActivity.onStop(LibreOfficeMainActivity.java:427) E AndroidRuntime: at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1466) E AndroidRuntime: at android.app.Activity.performStop(Activity.java:8018) E AndroidRuntime: at android.app.ActivityThread.callActivityOnStop(ActivityThread.java:4616) E AndroidRuntime: ... 13 more Change-Id: I9f8a9329801b721dbfbc0a49c150f88ec341059c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90088 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-06android: Avoid crash when tapping while document is being loadedMichael Weghorn
'mViewportMetrics' can be null here, e.g. while the document is still being loaded. This fixes a crash that happened e.g. when tapping on the screen while document was still being loaded. Change-Id: Ib3f237ecf64c05a5736d97e00b46d0de2ef051a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90048 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-02-16GBUILD_TRACE, support for finding out where the build time is spentLuboš Luňák
See instructions in solenv/gbuild/Trace.mk . This generates a file than can be viewed e.g. in the Chromium tracing view. Change-Id: I5f90647c58ca729375525b6daed2d4918adc8188 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88754 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-02-09Fix typoAndrea Gelmini
Change-Id: Iff25ac2f21bdafc911874d151e4d0c5867a52b76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88340 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-02-04tdf#117331 Merge jurt and unoil into ridlSamuel Mehrbrodt
jurt.jar and unoil.jar are kept as effectively empty jars, each with a Class-Path: ridl.jar in their meta-inf/manifest.mf, so that 3rd-party code loading them (with or without also loading ridl.jar) will still have access to their content. Conceptually, the UNOIDL entities in unoil.jar (corresponding to module offapi) are not part of the URE, but are now made available by URE's ridl.jar. This should probably not cause problems in practice. At least for now, we seal exactly those packages in ridl.jar that were originally sealed in jurt.jar. Ideally, all of ridl.jar could be sealed now, but that would be mildly incompatible, as it would prevent 3rd-party code from introducing additional UNOIDL entities in the relevant namespaces (even if that is something we do not want 3rd-party code to do anyway). However, some JunitTest_jurt_* define classes in those sealed packages. In the past they got away with that by using gb_JunitTest_use_jar_classset,*,jurt. Instead they now need to gb_JunitTest_use_jar_classset,*,ridl and drop the gb_JunitTest_use_jar,*,ridl. But the former only makes available the classes that are specified in ridljar/Jar_ridl.mk with gb_Jar_add_sourcefiles, not the UNOIDL entities specified via gb_Jar_add_packagedirs. But the tests need the udkapi UNOIDL entities, so introduce gb_JunitTest_add_classpath to let the tests get them explicitly. (Curiously, JunitTest_jurt_uno and JnitTest_jurt_util use gb_JunitTest_use_jar_classset,*,jurt but don't seem to acutally need it; lets leave that for a follow-up clean up.) As a follow-up clean up, relevant files could be moved from jurt/ to ridljar/. Change-Id: I836f4e7bb47fb41f1306e3f223da90dba988eb9a Co-authored-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84946 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-23Fix German typoAndrea Gelmini
Change-Id: I7a45ba05fdeefed611024304bceffcf5c5aab5a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87229 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-22android: Use system locale by defaultMichael Weghorn
Instead of hard-coding the use of English as default locale and allowing manually selecting another language, this now makes the system's default locale to be used by default in the Android Viewer. It's still possible to explicitly select another language to override that. In case there is no localization for the system locale, an automatic fallback to English happens anyway, so there should be no need to explicitly set the locale to English in that case either. Change-Id: I0b8cfafea6a4659c3657522cfd5895c00f25f054 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85583 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-01-22Android Viewer: Add German localizationMichael Weghorn
Change-Id: Id62bbb9404c51bf529bd7932d66e49b01d3d9c8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85125 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-01-17android: Fix linking of liblo-native-code.so on x86_64Michael Weghorn
This is similar to commit c6dadf5035c8e1c31dbd3fccec167bd4a906bf54 ("commit android: Fix linking of liblo-native-code.so on aarch64."). Build previously failed with Linking obj/local/x86_64/liblo-native-code.so .../x86_64-linux-android/bin/ld.gold: error: cannot find -landroid_support clang++: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [../Bootstrap/Makefile.shared:62: obj/local/x86_64/liblo-native-code.so] Error 1 make[1]: *** [.../android/CustomTarget_lo_android.mk:18: .../workdir/CustomTarget/android/source/done] Error 2 make: *** [Makefile:282: build] Error 2 I quickly checked that the app actually runs on an x86_64 AVD and is able to open and display documents after successfully building with this commit in place. Change-Id: I92b3759af6a86a6717c287d035b6a1add3a9af7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85204 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>