Merge "Kotlin 1.5.31 compatibility" into sc-v2-dev

This commit is contained in:
Lucas Dupin
2021-10-26 02:06:39 +00:00
committed by Android (Google) Code Review
2 changed files with 2 additions and 2 deletions

View File

@@ -120,7 +120,7 @@ class ControlsUiControllerImpl @Inject constructor (
private val onSeedingComplete = Consumer<Boolean> { private val onSeedingComplete = Consumer<Boolean> {
accepted -> accepted ->
if (accepted) { if (accepted) {
selectedStructure = controlsController.get().getFavorites().maxBy { selectedStructure = controlsController.get().getFavorites().maxByOrNull {
it.controls.size it.controls.size
} ?: EMPTY_STRUCTURE } ?: EMPTY_STRUCTURE
updatePreferences(selectedStructure) updatePreferences(selectedStructure)

View File

@@ -28,7 +28,7 @@ class PrivacyChipBuilder(private val context: Context, itemsList: List<PrivacyIt
appsAndTypes = itemsList.groupBy({ it.application }, { it.privacyType }) appsAndTypes = itemsList.groupBy({ it.application }, { it.privacyType })
.toList() .toList()
.sortedWith(compareBy({ -it.second.size }, // Sort by number of AppOps .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() types = itemsList.map { it.privacyType }.distinct().sorted()
} }