So keep getting "java.net.ProtocolException: unexp...
# squarelibraries
t
So keep getting "java.net.ProtocolException: unexpected end of stream at okhttp3.internal.http1.Http1ExchangeCodec$FixedLengthSource.read(Http1ExchangeCodec.kt:400)" on Wear emulators. And I wonder if there's anything I can do to workaround those on the emulator or okhttp side?
y
Do you know why you are getting that error? App Retries via n interceptor?
t
There's no retries, it seems it can happen on Windows Android emulators (the server receive a connection reset) but the issues on Google side are closed as obsolete or without any answers and I can't find anything more about this 😞 I do not have issues on the normal wear so I suppose this is the same issue as https://issuetracker.google.com/issues/150758736 or https://issuetracker.google.com/issues/119027639
👀 1
The pin connection on Pixel Watch 2 is a pain to keep usb connection and wifi debugging kills the battery ultra fast 😞
y
Not really, from the bug reports, it seems like get some attention on fixing the emulator bug. And make your app code retry again, assuming it's not every request.
Gaaah, I wish I didn't know about these.
t
Opened in 2020 and auto changed assignment when the first auto assigned changed team or leaved.
This is 99% of the requests 😞
the retry with a range for the last 1 to 10 bytes also fails most of the time.
is there an easy way to throttle the connection to a relatively stable value to try to figure out if there's some value that workaround this?
y
Emulator advanced settings have some options like that. Not sure if they help.
t
Not really I was thinking on okhttp side.
y
But if you haven't, writing up what you are seeing on the open assigned bug is not a bad idea.
t
I have already a cancellable wrapper around the source, but no idea how to properly control the speed via fake pauses.
y
probably wrap the SocketFactory?
add some pauses and batching in there?
t
Is there some recipe or sample around that? Never touched that part.
y
Not really - something like this
Copy code
client =
      client.newBuilder()
        .socketFactory(
          object : DelegatingSocketFactory(getDefault()) {
            override fun configureSocket(socket: Socket): Socket {
              socket.receiveBufferSize = socketBufferSize
              socket.sendBufferSize = socketBufferSize
              return socket
            }
          },
        )
And subclass Socket
t
Ok thanks a lot, will test that tomorrow. Let's hope it works. Completely unrelated but do you know if on a Wear device there's a way to enable wireless debuging but disable usb debug? Actually ignore the fullscreen charging thing each time the pin move will still be a pain.
y
Cables seem a bit variable - I'd suggest trying a different cable first.
If for the crossed out idea, you mean, plugged in for power, but wireless ADB. Then a USB "condom"?
You can disable that full screen charging dialog, let me see if that's publicly documented
Copy code
ad.adb.shell("settings put global stay_on_while_plugged_in 7")
        ad.adb.shell("setprop persist.enable_charging_experience false")
t
Nice thanks. The issue is that the Pixel Watch 2 charger is USB c only and very small cable and the pins move easily and my USB c extender seems to cause issue. Hence why it's now directly connected so can't change the cable :(
y
Opened in 2020 and auto changed assignment when the first auto assigned changed team or leaved.
It got some attention yesterday, but any help with details or a repro would probably get it fixed sooner.
t
Thanks for the ping, still not adapted to the fact that now the +1 does not auto follow the issue and I need to star to get the updates ... Will try to post there.
Posted and subscribed.
315 Views