Bug ID: 111398
           Summary: Use a single thread for data transmission
           Product: Impress Remote
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Android app

We currently try to spawn a new thread every time we need to post a command
from the app:;a=blob;f=android/sdremote/mobile/src/main/java/org/libreoffice/impressremote/communication/;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(
> at

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.

You are receiving this mail because:
You are the assignee for the bug.
Libreoffice-bugs mailing list

Reply via email to