Commit graph

113 commits

Author SHA1 Message Date
kaishu-sahu
0f9492268e android: add support for screen dimming from JS.
Change-Id: Icd766c7dcc9c2d62ec90945ec88fa46f88a4711d
Reviewed-on: https://gerrit.libreoffice.org/76489
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-09-06 11:23:29 +02:00
Jan Holesovsky
68b33ba7f2 android: Load the document only after we've got the permission.
Without this, the first start was failing, there was only a black screen
and the request for permission.

Change-Id: I7929048ca51b044dcb574f48bd2b7bc9a27e0ec8
2019-07-23 14:20:25 +02:00
Jan Holesovsky
1d549fa9dd android: Obviously we need to request for writing, not only reading.
Change-Id: I68927593bd17a6ee6de0c1d879d6b05372c1350e
2019-07-23 12:40:09 +02:00
Jan Holesovsky
a04ed68104 android: No need for the extra wrapper, use the LOActivity directly.
Change-Id: Ie4afaedcc3b255c83c570acea02101d284e85653
2019-07-23 12:40:09 +02:00
kaishu-sahu
73f839164a android: add cut, copy, paste support to document viewer.
Change-Id: I85c3a602ab7e98272a193c392bf7bcfd1050dc90
Reviewed-on: https://gerrit.libreoffice.org/74127
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-07-22 12:03:09 +02:00
Jan Holesovsky
2f7fac7547 android: Fix the LOActivity lifecycle in several ways.
First of all, we shouldn't destroy the document in onStop(), instead do
that in onDestroy().  onStop() should only (auto-)save the document, but
otherwise keep it open, so that when we return from the file picker
Activity, the caret is at the same position as it was before.

In addition to that, we should close any open document before we try to
open the new one (in createLOOLWSD).

And finally, when closing the document, we should wait until after the
LOOLWSD is completely torn down, so that we avoid the risk that the user
tries to load another document too quickly, and the messages from the JS
go into the old, still running LOOLWSD.

Change-Id: Ib775021bccc5d5bc69aae392a88dc62a7c05a8fa
2019-07-19 17:59:06 +02:00
Jan Holesovsky
155718796e android: Fix a threading / ordering issue.
Sometimes when closing & reloading a document, the JS ended up with:

cmd=/storage/0/...document_name... type=unknown

error.  The problem was that the HULLO response came later than the next
message in the queue which was

loolclient 0.1

So LOOLWSd tried to load the document called "loolclient 0.1", which
failed, and then it did not know what to do with the "/storage/0/..."
which it understood as a command.

Seems we don't need to send the stuff from a thread on Android, so let's
avoid that, instead of setting up another sender queue here.

Change-Id: I96b4ad13153f1cad6aeb7fc71efcb402edbdc6d2
2019-07-19 17:58:58 +02:00
kaishu-sahu
89a8ce6009 android: add insert image feature to document viewer
Change-Id: I19cb8ef93606cf1bba7341f0d258487b604ad10e
2019-07-19 17:58:49 +02:00
Jan Holesovsky
fd4d896a7f android: Rename the .xml files to avoid potential conflicts.
Change-Id: I6209309c038f16aff150494adf14953aa6f31541
2019-07-15 19:41:44 +02:00
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
b75adb8629 android: Corrected the .odp template.
Change-Id: Iaea2e4f47dd2252ee1d736bd8d49ed1bffe37381
2019-07-11 08:34:03 +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
5b10be08f2 android: Remove also the build/ subdir during make clean.
Change-Id: I62d3840f26f5a9be2fc5d02aece50813b7eda30b
2019-06-20 14:14:23 +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
Jan Holesovsky
aa33301997 android: Update to a newer gradle.
Change-Id: I5eec51a8531ab763634aa78ef80b2fc1964444ac
2019-05-21 11:30:56 +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