Allow the host to send empty clipboards to the guest

the check was too strict.

Bug: 266956109
Test: check if clipboard sync host->guest
Change-Id: Id63612e8e7b5264af4def4e1f5ed5c1e25995b4c
Signed-off-by: Roman Kiryanov <rkir@google.com>
This commit is contained in:
Roman Kiryanov
2023-02-01 15:34:13 -08:00
parent 667a49fe46
commit 8c0d9b5a76

View File

@@ -111,7 +111,7 @@ class EmulatorClipboardMonitor implements Consumer<ClipData> {
bb.order(ByteOrder.LITTLE_ENDIAN);
final int msgLen = bb.getInt();
if (msgLen <= 0 || msgLen > MAX_CLIPBOARD_BYTES) {
if (msgLen < 0 || msgLen > MAX_CLIPBOARD_BYTES) {
throw new ProtocolException("Clipboard message length: " + msgLen + " out of bounds.");
}