Commit graph

95 commits

Author SHA1 Message Date
Jan Holesovsky
2b13c69d75 android: Split the actual editing Activity into an own library.
This way, it is more naturally visible what is the actuall app (with the
initial recent documents / file picker) and the editing part.

Change-Id: Ia764f2900939e980f703e3da9f9abd6c0aee7cbb
2019-07-12 11:52:56 +02:00
Jan Holesovsky
55377739c6 android: Avoid system fonts.
They are huge and fontconfig has real trouble indexing / creating the
cache on the 1st start.

This reduces the startup time by nearly a minute (on my phone).

Change-Id: I85abd541251ab949c3c29c4df5fb95ce28f5634c
2019-07-11 08:33:34 +02:00
Jan Holesovsky
0ce797606c android: Create New File dialog rework.
Use a xml layout instead of ad-hoc creation of widgets for better look
(the widgets are not styled when created using 'new') and maintainability.

Update the label of the positive button based on whether the file will
be just created or overwritten (or hide it completely when the input is
empty).

Change-Id: I8cba88402dc4167ff053612b6101a3d7cf57b8c0
2019-06-20 14:15:25 +02:00
Jan Holesovsky
008b189cc8 android: Actually let's disable the obfuscation for the moment.
The rules apparently still need improvements.

Change-Id: I606a5c526df3500f964de5b3a9f2e2c577a0b25b
2019-06-20 14:15:13 +02:00
Jan Holesovsky
8f8e997e1b android: The JNI callbacks must not change names during obfuscation.
Otherwise they are not found when attempting to call them.  Particularly
problematic was the callFakeWebsocketOnMessage that is called from C++.

Change-Id: I9c99733d63583e7c568f0f708e7efbd92497b5fb
2019-06-20 14:14:59 +02:00
Jan Holesovsky
fe9b3d69d5 android: We also need to DetachCurrentThread().
And clean the exceptions too, otherwise we get failures in GetMethodID.

Change-Id: Id636002dd9d32cb7ea0db8ad906b11619f38ef36
2019-06-20 14:14:50 +02:00
Jan Holesovsky
297a4857ad android: Explicitly enable unipoll.
Change-Id: If48dc344bbe07a8633c05fc95c2e7ccd1719c288
2019-06-20 14:14:39 +02:00
Jan Holesovsky
f77c8cd967 android: make clean should clean the assets too.
Change-Id: I1cb2ddb1a7ed71234a5ffc9bdf3631d701df6e5c
2019-06-20 14:14:00 +02:00
Jan Holesovsky
61f6189a99 android: Allow providing the package name via --with-android-package-name.
And when at that, tweak some settings for the release configuration.

Change-Id: Ib8dab481fb7734637076603347f8fde453455fda
2019-06-20 14:12:55 +02:00
Jan Holesovsky
8b349d589f android: Move versionCode to liboSettings.gradle.in.
Change-Id: I32ab573831d4b0d5ef08787ae6c8234b3caad0ee
2019-06-20 14:12:46 +02:00
Jan Holesovsky
9b7b2a7590 android: Use the full main.xcd and registry_en-US.xcd.
The current mobile-config.py filters out the sidebar-related entries
there.  Let's focus on the functionality first and optimize later...

Change-Id: Ia86d11ae1aea24c5ba7d7f1e238c9194e544508a
2019-06-20 14:12:36 +02:00
Jan Holesovsky
001c8ee24c android: These have to be passed by copy too.
Without this, we get crashes later in GetMethodID when performing
send2JS().

Change-Id: Ia0d8a07d0a4f24dec17215a94c5bb3d0d77d19c8
2019-06-20 14:12:16 +02:00
Jan Holesovsky
2d2208e16d android: Copy images.zip into the APK too.
Will be needed for eg. the sidebar.

Change-Id: I4e39db8e593d5a4f52b23dcf70e4e791144f7470
2019-06-20 14:12:07 +02:00
Jan Holesovsky
29f981028e android: No initial spaces in the rc files.
Just a reformat, no functional change.

Change-Id: I516a4548ea3d188759a5eb37f273fafbc490df29
2019-06-20 14:11:58 +02:00
Jan Holesovsky
7a4290dc5c android: The BRAND_SHARE_SUBDIR is needed for the dialogs to work.
Change-Id: Ie65701e6ebe83f3f054c299c50327a2ae2ffe87f
2019-06-20 14:11:46 +02:00
Jan Holesovsky
bbab589ea0 android: Unload the document already in onPause().
So that it  doesn't end up running on the background.

Change-Id: I24386a2eecb740bfce7fcfb83c62aafadb36f7f9
2019-06-20 14:11:22 +02:00
Jan Holesovsky
9794b85ff3 android: Re-create fakeClientFd for every loolwsd restart.
Also remember it in the thread itself, otherwise we are likely to close
the newly created one, instead of the old one (when loading the document
the 2nd time).

[This is the most important piece of the '2nd start crashes' puzzle.]

