From 454b8b7737cdba14afdd8f15828ad1f42519eb2f Mon Sep 17 00:00:00 2001 From: Felipe Leon Date: Fri, 25 Oct 2024 13:36:21 -0300 Subject: [PATCH] s --- apk/app/src/main/java/com/fgl27/twitch/Tools.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apk/app/src/main/java/com/fgl27/twitch/Tools.java b/apk/app/src/main/java/com/fgl27/twitch/Tools.java index eb9c4e667..e46fdfa98 100644 --- a/apk/app/src/main/java/com/fgl27/twitch/Tools.java +++ b/apk/app/src/main/java/com/fgl27/twitch/Tools.java @@ -689,11 +689,13 @@ static int DeviceRam(Context context) { } else { return maxRamSize / 20; } - int ramSize = (int) (memInfo.totalMem / 20); + int ramSize = (int) memInfo.totalMem; //Prevent Ram too big bigger then max int value //Or just too big even on devices with a lot of RAM it can't be too large - return ramSize > maxRamSize || ramSize < 0 ? maxRamSize : ramSize; + ramSize = ramSize > maxRamSize || ramSize < 0 ? maxRamSize : ramSize; + + return ramSize / 20; } static String getWebviewVersion(Context context) {