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

Commit b88e52c7 authored by Patrick Scott's avatar Patrick Scott
Browse files

Need a public way to wait for cookie operations.

Hidden for now as we are past the public api deadline.

Bug: 3421214
Change-Id: I8a65ae479d0b8b020af2600d7d29d5d358414add
parent 67ec9aa8
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--;