Disable processor information when running on Android
This commit is contained in:
parent
65705508c5
commit
e5ec7ede72
1 changed files with 3 additions and 0 deletions
|
|
@ -127,6 +127,9 @@ public class Util extends Queue {
|
|||
if (System.getProperty("os.name").startsWith("Windows") && !System.getProperty("sun.arch.data.model").equals("64")) {
|
||||
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);
|
||||
SystemInfo systemInfo = new SystemInfo();
|
||||
result = systemInfo.getHardware().getProcessor();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue