Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55495201 authored by vadimt's avatar vadimt
Browse files

Avoiding cascading "nested events checking" failure after timed-out wait

Bug: 155656943
Change-Id: I0f11552349a9f6b3b14bd1bebb37904d5dfa9c55
parent 122d2d9d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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()) {
+2 −1
Original line number Diff line number Diff line
@@ -69,9 +69,10 @@ public class LogEventChecker {
                mFinished.await();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            } finally {
                mFinished = null;
            }
        }
        mEvents.clear();
        Log.d(SKIP_EVENTS_TAG, "Cleared events");
        mExpectedEvents.clear();