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
Test: build, install and test with CtsVerifier
Change-Id: I1cfc12c41249010645e0c9c08818636c70e60b2d
Merged-In: I1cfc12c41249010645e0c9c08818636c70e60b2d
1 file changed