Merge "Emulator cleanup in ClipboardService.java (closePipe)" am: 43a464cb70
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1634488 Change-Id: I003e714fce002d63fb9a37fec0194b99a59102d0
This commit is contained in:
@@ -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) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user