Change-Id: I3bb89882b6f3ac1493c47a27b4c4589b6996afab
2019-06-20 14:11:03 +02:00
Jan Holesovsky
9ea4f537d4 android: No need to have the loolwsd instance static.
When we don't treat it as static anyway...

Change-Id: I165c06390882cfb9870c338a361ec3c5216985c7
2019-06-20 14:10:55 +02:00
Jan Holesovsky
a742f95473 android: Initialize the LibreOfficeKit only once.
Change-Id: Ieeefaa94bc2eeb583fe0f815306c8fc76a02c327
2019-06-20 14:10:45 +02:00
Jan Holesovsky
834d6453c6 android: We avoid trace log level on Android, adapt accordingly.
Change-Id: I1d30e550fc22c70d7687a40ab0d1d853f099a232
2019-06-20 14:10:32 +02:00
Jan Holesovsky
2103cd39de android: Use the MobileTerminationFlag the same way as on iOS.
We have the same problems - lokit_main thread does not go away - so
let's get the code in sync.

For the actual MobileTerminationFlag background, see the "Introduce new
flag to speed up shutdown of the Online plumbing in the iOS app" commit.

Change-Id: I091a61472f2528971a7473e222bf79f6f33874a9
2019-06-20 14:09:59 +02:00
Jan Holesovsky
9f04503f34 android: Reduce the logging to 'debug'.
With 'trace', the logcat often ends up with 'Unexpected EOF' and nothing
else is logged until after you reconnect the device again.

Change-Id: Idd14a5100d49a4920be0a19b4d9b32e7fb158a12
2019-06-20 14:09:26 +02:00
kaishu-sahu
5a699dcf23 android: add slideshow support in the document viewer.
Change-Id: I33cb9b1591d98088bc8cf1fd13d710fa6ee131b3
Reviewed-on: https://gerrit.libreoffice.org/73727
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-06-14 20:39:27 +02:00
kaishu-sahu
3209a8c368 android: add print feature to the document viewer.
Change-Id: I9de03347bde73faac1e9285f775e9584bb48a08d
Reviewed-on: https://gerrit.libreoffice.org/73268
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-06-14 20:35:50 +02:00
kaishu-sahu
743f2e7bdb android: add rationale dialog for permission denial with "Don't ask again".
If the user denies the permission with "Don't ask again" ticked
in the permission dialog then the only way to allow the permission
is through android os settings.

Change-Id: I8f51ae7390a9565011d6172bcbd08b3666bd60e4
Reviewed-on: https://gerrit.libreoffice.org/73071
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-06-14 20:34:00 +02:00
Jan Holesovsky
e0a5b52444 android: Create the handler on demand.
Somehow I've seen situation when the activity tried to read it before it
was even initialized...

Change-Id: Iafa2f5bebfb7005db9d38bd4832f2027373cd950
2019-06-07 12:58:25 +02:00
Jan Holesovsky
ea2b77ce07 android: Make the LOK document accessible from the JNI.
For some operations like printing to PDF, we need to have access to the
LOK API to perform eg. saveAs().  iOS is using an extern for that, but
given that it is needed for Android too, let's introduce a proper getter
for that.

Change-Id: Ie2340a4ee0bdf9dc46e799e2567a828172d9a67d
2019-05-31 09:20:34 +02:00
Jan Holesovsky
3a03f50784 Revert "Adapt paths to new package name"
It is not a good idea to change the configuration directory, it will affect all the existing installations.

And the service is called loolwsd - so the configuration should be called that way too.

This reverts commit 9278574289.

Change-Id: I7e6eee644e21ad2dd842742585d16133ff8e36c9
Reviewed-on: https://gerrit.libreoffice.org/72730
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-22 12:06:06 +02:00
Samuel Mehrbrodt
9278574289 Adapt paths to new package name
After 1dbbc5acc7

Change-Id: I64a12fb13bc8f9371821b2d5969941bfddc2514a
Reviewed-on: https://gerrit.libreoffice.org/72728
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-22 10:27:33 +02:00
Florin Ciornei
4bf4ba0212 android: Implement returning using the back button
Pressing back button now returns you to the document browser.

Change-Id: I93f281bd6251522422a578e2e23bd68e75c9af7d
2019-05-22 10:16:11 +02:00
Florin Ciornei
0297c42549 android: Send a BYE signal when stopping.
This triggers the save-on-exit operation.

Change-Id: Ibf76ca5a5e87906e6abbc9d8ae17871ec4d5d11a
2019-05-21 11:55:48 +02:00
Jan Holesovsky
11000f11f0 android: Logging must be initialized only once, otherwise it crashes.
Change-Id: I78d5f03951bef5603f0e84d992e656c222a1416e
2019-05-21 11:31:28 +02:00
kaishu-sahu
b67e0d45dd android: resolve the deprecation of PreferenceFragment in DocumentProviderSettingsAcitvity
Change-Id: I736807d6bb47df7b3766a849ce77f87968ebda05
Reviewed-on: https://gerrit.libreoffice.org/71435
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-05-07 17:40:49 +02:00
kaishu-sahu
d50ce4f86c android: replace PreferenceFragment with PreferenceFragmentCompat
PreferenceFragment is deprecated.

