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

Commit 730ec13e 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

am: cdabc872

Change-Id: I3a01ecd76e554c113427f29b07d765f370a2541d
parents 9d744386 cdabc872
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -86,6 +86,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
@@ -226,11 +228,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");
            }
        }
    }
@@ -238,6 +243,7 @@ public abstract class TelephonyTest {
    protected void setReady(boolean ready) {
        synchronized (mLock) {
            mReady = ready;
            mLock.notifyAll();
        }
    }