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

Commit c40fc2c3 authored by Iain Merrick's avatar Iain Merrick
Browse files

Add FlushCookieStore() method to CookieManager (Java side)

The browser app will use this to sync cookies to flash when it is
sent to the background. Corresponding C++ code is in Ia9b56f3c.

Bug: 3231371

Change-Id: I04e96affcce335191ee2075d0e160f0d8313bf76
parent 4449e4b6
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -620,6 +620,20 @@ public final class CookieManager {
        new Thread(clearCache).start();
    }

    /**
     * Tell the cookie store that this is a good time to flush cookies to flash.
     *
     * This should be called when the app is paused. Note that this method only
     * acts as a hint, and may not have any effect. Flushing is asynchronous.
     *
     * @hide pending API council approval.
     */
    public void flushCookieStore() {
        if (useChromiumHttpStack()) {
            nativeFlushCookieStore();
        }
    }

    /**
     * Package level api, called from CookieSyncManager
     *
@@ -1078,4 +1092,5 @@ public final class CookieManager {
    private static native void nativeRemoveSessionCookie();
    private static native void nativeSetAcceptCookie(boolean accept);
    private static native void nativeSetCookie(String url, String value);
    private static native void nativeFlushCookieStore();
}