Fix Kotlin warning (min -> minOrNull)

Test: atest PrivacyChipBuilderTest
Bug: 177438869
Change-Id: I567d59fa6398c665e17c9a713f170eff4600dd23
This commit is contained in:
Fabian Kozynski
2021-01-13 14:42:34 -05:00
parent 23c36e41d1
commit 67b5a8c79f

View File

@@ -28,7 +28,7 @@ class PrivacyChipBuilder(private val context: Context, itemsList: List<PrivacyIt
appsAndTypes = itemsList.groupBy({ it.application }, { it.privacyType })
.toList()
.sortedWith(compareBy({ -it.second.size }, // Sort by number of AppOps
{ it.second.min() })) // Sort by "smallest" AppOpp (Location is largest)
{ it.second.minOrNull() })) // Sort by "smallest" AppOpp (Location is largest)
types = itemsList.map { it.privacyType }.distinct().sorted()
}