Skip to content
Commit da188d45 authored by Lais Andrade's avatar Lais Andrade
Browse files

Fix ANR caused by VibrationThread

The awaitUntil method that waits for vibration completion is waiting on
a CountDownLatch in a block synchrnized on the VibrationThread. This
causes any call to VibrationThread.cancel() to lock on this wait block
and triggers ANR when vibration is cancelled by the main thread.

The awaitUntil methods should only wait on the VibrationThread instance
so the calls to cancel() will notify and interrupt this wait.

Changed the VibrationThreadTest to test the cancel call on a longer
vibration pattern, that should cause the test to fail if the Thread is
not cancelled right away (i.e. similar conditions that would trigger an
ANR on the main thread).

Fix: 177974811
Test: VibrationThread
Change-Id: Id4346e60292e96df26f5c12e2e088bbf83f416c8
parent ee605b64
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