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

Commit 160c18a4 authored by Patrick Scott's avatar Patrick Scott Committed by Android (Google) Code Review
Browse files

Merge "Need a public way to wait for cookie operations." into honeycomb

parents 23c907ca b88e52c7
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -519,13 +519,19 @@ public final class CookieManager {
        }
    }

    synchronized void waitForCookieOperationsToComplete() {
    /**
     * Waits for pending operations to completed.
     * {@hide}  Too late to release publically.
     */
    public void waitForCookieOperationsToComplete() {
        synchronized (this) {
            while (pendingCookieOperations > 0) {
                try {
                    wait();
                } catch (InterruptedException e) { }
            }
        }
    }

    private synchronized void signalCookieOperationsComplete() {
        pendingCookieOperations--;