diff --git a/app/lint-baseline.xml b/app/lint-baseline.xml index f1481b831..fc65f7f62 100644 --- a/app/lint-baseline.xml +++ b/app/lint-baseline.xml @@ -8,7 +8,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -19,7 +19,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -30,7 +30,7 @@ errorLine2=" ^"> @@ -41,7 +41,7 @@ errorLine2=" ^"> @@ -52,7 +52,7 @@ errorLine2=" ^"> @@ -63,7 +63,7 @@ errorLine2=" ^"> @@ -85,7 +85,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -140,7 +140,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -433,7 +433,7 @@ @@ -613,7 +613,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -624,7 +624,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -635,7 +635,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -646,7 +646,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -657,7 +657,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -767,7 +767,7 @@ errorLine2=" ~~~~~~~~~~~~~~"> @@ -778,7 +778,7 @@ errorLine2=" ~~~~~~~~~~~~~~"> @@ -1055,19 +1055,19 @@ errorLine2=" ~~~~~~~~~~~~~~~~"> + errorLine1=" MapAnySerializer," + errorLine2=" ~~~~~~~~~~~~~~~~"> + line="157" + column="29"/> @@ -1088,7 +1088,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1099,7 +1099,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1121,7 +1121,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1132,7 +1132,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1143,7 +1143,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1154,7 +1154,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1165,7 +1165,7 @@ errorLine2=" ^"> @@ -1176,30 +1176,30 @@ errorLine2=" ^"> + errorLine1=" Uri.parse(" + errorLine2=" ^"> + line="1706" + column="25"/> + errorLine1=" Uri.parse(" + errorLine2=" ^"> + line="1706" + column="25"/> @@ -1220,7 +1220,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1231,7 +1231,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1242,7 +1242,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1253,7 +1253,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1264,7 +1264,7 @@ errorLine2=" ^"> @@ -1275,7 +1275,7 @@ errorLine2=" ^"> @@ -1286,7 +1286,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1297,30 +1297,30 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + errorLine1=" Uri.parse("https://companion.home-assistant.io/docs/integrations/universal-links")," + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="95" + column="33"/> + errorLine1=" Uri.parse("package:${context.packageName}")," + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="126" + column="37"/> @@ -1341,7 +1341,7 @@ errorLine2=" ~~~~~~~~~~~~~~~"> @@ -1352,7 +1352,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1363,7 +1363,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1374,7 +1374,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1385,7 +1385,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1396,7 +1396,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -1407,7 +1407,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1418,21 +1418,10 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - - - - @@ -1473,7 +1462,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> diff --git a/automotive/lint-baseline.xml b/automotive/lint-baseline.xml index e14a55465..a62286b4f 100644 --- a/automotive/lint-baseline.xml +++ b/automotive/lint-baseline.xml @@ -8,7 +8,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -19,7 +19,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -30,7 +30,7 @@ errorLine2=" ^"> @@ -41,7 +41,7 @@ errorLine2=" ^"> @@ -52,7 +52,7 @@ errorLine2=" ^"> @@ -63,7 +63,7 @@ errorLine2=" ^"> @@ -85,7 +85,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -151,7 +151,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -338,14 +338,14 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -547,7 +547,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -558,7 +558,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -580,7 +580,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -591,7 +591,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -602,7 +602,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -613,7 +613,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -624,7 +624,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -635,7 +635,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -646,7 +646,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -657,7 +657,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -668,7 +668,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -690,7 +690,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -701,7 +701,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -712,7 +712,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -730,12 +730,12 @@ + errorLine1=" if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="87" + column="21"/> @@ -778,7 +778,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -789,7 +789,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -800,7 +800,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -844,7 +844,7 @@ errorLine2="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -877,7 +877,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -888,7 +888,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -899,7 +899,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -910,7 +910,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -921,7 +921,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -932,7 +932,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -987,19 +987,19 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + errorLine1=" if (Build.VERSION.SDK_INT >=" + errorLine2=" ^"> + line="855" + column="29"/> @@ -1020,7 +1020,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1031,7 +1031,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1086,7 +1086,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1108,7 +1108,7 @@ errorLine2="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1119,7 +1119,7 @@ errorLine2="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1130,7 +1130,7 @@ errorLine2="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1148,12 +1148,12 @@ + errorLine1=" Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && ShortcutManagerCompat.isRequestPinShortcutSupported(app)" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="60" + column="9"/> @@ -1174,7 +1174,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1185,7 +1185,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1214,12 +1214,12 @@ + errorLine1=" override fun appSupportsCommissioning(): Boolean = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1 &&" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="20" + column="56"/> @@ -1240,7 +1240,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1251,19 +1251,19 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + errorLine1=" Build.VERSION.SDK_INT >= Build.VERSION_CODES.M" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="601" + column="33"/> @@ -1284,7 +1284,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1295,7 +1295,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1306,7 +1306,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1317,7 +1317,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1328,7 +1328,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1339,7 +1339,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1350,7 +1350,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1361,7 +1361,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1372,7 +1372,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1383,7 +1383,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1394,7 +1394,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1405,7 +1405,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1416,7 +1416,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1427,7 +1427,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1438,7 +1438,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1449,7 +1449,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1460,7 +1460,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1471,7 +1471,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1482,7 +1482,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1493,29 +1493,29 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + errorLine1=" COMMAND_WEBVIEW, COMMAND_ACTIVITY, COMMAND_LAUNCH_APP -> if (Build.VERSION.SDK_INT >=" + errorLine2=" ^"> + errorLine1=" COMMAND_RINGER_MODE, COMMAND_DND, COMMAND_VOLUME_LEVEL -> if (Build.VERSION.SDK_INT >=" + errorLine2=" ^"> @@ -1526,7 +1526,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1537,7 +1537,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1548,7 +1548,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1581,7 +1581,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1592,7 +1592,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1603,7 +1603,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1665,11 +1665,11 @@ @@ -1680,7 +1680,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1691,7 +1691,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1702,7 +1702,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1713,29 +1713,29 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1746,7 +1746,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1757,7 +1757,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1768,7 +1768,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1779,7 +1779,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1790,7 +1790,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1801,7 +1801,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1812,7 +1812,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1823,7 +1823,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1834,18 +1834,18 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1856,7 +1856,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1867,7 +1867,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1878,7 +1878,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1922,7 +1922,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1933,19 +1933,19 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + errorLine1=" override fun appSupportsThread(): Boolean = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1 &&" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="35" + column="49"/> @@ -2417,7 +2417,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2428,7 +2428,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2439,7 +2439,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2461,7 +2461,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2472,7 +2472,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2483,7 +2483,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2494,7 +2494,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2505,7 +2505,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2516,7 +2516,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2527,7 +2527,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2538,7 +2538,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2549,7 +2549,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2560,7 +2560,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2571,7 +2571,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2582,19 +2582,19 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + errorLine1=" Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="115" + column="17"/> @@ -2738,7 +2738,7 @@ errorLine2=" ~~~~~~~~~~~~~~"> @@ -2749,7 +2749,7 @@ errorLine2=" ~~~~~~~~~~~~~~"> @@ -3026,19 +3026,19 @@ errorLine2=" ~~~~~~~~~~~~~~~~"> + errorLine1=" MapAnySerializer," + errorLine2=" ~~~~~~~~~~~~~~~~"> + line="157" + column="29"/> @@ -3059,7 +3059,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3070,7 +3070,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3092,7 +3092,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3103,7 +3103,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3114,7 +3114,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3125,7 +3125,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3136,7 +3136,7 @@ errorLine2=" ^"> @@ -3147,30 +3147,30 @@ errorLine2=" ^"> + errorLine1=" Uri.parse(" + errorLine2=" ^"> + line="1706" + column="25"/> + errorLine1=" Uri.parse(" + errorLine2=" ^"> + line="1706" + column="25"/> @@ -3191,7 +3191,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3202,7 +3202,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3213,7 +3213,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3224,7 +3224,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3235,7 +3235,7 @@ errorLine2=" ^"> @@ -3246,7 +3246,7 @@ errorLine2=" ^"> @@ -3257,7 +3257,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3268,30 +3268,30 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + errorLine1=" Uri.parse("https://companion.home-assistant.io/docs/integrations/universal-links")," + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="95" + column="33"/> + errorLine1=" Uri.parse("package:${context.packageName}")," + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="126" + column="37"/> @@ -3312,7 +3312,7 @@ errorLine2=" ~~~~~~~~~~~~~~~"> @@ -3323,7 +3323,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3334,7 +3334,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3345,7 +3345,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3356,7 +3356,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3367,7 +3367,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -3378,7 +3378,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3389,21 +3389,10 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - - - - @@ -3444,7 +3433,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> diff --git a/common/lint-baseline.xml b/common/lint-baseline.xml index 14b864031..ed691c04e 100644 --- a/common/lint-baseline.xml +++ b/common/lint-baseline.xml @@ -3,7 +3,7 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - + errorLine1=" NotificationManagerCompat.from(" + errorLine2=" ^"> @@ -536,7 +470,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -613,7 +547,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -624,7 +558,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -635,7 +569,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -646,7 +580,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -675,23 +609,23 @@ + errorLine1=" Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q &&" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="130" + column="17"/> + errorLine1=" Build.VERSION.SDK_INT >= Build.VERSION_CODES.N &&" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="143" + column="17"/> @@ -789,19 +723,19 @@ errorLine2=" ~~~~~~~~~~~~~~~~"> + errorLine1=" kotlinJsonMapper.encodeToString(MapAnySerializer, outbound)," + errorLine2=" ~~~~~~~~~~~~~~~~"> + line="273" + column="69"/> @@ -888,7 +822,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -899,7 +833,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> diff --git a/common/src/main/kotlin/io/homeassistant/companion/android/database/location/LocationHistoryDao.kt b/common/src/main/kotlin/io/homeassistant/companion/android/database/location/LocationHistoryDao.kt index 77dc06f9a..77d81b15e 100644 --- a/common/src/main/kotlin/io/homeassistant/companion/android/database/location/LocationHistoryDao.kt +++ b/common/src/main/kotlin/io/homeassistant/companion/android/database/location/LocationHistoryDao.kt @@ -10,7 +10,7 @@ import androidx.room.Query interface LocationHistoryDao { @Insert(onConflict = OnConflictStrategy.REPLACE) - fun add(item: LocationHistoryItem): Long + suspend fun add(item: LocationHistoryItem): Long @Query("SELECT * FROM location_history ORDER BY id DESC") fun getAll(): PagingSource diff --git a/lint/src/main/kotlin/io/homeassistant/lint/room/CoroutineDaoFunctionsIssue.kt b/lint/src/main/kotlin/io/homeassistant/lint/room/CoroutineDaoFunctionsIssue.kt index b3a886f0f..f9f99437c 100644 --- a/lint/src/main/kotlin/io/homeassistant/lint/room/CoroutineDaoFunctionsIssue.kt +++ b/lint/src/main/kotlin/io/homeassistant/lint/room/CoroutineDaoFunctionsIssue.kt @@ -19,9 +19,9 @@ object CoroutineDaoFunctionsIssue { @JvmField val ISSUE = Issue.Companion.create( id = "CoroutineDaoFunction", - briefDescription = "DAO functions should suspend or return a Flow", - explanation = """All functions in a DAO should suspend or return a Flow to ensure - |they can be executed properly in coroutines + briefDescription = "DAO functions should suspend, return a Flow, or return a PagingSource", + explanation = """All functions in a DAO should suspend, return a Flow, or return a PagingSource + |to ensure they can be executed properly in coroutines """.trimMargin(), category = Category.Companion.CORRECTNESS, severity = Severity.ERROR, @@ -50,12 +50,12 @@ object CoroutineDaoFunctionsIssue { } private fun checkMethod(context: JavaContext, method: UMethod) { - if (!method.isSuspend() && !method.isReturningFlow()) { + if (!method.isSuspend() && !method.isReturningFlow() && !method.isPagingSource()) { context.report( ISSUE, method, context.getLocation(method), - "DAO functions should suspend or return a Flow.", + "DAO functions should suspend, return a Flow, or return a PagingSource.", ) } } @@ -73,3 +73,6 @@ private fun UMethod.isSuspend(): Boolean { private fun UMethod.isReturningFlow(): Boolean { return returnType?.canonicalText?.startsWith("kotlinx.coroutines.flow.Flow") == true } +private fun UMethod.isPagingSource(): Boolean { + return returnType?.canonicalText?.startsWith("androidx.paging.PagingSource") == true +} diff --git a/lint/src/test/kotlin/io/homeassistant/lint/room/CoroutineDaoFunctionsIssueTest.kt b/lint/src/test/kotlin/io/homeassistant/lint/room/CoroutineDaoFunctionsIssueTest.kt index d7c7df87d..6d4016f99 100644 --- a/lint/src/test/kotlin/io/homeassistant/lint/room/CoroutineDaoFunctionsIssueTest.kt +++ b/lint/src/test/kotlin/io/homeassistant/lint/room/CoroutineDaoFunctionsIssueTest.kt @@ -22,6 +22,14 @@ class CoroutineDaoFunctionsIssueTest { """, ).indented() + private val pagingSource = kotlin( + """ + package androidx.paging + + interface PagingSource + """, + ).indented() + @Test fun `Given a DAO when function is not suspending and does not return a Flow then CoroutineDaoFunction issue is raised`() { lint().issues(CoroutineDaoFunctionsIssue.ISSUE) @@ -43,7 +51,7 @@ class CoroutineDaoFunctionsIssueTest { ) .run() .expect( - """src/io/homeassistan/companion/android/TestDao.kt:7: Error: DAO functions should suspend or return a Flow. [CoroutineDaoFunction] + """src/io/homeassistan/companion/android/TestDao.kt:7: Error: DAO functions should suspend, return a Flow, or return a PagingSource. [CoroutineDaoFunction] fun test() ~~~~~~~~~~ 1 error""", @@ -97,4 +105,29 @@ class CoroutineDaoFunctionsIssueTest { .run() .expectClean() } + + @Test + fun `Given a DAO when function is not suspending and does return a PagingSource then no issues`() { + lint().issues(CoroutineDaoFunctionsIssue.ISSUE) + .allowMissingSdk() + .files( + pagingSource, + flow, + kotlin( + """ + package io.homeassistan.companion.android + + import androidx.paging.PagingSource + import kotlinx.coroutines.flow.Flow + + @Dao + interface TestDao { + fun test(): PagingSource + } + """, + ).indented(), + ) + .run() + .expectClean() + } }