Skip to content

Commit 645570d

Browse files
fix(agent): avoid nullable health payload map
1 parent 7c1b116 commit 645570d

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

app/src/main/java/com/abk/kernel/agent/AbkAgentFacade.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,20 @@ internal object AbkAgentFacade {
8585
val rootGranted = RootUtils.isRootAvailable()
8686
val access = RootUtils.resolveManagerAccess(rootGranted)
8787
val runtime = currentRuntimeSnapshot(rootGranted, access)
88-
return mapOf(
88+
return mutableMapOf<String, Any>(
8989
"status" to "ok",
9090
"protocolVersion" to "abk-agent-v1",
9191
"port" to port,
9292
"appVersion" to BuildConfig.VERSION_NAME,
9393
"appVersionCode" to BuildConfig.APP_VERSION_CODE,
9494
"rootGranted" to rootGranted,
9595
"managerAccessKind" to access.kind.name.lowercase(),
96-
"managerDiagnostic" to managerAccessError(context, access, rootGranted),
9796
"capabilities" to declaredCapabilities(rootGranted, access, runtime),
98-
)
97+
).apply {
98+
managerAccessError(context, access, rootGranted)?.let {
99+
put("managerDiagnostic", it)
100+
}
101+
}
99102
}
100103

101104
fun session(context: Context, host: String, port: Int): AbkAgentSessionResponse {

0 commit comments

Comments
 (0)