mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
update system info table
This commit is contained in:
parent
c4296bc2a1
commit
58f5ee94cd
1 changed files with 9 additions and 0 deletions
|
|
@ -18,7 +18,11 @@ class SystemInfoTable(private val context: Context) : TablePlugin {
|
|||
ColumnDef("hardware_vendor"),
|
||||
ColumnDef("hardware_model"),
|
||||
ColumnDef("hardware_version"),
|
||||
ColumnDef("hardware_serial"),
|
||||
ColumnDef("cpu_brand"),
|
||||
ColumnDef("cpu_type"),
|
||||
ColumnDef("cpu_physical_cores"),
|
||||
ColumnDef("cpu_logical_cores"),
|
||||
ColumnDef("physical_memory"),
|
||||
)
|
||||
|
||||
|
|
@ -27,6 +31,7 @@ class SystemInfoTable(private val context: Context) : TablePlugin {
|
|||
val model = Build.MODEL.orEmpty()
|
||||
val manufacturer = Build.MANUFACTURER.orEmpty()
|
||||
val abi = Build.SUPPORTED_ABIS.firstOrNull().orEmpty()
|
||||
val cpuCores = Runtime.getRuntime().availableProcessors().toString()
|
||||
|
||||
val memInfo = ActivityManager.MemoryInfo()
|
||||
val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as? ActivityManager
|
||||
|
|
@ -40,7 +45,11 @@ class SystemInfoTable(private val context: Context) : TablePlugin {
|
|||
"hardware_vendor" to manufacturer,
|
||||
"hardware_model" to model,
|
||||
"hardware_version" to Build.HARDWARE.orEmpty(),
|
||||
"hardware_serial" to (runCatching { Build.getSerial() }.getOrNull().orEmpty()),
|
||||
"cpu_brand" to abi,
|
||||
"cpu_type" to abi,
|
||||
"cpu_physical_cores" to cpuCores,
|
||||
"cpu_logical_cores" to cpuCores,
|
||||
"physical_memory" to memInfo.totalMem.coerceAtLeast(0L).toString(),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue