diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/prefs/LauncherPreferences.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/prefs/LauncherPreferences.java index 9eba503313..5f26453f1b 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/prefs/LauncherPreferences.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/prefs/LauncherPreferences.java @@ -17,6 +17,8 @@ import net.kdt.pojavlaunch.multirt.MultiRTUtils; import net.kdt.pojavlaunch.utils.JREUtils; +import java.io.IOException; + public class LauncherPreferences { public static final String PREF_KEY_CURRENT_PROFILE = "currentProfile"; public static final String PREF_KEY_SKIP_NOTIFICATION_CHECK = "skipNotificationPermissionCheck"; @@ -175,9 +177,22 @@ private static boolean isDevicePowerful(Context context) { DisplayMetrics metrics = context.getResources().getDisplayMetrics(); if (Math.min(metrics.widthPixels, metrics.heightPixels) < 1080) return false; if (Runtime.getRuntime().availableProcessors() <= 4) return false; + if (hasAllCoreSameFreq()) return false; return true; } + private static boolean hasAllCoreSameFreq() { + int coreCount = Runtime.getRuntime().availableProcessors(); + try { + String freq0 = Tools.read("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"); + String freqX = Tools.read("/sys/devices/system/cpu/cpu" + (coreCount - 1) + "/cpufreq/cpuinfo_max_freq"); + if(freq0.equals(freqX)) return true; + } catch (IOException e) { + Log.e("LauncherPreferences", "Failed to read CPU frequencies", e); + } + return false; + } + /** Compute the notch size to avoid being out of bounds */ public static void computeNotchSize(Activity activity) { if (Build.VERSION.SDK_INT < P) return;