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

Commit d618c46e 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

Change-Id: I200b0640282cdc0fda08211a4bc8e9e86f93796f
parents b8348982 cfa72519
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();
        }
    }