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

Commit cdabc872 authored by nharold's avatar nharold Committed by android-build-merger
Browse files

Merge "Update the waitUntilReady/setReady logic to use java blocking" am: cfa72519

am: d618c46e

Change-Id: I477c8b16633566b367d765a015b7f3590fd28a2c
parents dfbb1872 d618c46e
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -87,6 +87,8 @@ import java.util.concurrent.TimeUnit;
public abstract class TelephonyTest {
    protected static String TAG;

    private static final int MAX_INIT_WAIT_MS = 30000; // 30 seconds

    @Mock
    protected GsmCdmaPhone mPhone;
    @Mock
@@ -225,11 +227,14 @@ public abstract class TelephonyTest {
    }

    protected void waitUntilReady() {
        while (true) {
        synchronized (mLock) {
                if (mReady) {
                    break;
            try {
                mLock.wait(MAX_INIT_WAIT_MS);
            } catch (InterruptedException ie) {
            }

            if (!mReady) {
                fail("Telephony tests failed to initialize");
            }
        }
    }
@@ -237,6 +242,7 @@ public abstract class TelephonyTest {
    protected void setReady(boolean ready) {
        synchronized (mLock) {
            mReady = ready;
            mLock.notifyAll();
        }
    }