Isolate WMTrace buffer and limit it by size not number of elements

Currently the buffer is a BlockingQueue with fixed capacity for 200
elements. This implementation changes it to use up to 512KB of
memory, instead of a fixed number of elements.

It also encapsulates the buffer in a separate class to support a ring
buffer for continuous monitoring (future implementation)

Test: Flash a device. Enable window manager tracing. Use the device.
Stop the trace and pull the logged trace. Open the trace in Winscope and
check if the data is correctly stored. Unit tests:
atest WmTests:WindowTraceBufferTest

Change-Id: Ia515d350d82520d378ae7339a6486ca6a43e62c3
4 files changed