Bug 111398 - Use a single thread for data transmission
Summary: Use a single thread for data transmission
Status: NEW
Alias: None
Product: Impress Remote
Classification: Unclassified
Component: Android Remote App (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-05 15:16 UTC by Andrzej Hunt
Modified: 2022-08-08 03:48 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrzej Hunt 2017-08-05 15:16:11 UTC
We currently try to spawn a new thread every time we need to post a command from the app:
https://gerrit.libreoffice.org/gitweb?p=impress_remote.git;a=blob;f=android/sdremote/mobile/src/main/java/org/libreoffice/impressremote/communication/CommandsTransmitter.java;h=1c01618741b64938f24be6edbbe4d8665cfd5ec2;hb=refs/heads/master#l42

I'm currently converting this to an AsyncTask which is already an improvement (depending on version, AsyncTask uses a single thread, or pool of threads) - however we should ideally ensure only a single thread is used for all communication, which we could do by creating a handler specific to the socket and posting the AsyncTask to that handler.

Rather oddly, this method actually crashed on my N6P running Android 7.1 (i.e. before the AsyncTask conversion):
> android.os.NetworkOnMainThreadException
> at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303)
> at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)

I'm guessing Android's StrictMode thread detection gets confused when you create arbitrary threads, there's probably not much point in debugging that since creating Thread's in that way is very un-Androidy anyway.
Comment 1 Adolfo Jayme Barrientos 2017-08-08 13:22:05 UTC
Thanks. → NEW
Comment 2 QA Administrators 2018-08-09 02:35:52 UTC Comment hidden (obsolete)
Comment 3 QA Administrators 2022-08-08 03:48:15 UTC
Dear Andrzej Hunt,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug