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

Commit 43a464cb authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Emulator cleanup in ClipboardService.java (closePipe)"

parents fb5d22ff e9cede48
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -106,6 +106,17 @@ class HostClipboardMonitor implements Runnable {
        return false;
    }

    private void closePipe() {
        try {
            final RandomAccessFile pipe = mPipe;
            mPipe = null;
            if (pipe != null) {
                pipe.close();
            }
        } catch (IOException ignore) {
        }
    }

    public HostClipboardMonitor(HostClipboardCallback cb) {
        mHostClipboardCallback = cb;
    }
@@ -127,10 +138,7 @@ class HostClipboardMonitor implements Runnable {
                mHostClipboardCallback.onHostClipboardUpdated(
                    new String(receivedData));
            } catch (IOException e) {
                try {
                    mPipe.close();
                } catch (IOException ee) {}
                mPipe = null;
                closePipe();
            } catch (InterruptedException e) {}
        }
    }