From 2091b11bf020221b6822b998d2c6cad69f0a160e Mon Sep 17 00:00:00 2001 From: stylianosgakis Date: Wed, 12 Aug 2026 20:47:38 +0200 Subject: [PATCH 1/3] chore: fix spurious UnknownIssueId lint noise from shared lint config The convention plugin disabled 'androidx.media3.common.util.UnstableApi', which is the opt-in annotation FQN, not a lint issue id, so every module's baseline collected UnknownIssueId entries. The media3 opt-in is already handled correctly by lint.xml's UnsafeOptInUsageError + opt-in option. Since lint.xml is shared across all modules, it also references UnsafeOptInUsageError, which is only registered where a dependency bundles that check; in other modules that reference produced UnknownIssueId too. Ignore UnknownIssueId in the shared config and clear the affected baselines. --- .../main/kotlin/HedvigLintConventionPlugin.kt | 1 - .../lint-baseline-core-locale.xml | 36 -------------- .../lint-baseline/lint-baseline-core-rive.xml | 14 ------ .../lint-baseline-data-claim-intent.xml | 36 -------------- .../lint-baseline-data-coinsured.xml | 36 -------------- ...nt-baseline-data-cross-sell-after-flow.xml | 36 -------------- .../lint-baseline-feature-chip-id.xml | 47 ------------------- ...baseline-feature-insurance-certificate.xml | 47 ------------------- .../lint-baseline-feature-remove-addons.xml | 36 -------------- .../lint-baseline-partners-deflect.xml | 36 -------------- .../lint-baseline-tracking-firebase.xml | 14 ------ hedvig-lint/lint.xml | 5 ++ 12 files changed, 5 insertions(+), 339 deletions(-) diff --git a/build-logic/convention/src/main/kotlin/HedvigLintConventionPlugin.kt b/build-logic/convention/src/main/kotlin/HedvigLintConventionPlugin.kt index cbc6b4c497..b4c02e5807 100644 --- a/build-logic/convention/src/main/kotlin/HedvigLintConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/HedvigLintConventionPlugin.kt @@ -56,5 +56,4 @@ private fun Lint.configure(lintXmlFile: File, lintBaselineFile: File) { baseline = lintBaselineFile lintConfig = lintXmlFile xmlReport = true - disable.add("androidx.media3.common.util.UnstableApi") } diff --git a/hedvig-lint/lint-baseline/lint-baseline-core-locale.xml b/hedvig-lint/lint-baseline/lint-baseline-core-locale.xml index b48fefaf03..74b28f28ab 100644 --- a/hedvig-lint/lint-baseline/lint-baseline-core-locale.xml +++ b/hedvig-lint/lint-baseline/lint-baseline-core-locale.xml @@ -1,40 +1,4 @@ - - - - - - - - - - - - - - - - diff --git a/hedvig-lint/lint-baseline/lint-baseline-core-rive.xml b/hedvig-lint/lint-baseline/lint-baseline-core-rive.xml index bdfed02b17..05a9be7dd9 100644 --- a/hedvig-lint/lint-baseline/lint-baseline-core-rive.xml +++ b/hedvig-lint/lint-baseline/lint-baseline-core-rive.xml @@ -1,18 +1,4 @@ - - - - - - - - diff --git a/hedvig-lint/lint-baseline/lint-baseline-data-claim-intent.xml b/hedvig-lint/lint-baseline/lint-baseline-data-claim-intent.xml index f23053f17a..552e68c298 100644 --- a/hedvig-lint/lint-baseline/lint-baseline-data-claim-intent.xml +++ b/hedvig-lint/lint-baseline/lint-baseline-data-claim-intent.xml @@ -1,40 +1,4 @@ - - - - - - - - - - - - - - - - diff --git a/hedvig-lint/lint-baseline/lint-baseline-data-coinsured.xml b/hedvig-lint/lint-baseline/lint-baseline-data-coinsured.xml index 8e7fcd1f2a..05a9be7dd9 100644 --- a/hedvig-lint/lint-baseline/lint-baseline-data-coinsured.xml +++ b/hedvig-lint/lint-baseline/lint-baseline-data-coinsured.xml @@ -1,40 +1,4 @@ - - - - - - - - - - - - - - - - diff --git a/hedvig-lint/lint-baseline/lint-baseline-data-cross-sell-after-flow.xml b/hedvig-lint/lint-baseline/lint-baseline-data-cross-sell-after-flow.xml index 50fa2cd4f1..98fa5822c7 100644 --- a/hedvig-lint/lint-baseline/lint-baseline-data-cross-sell-after-flow.xml +++ b/hedvig-lint/lint-baseline/lint-baseline-data-cross-sell-after-flow.xml @@ -1,40 +1,4 @@ - - - - - - - - - - - - - - - - diff --git a/hedvig-lint/lint-baseline/lint-baseline-feature-chip-id.xml b/hedvig-lint/lint-baseline/lint-baseline-feature-chip-id.xml index 249a9d603a..05a9be7dd9 100644 --- a/hedvig-lint/lint-baseline/lint-baseline-feature-chip-id.xml +++ b/hedvig-lint/lint-baseline/lint-baseline-feature-chip-id.xml @@ -1,51 +1,4 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/hedvig-lint/lint-baseline/lint-baseline-feature-insurance-certificate.xml b/hedvig-lint/lint-baseline/lint-baseline-feature-insurance-certificate.xml index cfd3172982..98fa5822c7 100644 --- a/hedvig-lint/lint-baseline/lint-baseline-feature-insurance-certificate.xml +++ b/hedvig-lint/lint-baseline/lint-baseline-feature-insurance-certificate.xml @@ -1,51 +1,4 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/hedvig-lint/lint-baseline/lint-baseline-feature-remove-addons.xml b/hedvig-lint/lint-baseline/lint-baseline-feature-remove-addons.xml index b48fefaf03..74b28f28ab 100644 --- a/hedvig-lint/lint-baseline/lint-baseline-feature-remove-addons.xml +++ b/hedvig-lint/lint-baseline/lint-baseline-feature-remove-addons.xml @@ -1,40 +1,4 @@ - - - - - - - - - - - - - - - - diff --git a/hedvig-lint/lint-baseline/lint-baseline-partners-deflect.xml b/hedvig-lint/lint-baseline/lint-baseline-partners-deflect.xml index aa0b5f2d2a..05a9be7dd9 100644 --- a/hedvig-lint/lint-baseline/lint-baseline-partners-deflect.xml +++ b/hedvig-lint/lint-baseline/lint-baseline-partners-deflect.xml @@ -1,40 +1,4 @@ - - - - - - - - - - - - - - - - diff --git a/hedvig-lint/lint-baseline/lint-baseline-tracking-firebase.xml b/hedvig-lint/lint-baseline/lint-baseline-tracking-firebase.xml index 37588e7a01..552e68c298 100644 --- a/hedvig-lint/lint-baseline/lint-baseline-tracking-firebase.xml +++ b/hedvig-lint/lint-baseline/lint-baseline-tracking-firebase.xml @@ -1,18 +1,4 @@ - - - - - - - - diff --git a/hedvig-lint/lint.xml b/hedvig-lint/lint.xml index 28059ff9af..5152aacc2b 100644 --- a/hedvig-lint/lint.xml +++ b/hedvig-lint/lint.xml @@ -3,6 +3,11 @@ + + + From 9a5a65b39f4f0e28f4c13485f336e6aaa6030fcf Mon Sep 17 00:00:00 2001 From: stylianosgakis Date: Wed, 12 Aug 2026 21:50:05 +0200 Subject: [PATCH 2/3] chore: fix lint findings surfaced by lint 9.3.1 These were pre-existing issues detected by newer lint checks that the stale baselines (generated on lint 8.8.0) never captured. Fixed in code rather than baselined: - UseKtx: Uri.parse -> String.toUri, Bitmap.createBitmap -> createBitmap KTX, Bitmap.setPixel -> Bitmap.set operator (app, feature-chat, feature-login). - UnusedResources: remove 5 unused debug-only URL string resources. - ModifierParameter: make modifier the first optional parameter in ReminderCardEnableNotifications. - TextConcatSpace: stop splitting a word across a string concatenation in design-showcase sample data. - SystemPermissionTypo: suppress locally on the debug-only receiver whose android:permission="@null" is deliberate (false positive). --- app/app/src/debug/AndroidManifest.xml | 1 + app/app/src/debug/res/values/strings.xml | 6 ------ .../app/externalnavigator/ExternalNavigatorImpl.kt | 12 ++++++------ .../android/app/urihandler/SafeAndroidUriHandler.kt | 4 ++-- .../android/feature/chat/model/CbmChatMessage.kt | 5 +++-- .../login/swedishlogin/SwedishLoginDestination.kt | 6 ++++-- .../memberreminders/ui/MemberReminderCards.kt | 2 +- .../android/sample/design/showcase/peril/Perils.kt | 4 ++-- 8 files changed, 19 insertions(+), 21 deletions(-) diff --git a/app/app/src/debug/AndroidManifest.xml b/app/app/src/debug/AndroidManifest.xml index 929b3ec5dd..5f694363d3 100644 --- a/app/app/src/debug/AndroidManifest.xml +++ b/app/app/src/debug/AndroidManifest.xml @@ -35,6 +35,7 @@ android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true" android:permission="@null" + tools:ignore="SystemPermissionTypo" tools:replace="android:permission"> diff --git a/app/app/src/debug/res/values/strings.xml b/app/app/src/debug/res/values/strings.xml index b8d2b06ec6..cba29f7bda 100644 --- a/app/app/src/debug/res/values/strings.xml +++ b/app/app/src/debug/res/values/strings.xml @@ -5,10 +5,4 @@ hedvigdevelop.page.link dev.hedvigit.com link.dev.hedvigit.com - - https://apollo-router.dev.hedvigit.com - https://www.dev.hedvigit.com - https://odyssey.dev.hedvigit.com - https://gateway.dev.hedvigit.com/bot-service - https://gateway.dev.hedvigit.com/claims \ No newline at end of file diff --git a/app/app/src/main/kotlin/com/hedvig/android/app/externalnavigator/ExternalNavigatorImpl.kt b/app/app/src/main/kotlin/com/hedvig/android/app/externalnavigator/ExternalNavigatorImpl.kt index 9c22802b3d..bcd953df3e 100644 --- a/app/app/src/main/kotlin/com/hedvig/android/app/externalnavigator/ExternalNavigatorImpl.kt +++ b/app/app/src/main/kotlin/com/hedvig/android/app/externalnavigator/ExternalNavigatorImpl.kt @@ -7,9 +7,9 @@ import android.content.Intent import android.content.pm.LabeledIntent import android.content.pm.PackageManager import android.content.pm.ResolveInfo -import android.net.Uri import android.provider.Settings import android.widget.Toast +import androidx.core.net.toUri import com.hedvig.android.logger.LogPriority import com.hedvig.android.logger.logcat import com.hedvig.android.navigation.activity.ExternalNavigator @@ -27,7 +27,7 @@ internal class ExternalNavigatorImpl( override fun openAppSettings() { val permissionActivity = Intent( Settings.ACTION_APPLICATION_DETAILS_SETTINGS, - Uri.parse("package:$buildConfigApplicationId"), + "package:$buildConfigApplicationId".toUri(), ) if (activity.packageManager.resolveActivity(permissionActivity, 0) != null) { activity.startActivity(permissionActivity) @@ -45,7 +45,7 @@ internal class ExternalNavigatorImpl( activity.startActivity( Intent( Intent.ACTION_DIAL, - Uri.parse("tel:$number"), + "tel:$number".toUri(), ), ) } catch (exception: Throwable) { @@ -79,10 +79,10 @@ private fun Context.tryOpenPlayStore() { @SuppressLint("QueryPermissionsNeeded") private fun Context.canOpenPlayStore() = playStoreIntent().resolveActivity(packageManager) != null -private fun Context.playStoreIntent() = Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=$packageName")) +private fun Context.playStoreIntent() = Intent(Intent.ACTION_VIEW, "market://details?id=$packageName".toUri()) private fun Context.openPlayStore() { - val intent = Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=$packageName")) + val intent = Intent(Intent.ACTION_VIEW, "market://details?id=$packageName".toUri()) intent.flags = ( Intent.FLAG_ACTIVITY_NO_HISTORY or Intent.FLAG_ACTIVITY_MULTIPLE_TASK @@ -92,7 +92,7 @@ private fun Context.openPlayStore() { } private fun Activity.openEmail(title: String) { - val emailIntent = Intent(Intent.ACTION_VIEW, Uri.parse("mailto:")) + val emailIntent = Intent(Intent.ACTION_VIEW, "mailto:".toUri()) val resInfo = packageManager.queryIntentActivities(emailIntent, 0) if (resInfo.isNotEmpty()) { diff --git a/app/app/src/main/kotlin/com/hedvig/android/app/urihandler/SafeAndroidUriHandler.kt b/app/app/src/main/kotlin/com/hedvig/android/app/urihandler/SafeAndroidUriHandler.kt index 1dd9c524c3..38144a3e23 100644 --- a/app/app/src/main/kotlin/com/hedvig/android/app/urihandler/SafeAndroidUriHandler.kt +++ b/app/app/src/main/kotlin/com/hedvig/android/app/urihandler/SafeAndroidUriHandler.kt @@ -2,8 +2,8 @@ package com.hedvig.android.app.urihandler import android.content.Context import android.content.Intent -import android.net.Uri import androidx.compose.ui.platform.UriHandler +import androidx.core.net.toUri import com.hedvig.android.core.tracking.ErrorSource import com.hedvig.android.core.tracking.logError import com.hedvig.android.logger.LogPriority @@ -22,7 +22,7 @@ internal class SafeAndroidUriHandler(private val context: Context) : UriHandler return } try { - context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(uri))) + context.startActivity(Intent(Intent.ACTION_VIEW, uri.toUri())) } catch (e: Exception) { if (e is CancellationException) { throw e diff --git a/app/feature/feature-chat/src/main/kotlin/com/hedvig/android/feature/chat/model/CbmChatMessage.kt b/app/feature/feature-chat/src/main/kotlin/com/hedvig/android/feature/chat/model/CbmChatMessage.kt index de5c1fc692..f866131ebe 100644 --- a/app/feature/feature-chat/src/main/kotlin/com/hedvig/android/feature/chat/model/CbmChatMessage.kt +++ b/app/feature/feature-chat/src/main/kotlin/com/hedvig/android/feature/chat/model/CbmChatMessage.kt @@ -1,6 +1,7 @@ package com.hedvig.android.feature.chat.model import android.net.Uri +import androidx.core.net.toUri import com.benasher44.uuid.Uuid import com.hedvig.android.data.chat.database.ChatMessageEntity import com.hedvig.android.data.chat.database.ChatMessageEntity.FailedToSendType.MEDIA @@ -267,11 +268,11 @@ internal fun ChatMessageEntity.toChatMessage(): CbmChatMessage? { } failedToSend == PHOTO && url != null -> { - CbmChatMessage.FailedToBeSent.ChatMessagePhoto(id.toString(), sentAt, Uri.parse(url)) + CbmChatMessage.FailedToBeSent.ChatMessagePhoto(id.toString(), sentAt, url!!.toUri()) } failedToSend == MEDIA && url != null -> { - CbmChatMessage.FailedToBeSent.ChatMessageMedia(id.toString(), sentAt, Uri.parse(url)) + CbmChatMessage.FailedToBeSent.ChatMessageMedia(id.toString(), sentAt, url!!.toUri()) } else -> { diff --git a/app/feature/feature-login/src/main/kotlin/com/hedvig/android/feature/login/swedishlogin/SwedishLoginDestination.kt b/app/feature/feature-login/src/main/kotlin/com/hedvig/android/feature/login/swedishlogin/SwedishLoginDestination.kt index b61e6d0af1..eed4d39f6c 100644 --- a/app/feature/feature-login/src/main/kotlin/com/hedvig/android/feature/login/swedishlogin/SwedishLoginDestination.kt +++ b/app/feature/feature-login/src/main/kotlin/com/hedvig/android/feature/login/swedishlogin/SwedishLoginDestination.kt @@ -40,6 +40,8 @@ import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp +import androidx.core.graphics.createBitmap +import androidx.core.graphics.set import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.google.zxing.BarcodeFormat import com.google.zxing.common.BitMatrix @@ -267,11 +269,11 @@ internal fun QRCode( size.width, size.height, ) - val bitmap = Bitmap.createBitmap(size.width, size.height, Bitmap.Config.RGB_565) + val bitmap = createBitmap(size.width, size.height, Bitmap.Config.RGB_565) for (x in 0 until size.width) { for (y in 0 until size.height) { val color = if (bitMatrix.get(x, y)) android.graphics.Color.BLACK else android.graphics.Color.WHITE - bitmap.setPixel(x, y, color) + bitmap[x, y] = color } } BitmapPainter(bitmap.asImageBitmap()) diff --git a/app/member-reminders/member-reminders-ui/src/main/kotlin/com/hedvig/android/memberreminders/ui/MemberReminderCards.kt b/app/member-reminders/member-reminders-ui/src/main/kotlin/com/hedvig/android/memberreminders/ui/MemberReminderCards.kt index e3dc14285d..3186dae35f 100644 --- a/app/member-reminders/member-reminders-ui/src/main/kotlin/com/hedvig/android/memberreminders/ui/MemberReminderCards.kt +++ b/app/member-reminders/member-reminders-ui/src/main/kotlin/com/hedvig/android/memberreminders/ui/MemberReminderCards.kt @@ -337,8 +337,8 @@ private val cardReminderExitTransition = fadeOut() + shrinkVertically( fun ReminderCardEnableNotifications( snoozeNotificationPermissionReminder: () -> Unit, requestNotificationPermission: () -> Unit, - minLines: Int = 1, modifier: Modifier = Modifier, + minLines: Int = 1, ) { val message = getMemberReminderMessage(MemberReminder.EnableNotifications()) HedvigNotificationCard( diff --git a/micro-apps/design-showcase/src/main/kotlin/com/hedvig/android/sample/design/showcase/peril/Perils.kt b/micro-apps/design-showcase/src/main/kotlin/com/hedvig/android/sample/design/showcase/peril/Perils.kt index 901902ca75..27ce3a1354 100644 --- a/micro-apps/design-showcase/src/main/kotlin/com/hedvig/android/sample/design/showcase/peril/Perils.kt +++ b/micro-apps/design-showcase/src/main/kotlin/com/hedvig/android/sample/design/showcase/peril/Perils.kt @@ -48,8 +48,8 @@ private val previewPerils: List = List(4) { index -> PerilData( title = "Eldsvåda $index", description = "description description description description " + - "description description description descri" + - "ption description description description description$index", + "description description description description " + + "description description description description$index", covered = listOf("Covered#$index", "Also covered#$index"), colorCode = "#FFD0ECFB", ) From 300aa8fd03b1a8f8d9caf5849a855eece65d886f Mon Sep 17 00:00:00 2001 From: stylianosgakis Date: Thu, 13 Aug 2026 12:30:54 +0200 Subject: [PATCH 3/3] chore: document that Android Lint doesn't run on KMP-android modules The KMP-android variant registers no runnable lint task, so the shared lint config applied to these modules is inert and their baselines are neither enforced nor regenerable. Documented at the wiring site to prevent confusion. --- .../convention/src/main/kotlin/HedvigLintConventionPlugin.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build-logic/convention/src/main/kotlin/HedvigLintConventionPlugin.kt b/build-logic/convention/src/main/kotlin/HedvigLintConventionPlugin.kt index b4c02e5807..bc6f7496c7 100644 --- a/build-logic/convention/src/main/kotlin/HedvigLintConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/HedvigLintConventionPlugin.kt @@ -22,6 +22,10 @@ class HedvigLintConventionPlugin : Plugin { .resolve("lint-baseline-$moduleName.xml") val lintXmlPath: File = rootProject.projectDir.resolve("hedvig-lint").resolve("lint.xml") var didConfigureLint = false + // The KMP-android variant registers no runnable Android Lint task (only `lintKotlin*`, which is + // ktlint), so this lint configuration is inert: `./gradlew lint` does not lint these modules and + // nothing produces or consumes their baseline file. Any lint-baseline-.xml for a KMP-android + // module is therefore not enforced and cannot be regenerated via `updateLintBaseline`. pluginManager.withPlugin(libs.plugins.androidLibraryMultiplatform.get().pluginId) { configure { finalizeDsl {