update system info table

This commit is contained in:
Carlo DiCelico 2026-04-16 11:23:46 -05:00
parent c4296bc2a1
commit 58f5ee94cd
No known key found for this signature in database
GPG key ID: 364DF3D5156A623B

View file

@ -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(),
),
)