InspectorDataSource

Functions

Link copied to clipboard

Ungated read, mirroring the other listing methods; only the mutations below are gated.

Link copied to clipboard
open suspend fun captureScreenshot(): ScreenshotResult

The More screen's screenshot capture button. Delegates to DevConsole.captureScreenshot() on a build that has it wired up; defaults to a not-connected ScreenshotResult.Failed so every existing adapter and fake keeps compiling and behaving unchanged, matching this interface's other "only override if you actually implement it" defaults.

Link copied to clipboard
open suspend fun crashesForSession(sessionId: String?): List<InspectorCrashUi>

Session-scoped counterpart of logsForSession for the Crashes tab: retained crash/ANR captures for a past (non-active) session, e.g. the one the previous-run-crashed banner links to. Defaults to the live snapshot's crashes so every existing adapter and fake keeps compiling unchanged; only an adapter with retained-session storage (see FullInspectorDataSource) needs to override it.

Link copied to clipboard
Link copied to clipboard
abstract fun deleteFile(root: String, relativePath: String): InspectorCommandResult
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun executeSql(database: String, sql: String): InspectorSqlResultUi
Link copied to clipboard
abstract fun exportHar(transactionIds: Set<String> = emptySet()): InspectorCommandResult

Exports captured network traffic as a HAR file, sharing the result via the same FileProvider/Share-sheet flow as shareableFilePath. transactionIds mirrors whatever the Traffic screen's multi-select (InspectorAction.ToggleTransactionSelection) currently holds; an empty set exports every captured transaction.

Link copied to clipboard
abstract fun exportPostman(transactionIds: Set<String> = emptySet()): InspectorCommandResult

Same selection semantics as exportHar, as a Postman v2.1 collection instead.

Link copied to clipboard

Exports the whole current session (timeline, network, and app metadata) as one ZIP bundle.

Link copied to clipboard
open suspend fun flagCrash(id: String, sessionId: String? = null): InspectorCommandResult

Crash counterpart of flagTransaction, scoped to sessionId like crashesForSession.

Link copied to clipboard
open suspend fun flaggedCrashIds(sessionId: String? = null): Set<String>

Same durable mechanism as flaggedTransactionIds, scoped to sessionId like crashesForSession (null means the live session).

Link copied to clipboard
open suspend fun flaggedTransactionIds(): Set<String>

Evidence-tray flag state for captured network transactions, durable via EvidenceStore -- the same store the dashboard's evidence tray reads and writes, so a flag made on this device and one made from the browser are the same fact rather than two independent copies. Defaults to empty so every existing adapter/fake keeps compiling; only an adapter with a durable EvidenceStore (see FullInspectorDataSource) needs to override it.

Link copied to clipboard

Flags id (a captured InspectorTransactionUi) into the evidence tray. The subject is materialized fresh from whatever this data source's own capture store currently holds for id -- never re-derived from a value the caller already has cached -- so the stored snapshot matches exactly what the dashboard's own flag route would have produced for the same transaction. InspectorCommandResult.Invalid covers both "already flagged" and "evidence tray full"; InspectorCommandResult.Unavailable covers no durable store being wired up.

Link copied to clipboard
abstract fun listFiles(root: String, relativePath: String): InspectorFileListingUi?
Link copied to clipboard
abstract fun listTables(database: String): InspectorDatabaseListingUi?
Link copied to clipboard
open suspend fun logsForSession(sessionId: String?): List<InspectorLogUi>
Link copied to clipboard

Ungated read, mirroring the other listing methods; only the mutations below are gated.

Link copied to clipboard

Called after the operator grants POST_NOTIFICATIONS from the keep-alive prompt.

Link copied to clipboard
abstract fun previewFile(root: String, relativePath: String): InspectorFilePreviewUi
Link copied to clipboard
abstract fun queryTable(database: String, table: String): InspectorQueryResultUi?
Link copied to clipboard
Link copied to clipboard

Revokes an authenticated browser by id, the same action the dashboard's Session view exposes through DELETE /api/v1/auth/principals/{id} -- this is the device-side equivalent. Ungated by capability, like the exports above: the device owner opening this screen is already the highest trust level there is.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun setPreference(file: String, key: String, value: String, type: String): InspectorCommandResult
Link copied to clipboard
Link copied to clipboard
open fun shareableFilePath(root: String, relativePath: String): String?

Absolute filesystem path to a regular file, for local sharing (the Android Compose Share action wraps it in a content:// URI via androidx.core.content.FileProvider). Returns null when unavailable, out of bounds, or a directory. Gated by the same files capability as deleteFile -- unlike previewFile, the bytes a caller ultimately shares are raw and unredacted, the same reasoning the browser download route documents.

Link copied to clipboard
abstract fun snapshot(): InspectorSnapshot

Filtered variant of snapshot backing the Observe traffic tab's search/method/status filters. Defaults to ignoring the filter and deferring to snapshot so every existing adapter and fake keeps compiling and behaving unchanged; only adapters that want filtering (see FullInspectorDataSource) need to override it.

Link copied to clipboard

Starts or stops the embedded local server -- the More surface's "Start/Stop server" CTA. setServerRunning defaults to InspectorCommandResult.Unavailable like the exports above: sdk/ui-compose only owns the affordance, not the host's actual DevConsoleFacade.start()/ stop() lifecycle, which lives in sdk/full and is out of this module's scope to wire. supportsServerControl reports whether setServerRunning actually does anything on this build; UIs hide the control when false.

Link copied to clipboard
open suspend fun unflagCrash(id: String, sessionId: String? = null): InspectorCommandResult

Crash counterpart of unflagTransaction, scoped to sessionId like crashesForSession.

Link copied to clipboard

Removes id's evidence flag; a no-op if it was never flagged.

Link copied to clipboard