Commit 3b4e2d0a authored by Geoffrey Métais's avatar Geoffrey Métais

Use larger cache on Android 3+ devices

parent 57c5ff8e
......@@ -20,6 +20,7 @@
package org.videolan.vlc.util;
import org.videolan.libvlc.LibVlcUtil;
import org.videolan.vlc.VLCApplication;
import android.app.ActivityManager;
......@@ -51,8 +52,9 @@ public class BitmapCache {
// Get memory class of this device, exceeding this amount will throw an
// OutOfMemory exception.
final int memClass = ((ActivityManager) context.getSystemService(
Context.ACTIVITY_SERVICE)).getMemoryClass();
final ActivityManager am = ((ActivityManager) context.getSystemService(
Context.ACTIVITY_SERVICE));
final int memClass = LibVlcUtil.isHoneycombOrLater() ? am.getLargeMemoryClass() : am.getMemoryClass();
// Use 1/5th of the available memory for this memory cache.
final int cacheSize = 1024 * 1024 * memClass / 5;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment