Use handler and unregister properties after test
In previous design, the listener still listen to gear event after it got
all expected events. In this case, if the tester change the gear before
quitting the page, the listener will get an extra event and throw
exceptions.
Use the countDownLatch to count the events and unregister the listener
after we got all events.
Bug: 199908538,223112348
Test: build, install and test with CtsVerifier
Change-Id: I1cfc12c41249010645e0c9c08818636c70e60b2d
Merged-In: I1cfc12c41249010645e0c9c08818636c70e60b2d
(cherry picked from commit 36b4c01efb8d159e19d913e6b90c0c5e38ea8366)
1 file changed