From a2be40e67f332b7ebbd6568cdc06a9d5f5f20854 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Tue, 14 Apr 2026 15:56:28 -0400 Subject: [PATCH] Replace fully qualified names with imports across production code Audit of production Kotlin sources for inline `java.*`, `kotlinx.*`, `io.ktor.*`, and `android.*` FQNs. Replaced with proper imports in: - core/mcp: McpRouting.kt (RoutingCall, JsonArray, JsonElement, JsonPrimitive, URI, UUID), AuthorizationCodeManager.kt (URI, UUID), McpSession.kt (EmbeddedServer) - outreach: OutreachMcpProvider.kt (JsonArray, PackageManager) - usage: UsageMcpProvider.kt (JsonArray) - work: IdleTimeoutManager.kt (StateFlow) - app: AppModule.kt (Context, PowerManager), MainActivity.kt (Color), RouseContextApp.kt (Color), AppNavigation.kt (Uri), FileCertificateStore.kt (Base64), MtlsWebSocketFactory.kt (Base64) No behavior change. ktlintFormat applied. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../java/com/rousecontext/app/MainActivity.kt | 3 +- .../app/cert/FileCertificateStore.kt | 5 +- .../app/cert/MtlsWebSocketFactory.kt | 5 +- .../java/com/rousecontext/app/di/AppModule.kt | 16 ++-- .../app/ui/navigation/AppNavigation.kt | 3 +- .../app/ui/navigation/RouseContextApp.kt | 5 +- .../mcp/core/AuthorizationCodeManager.kt | 6 +- .../com/rousecontext/mcp/core/McpRouting.kt | 76 +++++++++---------- .../com/rousecontext/mcp/core/McpSession.kt | 3 +- .../outreach/OutreachMcpProvider.kt | 12 +-- .../rousecontext/usage/UsageMcpProvider.kt | 3 +- .../rousecontext/work/IdleTimeoutManager.kt | 3 +- 12 files changed, 77 insertions(+), 63 deletions(-) diff --git a/app/src/main/java/com/rousecontext/app/MainActivity.kt b/app/src/main/java/com/rousecontext/app/MainActivity.kt index 1f2ca8ac..d58bf10b 100644 --- a/app/src/main/java/com/rousecontext/app/MainActivity.kt +++ b/app/src/main/java/com/rousecontext/app/MainActivity.kt @@ -2,6 +2,7 @@ package com.rousecontext.app import android.animation.AnimatorSet import android.animation.ObjectAnimator +import android.graphics.Color import android.os.Bundle import android.view.animation.DecelerateInterpolator import androidx.activity.ComponentActivity @@ -30,7 +31,7 @@ class MainActivity : ComponentActivity() { // Navy status bar in both themes = always white icons enableEdgeToEdge( statusBarStyle = SystemBarStyle.dark( - android.graphics.Color.parseColor("#0F1A30") + Color.parseColor("#0F1A30") ) ) super.onCreate(savedInstanceState) diff --git a/app/src/main/java/com/rousecontext/app/cert/FileCertificateStore.kt b/app/src/main/java/com/rousecontext/app/cert/FileCertificateStore.kt index 009bf667..96d57079 100644 --- a/app/src/main/java/com/rousecontext/app/cert/FileCertificateStore.kt +++ b/app/src/main/java/com/rousecontext/app/cert/FileCertificateStore.kt @@ -10,6 +10,7 @@ import java.security.KeyStore import java.security.MessageDigest import java.security.cert.CertificateFactory import java.security.cert.X509Certificate +import java.util.Base64 import javax.crypto.Cipher import javax.crypto.KeyGenerator import javax.crypto.SecretKey @@ -161,7 +162,7 @@ class FileCertificateStore(private val context: Context) : CertificateStore { val cert = factory.generateCertificate(der.inputStream()) pemBuilder.append("-----BEGIN CERTIFICATE-----\n") pemBuilder.append( - java.util.Base64.getMimeEncoder(LINE_LENGTH, "\n".toByteArray()) + Base64.getMimeEncoder(LINE_LENGTH, "\n".toByteArray()) .encodeToString(cert.encoded) ) pemBuilder.append("\n-----END CERTIFICATE-----\n") @@ -260,7 +261,7 @@ class FileCertificateStore(private val context: Context) : CertificateStore { ) for (match in regex.findAll(pem)) { val base64 = match.groupValues[1].replace("\\s".toRegex(), "") - val der = java.util.Base64.getDecoder().decode(base64) + val der = Base64.getDecoder().decode(base64) val cert = factory.generateCertificate(der.inputStream()) as X509Certificate certs.add(cert) } diff --git a/app/src/main/java/com/rousecontext/app/cert/MtlsWebSocketFactory.kt b/app/src/main/java/com/rousecontext/app/cert/MtlsWebSocketFactory.kt index 5d194b18..cddbccf3 100644 --- a/app/src/main/java/com/rousecontext/app/cert/MtlsWebSocketFactory.kt +++ b/app/src/main/java/com/rousecontext/app/cert/MtlsWebSocketFactory.kt @@ -12,6 +12,7 @@ import java.security.PrivateKey import java.security.cert.CertificateFactory import java.security.cert.X509Certificate import java.security.spec.PKCS8EncodedKeySpec +import java.util.Base64 import java.util.concurrent.TimeUnit import javax.crypto.Cipher import javax.crypto.SecretKey @@ -244,7 +245,7 @@ object MtlsWebSocketFactory { .replace("-----END EC PRIVATE KEY-----", "") .replace("\\s".toRegex(), "") return try { - val der = java.util.Base64.getDecoder().decode(base64) + val der = Base64.getDecoder().decode(base64) val spec = PKCS8EncodedKeySpec(der) try { KeyFactory.getInstance("EC").generatePrivate(spec) @@ -266,7 +267,7 @@ object MtlsWebSocketFactory { ) for (match in regex.findAll(pem)) { val base64 = match.groupValues[1].replace("\\s".toRegex(), "") - val der = java.util.Base64.getDecoder().decode(base64) + val der = Base64.getDecoder().decode(base64) val cert = factory.generateCertificate(der.inputStream()) as X509Certificate certs.add(cert) } diff --git a/app/src/main/java/com/rousecontext/app/di/AppModule.kt b/app/src/main/java/com/rousecontext/app/di/AppModule.kt index 666dae95..0a6ce773 100644 --- a/app/src/main/java/com/rousecontext/app/di/AppModule.kt +++ b/app/src/main/java/com/rousecontext/app/di/AppModule.kt @@ -1,5 +1,7 @@ package com.rousecontext.app.di +import android.content.Context +import android.os.PowerManager import com.rousecontext.api.IntegrationStateStore import com.rousecontext.api.LaunchRequestNotifierApi import com.rousecontext.api.McpIntegration @@ -323,7 +325,7 @@ val appModule = module { securityAlertCheck = { val prefs = androidContext().getSharedPreferences( com.rousecontext.work.SecurityCheckWorker.PREFS_NAME, - android.content.Context.MODE_PRIVATE + Context.MODE_PRIVATE ) val self = prefs.getString( com.rousecontext.work.SecurityCheckWorker.KEY_SELF_CERT_RESULT, @@ -371,7 +373,7 @@ val appModule = module { single { val pm = androidContext().getSystemService(android.os.PowerManager::class.java) val wakeLock = pm.newWakeLock( - android.os.PowerManager.PARTIAL_WAKE_LOCK, + PowerManager.PARTIAL_WAKE_LOCK, "rousecontext:tunnel" ) WakelockManager(RealWakeLockHandle(wakeLock)) @@ -396,11 +398,11 @@ val appModule = module { viewModel { val certRenewalPrefs = androidContext().getSharedPreferences( com.rousecontext.work.CertRenewalWorker.PREFS_NAME, - android.content.Context.MODE_PRIVATE + Context.MODE_PRIVATE ) val spuriousWakePrefs = androidContext().getSharedPreferences( SharedPreferencesSpuriousWakeRecorder.PREFS_NAME, - android.content.Context.MODE_PRIVATE + Context.MODE_PRIVATE ) val refresher: NotificationPermissionRefresher = get() MainDashboardViewModel( @@ -424,7 +426,7 @@ val appModule = module { viewModel { val spuriousWakePrefs = androidContext().getSharedPreferences( SharedPreferencesSpuriousWakeRecorder.PREFS_NAME, - android.content.Context.MODE_PRIVATE + Context.MODE_PRIVATE ) SettingsViewModel( notificationSettingsProvider = get(), @@ -434,11 +436,11 @@ val appModule = module { integrations = get(), securityCheckPrefs = androidContext().getSharedPreferences( com.rousecontext.work.SecurityCheckWorker.PREFS_NAME, - android.content.Context.MODE_PRIVATE + Context.MODE_PRIVATE ), settingsPrefs = androidContext().getSharedPreferences( com.rousecontext.app.RouseApplication.PREFS_NAME, - android.content.Context.MODE_PRIVATE + Context.MODE_PRIVATE ), spuriousWakesFlow = SettingsViewModel.spuriousWakeStatsFlow(spuriousWakePrefs) ) diff --git a/app/src/main/java/com/rousecontext/app/ui/navigation/AppNavigation.kt b/app/src/main/java/com/rousecontext/app/ui/navigation/AppNavigation.kt index 4650e0b7..99a49558 100644 --- a/app/src/main/java/com/rousecontext/app/ui/navigation/AppNavigation.kt +++ b/app/src/main/java/com/rousecontext/app/ui/navigation/AppNavigation.kt @@ -3,6 +3,7 @@ package com.rousecontext.app.ui.navigation import android.Manifest import android.content.ActivityNotFoundException import android.content.Intent +import android.net.Uri import android.os.Build import android.provider.Settings import androidx.activity.compose.rememberLauncherForActivityResult @@ -1144,7 +1145,7 @@ fun AppNavigation( val ctx = navController.context val intent = Intent( Settings.ACTION_MANAGE_OVERLAY_PERMISSION, - android.net.Uri.parse("package:${ctx.packageName}") + Uri.parse("package:${ctx.packageName}") ).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) } diff --git a/app/src/main/java/com/rousecontext/app/ui/navigation/RouseContextApp.kt b/app/src/main/java/com/rousecontext/app/ui/navigation/RouseContextApp.kt index 1ca2d44c..acc86764 100644 --- a/app/src/main/java/com/rousecontext/app/ui/navigation/RouseContextApp.kt +++ b/app/src/main/java/com/rousecontext/app/ui/navigation/RouseContextApp.kt @@ -1,5 +1,6 @@ package com.rousecontext.app.ui.navigation +import android.graphics.Color import androidx.activity.ComponentActivity import androidx.activity.SystemBarStyle import androidx.activity.enableEdgeToEdge @@ -34,9 +35,9 @@ fun RouseContextApp(startDestination: String = Routes.HOME) { val activity = LocalContext.current as? ComponentActivity // Navy bars in both themes = always white system icons val systemBarColor = if (isDark) { - android.graphics.Color.parseColor("#060D18") + Color.parseColor("#060D18") } else { - android.graphics.Color.parseColor("#0F1A30") + Color.parseColor("#0F1A30") } androidx.compose.runtime.SideEffect { activity?.enableEdgeToEdge( diff --git a/core/mcp/src/commonMain/kotlin/com/rousecontext/mcp/core/AuthorizationCodeManager.kt b/core/mcp/src/commonMain/kotlin/com/rousecontext/mcp/core/AuthorizationCodeManager.kt index 05a34d54..23b24e5b 100644 --- a/core/mcp/src/commonMain/kotlin/com/rousecontext/mcp/core/AuthorizationCodeManager.kt +++ b/core/mcp/src/commonMain/kotlin/com/rousecontext/mcp/core/AuthorizationCodeManager.kt @@ -1,8 +1,10 @@ package com.rousecontext.mcp.core +import java.net.URI import java.security.MessageDigest import java.security.SecureRandom import java.util.Base64 +import java.util.UUID import java.util.concurrent.ConcurrentHashMap import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow @@ -143,7 +145,7 @@ class AuthorizationCodeManager( ) { for (uri in redirectUris) { val scheme = try { - java.net.URI(uri).scheme?.lowercase() + URI(uri).scheme?.lowercase() } catch (_: Exception) { null } @@ -179,7 +181,7 @@ class AuthorizationCodeManager( "redirect_uri not registered for this client" } - val requestId = java.util.UUID.randomUUID().toString() + val requestId = UUID.randomUUID().toString() val displayCode = generateDisplayCode() val now = clock.currentTimeMillis() diff --git a/core/mcp/src/commonMain/kotlin/com/rousecontext/mcp/core/McpRouting.kt b/core/mcp/src/commonMain/kotlin/com/rousecontext/mcp/core/McpRouting.kt index c7211f11..f3486c67 100644 --- a/core/mcp/src/commonMain/kotlin/com/rousecontext/mcp/core/McpRouting.kt +++ b/core/mcp/src/commonMain/kotlin/com/rousecontext/mcp/core/McpRouting.kt @@ -11,6 +11,7 @@ import io.ktor.server.request.receiveParameters import io.ktor.server.request.receiveText import io.ktor.server.response.respond import io.ktor.server.response.respondText +import io.ktor.server.routing.RoutingCall import io.ktor.server.routing.get import io.ktor.server.routing.post import io.ktor.server.routing.routing @@ -21,11 +22,16 @@ import io.modelcontextprotocol.kotlin.sdk.types.Implementation import io.modelcontextprotocol.kotlin.sdk.types.JSONRPCMessage import io.modelcontextprotocol.kotlin.sdk.types.ServerCapabilities import io.modelcontextprotocol.kotlin.sdk.types.TextContent +import java.net.URI +import java.util.UUID import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonArray +import kotlinx.serialization.json.JsonElement import kotlinx.serialization.json.JsonNull import kotlinx.serialization.json.JsonObject +import kotlinx.serialization.json.JsonPrimitive import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.jsonArray import kotlinx.serialization.json.jsonObject @@ -83,16 +89,15 @@ fun Application.configureMcpRouting( // Resolve the public hostname from the request's Host header, falling back // to the configured hostname. This allows a single MCP session to serve // multiple integration hostnames correctly. - fun io.ktor.server.routing.RoutingCall.resolveHostname(): String = - request.headers["Host"]?.takeIf { - it.isNotEmpty() - } ?: hostname + fun RoutingCall.resolveHostname(): String = request.headers["Host"]?.takeIf { + it.isNotEmpty() + } ?: hostname // Resolve the integration name from the Host header. // Hostname format: {adjective}-{integration}.{subdomain}.{domain} // e.g. "exact-health.abc123.rousecontext.com" -> "health" // Falls back to the configured integration parameter. - fun io.ktor.server.routing.RoutingCall.resolveIntegration(): String { + fun RoutingCall.resolveIntegration(): String { val host = request.headers["Host"] ?.substringBefore(":") // strip port if present ?.takeIf { it.isNotEmpty() } @@ -104,7 +109,7 @@ fun Application.configureMcpRouting( routing { // Helper: if a security alert is active, block the request with 503. - suspend fun io.ktor.server.routing.RoutingCall.rejectIfSecurityAlert(): Boolean { + suspend fun RoutingCall.rejectIfSecurityAlert(): Boolean { if (securityAlertCheck?.invoke() == true) { respond( HttpStatusCode.ServiceUnavailable, @@ -130,9 +135,9 @@ fun Application.configureMcpRouting( put("resource", "$baseUrl/mcp") put( "authorization_servers", - kotlinx.serialization.json.JsonArray( + JsonArray( listOf( - kotlinx.serialization.json.JsonPrimitive(baseUrl) + JsonPrimitive(baseUrl) ) ) ) @@ -197,12 +202,12 @@ fun Application.configureMcpRouting( val clientName = body["client_name"]?.jsonPrimitive?.content ?: "unknown" // Validate redirect_uris: only http/https schemes allowed - val rawUris = (body["redirect_uris"] as? kotlinx.serialization.json.JsonArray) + val rawUris = (body["redirect_uris"] as? JsonArray) ?.mapNotNull { it.jsonPrimitive.content } ?: emptyList() val validUris = rawUris.filter { uri -> try { - val scheme = java.net.URI(uri).scheme?.lowercase() + val scheme = URI(uri).scheme?.lowercase() scheme == "http" || scheme == "https" } catch (_: Exception) { false @@ -223,7 +228,7 @@ fun Application.configureMcpRouting( } val redirectUris = validUris - val clientId = java.util.UUID.randomUUID().toString() + val clientId = UUID.randomUUID().toString() try { authorizationCodeManager.registerClient(clientId, clientName, redirectUris) } catch (e: IllegalArgumentException) { @@ -242,18 +247,18 @@ fun Application.configureMcpRouting( put("client_name", clientName) put( "redirect_uris", - kotlinx.serialization.json.JsonArray( - validUris.map { kotlinx.serialization.json.JsonPrimitive(it) } + JsonArray( + validUris.map { JsonPrimitive(it) } ) ) put( "grant_types", - kotlinx.serialization.json.JsonArray( + JsonArray( listOf( - kotlinx.serialization.json.JsonPrimitive( + JsonPrimitive( "authorization_code" ), - kotlinx.serialization.json.JsonPrimitive( + JsonPrimitive( "urn:ietf:params:oauth:grant-type:device_code" ) ) @@ -261,9 +266,9 @@ fun Application.configureMcpRouting( ) put( "response_types", - kotlinx.serialization.json.JsonArray( + JsonArray( listOf( - kotlinx.serialization.json.JsonPrimitive("code") + JsonPrimitive("code") ) ) ) @@ -331,7 +336,7 @@ fun Application.configureMcpRouting( // Validate redirect_uri scheme val uriScheme = try { - java.net.URI(redirectUri!!).scheme?.lowercase() + URI(redirectUri!!).scheme?.lowercase() } catch (_: Exception) { null } @@ -587,7 +592,7 @@ fun Application.configureMcpRouting( } private suspend fun respondToDeviceCodePoll( - call: io.ktor.server.routing.RoutingCall, + call: RoutingCall, deviceCodeManager: DeviceCodeManager, deviceCode: String ) { @@ -694,9 +699,7 @@ internal suspend fun dispatchJsonRpc(transport: HttpTransport, requestBody: Stri * Parses token request parameters from either form-encoded or JSON body. * Returns a simple map of parameter names to values, or null on parse failure. */ -private suspend fun parseTokenRequestParams( - call: io.ktor.server.routing.RoutingCall -): Map? = try { +private suspend fun parseTokenRequestParams(call: RoutingCall): Map? = try { if (call.request.contentType().match(ContentType.Application.FormUrlEncoded)) { val params = call.receiveParameters() params.names().associateWith { params[it] } @@ -977,18 +980,15 @@ internal fun htmlEscapeForJs(value: String): String { /** Timeout for reading the MCP request body and dispatching it (30 seconds). */ private const val MCP_REQUEST_TIMEOUT_MS = 30_000L -private fun jsonRpcError( - id: kotlinx.serialization.json.JsonElement, - code: Int, - message: String -): JsonObject = buildJsonObject { - put("jsonrpc", "2.0") - put( - "error", - buildJsonObject { - put("code", code) - put("message", message) - } - ) - put("id", id) -} +private fun jsonRpcError(id: JsonElement, code: Int, message: String): JsonObject = + buildJsonObject { + put("jsonrpc", "2.0") + put( + "error", + buildJsonObject { + put("code", code) + put("message", message) + } + ) + put("id", id) + } diff --git a/core/mcp/src/commonMain/kotlin/com/rousecontext/mcp/core/McpSession.kt b/core/mcp/src/commonMain/kotlin/com/rousecontext/mcp/core/McpSession.kt index 56b1af70..7dd1baf9 100644 --- a/core/mcp/src/commonMain/kotlin/com/rousecontext/mcp/core/McpSession.kt +++ b/core/mcp/src/commonMain/kotlin/com/rousecontext/mcp/core/McpSession.kt @@ -1,6 +1,7 @@ package com.rousecontext.mcp.core import io.ktor.server.cio.CIO +import io.ktor.server.engine.EmbeddedServer import io.ktor.server.engine.embeddedServer import kotlinx.coroutines.CompletableDeferred @@ -45,7 +46,7 @@ class McpSession( ) { private val done = CompletableDeferred() - private var engine: io.ktor.server.engine.EmbeddedServer<*, *>? = null + private var engine: EmbeddedServer<*, *>? = null /** * Returns the actual port the HTTP server is listening on. diff --git a/outreach/src/main/kotlin/com/rousecontext/outreach/OutreachMcpProvider.kt b/outreach/src/main/kotlin/com/rousecontext/outreach/OutreachMcpProvider.kt index b9b9192f..16198acd 100644 --- a/outreach/src/main/kotlin/com/rousecontext/outreach/OutreachMcpProvider.kt +++ b/outreach/src/main/kotlin/com/rousecontext/outreach/OutreachMcpProvider.kt @@ -8,6 +8,7 @@ import android.content.ClipboardManager import android.content.Context import android.content.Intent import android.content.pm.ApplicationInfo +import android.content.pm.PackageManager import android.net.Uri import android.os.Build import android.provider.Settings @@ -25,6 +26,7 @@ import io.modelcontextprotocol.kotlin.sdk.types.ToolSchema import java.util.concurrent.atomic.AtomicInteger import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext +import kotlinx.serialization.json.JsonArray import kotlinx.serialization.json.JsonPrimitive import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.jsonArray @@ -393,7 +395,7 @@ class OutreachMcpProvider( val pm = context.packageManager val allApps = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { pm.getInstalledApplications( - android.content.pm.PackageManager.ApplicationInfoFlags.of(0) + PackageManager.ApplicationInfoFlags.of(0) ) } else { pm.getInstalledApplications(0) @@ -713,7 +715,7 @@ private fun notificationSchema() = ToolSchema( ) put( "enum", - kotlinx.serialization.json.JsonArray( + JsonArray( listOf( JsonPrimitive("low"), JsonPrimitive("default"), @@ -764,7 +766,7 @@ private fun notificationSchema() = ToolSchema( ) put( "required", - kotlinx.serialization.json.JsonArray( + JsonArray( listOf(JsonPrimitive("label"), JsonPrimitive("url")) ) ) @@ -810,7 +812,7 @@ private fun createChannelSchema() = ToolSchema( ) put( "enum", - kotlinx.serialization.json.JsonArray( + JsonArray( listOf( JsonPrimitive("min"), JsonPrimitive("low"), @@ -865,7 +867,7 @@ private fun dndSchema() = ToolSchema( ) put( "enum", - kotlinx.serialization.json.JsonArray( + JsonArray( listOf( JsonPrimitive("total_silence"), JsonPrimitive("priority_only"), diff --git a/usage/src/main/kotlin/com/rousecontext/usage/UsageMcpProvider.kt b/usage/src/main/kotlin/com/rousecontext/usage/UsageMcpProvider.kt index e6b9c55b..e4584543 100644 --- a/usage/src/main/kotlin/com/rousecontext/usage/UsageMcpProvider.kt +++ b/usage/src/main/kotlin/com/rousecontext/usage/UsageMcpProvider.kt @@ -16,6 +16,7 @@ import java.time.ZoneId import java.time.format.DateTimeFormatter import java.util.Calendar import java.util.TimeZone +import kotlinx.serialization.json.JsonArray import kotlinx.serialization.json.JsonPrimitive import kotlinx.serialization.json.buildJsonObject @@ -583,7 +584,7 @@ private fun periodProperty() = buildJsonObject { ) put( "enum", - kotlinx.serialization.json.JsonArray( + JsonArray( listOf( JsonPrimitive("today"), JsonPrimitive("yesterday"), diff --git a/work/src/main/kotlin/com/rousecontext/work/IdleTimeoutManager.kt b/work/src/main/kotlin/com/rousecontext/work/IdleTimeoutManager.kt index d7111df7..b833d77e 100644 --- a/work/src/main/kotlin/com/rousecontext/work/IdleTimeoutManager.kt +++ b/work/src/main/kotlin/com/rousecontext/work/IdleTimeoutManager.kt @@ -4,6 +4,7 @@ import com.rousecontext.tunnel.TunnelState import kotlinx.coroutines.Job import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch /** @@ -46,7 +47,7 @@ class IdleTimeoutManager( * Collects [stateFlow] and manages the idle timer. * Suspends until cancelled. */ - suspend fun observe(stateFlow: kotlinx.coroutines.flow.StateFlow) { + suspend fun observe(stateFlow: StateFlow) { timeoutFired = false if (batteryExempt) {