Skip to content

Commit e5ec7ed

Browse files
committed
Disable processor information when running on Android
1 parent 6570550 commit e5ec7ed

File tree

1 file changed

+3
-0
lines changed
  • src/main/java/net/coreprotect/utility

1 file changed

+3
-0
lines changed

src/main/java/net/coreprotect/utility/Util.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ public static CentralProcessor getProcessorInfo() {
127127
if (System.getProperty("os.name").startsWith("Windows") && !System.getProperty("sun.arch.data.model").equals("64")) {
128128
Class.forName("com.sun.jna.platform.win32.Win32Exception");
129129
}
130+
else if (System.getProperty("os.name").toLowerCase().contains("android") || System.getProperty("java.runtime.name").toLowerCase().contains("android")) {
131+
return null;
132+
}
130133
Configurator.setLevel("oshi.hardware.common.AbstractCentralProcessor", Level.OFF);
131134
SystemInfo systemInfo = new SystemInfo();
132135
result = systemInfo.getHardware().getProcessor();

0 commit comments

Comments
 (0)