Fix threading problem that resulted in the wakelock being held too long.

In some circumstances we were calling wait after we had been signalled, causing
us to wait until we are signalled again (while holding a wakelock).
Now we only want to wait in the deferred action thread if no events are pending
and only hold the wakelock while not waiting.

BUG: 3127617

Change-Id: I4c6886b2bbdcbcb2c0cf348d89bc5408f0d875b9
Signed-off-by: Mike Lockwood <>
1 file changed
tree: ec62d24210cc27a028b7b09757ddb2ec3d5411dc
  2. loc_api/