Merge "Avoiding cascading "nested events checking" failure after timed-out wait" into ub-launcher3-rvc-dev

This commit is contained in:
TreeHugger Robot
2020-05-04 19:41:56 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 2 deletions
@@ -1283,10 +1283,10 @@ public final class LauncherInstrumentation {
public Closable eventsCheck() {
Assert.assertTrue("Nested event checking", !sCheckingEvents);
disableSensorRotation();
sCheckingEvents = true;
final int initialPid = getPid();
if (sEventChecker == null) sEventChecker = new LogEventChecker();
sEventChecker.start();
sCheckingEvents = true;
return () -> {
if (initialPid != getPid()) {
@@ -69,8 +69,9 @@ public class LogEventChecker {
mFinished.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
} finally {
mFinished = null;
}
mFinished = null;
}
mEvents.clear();
Log.d(SKIP_EVENTS_TAG, "Cleared events");