Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d875307 authored by Paul McLean's avatar Paul McLean
Browse files

Commenting exit condition from read thread.

Silence spurious exception error reporting.

Test: Run CTS and CTSVerifier Midi tests.
Bug: 114123487
Bug: 120225301

Change-Id: I82b13e563c30ba42e02625cfe57bd27897cb8035
parent b4c2dc0c
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@ public final class MidiOutputPort extends MidiSender implements Closeable {
                    // read next event
                    int count = mInputStream.read(buffer);
                    if (count < 0) {
                        // This is the exit condition as read() returning <0 indicates
                        // that the pipe has been closed.
                        break;
                        // FIXME - inform receivers here?
                    }
@@ -81,10 +83,15 @@ public final class MidiOutputPort extends MidiSender implements Closeable {
                            Log.e(TAG, "Unknown packet type " + packetType);
                            break;
                    }
                }
                } // while (true)
            } catch (IOException e) {
                // FIXME report I/O failure?
                Log.e(TAG, "read failed", e);
                // TODO: The comment above about the exit condition is not currently working
                // as intended. The read from the closed pipe is throwing an error rather than
                // returning <0, so this becomes (probably) not an error, but the exit case.
                // This warrants further investigation;
                // Silence the (probably) spurious error message.
                // Log.e(TAG, "read failed", e);
            } finally {
                IoUtils.closeQuietly(mInputStream);
            }