You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm porting an App to Android. I noticed that sys.cpus() functions is returning always an empty vector on Android platform. sysinfo = "0.29.10"
The code below returns information in Windows, Linux and MacOS, but it returns an empty vector in Android.
Calling sys.physical_core_count() works as expected, returning the actual core count. As Android is Linux, I though sys.cpus() should just work as well, but it doesn't. Is this behavior expected?
The text was updated successfully, but these errors were encountered:
I found that this is not exactly a problem with sysinfo but rather the way it works. Refreshing CPU data depends on reading proc/stat in Linux.
However, according to https://issuetracker.google.com/issues/37140047, /proc/stat leaks side channel information about applications which could allow one application to infer the state of other applications on the device, so read access to proc/stat was removed from API Levels 26 or higher. Hence, when using a sysinfo feature that requires reading proc/stat we got: Stderr: failed to retrieve CPU information: Os { code: 13, kind: PermissionDeionDenied, message: "Permission denied" }
Even worst, the permission required to get read access: https://developer.android.com/reference/android/Manifest.permission#READ_LOGS is reserved for system applications only, so third party software cannot use it.
Describe the bug
I'm porting an App to Android. I noticed that
sys.cpus()
functions is returning always an empty vector on Android platform.sysinfo = "0.29.10"
The code below returns information in Windows, Linux and MacOS, but it returns an empty vector in Android.
Calling
sys.physical_core_count()
works as expected, returning the actual core count. As Android is Linux, I thoughsys.cpus()
should just work as well, but it doesn't. Is this behavior expected?The text was updated successfully, but these errors were encountered: