Skip to content
Commit e5b03a17 authored by Robin Lee's avatar Robin Lee Committed by Roman Kiryanov
Browse files

Emulator: handle OOM and Protocol error cases

 - OutOfMemoryError can happen naturally if the size of the clipboard is
   too large to allocate. We should prefer to drop the clipboard data if
   we have a choice between that and crashing the system server.

 - OutOfMemoryError can happen unnatturally if the protocol gets out of
   sync with the host. This can happen quite easily if there is a caught
   exception and the clipboard monitor tries to keep on trucking, since
   the protocol doesn't have any built in synchronisation to catch back
   up to the start of the next message again. The only option to prevent
   that at the moment is to just close the pipe and reopen it in case
   of failure to understand something.

Bug: 231340598
Test: presubmit
Change-Id: Icceb8ec8b3988c32a2eb5f5598a43753460fc26b
parent 6192fb8f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment