log: replace android.util.Log with :library:log facade repo-wide
- Commit
5edc877f81dfa50ea48672bd983928809c768326- Author
- vayun-mathur <[email protected]>
- When
- 2026-10-08 21:07 UTC (1 month ago)
- Parents
d90de8d
Diff
appstore/src/main/AndroidManifest.xml
diff --git a/appstore/src/main/AndroidManifest.xml b/appstore/src/main/AndroidManifest.xmlindex 20f9acd2c7..8a40f40b00 100644--- a/appstore/src/main/AndroidManifest.xml+++ b/appstore/src/main/AndroidManifest.xml@@ -14,6 +14,7 @@ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" /> <application+ android:name=".AppstoreApplication" android:allowBackup="true" android:dataExtractionRules="@xml/data_extraction_rules" android:icon="@mipmap/ic_launcher"
appstore/src/main/java/com/vayunmathur/appstore/AppstoreApplication.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/AppstoreApplication.kt b/appstore/src/main/java/com/vayunmathur/appstore/AppstoreApplication.ktnew file mode 100644index 0000000000..965fab52a8--- /dev/null+++ b/appstore/src/main/java/com/vayunmathur/appstore/AppstoreApplication.kt@@ -0,0 +1,15 @@+package com.vayunmathur.appstore++import android.app.Application+import com.vayunmathur.library.log.Log++/**+ * Wires the repo logging facade's dev gate: `Log.dev` only emits on `dev`+ * builds (`BuildConfig.DEV_BUILD`), matching the findfamily tracker gate.+ */+class AppstoreApplication : Application() {+ override fun onCreate() {+ super.onCreate()+ Log.init(BuildConfig.DEV_BUILD)+ }+}
appstore/src/main/java/com/vayunmathur/appstore/data/FDroidAppProvider.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidAppProvider.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidAppProvider.ktindex 961bf5c5e2..5d3c9dc44d 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidAppProvider.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidAppProvider.kt@@ -1,7 +1,7 @@ package com.vayunmathur.appstore.data import android.content.Context-import android.util.Log+import com.vayunmathur.library.log.Log import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext @@ -30,10 +30,10 @@ class FDroidAppProvider( val result = try { fetchVerifiedIndex() } catch (expected: Exception) {- Log.w(TAG, "sync of ${descriptor.displayName} failed", expected)+ Log.status(TAG, "sync of ${descriptor.displayName} failed", expected) throw expected }- Log.i(+ Log.status( TAG, "sync of ${descriptor.displayName}: fetched ${result.apps.size} " + "apps (signer ${result.signerSha256.take(16)}…)"@@ -42,7 +42,7 @@ class FDroidAppProvider( // previous rows so one bad sync cannot wipe the catalogue (issue: "catalogue // updated — 0 apps" left the Modern Apps section empty until the next good sync). if (result.apps.isEmpty()) {- Log.w(TAG, "sync of ${descriptor.displayName} parsed 0 apps; keeping cached rows")+ Log.status(TAG, "sync of ${descriptor.displayName} parsed 0 apps; keeping cached rows") return@withContext 0 } val repo = db.repoDao().all().find { it.url == descriptor.url }
appstore/src/main/java/com/vayunmathur/appstore/data/UpdateCheckWorker.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/UpdateCheckWorker.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/UpdateCheckWorker.ktindex ae0e0ad931..c9a92da7c4 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/UpdateCheckWorker.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/UpdateCheckWorker.kt@@ -9,7 +9,7 @@ import android.content.Intent import android.content.pm.PackageManager import android.content.pm.ServiceInfo import android.os.Build-import android.util.Log+import com.vayunmathur.library.log.Log import androidx.core.app.ActivityCompat import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat@@ -68,13 +68,13 @@ class UpdateCheckWorker( } Result.success() } catch (expected: java.io.IOException) {- Log.w(TAG, "Update check failed", expected)+ Log.status(TAG, "Update check failed", expected) Result.retry() } catch (expected: IllegalStateException) {- Log.w(TAG, "Update check failed", expected)+ Log.status(TAG, "Update check failed", expected) Result.retry() } catch (expected: SecurityException) {- Log.w(TAG, "Update check failed", expected)+ Log.status(TAG, "Update check failed", expected) Result.retry() }
appstore/src/main/java/com/vayunmathur/appstore/data/accrescent/AccrescentRepoData.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/accrescent/AccrescentRepoData.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/accrescent/AccrescentRepoData.ktindex 9b83b53068..4bf64db75c 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/accrescent/AccrescentRepoData.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/accrescent/AccrescentRepoData.kt@@ -1,7 +1,7 @@ package com.vayunmathur.appstore.data.accrescent import android.content.Context-import android.util.Log+import com.vayunmathur.library.log.Log import androidx.datastore.preferences.core.edit import androidx.datastore.preferences.core.longPreferencesKey import androidx.datastore.preferences.preferencesDataStore@@ -83,13 +83,13 @@ class AccrescentRepoDataFetcher(private val context: Context) { Result.success(repoData) } catch (expected: IllegalStateException) {- Log.w(TAG, "repodata fetch/verify failed", expected)+ Log.status(TAG, "repodata fetch/verify failed", expected) Result.failure(expected) } catch (expected: java.io.IOException) {- Log.w(TAG, "repodata fetch/verify failed", expected)+ Log.status(TAG, "repodata fetch/verify failed", expected) Result.failure(expected) } catch (expected: SecurityException) {- Log.w(TAG, "repodata fetch/verify failed", expected)+ Log.status(TAG, "repodata fetch/verify failed", expected) Result.failure(expected) } }@@ -98,10 +98,10 @@ class AccrescentRepoDataFetcher(private val context: Context) { try { context.accrescentDataStore.data.first()[REPODATA_TIMESTAMP_KEY] ?: 0L } catch (expected: java.io.IOException) {- Log.w(TAG, "read stored timestamp", expected)+ Log.status(TAG, "read stored timestamp", expected) 0L } catch (expected: IllegalStateException) {- Log.w(TAG, "read stored timestamp", expected)+ Log.status(TAG, "read stored timestamp", expected) 0L } @@ -109,7 +109,7 @@ class AccrescentRepoDataFetcher(private val context: Context) { try { context.accrescentDataStore.edit { it[REPODATA_TIMESTAMP_KEY] = timestamp } } catch (expected: java.io.IOException) {- Log.w(TAG, "persist timestamp", expected)+ Log.status(TAG, "persist timestamp", expected) } }
appstore/src/main/java/com/vayunmathur/appstore/data/accrescent/AccrescentRepository.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/accrescent/AccrescentRepository.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/accrescent/AccrescentRepository.ktindex 79e6449851..3d7f613353 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/accrescent/AccrescentRepository.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/accrescent/AccrescentRepository.kt@@ -1,7 +1,7 @@ package com.vayunmathur.appstore.data.accrescent import android.content.Context-import android.util.Log+import com.vayunmathur.library.log.Log import app.accrescent.appstore.v1.AppListing import com.vayunmathur.appstore.data.AppDatabase import com.vayunmathur.appstore.data.AppSource@@ -88,10 +88,10 @@ class AccrescentRepository( } catch (e: CancellationException) { throw e } catch (expected: java.io.IOException) {- Log.w(TAG, "listApps failed", expected)+ Log.status(TAG, "listApps failed", expected) AccrescentPage(emptyList(), "") } catch (expected: IllegalStateException) {- Log.w(TAG, "listApps failed", expected)+ Log.status(TAG, "listApps failed", expected) AccrescentPage(emptyList(), "") } }@@ -146,10 +146,10 @@ class AccrescentRepository( } catch (e: CancellationException) { throw e } catch (expected: java.io.IOException) {- Log.w(TAG, "listAppListings page $pages failed", expected)+ Log.status(TAG, "listAppListings page $pages failed", expected) null } catch (expected: IllegalStateException) {- Log.w(TAG, "listAppListings page $pages failed", expected)+ Log.status(TAG, "listAppListings page $pages failed", expected) null } }@@ -168,10 +168,10 @@ class AccrescentRepository( } catch (e: CancellationException) { throw e } catch (expected: java.io.IOException) {- Log.w(TAG, "details failed for $appId", expected)+ Log.status(TAG, "details failed for $appId", expected) null } catch (expected: IllegalStateException) {- Log.w(TAG, "details failed for $appId", expected)+ Log.status(TAG, "details failed for $appId", expected) null } }
appstore/src/main/java/com/vayunmathur/appstore/data/grapheneos/GrapheneOSRepository.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/grapheneos/GrapheneOSRepository.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/grapheneos/GrapheneOSRepository.ktindex 06a8808e88..66c77ddca5 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/grapheneos/GrapheneOSRepository.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/grapheneos/GrapheneOSRepository.kt@@ -1,7 +1,7 @@ package com.vayunmathur.appstore.data.grapheneos import android.content.Context-import android.util.Log+import com.vayunmathur.library.log.Log import androidx.datastore.preferences.core.edit import androidx.datastore.preferences.core.longPreferencesKey import androidx.datastore.preferences.preferencesDataStore@@ -90,13 +90,13 @@ class GrapheneOSRepository(private val context: Context) { cached = parsed Result.success(parsed) } catch (expected: IllegalStateException) {- Log.w(TAG, "index fetch/verify failed", expected)+ Log.status(TAG, "index fetch/verify failed", expected) Result.failure(expected) } catch (expected: java.io.IOException) {- Log.w(TAG, "index fetch/verify failed", expected)+ Log.status(TAG, "index fetch/verify failed", expected) Result.failure(expected) } catch (expected: SecurityException) {- Log.w(TAG, "index fetch/verify failed", expected)+ Log.status(TAG, "index fetch/verify failed", expected) Result.failure(expected) } }@@ -120,10 +120,10 @@ class GrapheneOSRepository(private val context: Context) { private suspend fun readStoredTimestamp(): Long = try { context.grapheneOSDataStore.data.first()[INDEX_TIMESTAMP_KEY] ?: 0L } catch (expected: java.io.IOException) {- Log.w(TAG, "read stored timestamp", expected)+ Log.status(TAG, "read stored timestamp", expected) 0L } catch (expected: IllegalStateException) {- Log.w(TAG, "read stored timestamp", expected)+ Log.status(TAG, "read stored timestamp", expected) 0L } @@ -131,7 +131,7 @@ class GrapheneOSRepository(private val context: Context) { try { context.grapheneOSDataStore.edit { it[INDEX_TIMESTAMP_KEY] = timestamp } } catch (expected: java.io.IOException) {- Log.w(TAG, "persist timestamp", expected)+ Log.status(TAG, "persist timestamp", expected) } }
appstore/src/main/java/com/vayunmathur/appstore/data/installer/InstallCoordinator.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/installer/InstallCoordinator.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/installer/InstallCoordinator.ktindex 0d8bf4a029..d1707eae56 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/installer/InstallCoordinator.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/installer/InstallCoordinator.kt@@ -1,7 +1,7 @@ package com.vayunmathur.appstore.data.installer import android.content.Context-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.appstore.data.AppDatabase import com.vayunmathur.appstore.data.AppSource import com.vayunmathur.appstore.data.PinnedStampEntity@@ -142,7 +142,7 @@ class InstallCoordinator( } private fun failInstall(packageName: String, e: Exception): SessionInstaller.Outcome {- Log.e(TAG, "Install failed for $packageName", e)+ Log.error(TAG, "Install failed for $packageName", e) stage(packageName, InstallStage.Failed(e.message ?: "download failed")) return SessionInstaller.Outcome(false, VerificationResult.Rejected(e.message ?: "download failed")) }@@ -349,7 +349,7 @@ class InstallCoordinator( val splits = try { accrescent.downloadInfo(app.packageName) } catch (expected: IncompatibleDeviceException) {- Log.w(TAG, "no Accrescent build for ${app.packageName}", expected)+ Log.status(TAG, "no Accrescent build for ${app.packageName}", expected) return@withContext SessionInstaller.Outcome( false, VerificationResult.Rejected("this app has no build for your device") )@@ -481,9 +481,9 @@ class InstallCoordinator( ) ) } catch (expected: android.database.sqlite.SQLiteException) {- Log.w(TAG, "pin stamp for $packageName", expected)+ Log.status(TAG, "pin stamp for $packageName", expected) } catch (expected: IllegalStateException) {- Log.w(TAG, "pin stamp for $packageName", expected)+ Log.status(TAG, "pin stamp for $packageName", expected) } }
appstore/src/main/java/com/vayunmathur/appstore/data/installer/InstallStatusReceiver.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/installer/InstallStatusReceiver.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/installer/InstallStatusReceiver.ktindex b99d77a1b0..cb9200d8b3 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/installer/InstallStatusReceiver.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/installer/InstallStatusReceiver.kt@@ -4,7 +4,7 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.content.pm.PackageInstaller-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.appstore.R import com.vayunmathur.appstore.data.RestrictedPackages import com.vayunmathur.library.util.AppMessages@@ -58,24 +58,24 @@ class InstallStatusReceiver : BroadcastReceiver() { context.startActivity(it) } } catch (expected: android.content.ActivityNotFoundException) {- Log.w(TAG, "Failed to start user action: ${expected.message}")+ Log.status(TAG, "Failed to start user action: ${expected.message}") } catch (expected: SecurityException) {- Log.w(TAG, "Failed to start user action: ${expected.message}")+ Log.status(TAG, "Failed to start user action: ${expected.message}") } } private fun reportSuccess(pkg: String?) {- Log.i(TAG, "Install success for $pkg")+ Log.status(TAG, "Install success for $pkg") pkg?.let { InstallEvents.publish(InstallResult(it, success = true)) } } private fun reportAborted(pkg: String?) {- Log.i(TAG, "Install aborted for $pkg")+ Log.status(TAG, "Install aborted for $pkg") pkg?.let { InstallEvents.publish(InstallResult(it, success = false)) } } private fun reportFailure(context: Context, status: Int, message: String?, pkg: String?) {- Log.w(TAG, "Install failed for $pkg status=$status message=$message")+ Log.status(TAG, "Install failed for $pkg status=$status message=$message") pkg?.let { InstallEvents.publish(InstallResult(it, success = false)) } // A source-restricted refusal is the OS's final answer, so stop offering it. RestrictedPackages.recordIfRestricted(context, pkg, message)
appstore/src/main/java/com/vayunmathur/appstore/data/installer/PlayDownloader.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/installer/PlayDownloader.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/installer/PlayDownloader.ktindex eaf4775e79..f9f0cd0fde 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/installer/PlayDownloader.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/installer/PlayDownloader.kt@@ -1,7 +1,7 @@ package com.vayunmathur.appstore.data.installer import android.content.Context-import android.util.Log+import com.vayunmathur.library.log.Log import com.aurora.gplayapi.data.models.PlayFile import java.io.File import java.net.HttpURLConnection@@ -78,10 +78,10 @@ class PlayDownloader( Result.success(localFiles) } catch (expected: java.io.IOException) {- Log.e(TAG, "downloadFiles failed: ${expected.message}", expected)+ Log.error(TAG, "downloadFiles failed: ${expected.message}", expected) Result.failure(expected) } catch (expected: SecurityException) {- Log.e(TAG, "downloadFiles failed: ${expected.message}", expected)+ Log.error(TAG, "downloadFiles failed: ${expected.message}", expected) Result.failure(expected) } }
appstore/src/main/java/com/vayunmathur/appstore/data/installer/SessionInstaller.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/installer/SessionInstaller.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/installer/SessionInstaller.ktindex 1c034a614d..d6f6afb313 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/installer/SessionInstaller.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/installer/SessionInstaller.kt@@ -6,7 +6,7 @@ import android.content.Intent import android.content.pm.PackageInstaller import android.os.Build import android.os.Process-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.appstore.data.security.InstallRequirement import com.vayunmathur.appstore.data.security.InstallVerifier import com.vayunmathur.appstore.data.security.VerificationResult@@ -38,13 +38,13 @@ class SessionInstaller( totalSize: Long = -1L ): Outcome { if (files.isEmpty()) {- Log.w(TAG, "No files to install for $packageName")+ Log.status(TAG, "No files to install for $packageName") return Outcome(false, VerificationResult.Rejected("nothing was downloaded")) } val verification = InstallVerifier.verify(context, files, requirement) if (verification is VerificationResult.Rejected) {- Log.e(TAG, "Refusing to install $packageName: ${verification.reason}")+ Log.error(TAG, "Refusing to install $packageName: ${verification.reason}") files.forEach { runCatching { it.delete() } } return Outcome(false, verification) }@@ -79,22 +79,22 @@ class SessionInstaller( try { writeFiles(session, files) } catch (expected: java.io.IOException) {- Log.e(TAG, "Write failed for $packageName: ${expected.message}", expected)+ Log.error(TAG, "Write failed for $packageName: ${expected.message}", expected) abandonQuietly(session) return false } commitSession(session, sessionId, packageName)- Log.i(TAG, "Commit started for $packageName sessionId=$sessionId")+ Log.status(TAG, "Commit started for $packageName sessionId=$sessionId") true } catch (expected: SecurityException) {- Log.e(TAG, "Install failed for $packageName: ${expected.message}", expected)+ Log.error(TAG, "Install failed for $packageName: ${expected.message}", expected) false } catch (expected: java.io.IOException) {- Log.e(TAG, "Install failed for $packageName: ${expected.message}", expected)+ Log.error(TAG, "Install failed for $packageName: ${expected.message}", expected) false } catch (expected: IllegalStateException) {- Log.e(TAG, "Install failed for $packageName: ${expected.message}", expected)+ Log.error(TAG, "Install failed for $packageName: ${expected.message}", expected) false } }@@ -110,11 +110,11 @@ class SessionInstaller( try { installer.abandonSession(it.sessionId) } catch (expected: SecurityException) {- Log.w(TAG, "abandon ${it.sessionId}", expected)+ Log.status(TAG, "abandon ${it.sessionId}", expected) } } } catch (expected: SecurityException) {- Log.w(TAG, "list sessions", expected)+ Log.status(TAG, "list sessions", expected) } } @@ -162,7 +162,7 @@ class SessionInstaller( try { session.abandon() } catch (expected: SecurityException) {- Log.w(TAG, "abandon session", expected)+ Log.status(TAG, "abandon session", expected) } } @@ -182,7 +182,7 @@ class SessionInstaller( session.commit(pendingIntent.intentSender) session.close() } catch (expected: SecurityException) {- Log.e(TAG, "commit failed for $packageName", expected)+ Log.error(TAG, "commit failed for $packageName", expected) abandonQuietly(session) throw expected }
appstore/src/main/java/com/vayunmathur/appstore/data/play/AnonymousAuthRepository.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/play/AnonymousAuthRepository.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/play/AnonymousAuthRepository.ktindex 1d2a4fcef9..f5fbbf86fc 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/play/AnonymousAuthRepository.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/play/AnonymousAuthRepository.kt@@ -1,6 +1,6 @@ package com.vayunmathur.appstore.data.play -import android.util.Log+import com.vayunmathur.library.log.Log import com.aurora.gplayapi.data.models.AuthData import com.aurora.gplayapi.helpers.AuthHelper import kotlinx.coroutines.Dispatchers@@ -163,7 +163,7 @@ class AnonymousAuthRepository { val auth = json.decodeFromString(AuthResponse.serializer(), responseBody) Result.success(auth) } catch (expected: IllegalArgumentException) {- Log.w(TAG, "Parse auth failed: ${expected.message}")+ Log.status(TAG, "Parse auth failed: ${expected.message}") Result.failure(AuthError.Unknown(code, responseBody)) } } catch (expected: java.io.IOException) {@@ -192,10 +192,10 @@ class AnonymousAuthRepository { ) Result.success(authData) } catch (expected: IllegalStateException) {- Log.w(TAG, "buildAuthData failed: ${expected.message}", expected)+ Log.status(TAG, "buildAuthData failed: ${expected.message}", expected) Result.failure(expected) } catch (expected: IllegalArgumentException) {- Log.w(TAG, "buildAuthData failed: ${expected.message}", expected)+ Log.status(TAG, "buildAuthData failed: ${expected.message}", expected) Result.failure(expected) } }@@ -230,7 +230,7 @@ class AnonymousAuthRepository { val error = credResult.exceptionOrNull() lastError = error if (error != null && !isTransient(error)) {- Log.w(TAG, "Dispenser $url rejected us permanently: $error")+ Log.status(TAG, "Dispenser $url rejected us permanently: $error") break } }@@ -238,7 +238,7 @@ class AnonymousAuthRepository { if (attempt < MAX_ATTEMPTS - 1) { val backoff = BASE_BACKOFF_MS shl attempt val wait = backoff + Random.nextLong((backoff / 2).coerceAtLeast(1))- Log.w(TAG, "Dispenser $url attempt ${attempt + 1} failed ($lastError), " ++ Log.status(TAG, "Dispenser $url attempt ${attempt + 1} failed ($lastError), " + "retrying in ${wait}ms") delay(wait) }
appstore/src/main/java/com/vayunmathur/appstore/data/play/PlayRepository.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/play/PlayRepository.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/play/PlayRepository.ktindex 1dca624306..c746deccf2 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/play/PlayRepository.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/play/PlayRepository.kt@@ -1,7 +1,7 @@ package com.vayunmathur.appstore.data.play import android.content.Context-import android.util.Log+import com.vayunmathur.library.log.Log import androidx.datastore.preferences.core.edit import androidx.datastore.preferences.core.longPreferencesKey import androidx.datastore.preferences.core.stringPreferencesKey@@ -99,9 +99,9 @@ class PlayRepository(private val context: Context) { invalidate() } } catch (expected: java.io.IOException) {- Log.w(TAG, "restore auth failed", expected)+ Log.status(TAG, "restore auth failed", expected) } catch (expected: IllegalStateException) {- Log.w(TAG, "restore auth failed", expected)+ Log.status(TAG, "restore auth failed", expected) } } @@ -122,9 +122,9 @@ class PlayRepository(private val context: Context) { } catch (e: CancellationException) { throw e } catch (expected: java.io.IOException) {- Log.w(TAG, "Play call failed; cycling anonymous account", expected)+ Log.status(TAG, "Play call failed; cycling anonymous account", expected) } catch (expected: IllegalStateException) {- Log.w(TAG, "Play call failed; cycling anonymous account", expected)+ Log.status(TAG, "Play call failed; cycling anonymous account", expected) } invalidate()@@ -134,10 +134,10 @@ class PlayRepository(private val context: Context) { } catch (e: CancellationException) { throw e } catch (expected: java.io.IOException) {- Log.w(TAG, "Play call failed again after cycling", expected)+ Log.status(TAG, "Play call failed again after cycling", expected) null } catch (expected: IllegalStateException) {- Log.w(TAG, "Play call failed again after cycling", expected)+ Log.status(TAG, "Play call failed again after cycling", expected) null } }@@ -247,7 +247,7 @@ class PlayRepository(private val context: Context) { prefs.remove(PLAY_AUTH_DISPENSED_AT_KEY) } } catch (expected: java.io.IOException) {- Log.w(TAG, "invalidate auth failed", expected)+ Log.status(TAG, "invalidate auth failed", expected) } } @@ -259,7 +259,7 @@ class PlayRepository(private val context: Context) { prefs[PLAY_AUTH_DISPENSED_AT_KEY] = dispensedAt } } catch (expected: java.io.IOException) {- Log.w(TAG, "persist auth failed", expected)+ Log.status(TAG, "persist auth failed", expected) } }
appstore/src/main/java/com/vayunmathur/appstore/data/security/SourceStamp.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/security/SourceStamp.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/security/SourceStamp.ktindex b213291813..621afaf6e3 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/security/SourceStamp.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/security/SourceStamp.kt@@ -1,6 +1,6 @@ package com.vayunmathur.appstore.data.security -import android.util.Log+import com.vayunmathur.library.log.Log import com.android.apksig.SourceStampVerifier import java.io.File import java.security.cert.X509Certificate@@ -39,13 +39,13 @@ object SourceStamp { } catch (expected: SecurityException) { // An absent stamp is normal and not an error; a malformed one is treated the // same as absent, and the caller decides whether absence is acceptable.- Log.d(TAG, "No verifiable source stamp on ${apk.name}: ${expected.message}")+ Log.debug(TAG, "No verifiable source stamp on ${apk.name}: ${expected.message}") null } catch (expected: IllegalStateException) {- Log.d(TAG, "No verifiable source stamp on ${apk.name}: ${expected.message}")+ Log.debug(TAG, "No verifiable source stamp on ${apk.name}: ${expected.message}") null } catch (expected: java.io.IOException) {- Log.d(TAG, "No verifiable source stamp on ${apk.name}: ${expected.message}")+ Log.debug(TAG, "No verifiable source stamp on ${apk.name}: ${expected.message}") null } }
astronomy/src/main/AndroidManifest.xml
diff --git a/astronomy/src/main/AndroidManifest.xml b/astronomy/src/main/AndroidManifest.xmlindex a89c31e951..419e4bb586 100644--- a/astronomy/src/main/AndroidManifest.xml+++ b/astronomy/src/main/AndroidManifest.xml@@ -9,6 +9,7 @@ <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> <application+ android:name=".AstronomyApplication" android:allowBackup="true" android:dataExtractionRules="@xml/data_extraction_rules" android:icon="@mipmap/ic_launcher"
astronomy/src/main/java/com/vayunmathur/astronomy/AstronomyApplication.kt
diff --git a/astronomy/src/main/java/com/vayunmathur/astronomy/AstronomyApplication.kt b/astronomy/src/main/java/com/vayunmathur/astronomy/AstronomyApplication.ktnew file mode 100644index 0000000000..98c02f1fc1--- /dev/null+++ b/astronomy/src/main/java/com/vayunmathur/astronomy/AstronomyApplication.kt@@ -0,0 +1,15 @@+package com.vayunmathur.astronomy++import android.app.Application+import com.vayunmathur.library.log.Log++/**+ * Wires the repo logging facade's dev gate: `Log.dev` only emits on `dev`+ * builds (`BuildConfig.DEV_BUILD`), matching the findfamily tracker gate.+ */+class AstronomyApplication : Application() {+ override fun onCreate() {+ super.onCreate()+ Log.init(BuildConfig.DEV_BUILD)+ }+}
auto/src/main/AndroidManifest.xml
diff --git a/auto/src/main/AndroidManifest.xml b/auto/src/main/AndroidManifest.xmlindex 2d3872bb0d..74d70d62dd 100644--- a/auto/src/main/AndroidManifest.xml+++ b/auto/src/main/AndroidManifest.xml@@ -169,6 +169,7 @@ </queries> <application+ android:name=".AutoApplication" android:allowBackup="false" android:dataExtractionRules="@xml/data_extraction_rules" android:icon="@mipmap/ic_launcher"
auto/src/main/java/com/vayunmathur/auto/AutoApplication.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/AutoApplication.kt b/auto/src/main/java/com/vayunmathur/auto/AutoApplication.ktnew file mode 100644index 0000000000..e9ce50dcdf--- /dev/null+++ b/auto/src/main/java/com/vayunmathur/auto/AutoApplication.kt@@ -0,0 +1,15 @@+package com.vayunmathur.auto++import android.app.Application+import com.vayunmathur.library.log.Log++/**+ * Wires the repo logging facade's dev gate: `Log.dev` only emits on `dev`+ * builds (`BuildConfig.DEV_BUILD`), matching the findfamily tracker gate.+ */+class AutoApplication : Application() {+ override fun onCreate() {+ super.onCreate()+ Log.init(BuildConfig.DEV_BUILD)+ }+}
auto/src/main/java/com/vayunmathur/auto/network/HeadUnitServer.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/network/HeadUnitServer.kt b/auto/src/main/java/com/vayunmathur/auto/network/HeadUnitServer.ktindex 6594aba51d..2ca4cbf45c 100644--- a/auto/src/main/java/com/vayunmathur/auto/network/HeadUnitServer.kt+++ b/auto/src/main/java/com/vayunmathur/auto/network/HeadUnitServer.kt@@ -1,6 +1,6 @@ package com.vayunmathur.auto.network -import android.util.Log+import com.vayunmathur.library.log.Log import java.io.Closeable import java.net.InetAddress import java.net.ServerSocket@@ -30,17 +30,17 @@ class HeadUnitServer(private val port: Int = DHU_PORT) : Closeable { // would expose the socket only to the phone itself either way. val socket = server ?: tryIpv4Loopback() ?: ServerSocket(port, BACKLOG) .also {- Log.w(TAG, "IPv4 loopback bind failed; listening dual-stack instead")+ Log.status(TAG, "IPv4 loopback bind failed; listening dual-stack instead") } .also { server = it- Log.i(TAG, "listening for a head unit on ${it.inetAddress.hostAddress}:$port")+ Log.status(TAG, "listening for a head unit on ${it.inetAddress.hostAddress}:$port") } return socket.accept().apply { // Projection is latency-sensitive and its writes are small and frequent; Nagle // would coalesce frames and add a visible stutter. tcpNoDelay = true- Log.i(TAG, "head unit connected from $remoteSocketAddress")+ Log.status(TAG, "head unit connected from $remoteSocketAddress") } }
auto/src/main/java/com/vayunmathur/auto/network/UsbConnector.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/network/UsbConnector.kt b/auto/src/main/java/com/vayunmathur/auto/network/UsbConnector.ktindex 7c9e65be12..cfe7a80f95 100644--- a/auto/src/main/java/com/vayunmathur/auto/network/UsbConnector.kt+++ b/auto/src/main/java/com/vayunmathur/auto/network/UsbConnector.kt@@ -6,7 +6,7 @@ import android.content.Intent import android.hardware.usb.UsbAccessory import android.hardware.usb.UsbManager import android.os.ParcelFileDescriptor-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.platform.TransportState import com.vayunmathur.auto.protocol.StreamTransport import com.vayunmathur.auto.protocol.TransportKind@@ -65,7 +65,7 @@ object UsbConnector { lastAccessory = null session.onDetached() TransportState.publishUsb(session)- Log.i(TAG, "USB accessory detached")+ Log.status(TAG, "USB accessory detached") return true } ACTION_USB_ACCESSORY_FORCE_START -> {@@ -86,10 +86,10 @@ object UsbConnector { */ fun forceStart(context: Context) { val accessory = lastAccessory ?: run {- Log.i(TAG, "USB force-start with no accessory seen; ignoring")+ Log.status(TAG, "USB force-start with no accessory seen; ignoring") return }- Log.i(TAG, "USB force-start for ${accessory.model}")+ Log.status(TAG, "USB force-start for ${accessory.model}") onAttached(context, accessory) } @@ -108,7 +108,7 @@ object UsbConnector { } else { session.onPermissionDenied() TransportState.publishUsb(session)- Log.i(TAG, "USB accessory permission denied")+ Log.status(TAG, "USB accessory permission denied") } return true }@@ -136,7 +136,7 @@ object UsbConnector { // ride unchanged through. No fork here on purpose: the transport is // agnostic and the session reuses TLS/GAL verbatim. MANAGE_USB would // gate only the reset/role-switch side (see ConnectionResetReceiver).- Log.i(TAG, "USB accessory attached: ${session.accessoryLabel}")+ Log.status(TAG, "USB accessory attached: ${session.accessoryLabel}") val granted = manager?.hasPermission(accessory) == true if (granted) open(context, accessory) else requestPermission(context, accessory) }@@ -179,7 +179,7 @@ object UsbConnector { ) session.onPermissionGranted() TransportState.publishUsb(session)- Log.i(TAG, "USB accessory open, transport parked for the service loop")+ Log.status(TAG, "USB accessory open, transport parked for the service loop") } private const val TAG = "MaAuto.Usb"
auto/src/main/java/com/vayunmathur/auto/network/WifiDirectConnector.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/network/WifiDirectConnector.kt b/auto/src/main/java/com/vayunmathur/auto/network/WifiDirectConnector.ktindex 8ec7c3b510..3e21ef06ba 100644--- a/auto/src/main/java/com/vayunmathur/auto/network/WifiDirectConnector.kt+++ b/auto/src/main/java/com/vayunmathur/auto/network/WifiDirectConnector.kt@@ -14,7 +14,7 @@ import android.net.wifi.WifiNetworkSpecifier import android.net.wifi.p2p.WifiP2pConfig import android.net.wifi.p2p.WifiP2pManager import android.os.Looper-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.platform.TransportState import com.vayunmathur.auto.protocol.GalTransport import com.vayunmathur.auto.protocol.StreamTransport@@ -223,7 +223,7 @@ object WifiDirectConnector { // network keeps the bring-up going on the default route. huNetwork?.let { network -> runCatching { network.bindSocket(socket) }- .onFailure { Log.w(TAG, "could not bind the GAL socket to the car network", it) }+ .onFailure { Log.status(TAG, "could not bind the GAL socket to the car network", it) } } socket.connect(InetSocketAddress(params.host, params.port), CONNECT_TIMEOUT_MS) } catch (e: IOException) {@@ -249,7 +249,7 @@ object WifiDirectConnector { if (!cancelled) { session.onSocketConnected() TransportState.publishWireless(session)- Log.i(TAG, "wireless socket connected to $hostAddress, parked for the service loop")+ Log.status(TAG, "wireless socket connected to $hostAddress, parked for the service loop") } else { runCatching { transport.close() } }@@ -277,7 +277,7 @@ object WifiDirectConnector { } }, )- }.onFailure { Log.w(TAG, "could not bind to the WiFi network", it) }+ }.onFailure { Log.status(TAG, "could not bind to the WiFi network", it) } } /**@@ -307,7 +307,7 @@ object WifiDirectConnector { return } huNetwork = network- Log.i(TAG, "local car WiFi network available; GAL sockets bind to it")+ Log.status(TAG, "local car WiFi network available; GAL sockets bind to it") } override fun onLost(network: Network) {@@ -315,7 +315,7 @@ object WifiDirectConnector { } }, )- }.onFailure { Log.w(TAG, "could not request the local car WiFi network", it) }+ }.onFailure { Log.status(TAG, "could not request the local car WiFi network", it) } } /**@@ -350,7 +350,7 @@ object WifiDirectConnector { return } huNetwork = network- Log.i(TAG, "hidden car network available; GAL sockets bind to it")+ Log.status(TAG, "hidden car network available; GAL sockets bind to it") } override fun onLost(network: Network) {@@ -358,8 +358,8 @@ object WifiDirectConnector { } }, )- Log.i(TAG, "requesting hidden car network $ssid")- }.onFailure { Log.w(TAG, "could not request the hidden car network", it) }+ Log.status(TAG, "requesting hidden car network $ssid")+ }.onFailure { Log.status(TAG, "could not request the hidden car network", it) } } /**@@ -380,11 +380,11 @@ object WifiDirectConnector { */ private fun tryRfcommFallback(tcpCause: IOException): Boolean { val address = btPeerAddress ?: run {- Log.i(TAG, "no BT peer from CDM; skipping RFCOMM fallback (${tcpCause.message})")+ Log.status(TAG, "no BT peer from CDM; skipping RFCOMM fallback (${tcpCause.message})") return false } val adapter = appContext?.getSystemService(BluetoothAdapter::class.java) ?: run {- Log.w(TAG, "no Bluetooth adapter for RFCOMM fallback")+ Log.status(TAG, "no Bluetooth adapter for RFCOMM fallback") return false } // Discovery slows (and often breaks) an outgoing ACL connect; stop it@@ -392,7 +392,7 @@ object WifiDirectConnector { runCatching { adapter.cancelDiscovery() } val device: BluetoothDevice = runCatching { adapter.getRemoteDevice(address) }.getOrNull() ?: run {- Log.w(TAG, "RFCOMM fallback: unparsable BT peer $address")+ Log.status(TAG, "RFCOMM fallback: unparsable BT peer $address") return false } // Stage structure (budgets enforced by the stages that can time out):@@ -403,7 +403,7 @@ object WifiDirectConnector { // truthful to connect to, so the fallback stops after resolving the // peer and the caller reports the original TCP failure rather than // masking it with a half-handshake.- Log.i(+ Log.status( TAG, "RFCOMM fallback: BT peer ${device.address} resolved; ACL/HFP/credential " + "stages (budgets ${BT_ACL_TIMEOUT_MS}ms/${BT_HFP_TIMEOUT_MS}ms) await " +@@ -413,7 +413,7 @@ object WifiDirectConnector { } private fun fail(reason: String) {- Log.w(TAG, reason)+ Log.status(TAG, reason) if (session.state == WirelessSessionState.NEGOTIATING_WIFI) { session.onWifiFailed(reason) } else {
auto/src/main/java/com/vayunmathur/auto/notifications/MessageMirrorService.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/notifications/MessageMirrorService.kt b/auto/src/main/java/com/vayunmathur/auto/notifications/MessageMirrorService.ktindex a78d5f4e33..076ee9512a 100644--- a/auto/src/main/java/com/vayunmathur/auto/notifications/MessageMirrorService.kt+++ b/auto/src/main/java/com/vayunmathur/auto/notifications/MessageMirrorService.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.notifications import android.app.Notification import android.service.notification.NotificationListenerService import android.service.notification.StatusBarNotification-import android.util.Log+import com.vayunmathur.library.log.Log import androidx.core.app.NotificationCompat import com.vayunmathur.auto.platform.MessagingPrefs import com.vayunmathur.auto.protocol.gal.MessagingMessage@@ -28,7 +28,7 @@ class MessageMirrorService : NotificationListenerService() { val (thread, message) = extract(sbn) ?: return MessageMirrorBus.post(thread, message, replyRoute(sbn)) activeCount.incrementAndGet()- Log.d(TAG, "mirrored message for thread ${thread.threadId}")+ Log.debug(TAG, "mirrored message for thread ${thread.threadId}") } override fun onNotificationRemoved(sbn: StatusBarNotification) {
auto/src/main/java/com/vayunmathur/auto/platform/AppDecorService.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/AppDecorService.kt b/auto/src/main/java/com/vayunmathur/auto/platform/AppDecorService.ktindex 13f7101dad..91e6533512 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/AppDecorService.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/AppDecorService.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.app.Service import android.content.Intent import android.os.IBinder-import android.util.Log+import com.vayunmathur.library.log.Log /** * App-decor bind target, mirroring gearhead's `AppDecorService` (exported):@@ -22,7 +22,7 @@ class AppDecorService : Service() { // Explicit no-op-with-comment: the HU decor bind is safely rejected // (null) because MA draws CarDisplay drawer/launcher itself rather // than hosting AppDecor templates.- Log.i(TAG, "app-decor bind rejected (rendered-surface model)")+ Log.status(TAG, "app-decor bind rejected (rendered-surface model)") return null }
auto/src/main/java/com/vayunmathur/auto/platform/AudioSinkChannel.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/AudioSinkChannel.kt b/auto/src/main/java/com/vayunmathur/auto/platform/AudioSinkChannel.ktindex 8f56d4490a..0e477b4643 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/AudioSinkChannel.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/AudioSinkChannel.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.os.Handler import android.os.HandlerThread import android.os.SystemClock-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.protocol.AudioCodec import com.vayunmathur.auto.protocol.AudioGain import com.vayunmathur.auto.protocol.AudioSinkRole@@ -84,7 +84,7 @@ class AudioSinkChannel( if (pick == null) { state = AudioSinkState.UNSUPPORTED onEvent(AudioEvent.SinkSetup(role.name, "unsupported"))- Log.w(TAG, "$role sink unsupported (non-PCM or no config); parked")+ Log.status(TAG, "$role sink unsupported (non-PCM or no config); parked") publish() return }@@ -101,14 +101,14 @@ class AudioSinkChannel( "${pick.config.numberOfChannels}ch config ${pick.index}", ), )- Log.i(TAG, "$role sink setup requested (config ${pick.index})")+ Log.status(TAG, "$role sink setup requested (config ${pick.index})") publish() } /** One message for this channel; anything else is ignored, never misparsed. */ fun onMessage(channelId: Int, type: Int, payload: ByteArray) { if (channelId != this.channelId) {- Log.w(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId")+ Log.status(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId") return } when (val inbound = AudioCodec.decodeSinkInbound(type, payload)) {@@ -118,7 +118,7 @@ class AudioSinkChannel( onEvent(AudioEvent.AckReceived(role.name, inbound.ackSeq)) } is InboundAudio.Sync -> onEvent(AudioEvent.SyncReceived(role.name))- is InboundAudio.Observed -> Log.d(TAG, "$role unhandled audio message 0x${type.toString(HEX_RADIX)}")+ is InboundAudio.Observed -> Log.debug(TAG, "$role unhandled audio message 0x${type.toString(HEX_RADIX)}") } } @@ -144,7 +144,7 @@ class AudioSinkChannel( target.post { val pcm = AudioCodec.stripWavToPcm16Mono(snapshot) if (pcm == null) {- Log.w(TAG, "$role dropping malformed TTS wav (${snapshot.size}B)")+ Log.status(TAG, "$role dropping malformed TTS wav (${snapshot.size}B)") onEvent(AudioEvent.TtsDropped("malformed")) return@post }@@ -158,7 +158,7 @@ class AudioSinkChannel( lastGain = currentGain() publish() if (lastGain == AudioGain.MUTED) {- Log.d(TAG, "$role muted by focus")+ Log.debug(TAG, "$role muted by focus") } } @@ -184,7 +184,7 @@ class AudioSinkChannel( } val confirmed = AudioCodec.confirmConfig(inbound.response, pick, service) ?: run { state = AudioSinkState.UNSUPPORTED- Log.w(TAG, "$role head unit confirmed nothing usable; parked")+ Log.status(TAG, "$role head unit confirmed nothing usable; parked") publish() return }@@ -195,23 +195,23 @@ class AudioSinkChannel( state = AudioSinkState.STARTED lastGain = currentGain() onEvent(AudioEvent.SinkStarted(role.name, confirmed.index))- Log.i(TAG, "$role sink started (session $sessionId, config ${confirmed.index})")+ Log.status(TAG, "$role sink started (session $sessionId, config ${confirmed.index})") publish() } private fun writeFramed(pcm: ByteArray, sampleRateHz: Int) { val config = selected ?: run {- Log.d(TAG, "$role dropping ${pcm.size}B with no confirmed config")+ Log.debug(TAG, "$role dropping ${pcm.size}B with no confirmed config") return } if (state != AudioSinkState.STARTED) {- Log.d(TAG, "$role dropping ${pcm.size}B while $state")+ Log.debug(TAG, "$role dropping ${pcm.size}B while $state") return } val gain = currentGain() lastGain = gain if (gain == AudioGain.MUTED) {- Log.d(TAG, "$role muted; dropping ${pcm.size}B")+ Log.debug(TAG, "$role muted; dropping ${pcm.size}B") return } val resampled = AudioCodec.resampleLinearMono16(pcm, sampleRateHz, config.config.samplingRate)
auto/src/main/java/com/vayunmathur/auto/platform/CarAppDiscovery.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/CarAppDiscovery.kt b/auto/src/main/java/com/vayunmathur/auto/platform/CarAppDiscovery.ktindex 674a24fe13..c313c9f4df 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/CarAppDiscovery.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/CarAppDiscovery.kt@@ -4,7 +4,7 @@ import android.content.ComponentName import android.content.Context import android.content.pm.PackageManager import android.graphics.drawable.Drawable-import android.util.Log+import com.vayunmathur.library.log.Log import androidx.car.app.CarAppService /**@@ -44,7 +44,7 @@ object CarAppDiscovery { val found = runCatching { pm.queryIntentServices(intent, PackageManager.GET_META_DATA) }.getOrElse {- Log.w(TAG, "could not query car apps for $category", it)+ Log.status(TAG, "could not query car apps for $category", it) emptyList() } for (info in found) {@@ -62,7 +62,7 @@ object CarAppDiscovery { categories = categories, ) }.getOrElse {- Log.w(TAG, "could not load car app $component", it)+ Log.status(TAG, "could not load car app $component", it) null } }.sortedBy { it.label.toString().lowercase() }@@ -109,7 +109,7 @@ object CarAppDiscovery { categories = categories, ) }.getOrElse {- Log.w(TAG, "first-party car app not installed: $packageName", it)+ Log.status(TAG, "first-party car app not installed: $packageName", it) null } }
auto/src/main/java/com/vayunmathur/auto/platform/CarApps.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/CarApps.kt b/auto/src/main/java/com/vayunmathur/auto/platform/CarApps.ktindex 856ca8e3b8..ea9e891d57 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/CarApps.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/CarApps.kt@@ -4,7 +4,7 @@ import android.content.Context import android.content.Intent import android.content.pm.PackageManager import android.graphics.drawable.Drawable-import android.util.Log+import com.vayunmathur.library.log.Log /** One tile on the car launcher: an icon, a label, and how to open it. */ data class CarApp(@@ -33,7 +33,7 @@ object CarApps { */ fun query(context: Context, pinnedOrder: List<String> = emptyList()): List<CarApp> { val discovered = runCatching { CarAppDiscovery.query(context) }.getOrElse {- Log.w(TAG, "car discovery failed; legacy slots only", it)+ Log.status(TAG, "car discovery failed; legacy slots only", it) emptyList() } val byId = discovered.associateBy { it.id }@@ -49,7 +49,7 @@ object CarApps { for (slot in SLOTS) { runCatching { slot.resolve(context, context.packageManager) } .onSuccess { app -> if (app != null) found += app }- .onFailure { Log.w(TAG, "could not resolve car slot ${slot.label}", it) }+ .onFailure { Log.status(TAG, "could not resolve car slot ${slot.label}", it) } } return found }
auto/src/main/java/com/vayunmathur/auto/platform/CarChimeraService.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/CarChimeraService.kt b/auto/src/main/java/com/vayunmathur/auto/platform/CarChimeraService.ktindex b7e45790c4..69f8bcb2ce 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/CarChimeraService.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/CarChimeraService.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.app.Service import android.content.Intent import android.os.IBinder-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.service.ProjectionService /**@@ -21,10 +21,10 @@ class CarChimeraService : Service() { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { if (intent?.action == ACTION_START) {- Log.i(TAG, "chimera START; funneling into the projection service")+ Log.status(TAG, "chimera START; funneling into the projection service") ProjectionService.start(this) } else {- Log.d(TAG, "chimera start without START action; ignoring")+ Log.debug(TAG, "chimera start without START action; ignoring") } return START_NOT_STICKY }@@ -33,7 +33,7 @@ class CarChimeraService : Service() { // Explicit no-op-with-comment: GMS-compat clients bind for START, // not for a GAL interface -- there is no binder to hand out, and a // head-unit bind expecting one must be safely rejected, never crash.- Log.i(TAG, "chimera bind rejected (START-action service, no binder)")+ Log.status(TAG, "chimera bind rejected (START-action service, no binder)") return null }
auto/src/main/java/com/vayunmathur/auto/platform/CarCompanionDeviceService.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/CarCompanionDeviceService.kt b/auto/src/main/java/com/vayunmathur/auto/platform/CarCompanionDeviceService.ktindex b99b314eb0..3c4f8fb7cc 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/CarCompanionDeviceService.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/CarCompanionDeviceService.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.companion.AssociationInfo import android.companion.CompanionDeviceService import android.os.Build-import android.util.Log+import com.vayunmathur.library.log.Log import androidx.annotation.RequiresApi import com.vayunmathur.auto.network.WifiDirectConnector @@ -33,9 +33,9 @@ class CarCompanionDeviceService : CompanionDeviceService() { // trigger path. Display name is for the trace only -- the MAC is the // identity the RFCOMM fallback dials. val mac = associationInfo.deviceMacAddress?.toString()- Log.i(TAG, "companion head unit appeared: ${associationInfo.displayName} ($mac)")+ Log.status(TAG, "companion head unit appeared: ${associationInfo.displayName} ($mac)") if (mac.isNullOrBlank()) {- Log.w(TAG, "companion association without a MAC; wireless trigger skipped")+ Log.status(TAG, "companion association without a MAC; wireless trigger skipped") return } WifiDirectConnector.startFromAssociation(this, mac)@@ -43,7 +43,7 @@ class CarCompanionDeviceService : CompanionDeviceService() { @RequiresApi(Build.VERSION_CODES.TIRAMISU) override fun onDeviceDisappeared(associationInfo: AssociationInfo) {- Log.i(TAG, "companion head unit disappeared: ${associationInfo.displayName}")+ Log.status(TAG, "companion head unit disappeared: ${associationInfo.displayName}") WifiDirectConnector.cancel() }
auto/src/main/java/com/vayunmathur/auto/platform/CarDisplay.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/CarDisplay.kt b/auto/src/main/java/com/vayunmathur/auto/platform/CarDisplay.ktindex 2df3f2ab6c..c36b069613 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/CarDisplay.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/CarDisplay.kt@@ -7,7 +7,7 @@ import android.hardware.display.DisplayManager import android.hardware.display.VirtualDisplay import android.os.Handler import android.os.Looper-import android.util.Log+import com.vayunmathur.library.log.Log import android.view.Surface import androidx.lifecycle.setViewTreeLifecycleOwner import androidx.lifecycle.setViewTreeViewModelStoreOwner@@ -632,7 +632,7 @@ class CarDisplay( fun dumpVirtualDisplay(display: android.view.Display, surface: Surface) { if (!BuildConfig.DEV_BUILD) return val size = android.graphics.Point().also { display.getRealSize(it) }- Log.i(+ Log.status( TAG, "virtual display up: id=${display.displayId} real=${size.x}x${size.y} " + "surface valid=${surface.isValid}",
auto/src/main/java/com/vayunmathur/auto/platform/CarSetupService.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/CarSetupService.kt b/auto/src/main/java/com/vayunmathur/auto/platform/CarSetupService.ktindex cc25fa7fcf..989d2e9ac4 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/CarSetupService.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/CarSetupService.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.app.Service import android.content.Intent import android.os.IBinder-import android.util.Log+import com.vayunmathur.library.log.Log /** * Setup handshake service, mirroring gearhead's `CarSetupServiceImpl`@@ -20,7 +20,7 @@ class CarSetupService : Service() { // Explicit no-op-with-comment: the HU setup-handshake bind is safely // rejected (null) -- MA setup is the pairing screen, not a bound // handshake, and claiming one would stall first-time setup.- Log.i(TAG, "car-setup bind rejected (pairing-screen model)")+ Log.status(TAG, "car-setup bind rejected (pairing-screen model)") return null }
auto/src/main/java/com/vayunmathur/auto/platform/CarStartupService.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/CarStartupService.kt b/auto/src/main/java/com/vayunmathur/auto/platform/CarStartupService.ktindex 8065d02f1f..3111f78e6f 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/CarStartupService.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/CarStartupService.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.app.Service import android.content.Intent import android.os.IBinder-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.network.UsbConnector import com.vayunmathur.auto.service.ProjectionService @@ -29,19 +29,19 @@ class CarStartupService : Service() { // CarCompanionDeviceService); without one there is no MAC to // trigger on, so fall back to listening and let the pairing // screen stand in.- Log.i(TAG, "BT_START; ensuring the projection listener is up")+ Log.status(TAG, "BT_START; ensuring the projection listener is up") ProjectionService.start(this) } ACTION_START_USB_PROJECTION -> {- Log.i(TAG, "START_USB_PROJECTION; force-starting USB bring-up")+ Log.status(TAG, "START_USB_PROJECTION; force-starting USB bring-up") UsbConnector.forceStart(this) ProjectionService.start(this) } ACTION_CAR_STARTUP_NOTIFICATION -> {- Log.i(TAG, "CAR_STARTUP_NOTIFICATION; starting the projection listener")+ Log.status(TAG, "CAR_STARTUP_NOTIFICATION; starting the projection listener") ProjectionService.start(this) }- else -> Log.d(TAG, "startup service without a chain action; ignoring")+ else -> Log.debug(TAG, "startup service without a chain action; ignoring") } return START_NOT_STICKY }@@ -49,7 +49,7 @@ class CarStartupService : Service() { override fun onBind(intent: Intent?): IBinder? { // Explicit no-op-with-comment: the startup chain is start-actions, // not a binder -- a head-unit bind expecting one is safely rejected.- Log.i(TAG, "startup bind rejected (start-action service, no binder)")+ Log.status(TAG, "startup bind rejected (start-action service, no binder)") return null }
auto/src/main/java/com/vayunmathur/auto/platform/CarSystemUiControllerService.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/CarSystemUiControllerService.kt b/auto/src/main/java/com/vayunmathur/auto/platform/CarSystemUiControllerService.ktindex d4f77c1b1c..6c6bfe0744 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/CarSystemUiControllerService.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/CarSystemUiControllerService.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.app.Service import android.content.Intent import android.os.IBinder-import android.util.Log+import com.vayunmathur.library.log.Log /** * Head-unit compositor bind target, mirroring gearhead's@@ -23,7 +23,7 @@ class CarSystemUiControllerService : Service() { // Explicit no-op-with-comment: the HU compositor bind is safely // rejected (null) because MA renders CarDisplay into ch2 video // rather than hosting HU-composited system-UI windows.- Log.i(TAG, "system-ui controller bind rejected (rendered-surface model)")+ Log.status(TAG, "system-ui controller bind rejected (rendered-surface model)") return null }
auto/src/main/java/com/vayunmathur/auto/platform/CarTts.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/CarTts.kt b/auto/src/main/java/com/vayunmathur/auto/platform/CarTts.ktindex 0ea3527dc8..6967a2b09b 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/CarTts.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/CarTts.kt@@ -5,7 +5,7 @@ import android.os.Handler import android.os.HandlerThread import android.speech.tts.TextToSpeech import android.speech.tts.UtteranceProgressListener-import android.util.Log+import com.vayunmathur.library.log.Log import java.io.File import java.util.Locale import java.util.UUID@@ -57,7 +57,7 @@ class CarTts( engine?.language = Locale.getDefault() engine?.setOnUtteranceProgressListener(progressListener) } else {- Log.w(TAG, "tts engine unavailable (status $status)")+ Log.status(TAG, "tts engine unavailable (status $status)") } } }@@ -92,12 +92,12 @@ class CarTts( private fun synthesize(text: String) { val tts = engine if (!engineReady || tts == null) {- Log.d(TAG, "dropping ${text.length} chars; tts not ready")+ Log.debug(TAG, "dropping ${text.length} chars; tts not ready") onEvent(AudioEvent.TtsDropped("engine-unready")) return } val sink = systemSink() ?: run {- Log.d(TAG, "dropping ${text.length} chars; no system sink")+ Log.debug(TAG, "dropping ${text.length} chars; no system sink") onEvent(AudioEvent.TtsDropped("no-sink")) return }@@ -105,7 +105,7 @@ class CarTts( val utteranceId = file.name val queued = tts.synthesizeToFile(text, null, file, utteranceId) if (queued != TextToSpeech.SUCCESS) {- Log.w(TAG, "tts synthesize failed ($queued)")+ Log.status(TAG, "tts synthesize failed ($queued)") runCatching { file.delete() } onEvent(AudioEvent.TtsDropped("synthesize-failed")) return@@ -139,7 +139,7 @@ class CarTts( synchronized(pending) { pending.remove(utteranceId) }?.let { runCatching { it.file.delete() } }- Log.w(TAG, "tts utterance $utteranceId failed")+ Log.status(TAG, "tts utterance $utteranceId failed") onEvent(AudioEvent.TtsDropped("utterance-error")) } }
auto/src/main/java/com/vayunmathur/auto/platform/ConnectionResetReceiver.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/ConnectionResetReceiver.kt b/auto/src/main/java/com/vayunmathur/auto/platform/ConnectionResetReceiver.ktindex 1875019a41..773e9025db 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/ConnectionResetReceiver.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/ConnectionResetReceiver.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.content.BroadcastReceiver import android.content.Context import android.content.Intent-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.service.ProjectionService /**@@ -29,7 +29,7 @@ class ConnectionResetReceiver : BroadcastReceiver() { ACTION_RESET_ROLES, ACTION_RESET_FUNCTION, -> {- Log.i(TAG, "USB reset ${intent.action}; re-arming the projection listener")+ Log.status(TAG, "USB reset ${intent.action}; re-arming the projection listener") TransportState.publishRole(MaosRoleStatus.isProjectionRoleHeld(context)) ProjectionService.start(context) }
auto/src/main/java/com/vayunmathur/auto/platform/ConnectivityEventReceiver.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/ConnectivityEventReceiver.kt b/auto/src/main/java/com/vayunmathur/auto/platform/ConnectivityEventReceiver.ktindex 773625f287..2f1bad1175 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/ConnectivityEventReceiver.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/ConnectivityEventReceiver.kt@@ -5,7 +5,7 @@ import android.content.Context import android.content.Intent import android.net.ConnectivityManager import android.net.NetworkCapabilities-import android.util.Log+import com.vayunmathur.library.log.Log /** * Connectivity-event receiver, mirroring gearhead's@@ -29,12 +29,12 @@ class ConnectivityEventReceiver : BroadcastReceiver() { if (intent.action != ConnectivityManager.CONNECTIVITY_ACTION) return val connectivity = context.getSystemService(ConnectivityManager::class.java) ?: return val network = connectivity.activeNetwork ?: run {- Log.i(TAG, "connectivity lost; wireless bring-up (if any) is stale")+ Log.status(TAG, "connectivity lost; wireless bring-up (if any) is stale") return } val caps = connectivity.getNetworkCapabilities(network) ?: return if (!caps.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) {- Log.d(TAG, "active network is not WiFi; wireless bring-up unaffected")+ Log.debug(TAG, "active network is not WiFi; wireless bring-up unaffected") } }
auto/src/main/java/com/vayunmathur/auto/platform/DeepLinkResolverActivity.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/DeepLinkResolverActivity.kt b/auto/src/main/java/com/vayunmathur/auto/platform/DeepLinkResolverActivity.ktindex 8894509b4c..49b0dbbd8c 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/DeepLinkResolverActivity.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/DeepLinkResolverActivity.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.app.Activity import android.content.Intent import android.os.Bundle-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.service.ProjectionService /**@@ -26,14 +26,14 @@ class DeepLinkResolverActivity : Activity() { CarStartupService.ACTION_BT_START, WirelessStartupReceiver.ACTION_WIRELESS_STARTUP, -> {- Log.i(TAG, "deep link ${intent.action}; entering the startup chain")+ Log.status(TAG, "deep link ${intent.action}; entering the startup chain") startForegroundService( Intent(this, CarStartupService::class.java) .setAction(intent.action), ) } else -> {- Log.i(TAG, "deep link without a chain action; starting the listener")+ Log.status(TAG, "deep link without a chain action; starting the listener") ProjectionService.start(this) } }
auto/src/main/java/com/vayunmathur/auto/platform/GuidanceChannel.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/GuidanceChannel.kt b/auto/src/main/java/com/vayunmathur/auto/platform/GuidanceChannel.ktindex 66c20cba18..ed7b96ca44 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/GuidanceChannel.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/GuidanceChannel.kt@@ -1,6 +1,6 @@ package com.vayunmathur.auto.platform -import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.protocol.AudioCodec import com.vayunmathur.auto.protocol.GalConnection import com.vayunmathur.auto.protocol.GalService@@ -60,7 +60,7 @@ class GuidanceChannel( open = true val (type, payload) = AudioCodec.encodeSetup() connection.send(channelId, type, payload)- Log.i(TAG, "guidance setup requested")+ Log.status(TAG, "guidance setup requested") onEvent(SensorEvent.GuidanceSetup) // The TTS session started before ch3 opened: arm the stream now so // the CONFIG confirm starts it instead of parking it idle.@@ -70,7 +70,7 @@ class GuidanceChannel( /** One message for this channel; anything else is ignored, never misparsed. */ fun onMessage(channelId: Int, type: Int, payload: ByteArray) { if (channelId != this.channelId) {- Log.w(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId")+ Log.status(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId") return } when (val inbound = AudioCodec.decodeSinkInbound(type, payload)) {@@ -80,13 +80,13 @@ class GuidanceChannel( // idle: confirmed-but-never-started is the no-TTS state. val pick = selected ?: AudioCodec.selectConfig(service) selected = pick?.let { AudioCodec.confirmConfig(inbound.response, it, service) }- Log.i(TAG, "guidance configured (accepted=${selected != null})")+ Log.status(TAG, "guidance configured (accepted=${selected != null})") onEvent(SensorEvent.GuidanceConfigured(accepted = selected != null)) if (startRequested && selected != null) startStream(sessionId.coerceAtLeast(0)) }- is InboundAudio.Ack -> Log.d(TAG, "guidance ack (no stream running)")- is InboundAudio.Sync -> Log.d(TAG, "guidance sync pulse")- is InboundAudio.Observed -> Log.d(TAG, "unhandled guidance message 0x${type.toString(HEX_RADIX)}")+ is InboundAudio.Ack -> Log.debug(TAG, "guidance ack (no stream running)")+ is InboundAudio.Sync -> Log.debug(TAG, "guidance sync pulse")+ is InboundAudio.Observed -> Log.debug(TAG, "unhandled guidance message 0x${type.toString(HEX_RADIX)}") } } @@ -100,13 +100,13 @@ class GuidanceChannel( fun startStream(sessionId: Int = 0) { startRequested = true val config = selected ?: run {- Log.i(TAG, "guidance start armed; starts on CONFIG confirm")+ Log.status(TAG, "guidance start armed; starts on CONFIG confirm") return } this.sessionId = sessionId val (type, payload) = AudioCodec.encodeStart(sessionId, config.index) connection.send(channelId, type, payload)- Log.i(TAG, "guidance stream started (session $sessionId, config ${config.index})")+ Log.status(TAG, "guidance stream started (session $sessionId, config ${config.index})") } /**@@ -120,7 +120,7 @@ class GuidanceChannel( val (type, payload) = AudioCodec.encodeStop() connection.send(channelId, type, payload) sessionId = -1- Log.i(TAG, "guidance stream stopped")+ Log.status(TAG, "guidance stream stopped") } fun release() {
auto/src/main/java/com/vayunmathur/auto/platform/HostManager.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/HostManager.kt b/auto/src/main/java/com/vayunmathur/auto/platform/HostManager.ktindex 4f17ad8ae9..02c1adb146 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/HostManager.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/HostManager.kt@@ -2,7 +2,7 @@ package com.vayunmathur.auto.platform import android.content.ComponentName import android.content.Context-import android.util.Log+import com.vayunmathur.library.log.Log import android.view.Surface import com.vayunmathur.library.carhost.HostAction import com.vayunmathur.library.carhost.HostNavState@@ -77,7 +77,7 @@ class HostManager(private val context: Context) { if (previous == component) return if (previous != null) { runCatching { sessions[previous]?.clearSurface() }- .onFailure { Log.w(TAG, "clearSurface failed for $previous", it) }+ .onFailure { Log.status(TAG, "clearSurface failed for $previous", it) } } _focused.value = component pendingSurface?.let { (surface, w, h) ->@@ -135,7 +135,7 @@ class HostManager(private val context: Context) { val session = sessions[component] ?: return kotlin.concurrent.thread(name = "ma-auto-carhost-reset", isDaemon = true) { runCatching { session.unbind() }- .onFailure { Log.w(TAG, "reset unbind failed for $component", it) }+ .onFailure { Log.status(TAG, "reset unbind failed for $component", it) } session.bind() if (component == _focused.value) { pendingSurface?.let { (surface, w, h) ->
auto/src/main/java/com/vayunmathur/auto/platform/HostSession.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/HostSession.kt b/auto/src/main/java/com/vayunmathur/auto/platform/HostSession.ktindex 1dbf4f92bd..760579e368 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/HostSession.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/HostSession.kt@@ -9,7 +9,7 @@ import android.os.Handler import android.os.IBinder import android.os.Looper import android.os.RemoteException-import android.util.Log+import com.vayunmathur.library.log.Log import android.view.MotionEvent import android.view.Surface import androidx.car.app.CarAppService@@ -96,7 +96,7 @@ class HostSession( fun bind() { if (bound) return if (!hasService()) {- Log.i(TAG, "$component missing; stays unhosted")+ Log.status(TAG, "$component missing; stays unhosted") return } val intent = Intent(CarAppService.SERVICE_INTERFACE).apply {@@ -106,9 +106,9 @@ class HostSession( } val conn = object : ServiceConnection { override fun onServiceConnected(name: ComponentName?, binder: IBinder?) {- Log.i(TAG, "$component connected; starting handshake")+ Log.status(TAG, "$component connected; starting handshake") if (binder == null) {- Log.w(TAG, "$component connected with null binder")+ Log.status(TAG, "$component connected with null binder") return } thread(name = "ma-auto-carhost", isDaemon = true) {@@ -117,7 +117,7 @@ class HostSession( } override fun onServiceDisconnected(name: ComponentName?) {- Log.w(TAG, "$component disconnected")+ Log.status(TAG, "$component disconnected") carApp = null bound = false handshakeDone = false@@ -125,21 +125,21 @@ class HostSession( } override fun onBindingDied(name: ComponentName?) {- Log.w(TAG, "$component binding died")+ Log.status(TAG, "$component binding died") } override fun onNullBinding(name: ComponentName?) {- Log.w(TAG, "$component returned null binding")+ Log.status(TAG, "$component returned null binding") mainHandler.post { onTemplate(HostTemplate.Pane(title = null)) } } } connection = conn- Log.i(TAG, "binding car service $component")+ Log.status(TAG, "binding car service $component") val ok = runCatching { appContext.bindService(intent, conn, Context.BIND_AUTO_CREATE) }.getOrDefault(false) bound = ok- Log.i(TAG, "bindService returned $ok")+ Log.status(TAG, "bindService returned $ok") } /**@@ -167,7 +167,7 @@ class HostSession( runCatching { val container = SurfaceContainer(last, localWidth, localHeight, localDpi) bundleOf(container)?.let { cb.onSurfaceDestroyed(it, doneCallback()) }- }.onFailure { Log.w(TAG, "onSurfaceDestroyed failed", it) }+ }.onFailure { Log.status(TAG, "onSurfaceDestroyed failed", it) } } } @@ -182,7 +182,7 @@ class HostSession( if (dark) Configuration.UI_MODE_NIGHT_YES else Configuration.UI_MODE_NIGHT_NO } app.onConfigurationChanged(config, doneCallback())- }.onFailure { Log.w(TAG, "onConfigurationChanged failed", it) }+ }.onFailure { Log.status(TAG, "onConfigurationChanged failed", it) } } } @@ -251,7 +251,7 @@ class HostSession( private fun runHandshake(app: ICarApp) { carApp = app- Log.i(TAG, "starting car-app handshake for $component")+ Log.status(TAG, "starting car-app handshake for $component") val handshake = bundleOf(HandshakeInfo(appContext.packageName, HOST_API_LEVEL)) ?: return if (!roundTrip("onHandshakeCompleted") { cb -> app.onHandshakeCompleted(handshake, cb) }) return val config = Configuration(appContext.resources.configuration)@@ -272,17 +272,17 @@ class HostSession( /** One blocking binder call with a 5s cap; false means the session is dead. */ private fun roundTrip(name: String, call: (IOnDoneCallback) -> Unit): Boolean {- Log.i(TAG, "$name: calling for $component")+ Log.status(TAG, "$name: calling for $component") val latch = CountDownLatch(1) val failure = AtomicReference<Throwable?>(null) val cb = object : IOnDoneCallback.Stub() { override fun onSuccess(response: Bundleable?) {- Log.i(TAG, "$name: success")+ Log.status(TAG, "$name: success") latch.countDown() } override fun onFailure(response: Bundleable?) {- Log.w(TAG, "$name: failure $response")+ Log.status(TAG, "$name: failure $response") failure.set(RuntimeException("$name failed: $response")) latch.countDown() }@@ -290,12 +290,12 @@ class HostSession( override fun getInterfaceVersion(): Int = IOnDoneCallback.VERSION } runCatching { call(cb) }.onFailure {- Log.w(TAG, "$name binder call threw", it)+ Log.status(TAG, "$name binder call threw", it) return false } val done = runCatching { latch.await(CALL_TIMEOUT_MS, TimeUnit.MILLISECONDS) }.getOrDefault(false)- if (!done) Log.w(TAG, "$name timed out")- failure.get()?.let { Log.w(TAG, "$name rejected", it) }+ if (!done) Log.status(TAG, "$name timed out")+ failure.get()?.let { Log.status(TAG, "$name rejected", it) } return done && failure.get() == null } @@ -311,17 +311,17 @@ class HostSession( } override fun onFailure(response: Bundleable?) {- Log.w(TAG, "fetchTemplate: getManager failure $response")+ Log.status(TAG, "fetchTemplate: getManager failure $response") latch.countDown() } override fun getInterfaceVersion(): Int = IOnDoneCallback.VERSION } runCatching { app.getManager(CarContext.APP_SERVICE, managerCb) }- .onFailure { Log.w(TAG, "getManager threw", it); return }+ .onFailure { Log.status(TAG, "getManager threw", it); return } latch.await(CALL_TIMEOUT_MS, TimeUnit.MILLISECONDS) val manager = managerRef.get() ?: run {- Log.w(TAG, "getManager returned no manager")+ Log.status(TAG, "getManager returned no manager") return } val templateRef = AtomicReference<Any?>(null)@@ -333,20 +333,20 @@ class HostSession( } override fun onFailure(response: Bundleable?) {- Log.w(TAG, "fetchTemplate: getTemplate failure $response")+ Log.status(TAG, "fetchTemplate: getTemplate failure $response") templateLatch.countDown() } override fun getInterfaceVersion(): Int = IOnDoneCallback.VERSION } runCatching { manager.getTemplate(templateCb) }- .onFailure { Log.w(TAG, "getTemplate threw", it); return }+ .onFailure { Log.status(TAG, "getTemplate threw", it); return } templateLatch.await(CALL_TIMEOUT_MS, TimeUnit.MILLISECONDS) val wrapper = templateRef.get() as? androidx.car.app.model.TemplateWrapper val parsed = HostTemplateParsers.parse(wrapper) taskStack.record(parsed) if (!taskStack.isAllowed(parsed)) {- Log.w(TAG, "task quota exceeded for $component; showing error pane")+ Log.status(TAG, "task quota exceeded for $component; showing error pane") mainHandler.post { onTemplate(HostTemplate.Pane(title = "Too many screens")) } return }@@ -360,13 +360,13 @@ class HostSession( runCatching { bundleOf(SurfaceContainer(surface, localWidth, localHeight, localDpi)) ?.let { cb.onSurfaceAvailable(it, doneCallback()) }- }.onFailure { Log.w(TAG, "onSurfaceAvailable failed", it) }+ }.onFailure { Log.status(TAG, "onSurfaceAvailable failed", it) } } private fun doneCallback(): IOnDoneCallback = object : IOnDoneCallback.Stub() { override fun onSuccess(response: Bundleable?) = Unit override fun onFailure(response: Bundleable?) {- Log.w(TAG, "host call rejected: $response")+ Log.status(TAG, "host call rejected: $response") } override fun getInterfaceVersion(): Int = IOnDoneCallback.VERSION@@ -382,7 +382,7 @@ class HostSession( runCatching { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) appContext.startActivity(intent)- }.onFailure { Log.w(TAG, "startCarApp failed", it) }+ }.onFailure { Log.status(TAG, "startCarApp failed", it) } } override fun getHost(hostType: String?): IBinder {@@ -407,7 +407,7 @@ class HostSession( } override fun showToast(text: CharSequence?, duration: Int) {- Log.i(TAG, "car toast: $text")+ Log.status(TAG, "car toast: $text") } override fun setSurfaceCallback(callback: ISurfaceCallback?) {@@ -418,7 +418,7 @@ class HostSession( override fun sendLocation(location: android.location.Location?) = Unit override fun showAlert(alert: Bundleable?) {- Log.i(TAG, "car alert shown (not rendered)")+ Log.status(TAG, "car alert shown (not rendered)") } override fun dismissAlert(alertId: Int) = Unit@@ -432,12 +432,12 @@ class HostSession( private val navHostBinder = object : INavigationHost.Stub() { override fun navigationStarted() {- Log.i(TAG, "$component navigation started")+ Log.status(TAG, "$component navigation started") taskStack.reset() // NavigationTemplate resets the task quota } override fun navigationEnded() {- Log.i(TAG, "$component navigation ended")+ Log.status(TAG, "$component navigation ended") mainHandler.post { onTemplate(HostTemplate.Pane(title = null)) } } @@ -448,7 +448,7 @@ class HostSession( // This host has no voice pipeline of its own — GAL carries mic // audio on ch6 (MicSourceChannel) and the phone resolves intents. // Record receipt so a future voice route can consume it.- Log.i(TAG, "$component voice-assistant capabilities received")+ Log.status(TAG, "$component voice-assistant capabilities received") voiceCapabilities.set(capabilities != null) } @@ -487,7 +487,7 @@ class HostSession( */ private val mediaHostBinder = object : androidx.car.app.media.IMediaPlaybackHost.Stub() { override fun registerMediaSessionToken(token: Bundleable?) {- Log.i(TAG, "$component media playback token registered")+ Log.status(TAG, "$component media playback token registered") mediaToken.set(token != null) } @@ -502,7 +502,7 @@ class HostSession( */ private val suggestionHostBinder = object : androidx.car.app.suggestion.ISuggestionHost.Stub() { override fun updateSuggestions(suggestions: Bundleable?) {- Log.i(TAG, "$component suggestions updated")+ Log.status(TAG, "$component suggestions updated") } override fun getInterfaceVersion(): Int =
auto/src/main/java/com/vayunmathur/auto/platform/InputChannel.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/InputChannel.kt b/auto/src/main/java/com/vayunmathur/auto/platform/InputChannel.ktindex 0a9e17deb6..3ba45f0ca9 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/InputChannel.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/InputChannel.kt@@ -1,6 +1,6 @@ package com.vayunmathur.auto.platform -import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.protocol.GalConnection import com.vayunmathur.auto.protocol.GalMessage import com.vayunmathur.auto.protocol.InputCodec@@ -83,7 +83,7 @@ class InputChannel( val (type, payload) = InputCodec.encodeKeyBinding(keycodes) connection.send(channelId, type, payload) bound = true- Log.i(TAG, "input channel open; bound ${keycodes.size} keycodes")+ Log.status(TAG, "input channel open; bound ${keycodes.size} keycodes") onEvent(InputEvent.BindingRequested(keycodes.size)) } @@ -99,7 +99,7 @@ class InputChannel( if (!bound) return val (type, payload) = InputCodec.encodeFeedback(feedbackEvent) connection.send(channelId, type, payload)- Log.d(TAG, "input feedback sent: $feedbackEvent")+ Log.debug(TAG, "input feedback sent: $feedbackEvent") onEvent(InputEvent.FeedbackSent(feedbackEvent)) } @@ -118,7 +118,7 @@ class InputChannel( /** One message for this channel; anything else is ignored, never misparsed. */ fun onMessage(channelId: Int, type: Int, payload: ByteArray) { if (channelId != this.channelId) {- Log.w(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId")+ Log.status(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId") return } if (!bound) {@@ -126,7 +126,7 @@ class InputChannel( // talking on a channel we never bound (or the grant path never // ran). Log, don't crash -- the binding goes out on the grant and // on the focus flap back to input-allowed.- Log.w(TAG, "ch8 traffic before binding (0x${type.toString(HEX_RADIX)}); dropping")+ Log.status(TAG, "ch8 traffic before binding (0x${type.toString(HEX_RADIX)}); dropping") onEvent(InputEvent.DroppedNoFocus) return }@@ -136,17 +136,17 @@ class InputChannel( } val events = InputCodec.decodeInbound(type, payload) if (events == null) {- Log.d(TAG, "unhandled input message 0x${type.toString(HEX_RADIX)}")+ Log.debug(TAG, "unhandled input message 0x${type.toString(HEX_RADIX)}") return } if (!isInputAllowed()) {- Log.d(TAG, "dropping ${events.describe()} without input focus")+ Log.debug(TAG, "dropping ${events.describe()} without input focus") onEvent(InputEvent.DroppedNoFocus) return } val display = displaySize() if (display == null) {- Log.d(TAG, "dropping ${events.describe()} with no car display yet")+ Log.debug(TAG, "dropping ${events.describe()} with no car display yet") onEvent(InputEvent.DroppedNoFocus) return }@@ -155,7 +155,7 @@ class InputChannel( private fun onBindingResponse(payload: ByteArray) { val status = runCatching { InputCodec.decodeKeyBindingResponse(payload) }.getOrNull()- Log.i(TAG, "key binding response: ${status?.status}")+ Log.status(TAG, "key binding response: ${status?.status}") onEvent(InputEvent.BindingAnswered(status?.status ?: BINDING_UNKNOWN_STATUS)) } @@ -222,7 +222,7 @@ class InputChannel( sendInjectFeedback() } } else {- Log.d(TAG, "ignoring absolute event keycode=$keycode value=$value")+ Log.debug(TAG, "ignoring absolute event keycode=$keycode value=$value") } } }
auto/src/main/java/com/vayunmathur/auto/platform/MediaPlaybackMonitor.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/MediaPlaybackMonitor.kt b/auto/src/main/java/com/vayunmathur/auto/platform/MediaPlaybackMonitor.ktindex 7853523e87..d1eedcd905 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/MediaPlaybackMonitor.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/MediaPlaybackMonitor.kt@@ -5,7 +5,7 @@ import android.content.Context import android.content.Intent import android.os.Handler import android.os.Looper-import android.util.Log+import com.vayunmathur.library.log.Log import androidx.media3.common.MediaItem import androidx.media3.common.MediaMetadata import androidx.media3.common.Player@@ -51,7 +51,7 @@ class MediaPlaybackMonitor( fun start() { mainHandler.post { val component = resolveMediaSession() ?: run {- Log.w(TAG, "no media browser service; now-playing stays empty")+ Log.status(TAG, "no media browser service; now-playing stays empty") return@post } val future =@@ -109,7 +109,7 @@ class MediaPlaybackMonitor( private fun onConnected(connected: MediaController?) { if (connected == null) {- Log.w(TAG, "media controller connect failed; now-playing stays empty")+ Log.status(TAG, "media controller connect failed; now-playing stays empty") return } connected.addListener(listener)
auto/src/main/java/com/vayunmathur/auto/platform/MicSourceChannel.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/MicSourceChannel.kt b/auto/src/main/java/com/vayunmathur/auto/platform/MicSourceChannel.ktindex dbd19aaa9d..6a6f2c65bd 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/MicSourceChannel.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/MicSourceChannel.kt@@ -2,7 +2,7 @@ package com.vayunmathur.auto.platform import android.os.Handler import android.os.HandlerThread-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.protocol.AudioCodec import com.vayunmathur.auto.protocol.GalConnection import com.vayunmathur.auto.protocol.GalMessage@@ -65,23 +65,23 @@ class MicSourceChannel( fun onChannelOpen() { open = true startMicThread()- Log.i(TAG, "mic channel open; acking upstream chunks")+ Log.status(TAG, "mic channel open; acking upstream chunks") } /** One message for this channel; anything else is ignored, never misparsed. */ fun onMessage(channelId: Int, type: Int, payload: ByteArray) { if (channelId != this.channelId) {- Log.w(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId")+ Log.status(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId") return } if (type == GalMessage.Microphone.REQUEST) {- Log.d(TAG, "mic request (${payload.size}B); acking")+ Log.debug(TAG, "mic request (${payload.size}B); acking") ack() return } val chunk = AudioCodec.decodeMicData(type, payload) if (chunk == null) {- Log.d(TAG, "unhandled mic message 0x${type.toString(HEX_RADIX)}")+ Log.debug(TAG, "unhandled mic message 0x${type.toString(HEX_RADIX)}") return } val target = handler ?: run {@@ -109,14 +109,14 @@ class MicSourceChannel( val target = handler ?: return target.post { if (!retentionAllowed()) {- Log.w(TAG, "mic turn without permission; retaining nothing")+ Log.status(TAG, "mic turn without permission; retaining nothing") turnCallback = null retained = null return@post } retained = ByteArray(0) turnCallback = onResult- Log.i(TAG, "mic turn started")+ Log.status(TAG, "mic turn started") } } @@ -132,7 +132,7 @@ class MicSourceChannel( onEvent(AudioEvent.MicTurn(pcm.size.toLong())) callback(pcm) } else {- Log.d(TAG, "mic turn ended with ${pcm.size}B; yielding nothing")+ Log.debug(TAG, "mic turn ended with ${pcm.size}B; yielding nothing") } } }
auto/src/main/java/com/vayunmathur/auto/platform/MusicCapture.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/MusicCapture.kt b/auto/src/main/java/com/vayunmathur/auto/platform/MusicCapture.ktindex f871fba1d5..e49f0d165d 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/MusicCapture.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/MusicCapture.kt@@ -8,7 +8,7 @@ import android.media.AudioRecord import android.media.projection.MediaProjection import android.os.Handler import android.os.HandlerThread-import android.util.Log+import com.vayunmathur.library.log.Log import java.nio.ByteBuffer import java.nio.ByteOrder @@ -59,28 +59,28 @@ class MusicCapture( */ fun start(projection: MediaProjection?) { val target = handler ?: run {- Log.d(TAG, "dropping music capture start; no capture thread")+ Log.debug(TAG, "dropping music capture start; no capture thread") return } target.post { if (running) return@post if (!MusicCapturePrefs.isMusicCaptureConsented(appContext)) {- Log.i(TAG, "music capture not consented; ch5 stays silent")+ Log.status(TAG, "music capture not consented; ch5 stays silent") return@post } if (projection == null) {- Log.i(TAG, "music capture without projection grant; ch5 stays silent")+ Log.status(TAG, "music capture without projection grant; ch5 stays silent") return@post } val record = buildRecord(projection) ?: return@post runCatching { record.startRecording() }.onFailure {- Log.w(TAG, "music capture startRecording failed", it)+ Log.status(TAG, "music capture startRecording failed", it) runCatching { record.release() } return@post } this.record = record running = true- Log.i(TAG, "music capture started (${CAPTURE_RATE_HZ}Hz mono)")+ Log.status(TAG, "music capture started (${CAPTURE_RATE_HZ}Hz mono)") pump() } }@@ -99,7 +99,7 @@ class MusicCapture( runCatching { record?.stop() } runCatching { record?.release() } record = null- Log.i(TAG, "music capture stopped")+ Log.status(TAG, "music capture stopped") } } @@ -138,7 +138,7 @@ class MusicCapture( // socket bytes and keeps the sink's counters honest (music // only, never quiet-room noise). } else if (read < 0) {- Log.w(TAG, "music capture read failed ($read); stopping")+ Log.status(TAG, "music capture read failed ($read); stopping") running = false runCatching { active.stop() } runCatching { active.release() }@@ -170,7 +170,7 @@ class MusicCapture( AudioFormat.ENCODING_PCM_16BIT, ) if (minBytes <= 0) {- Log.w(TAG, "music capture has no viable buffer ($minBytes)")+ Log.status(TAG, "music capture has no viable buffer ($minBytes)") return null } return runCatching {@@ -180,7 +180,7 @@ class MusicCapture( .setBufferSizeInBytes((minBytes * BUFFER_SIZE_MULTIPLIER).coerceAtLeast(CHUNK_BYTES * 2)) .build() }.getOrElse {- Log.w(TAG, "music capture AudioRecord build failed", it)+ Log.status(TAG, "music capture AudioRecord build failed", it) null } }
auto/src/main/java/com/vayunmathur/auto/platform/NavGuidanceMonitor.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/NavGuidanceMonitor.kt b/auto/src/main/java/com/vayunmathur/auto/platform/NavGuidanceMonitor.ktindex 59c90e45e8..1fb08cb6ee 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/NavGuidanceMonitor.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/NavGuidanceMonitor.kt@@ -9,7 +9,7 @@ import android.location.LocationManager import android.os.Bundle import android.os.Handler import android.os.Looper-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.protocol.MapsGuidance import com.vayunmathur.auto.protocol.MapRoutePoint import com.vayunmathur.auto.protocol.NavSnapshot@@ -94,7 +94,7 @@ class NavGuidanceMonitor( fun start() { mainHandler.post { val manager = context.getSystemService(LocationManager::class.java) ?: run {- Log.w(TAG, "no location manager; guidance stays empty")+ Log.status(TAG, "no location manager; guidance stays empty") return@post } locationManager = manager@@ -121,7 +121,7 @@ class NavGuidanceMonitor( }.onFailure { // No permission (or no provider): last-known stays, live fixes // wait for the permission UX in MainActivity/Navigation/Route.- Log.w(TAG, "location unavailable; guidance holds last-known", it)+ Log.status(TAG, "location unavailable; guidance holds last-known", it) } } }
auto/src/main/java/com/vayunmathur/auto/platform/NavStatusChannel.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/NavStatusChannel.kt b/auto/src/main/java/com/vayunmathur/auto/platform/NavStatusChannel.ktindex 9cc5a54039..48454adf47 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/NavStatusChannel.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/NavStatusChannel.kt@@ -1,6 +1,6 @@ package com.vayunmathur.auto.platform -import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.protocol.GalConnection import com.vayunmathur.auto.protocol.GalService import com.vayunmathur.auto.protocol.NavStatusCodec@@ -42,17 +42,17 @@ class NavStatusChannel( lastPosted = NavStatusUpdate(guidanceActive = false) val (type, payload) = NavStatusCodec.encodeInactive() connection.send(channelId, type, payload)- Log.i(TAG, "nav-status posted: no guidance")+ Log.status(TAG, "nav-status posted: no guidance") onEvent(SensorEvent.NavStatusPosted) } /** One message for this channel; the head unit sends nothing normative, so all inbound is observed. */ fun onMessage(channelId: Int, type: Int) { if (channelId != this.channelId) {- Log.w(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId")+ Log.status(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId") return }- Log.d(TAG, "unhandled nav-status message 0x${type.toString(HEX_RADIX)}")+ Log.debug(TAG, "unhandled nav-status message 0x${type.toString(HEX_RADIX)}") } /**
auto/src/main/java/com/vayunmathur/auto/platform/PhoneStatusMonitor.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/PhoneStatusMonitor.kt b/auto/src/main/java/com/vayunmathur/auto/platform/PhoneStatusMonitor.ktindex e86f75cbbd..c5112d0366 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/PhoneStatusMonitor.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/PhoneStatusMonitor.kt@@ -11,7 +11,7 @@ import android.os.Looper import android.telephony.PhoneStateListener import android.telephony.SignalStrength import android.telephony.TelephonyManager-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.notifications.MessageMirrorService /**@@ -58,7 +58,7 @@ class PhoneStatusMonitor(private val context: Context) { signalListener = listener @Suppress("DEPRECATION") manager.listen(listener, PhoneStateListener.LISTEN_SIGNAL_STRENGTHS)- }.onFailure { Log.w(TAG, "signal listener unavailable", it) }+ }.onFailure { Log.status(TAG, "signal listener unavailable", it) } // Battery level + charging: sticky broadcast, no permission needed. runCatching { val receiver = object : BroadcastReceiver() {@@ -81,7 +81,7 @@ class PhoneStatusMonitor(private val context: Context) { IntentFilter(Intent.ACTION_BATTERY_CHANGED), Context.RECEIVER_NOT_EXPORTED, )- }.onFailure { Log.w(TAG, "battery receiver unavailable", it) }+ }.onFailure { Log.status(TAG, "battery receiver unavailable", it) } refreshDndAndBadge() }
auto/src/main/java/com/vayunmathur/auto/platform/SensorChannel.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/SensorChannel.kt b/auto/src/main/java/com/vayunmathur/auto/platform/SensorChannel.ktindex 2c6ccf4c59..65d8b4d989 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/SensorChannel.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/SensorChannel.kt@@ -1,7 +1,7 @@ package com.vayunmathur.auto.platform import android.os.SystemClock-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.protocol.GalConnection import com.vayunmathur.auto.protocol.GalService import com.vayunmathur.auto.protocol.InboundSensor@@ -108,7 +108,7 @@ class SensorChannel( connection.send(channelId, requestType, payload) requestTracker.markRequested(type, SystemClock.uptimeMillis()) pendingAnswers.addLast(type)- Log.i(TAG, "sensor subscribe: $type")+ Log.status(TAG, "sensor subscribe: $type") onEvent(SensorEvent.Subscribed(type.name)) } }@@ -116,7 +116,7 @@ class SensorChannel( /** One message for this channel; anything else is ignored, never misparsed. */ fun onMessage(channelId: Int, type: Int, payload: ByteArray) { if (channelId != this.channelId) {- Log.w(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId")+ Log.status(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId") return } // Sweep subscribes the head unit never answered: each surfaces once@@ -125,7 +125,7 @@ class SensorChannel( // also leave the FIFO below, so a late answer never misattributes. for (timedOut in requestTracker.takeTimedOut(SystemClock.uptimeMillis())) { pendingAnswers.remove(timedOut.type)- Log.w(TAG, "sensor subscribe timed out: ${timedOut.type}")+ Log.status(TAG, "sensor subscribe timed out: ${timedOut.type}") onEvent(SensorEvent.SensorError(timedOut.type.name, timedOut.status)) } when (val inbound = SensorCodec.decodeInbound(type, payload)) {@@ -136,10 +136,10 @@ class SensorChannel( val answered = pendingAnswers.removeFirstOrNull() if (answered != null) { requestTracker.markAnswered(answered)- Log.i(TAG, "sensor subscribed: $answered status=${inbound.status}")+ Log.status(TAG, "sensor subscribed: $answered status=${inbound.status}") onEvent(SensorEvent.SubscriptionAnswered(answered.name, inbound.status)) } else {- Log.w(TAG, "unsolicited sensor answer status=${inbound.status}")+ Log.status(TAG, "unsolicited sensor answer status=${inbound.status}") onEvent(SensorEvent.SubscriptionAnswered("UNSOLICITED", inbound.status)) } }@@ -149,15 +149,15 @@ class SensorChannel( val next = _snapshot.value.withEvents(inbound.events) _snapshot.value = next onValues(next)- Log.d(TAG, "sensor batch: ${inbound.events.size} events")+ Log.debug(TAG, "sensor batch: ${inbound.events.size} events") onEvent(SensorEvent.BatchReceived(inbound.events.size)) } is InboundSensor.Error -> { // Observed, never fatal: the bring-up and video carry on.- Log.w(TAG, "sensor error: ${inbound.type} status=${inbound.status}")+ Log.status(TAG, "sensor error: ${inbound.type} status=${inbound.status}") onEvent(SensorEvent.SensorError(inbound.type.name, inbound.status)) }- is InboundSensor.Observed -> Log.d(TAG, "unhandled sensor message 0x${type.toString(HEX_RADIX)}")+ is InboundSensor.Observed -> Log.debug(TAG, "unhandled sensor message 0x${type.toString(HEX_RADIX)}") } } @@ -173,7 +173,7 @@ class SensorChannel( val next = _snapshot.value.withEvents(events) _snapshot.value = next onValues(next)- Log.d(TAG, "sensor live batch: ${events.size} events")+ Log.debug(TAG, "sensor live batch: ${events.size} events") onEvent(SensorEvent.BatchReceived(events.size)) }
auto/src/main/java/com/vayunmathur/auto/platform/UsbTPlusReceiver.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/UsbTPlusReceiver.kt b/auto/src/main/java/com/vayunmathur/auto/platform/UsbTPlusReceiver.ktindex 1a778c67a9..2adbfebaed 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/UsbTPlusReceiver.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/UsbTPlusReceiver.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.content.BroadcastReceiver import android.content.Context import android.content.Intent-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.network.UsbConnector /**@@ -24,7 +24,7 @@ class UsbTPlusReceiver : BroadcastReceiver() { ) { return }- Log.i(TAG, "TPlus accessory event ${intent.action}; entering the USB attach path")+ Log.status(TAG, "TPlus accessory event ${intent.action}; entering the USB attach path") if (!UsbConnector.onAccessoryIntent(context, intent)) { // Not a stock accessory extra: re-drive as a force-start so the // last accessory still brings up without a replug.
auto/src/main/java/com/vayunmathur/auto/platform/VideoSinkChannel.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/VideoSinkChannel.kt b/auto/src/main/java/com/vayunmathur/auto/platform/VideoSinkChannel.ktindex 4dd4021851..fa5af5b64c 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/VideoSinkChannel.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/VideoSinkChannel.kt@@ -5,7 +5,7 @@ import android.media.MediaCodec import android.os.Handler import android.os.Looper import android.os.SystemClock-import android.util.Log+import com.vayunmathur.library.log.Log import android.view.Choreographer import android.view.Surface import com.vayunmathur.auto.BuildConfig@@ -159,7 +159,7 @@ class VideoSinkChannel( */ fun onMessage(channelId: Int, type: Int, payload: ByteArray) { if (channelId != this.channelId) {- Log.w(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId")+ Log.status(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId") return } when (type) {@@ -170,8 +170,8 @@ class VideoSinkChannel( // semantics were recovered (see VideoCodec), so it is observed like // the 0x800B sync pulse -- never answered, never fatal. GalMessage.Video.UPDATE_UI_CONFIG_REQUEST ->- Log.d(TAG, "update-ui-config response (${payload.size}B); observed")- else -> Log.d(TAG, "unhandled video message 0x${type.toString(HEX_RADIX)}")+ Log.debug(TAG, "update-ui-config response (${payload.size}B); observed")+ else -> Log.debug(TAG, "unhandled video message 0x${type.toString(HEX_RADIX)}") } } @@ -187,13 +187,13 @@ class VideoSinkChannel( if (accepted != null) { configuration = accepted } else {- Log.w(+ Log.status( TAG, "head unit accepted video config index $configurationIndex " + "of ${offered.size}; keeping entry 0", ) }- Log.i(TAG, "head unit accepted video, config index $configurationIndex")+ Log.status(TAG, "head unit accepted video, config index $configurationIndex") // Step 3: ask for the screen before starting the stream. connection.send(@@ -215,11 +215,11 @@ class VideoSinkChannel( // input/audio gates. connection.session.onVideoFocusIndication(indication) if (!indication.hasMode()) {- Log.w(TAG, "video focus indication with no mode; arbitration unchanged")+ Log.status(TAG, "video focus indication with no mode; arbitration unchanged") return } val mode = indication.mode- Log.i(TAG, "video focus is now $mode")+ Log.status(TAG, "video focus is now $mode") onEvent(VideoEvent.FocusChanged(mode.name)) // Regaining the screen needs a fresh keyframe; the head unit has nothing to decode // against otherwise and would show garbage until the next scheduled one.@@ -232,7 +232,7 @@ class VideoSinkChannel( // counter plus field3 entries are the sender-side sequence track of the stream. val ack = MediaAck.parseFrom(payload) if (ack.sessionId != sessionId) {- Log.w(TAG, "ack for session ${ack.sessionId}, expected $sessionId")+ Log.status(TAG, "ack for session ${ack.sessionId}, expected $sessionId") onEvent(VideoEvent.AckMismatch(expected = sessionId, actual = ack.sessionId)) } else { onEvent(@@ -253,7 +253,7 @@ class VideoSinkChannel( val frameRate = negotiateFrameRate(config) val density = config?.density?.takeIf { it > 0 } ?: DEFAULT_DENSITY - Log.i(TAG, "starting video ${width}x$height @${frameRate} dpi $density")+ Log.status(TAG, "starting video ${width}x$height @${frameRate} dpi $density") onEvent(VideoEvent.Setup(VideoInfo(width, height, frameRate, configurationIndex))) sessionId = 0@@ -309,11 +309,11 @@ class VideoSinkChannel( private fun sendUpdateUiConfig() { val (type, payload) = runCatching { VideoCodec.encodeUpdateUiConfig() }.getOrNull() ?: run {- Log.d(TAG, "update-ui-config stub; skipping 0x800A")+ Log.debug(TAG, "update-ui-config stub; skipping 0x800A") return } runCatching { connection.send(channelId, type, payload) }- .onFailure { Log.d(TAG, "update-ui-config send dropped", it) }+ .onFailure { Log.debug(TAG, "update-ui-config send dropped", it) } } /**@@ -327,7 +327,7 @@ class VideoSinkChannel( private fun startVsyncDrain(negotiatedFps: Int) { val choreographer = Choreographer.getInstance() this.choreographer = choreographer- Log.i(TAG, "draining encoder at vsync cadence for ${negotiatedFps}fps video")+ Log.status(TAG, "draining encoder at vsync cadence for ${negotiatedFps}fps video") choreographer.postFrameCallback(vsyncCallback) } @@ -345,7 +345,7 @@ class VideoSinkChannel( */ private fun dumpSurfaces(width: Int, height: Int, density: Int, surface: Surface) { if (!BuildConfig.DEV_BUILD) return- Log.i(+ Log.status( TAG, "render pair up: virtual display ${width}x$height dpi $density, " + "encoder input surface valid=${surface.isValid}",@@ -448,11 +448,11 @@ class VideoSinkChannel( accepted?.frameRate?.takeIf { it >= MIN_SANE_FPS }?.let { return it } val sibling = service.mediaSink.videoConfigsList.firstOrNull { it.frameRate == DEFAULT_FRAME_RATE } if (sibling != null) {- Log.i(TAG, "accepted config reports no usable rate; using offered 30fps entry")+ Log.status(TAG, "accepted config reports no usable rate; using offered 30fps entry") configuration = sibling return DEFAULT_FRAME_RATE }- Log.i(+ Log.status( TAG, "accepted config reports rate ${accepted?.frameRate}; forcing 30fps " + "(no 30fps sibling offered)",@@ -471,7 +471,7 @@ class VideoSinkChannel( "$index:${config.codecResolution}:@${config.frameRate}:dpi${config.density}" + if (index == accepted) "*" else "" }- Log.i(TAG, "offered video configs [${entries.joinToString(", ")}]")+ Log.status(TAG, "offered video configs [${entries.joinToString(", ")}]") } private fun VideoResolution?.dimensions(): Pair<Int, Int> = when (this) {
auto/src/main/java/com/vayunmathur/auto/platform/WifiBluetoothReceiver.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/WifiBluetoothReceiver.kt b/auto/src/main/java/com/vayunmathur/auto/platform/WifiBluetoothReceiver.ktindex d367eefd8c..b18f91d854 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/WifiBluetoothReceiver.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/WifiBluetoothReceiver.kt@@ -5,7 +5,7 @@ import android.bluetooth.BluetoothDevice import android.content.BroadcastReceiver import android.content.Context import android.content.Intent-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.network.WifiDirectConnector /**@@ -30,19 +30,19 @@ class WifiBluetoothReceiver : BroadcastReceiver() { val device: BluetoothDevice? = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE) val mac = device?.address ?: return- Log.i(TAG, "BT ACL connected to $mac during wireless setup")+ Log.status(TAG, "BT ACL connected to $mac during wireless setup") // Re-arm only: the CDM association (or the tap) owns the // trigger decision. Reporting the MAC here would start a // bring-up the user never consented to. } BluetoothDevice.ACTION_ACL_DISCONNECTED -> {- Log.i(TAG, "BT ACL disconnected; cancelling wireless bring-up")+ Log.status(TAG, "BT ACL disconnected; cancelling wireless bring-up") WifiDirectConnector.cancel() } BluetoothAdapter.ACTION_STATE_CHANGED -> { val state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1) if (state == BluetoothAdapter.STATE_OFF) {- Log.i(TAG, "Bluetooth off; cancelling wireless bring-up")+ Log.status(TAG, "Bluetooth off; cancelling wireless bring-up") WifiDirectConnector.cancel() } }
auto/src/main/java/com/vayunmathur/auto/platform/WirelessSetupCarService.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/WirelessSetupCarService.kt b/auto/src/main/java/com/vayunmathur/auto/platform/WirelessSetupCarService.ktindex 1ae0463fe1..16bfed8a0f 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/WirelessSetupCarService.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/WirelessSetupCarService.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.app.Service import android.content.Intent import android.os.IBinder-import android.util.Log+import com.vayunmathur.library.log.Log /** * Car-side wireless-setup half, mirroring gearhead's `WirelessSetup`@@ -22,7 +22,7 @@ class WirelessSetupCarService : Service() { // Explicit no-op-with-comment: the HU wireless-handshake bind is // safely rejected (null) -- credentials ride the CDM/RFCOMM path, // not a bound binder (see WirelessSetupSharedService).- Log.i(TAG, "wireless car-service bind rejected (CDM/RFCOMM model)")+ Log.status(TAG, "wireless car-service bind rejected (CDM/RFCOMM model)") return null }
auto/src/main/java/com/vayunmathur/auto/platform/WirelessSetupSharedService.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/WirelessSetupSharedService.kt b/auto/src/main/java/com/vayunmathur/auto/platform/WirelessSetupSharedService.ktindex 60f8714660..4c851606ce 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/WirelessSetupSharedService.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/WirelessSetupSharedService.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.app.Service import android.content.Intent import android.os.IBinder-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.network.WifiDirectConnector /**@@ -26,10 +26,10 @@ class WirelessSetupSharedService : Service() { // service form -- same connector, same consent semantics. val mac = intent?.getStringExtra(EXTRA_BT_ADDRESS) if (!mac.isNullOrBlank()) {- Log.i(TAG, "wireless setup for associated head unit $mac")+ Log.status(TAG, "wireless setup for associated head unit $mac") WifiDirectConnector.startFromAssociation(this, mac) } else {- Log.i(TAG, "wireless setup without an association; tap stand-in path")+ Log.status(TAG, "wireless setup without an association; tap stand-in path") WifiDirectConnector.start(this) } return START_NOT_STICKY@@ -38,7 +38,7 @@ class WirelessSetupSharedService : Service() { override fun onBind(intent: Intent?): IBinder? { // Explicit no-op-with-comment: wireless setup is a start-action, not // a binder -- a head-unit bind expecting one is safely rejected.- Log.i(TAG, "wireless-setup bind rejected (start-action service, no binder)")+ Log.status(TAG, "wireless-setup bind rejected (start-action service, no binder)") return null }
auto/src/main/java/com/vayunmathur/auto/platform/WirelessStartupActivity.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/WirelessStartupActivity.kt b/auto/src/main/java/com/vayunmathur/auto/platform/WirelessStartupActivity.ktindex c22e2ddaa0..1a6f709588 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/WirelessStartupActivity.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/WirelessStartupActivity.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.app.Activity import android.content.Intent import android.os.Bundle-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.service.ProjectionService /**@@ -20,7 +20,7 @@ class WirelessStartupActivity : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState)- Log.i(TAG, "wireless startup; entering the BT_START chain")+ Log.status(TAG, "wireless startup; entering the BT_START chain") startForegroundService( Intent(this, CarStartupService::class.java) .setAction(CarStartupService.ACTION_BT_START),
auto/src/main/java/com/vayunmathur/auto/platform/WirelessStartupReceiver.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/platform/WirelessStartupReceiver.kt b/auto/src/main/java/com/vayunmathur/auto/platform/WirelessStartupReceiver.ktindex 45b6ad2d65..9555428db5 100644--- a/auto/src/main/java/com/vayunmathur/auto/platform/WirelessStartupReceiver.kt+++ b/auto/src/main/java/com/vayunmathur/auto/platform/WirelessStartupReceiver.kt@@ -3,7 +3,7 @@ package com.vayunmathur.auto.platform import android.content.BroadcastReceiver import android.content.Context import android.content.Intent-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.service.ProjectionService /**@@ -20,7 +20,7 @@ class WirelessStartupReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { if (intent.action != ACTION_WIRELESS_STARTUP) return- Log.i(TAG, "wireless startup announced; entering the BT_START chain")+ Log.status(TAG, "wireless startup announced; entering the BT_START chain") context.startForegroundService( Intent(context, CarStartupService::class.java) .setAction(CarStartupService.ACTION_BT_START),
auto/src/main/java/com/vayunmathur/auto/service/CarMessagingAudio.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/service/CarMessagingAudio.kt b/auto/src/main/java/com/vayunmathur/auto/service/CarMessagingAudio.ktindex 9586179ea7..e235189118 100644--- a/auto/src/main/java/com/vayunmathur/auto/service/CarMessagingAudio.kt+++ b/auto/src/main/java/com/vayunmathur/auto/service/CarMessagingAudio.kt@@ -1,7 +1,7 @@ package com.vayunmathur.auto.service import android.os.Handler import android.os.Looper-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.platform.AudioEvent import com.vayunmathur.auto.platform.CarTts import com.vayunmathur.auto.platform.MessagingAudio@@ -39,20 +39,20 @@ class CarMessagingAudio( override fun beginVoiceReply(threadId: String, onResult: (String) -> Unit) { val channel = mic() ?: run {- Log.w(TAG, "voice reply for $threadId with no mic channel")+ Log.status(TAG, "voice reply for $threadId with no mic channel") return } channel.beginTurn { pcm -> if (pcm.isEmpty()) {- Log.d(TAG, "mic turn for $threadId yielded nothing")+ Log.debug(TAG, "mic turn for $threadId yielded nothing") return@beginTurn } transcribe(pcm) { text -> if (text.isNotBlank()) {- Log.i(TAG, "mic turn for $threadId transcribed ${text.length} chars")+ Log.status(TAG, "mic turn for $threadId transcribed ${text.length} chars") onResult(text) } else {- Log.d(TAG, "mic turn for $threadId transcribed nothing")+ Log.debug(TAG, "mic turn for $threadId transcribed nothing") } } // The turn stays open until the head unit ends it; the service
auto/src/main/java/com/vayunmathur/auto/service/MessagingCarAppService.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/service/MessagingCarAppService.kt b/auto/src/main/java/com/vayunmathur/auto/service/MessagingCarAppService.ktindex 074c22c9b4..e5807aedcd 100644--- a/auto/src/main/java/com/vayunmathur/auto/service/MessagingCarAppService.kt+++ b/auto/src/main/java/com/vayunmathur/auto/service/MessagingCarAppService.kt@@ -1,6 +1,6 @@ package com.vayunmathur.auto.service -import android.util.Log+import com.vayunmathur.library.log.Log import android.app.RemoteInput import com.vayunmathur.auto.notifications.MessageMirrorBus import com.vayunmathur.auto.notifications.MessageReplyRoute@@ -52,7 +52,7 @@ class MessagingCarAppService( /** The channel grant arrived; start mirroring the phone side. */ fun onChannelOpen() { open = true- Log.i(TAG, "messaging channel open; mirroring message threads")+ Log.status(TAG, "messaging channel open; mirroring message threads") mirror = MessageMirrorBus.register { thread, message, route -> onPhoneMessage(thread, message, route) }@@ -61,14 +61,14 @@ class MessagingCarAppService( /** One message for this channel; anything else is ignored, never misparsed. */ fun onMessage(channelId: Int, type: Int, payload: ByteArray) { if (channelId != this.channelId) {- Log.w(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId")+ Log.status(TAG, "ignoring 0x${type.toString(HEX_RADIX)} for channel $channelId") return } // Only ACTION arrives here; anything else (a head unit echoing our own // posts, a future extension) is observed and ignored. val action = MessagingCodec.decodeInbound(type, payload) if (action == null) {- Log.d(TAG, "unhandled messaging message 0x${type.toString(HEX_RADIX)}")+ Log.debug(TAG, "unhandled messaging message 0x${type.toString(HEX_RADIX)}") return } when (action) {@@ -100,13 +100,13 @@ class MessagingCarAppService( val intent = route?.replyIntent val remoteInput = route?.remoteInput if (intent == null || remoteInput == null) {- Log.i(TAG, "reply for $threadId with no app route; dropping")+ Log.status(TAG, "reply for $threadId with no app route; dropping") onEvent(MessagingEvent.ReplyFailed(threadId, "no-route")) onReply(threadId, text) return } val appContext = context() ?: run {- Log.i(TAG, "reply for $threadId with no context; dropping")+ Log.status(TAG, "reply for $threadId with no context; dropping") onEvent(MessagingEvent.ReplyFailed(threadId, "no-context")) onReply(threadId, text) return@@ -119,11 +119,11 @@ class MessagingCarAppService( intent.send(appContext, 0, fillIn) } .onSuccess {- Log.i(TAG, "reply for $threadId handed to message app")+ Log.status(TAG, "reply for $threadId handed to message app") onEvent(MessagingEvent.ReplySent(threadId)) } .onFailure {- Log.w(TAG, "reply for $threadId failed to send", it)+ Log.status(TAG, "reply for $threadId failed to send", it) onEvent(MessagingEvent.ReplyFailed(threadId, "send-failed")) } onReply(threadId, text)@@ -132,11 +132,11 @@ class MessagingCarAppService( /** Fires the thread's mark-read intent, if the app advertised one. */ private fun sendMarkRead(threadId: String) { val readIntent = routes[threadId]?.readIntent ?: run {- Log.d(TAG, "mark-read for $threadId with no app route")+ Log.debug(TAG, "mark-read for $threadId with no app route") return } runCatching { readIntent.send() }- .onFailure { Log.w(TAG, "mark-read for $threadId failed", it) }+ .onFailure { Log.status(TAG, "mark-read for $threadId failed", it) } } /** A phone notification arrived: snapshot the threads, post the body, read it aloud. */
auto/src/main/java/com/vayunmathur/auto/service/MusicCaptureService.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/service/MusicCaptureService.kt b/auto/src/main/java/com/vayunmathur/auto/service/MusicCaptureService.ktindex ffe9f53d51..dff3d6f967 100644--- a/auto/src/main/java/com/vayunmathur/auto/service/MusicCaptureService.kt+++ b/auto/src/main/java/com/vayunmathur/auto/service/MusicCaptureService.kt@@ -9,7 +9,7 @@ import android.content.Intent import android.content.pm.ServiceInfo import android.os.Build import android.os.IBinder-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.R import com.vayunmathur.auto.platform.AutoSessionState import com.vayunmathur.auto.platform.MusicCapture@@ -35,7 +35,7 @@ class MusicCaptureService : Service() { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { val projection = MusicCaptureGrant.projection(this) if (projection == null) {- Log.i(TAG, "no projection grant; not capturing")+ Log.status(TAG, "no projection grant; not capturing") stopSelf() return START_NOT_STICKY }
auto/src/main/java/com/vayunmathur/auto/service/ProjectionService.kt
diff --git a/auto/src/main/java/com/vayunmathur/auto/service/ProjectionService.kt b/auto/src/main/java/com/vayunmathur/auto/service/ProjectionService.ktindex da50a07545..43aa91679a 100644--- a/auto/src/main/java/com/vayunmathur/auto/service/ProjectionService.kt+++ b/auto/src/main/java/com/vayunmathur/auto/service/ProjectionService.kt@@ -7,7 +7,7 @@ import android.content.Intent import android.content.res.Configuration import android.os.Build import android.os.IBinder-import android.util.Log+import com.vayunmathur.library.log.Log import com.vayunmathur.auto.network.HeadUnitServer import com.vayunmathur.auto.network.TransportIntake import com.vayunmathur.auto.platform.AudioSinkChannel@@ -113,7 +113,7 @@ class ProjectionService : Service() { if (!running) return if (failed) { val delayMs = reconnectBackoff.onFailure()- Log.i(TAG, "session failed; retrying in ${delayMs}ms")+ Log.status(TAG, "session failed; retrying in ${delayMs}ms") sleepInterruptibly(delayMs) } else { reconnectBackoff.onSuccess()@@ -147,7 +147,7 @@ class ProjectionService : Service() { // close it here so a stillborn intake leaks nothing. A // live session's transport closes with its connection. runCatching { pending.transport.close() }- if (running) Log.e(TAG, "projection session ended", it)+ if (running) Log.error(TAG, "projection session ended", it) } return failed }@@ -155,7 +155,7 @@ class ProjectionService
Diff truncated.