Also add debug info option in settings.

Change-Id: I0e55079bc82c85d6ad7ffeb86f821bf7ad07a792
Reviewed-on: https://gerrit.libreoffice.org/71151
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-05-07 17:37:38 +02:00
kaishu-sahu
b33c3f1ffd android: preserve the state of MainActivity upon restart
Change-Id: Ia2956162291c331e1463a1c3267e0698a03e25fa
Reviewed-on: https://gerrit.libreoffice.org/71050
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-05-07 17:34:27 +02:00
Jan Holesovsky
5ea2857521 android: Update / introduce modelines in the .java files.
Plus some whitespace changes.

Change-Id: Ic35a67ad7f6d911679e6d1f717f340640cbcfee9
2019-04-16 13:09:04 +02:00
Jan Holesovsky
2c174e3c30 android: Introduce --with-vendor and --with-info-url.
For the Android's 'shell' About dialog box; includes also some fixes to
that dialog.

Change-Id: I0c9f660da981b653608bf11e1eaccb283feb513f
2019-04-16 12:59:43 +02:00
kaishu-sahu
1797ca4b45 android: fix ArrayIndexOutOfBounds on selecting 'Drawings' in DefaultFileFilter setting
Change-Id: I5ed924d9d79db169b11a0561b89da9b57eb078d9
Reviewed-on: https://gerrit.libreoffice.org/66971
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-04-16 09:23:15 +02:00
kaishu-sahu
3f896d749f android: Setting default values to setting preference, minor ux improvements
Change-Id: I356871429f2e26d9d34e0e1428334a4d2287b683
Reviewed-on: https://gerrit.libreoffice.org/67295
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-04-16 09:23:14 +02:00
Jan Holesovsky
264b6e941e android: Cleanup unused resources.
Change-Id: Ic1003da521d9496ee46ccbd72dd1935caa5e53c1
2019-04-16 09:11:30 +02:00
Florin Ciornei
7705d5893d android: Port Settings from the old app
Change-Id: I283040c518f9a7deb3bd302bc9ed2d11ac560775
Reviewed-on: https://gerrit.libreoffice.org/70790
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-04-16 08:52:48 +02:00
kaishu-sahu
97d659d480 android: Update handling of the storage permission.
If the user does these steps: install -> open a document(from app's file manager) -> close the app -> remove storage permission
-> open the document from the launcher shortcuts, he/she gets an error(from loolwsd).Expected behaviour should be to ask for
storage permission. Same behaviour can be observed if the user tries to open the document via file uri provided by 3rd party
file managers on api < 24.

Change-Id: Idfc3d55a81ccd269a2251aef57935eff2569ea94
Reviewed-on: https://gerrit.libreoffice.org/70759
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-04-15 11:18:11 +02:00
Jan Holesovsky
6746ef981d android: Allow setting of the app name via --with-app-name too.
Change-Id: I8c8da8b4872724daf72841f2bf36fdff9ac53df6
2019-04-12 18:06:16 +02:00
kaishu-sahu
1385f11f6e android: add launcher shortcuts support for api > 24
Change-Id: Iac166e2d659ac02c204fa80957a95dd80456d0a5
Reviewed-on: https://gerrit.libreoffice.org/70613
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-04-12 10:33:35 +02:00
kaishu-sahu
caeda968b3 android: convert the remaining explicit intents to implicit intents.
Change-Id: I0d9ff0a9726f751041d8ee6bdf3c1cd90e95baf4
Reviewed-on: https://gerrit.libreoffice.org/70604
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-04-12 10:31:39 +02:00
kaishu-sahu
c74a47bc7e android: add view document from other file-managers functionality.
Change-Id: I2325110a18c0acd93ec235e1a2e0dcc55affa6f5
Reviewed-on: https://gerrit.libreoffice.org/70025
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-04-10 18:00:20 +02:00
Jan Holesovsky
75949f6fd2 android: How to debug the native code with symbols.
Also no need to avoid stripping any more, the symbols are not necessary
inside the .apk.

Change-Id: I4d9f4c3db26c3d61af3cc5167589fcc82834d7f9
Reviewed-on: https://gerrit.libreoffice.org/70516
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-04-10 17:49:06 +02:00
kaishu-sahu
8ff2ac2142 android: add ownCloud support from old app.
Change-Id: I11f38bc7b35d2c7d9cc8a718232eac2efe13388f
Reviewed-on: https://gerrit.libreoffice.org/70084
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-04-08 18:45:30 +02:00
kaishu-sahu
789a1c1a7b android: add no_recent_items/no_items msg.
Change-Id: I398c65702d246772aeb46b68ba54d2800ce8200a
Reviewed-on: https://gerrit.libreoffice.org/70014
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-04-08 12:51:17 +02:00
Jan Holesovsky
f59e7a3740 android: Use the stripped liblo-native-code.so for the .apk.
Change-Id: If0b5fd34d8a834a7297b4a92aaa782876345cfc4
2019-04-05 18:16:58 +02:00