Loading core/java/android/webkit/JniUtil.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.webkit; import android.app.ActivityManager; import android.content.Context; import android.net.Uri; import android.provider.Settings; Loading Loading @@ -175,5 +176,16 @@ class JniUtil { Settings.Secure.WEB_AUTOFILL_QUERY_URL); } private static boolean canSatisfyMemoryAllocation(long bytesRequested) { checkInitialized(); ActivityManager manager = (ActivityManager) sContext.getSystemService( Context.ACTIVITY_SERVICE); ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo(); manager.getMemoryInfo(memInfo); long leftToAllocate = memInfo.availMem - memInfo.threshold; return !memInfo.lowMemory && bytesRequested < leftToAllocate; } private static native boolean nativeUseChromiumHttpStack(); } Loading
core/java/android/webkit/JniUtil.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.webkit; import android.app.ActivityManager; import android.content.Context; import android.net.Uri; import android.provider.Settings; Loading Loading @@ -175,5 +176,16 @@ class JniUtil { Settings.Secure.WEB_AUTOFILL_QUERY_URL); } private static boolean canSatisfyMemoryAllocation(long bytesRequested) { checkInitialized(); ActivityManager manager = (ActivityManager) sContext.getSystemService( Context.ACTIVITY_SERVICE); ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo(); manager.getMemoryInfo(memInfo); long leftToAllocate = memInfo.availMem - memInfo.threshold; return !memInfo.lowMemory && bytesRequested < leftToAllocate; } private static native boolean nativeUseChromiumHttpStack(); }