fix typo
create and reuse float arrays

Don't create array values in each iteration of the sensor event loop.
This puts unnecessary GC pressure and so CPU load.

Reuse initialized values held in member variables instead.
use standard condition variable rather than CyclicBarrier

Java contains condition variable primitive in the "Object" base class.
CyclicBarrier isn't suited for this.
don't register as sensor event handler twice
poll for debug events, don't register a handler

Registering an event handler from a running application makes that event
handler go stale and presumably crash when a service calls it after the
app doesn't exist anymore.

Switch to polling for debug events. This also simplifies logic where the
service had to keep track of the handler and whether to generate the
events.