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

Commit 1184313c authored by Grace Kloba's avatar Grace Kloba
Browse files

Setting WebCore cache limit depending on the memory class.

parent 6903d5ce
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