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

Commit 768ec6f2 authored by Iain Merrick's avatar Iain Merrick Committed by Android (Google) Code Review
Browse files

Merge "Call flushCookieStore() from CookieSyncManager."

parents 961d55fe 99f39771
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -621,14 +621,11 @@ public final class CookieManager {
    }

    /**
     * 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.
     * Package level api, called from CookieSyncManager
     *
     * @hide pending API council approval.
     * Flush all cookies managed by the Chrome HTTP stack to flash.
     */
    public void flushCookieStore() {
    void flushCookieStore() {
        if (useChromiumHttpStack()) {
            nativeFlushCookieStore();
        }
+7 −5
Original line number Diff line number Diff line
@@ -172,17 +172,19 @@ public final class CookieSyncManager extends WebSyncManager {
            Log.v(LOGTAG, "CookieSyncManager::syncFromRamToFlash STARTS");
        }

        if (!CookieManager.getInstance().acceptCookie()) {
        CookieManager manager = CookieManager.getInstance();

        if (!manager.acceptCookie()) {
            return;
        }

        ArrayList<Cookie> cookieList = CookieManager.getInstance()
                .getUpdatedCookiesSince(mLastUpdate);
        manager.flushCookieStore();

        ArrayList<Cookie> cookieList = manager.getUpdatedCookiesSince(mLastUpdate);
        mLastUpdate = System.currentTimeMillis();
        syncFromRamToFlash(cookieList);

        ArrayList<Cookie> lruList =
                CookieManager.getInstance().deleteLRUDomain();
        ArrayList<Cookie> lruList = manager.deleteLRUDomain();
        syncFromRamToFlash(lruList);

        if (DebugFlags.COOKIE_SYNC_MANAGER) {