Disable processor information when running on Android

This commit is contained in:
Intelli 2024-11-28 19:41:52 -07:00
parent 65705508c5
commit e5ec7ede72

View file

@ -127,6 +127,9 @@ public class Util extends Queue {
if (System.getProperty("os.name").startsWith("Windows") && !System.getProperty("sun.arch.data.model").equals("64")) { if (System.getProperty("os.name").startsWith("Windows") && !System.getProperty("sun.arch.data.model").equals("64")) {
Class.forName("com.sun.jna.platform.win32.Win32Exception"); Class.forName("com.sun.jna.platform.win32.Win32Exception");
} }
else if (System.getProperty("os.name").toLowerCase().contains("android") || System.getProperty("java.runtime.name").toLowerCase().contains("android")) {
return null;
}
Configurator.setLevel("oshi.hardware.common.AbstractCentralProcessor", Level.OFF); Configurator.setLevel("oshi.hardware.common.AbstractCentralProcessor", Level.OFF);
SystemInfo systemInfo = new SystemInfo(); SystemInfo systemInfo = new SystemInfo();
result = systemInfo.getHardware().getProcessor(); result = systemInfo.getHardware().getProcessor();