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

Commit a1c0506e authored by Grace Kloba's avatar Grace Kloba Committed by Android Git Automerger
Browse files

am 1184313c: Setting WebCore cache limit depending on the memory class.

Merge commit '1184313c' into eclair-mr2

* commit '1184313c':
  Setting WebCore cache limit depending on the memory class.
parents e9d8f545 1184313c
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.webkit;

import android.app.ActivityManager;
import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
@@ -105,7 +106,13 @@ class BrowserFrame extends Handler {
        if (sJavaBridge == null) {
            sJavaBridge = new JWebCoreJavaBridge(context);
            // set WebCore native cache size
            ActivityManager am = (ActivityManager) context
                    .getSystemService(Context.ACTIVITY_SERVICE);
            if (am.getMemoryClass() > 16) {
                sJavaBridge.setCacheSize(8 * 1024 * 1024);
            } else {
                sJavaBridge.setCacheSize(4 * 1024 * 1024);
            }
            // initialize CacheManager
            CacheManager.init(context);
            // create CookieSyncManager with current Context