Flush cookies when the browser is paused.

Cookies are currently flushed on a 30-second timer, but this isn't
sufficient because Android has a different application lifecycle
from a desktop OS -- it can kill the app when it's in the background
to save memory.

Here we flush cookies during onPause(), so the most recent user
activity should always be safely flushed to persistent memory.

Depends on CookieManager change in frameworks/base (I04e96aff).

Bug: 3231371
Change-Id: Iaa4541d4d18ab4c7bb6da372a4452f265b81d201
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 2392103..b4699e3 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -548,6 +548,7 @@
             Log.e(LOGTAG, "BrowserActivity is already paused.");
             return;
         }
+        CookieManager.getInstance().flushCookieStore();
         mActivityPaused = true;
         Tab tab = mTabControl.getCurrentTab();
         if (tab != null) {