Use a polling check when waiting for a specific device

Some timings have changed in our system.

In this CL, we change the way we are waiting for a device to show up.
Now, we are waiting up to 5 seconds for the correct device to appear
before failing the test.

In practice, the tests take about 30-40 ms to complete.

Test: TEST=inputflinger_tests; m $TEST && adb sync && adb shell -t /data/nativetest64/$TEST/$TEST --gtest_filter="*1\.StylusButtonsGenerateKeyEvents" --gtest_repeat=100 --gtest_break_on_failure
Test: TEST=inputflinger_tests; m $TEST && adb sync && adb shell -t /data/nativetest64/$TEST/$TEST --gtest_filter="*IntegrationTest*" --gtest_repeat=100 --gtest_break_on_failure
Bug: 325695791
Change-Id: I14aae8a1eaa888f4995c5cffc876c6b3c8b0196b
1 file changed