Merge "Revert "Fix incompatibilities with Kotlin 1.5.0"" am: f1e2bb9a81 am: c2db9c85cc am: 51a1b7d082
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1705633 Change-Id: I20f9e94bb3241e07052edbe8c042162c2ad6f118
This commit is contained in:
@@ -120,7 +120,7 @@ class ControlsUiControllerImpl @Inject constructor (
|
||||
private val onSeedingComplete = Consumer<Boolean> {
|
||||
accepted ->
|
||||
if (accepted) {
|
||||
selectedStructure = controlsController.get().getFavorites().maxByOrNull {
|
||||
selectedStructure = controlsController.get().getFavorites().maxBy {
|
||||
it.controls.size
|
||||
} ?: EMPTY_STRUCTURE
|
||||
updatePreferences(selectedStructure)
|
||||
|
||||
@@ -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.minOrNull() })) // Sort by "smallest" AppOpp (Location is largest)
|
||||
{ it.second.min() })) // Sort by "smallest" AppOpp (Location is largest)
|
||||
types = itemsList.map { it.privacyType }.distinct().sorted()
|
||||
}
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ inline infix fun Int.times(action: () -> Unit) {
|
||||
* cccc dd
|
||||
*/
|
||||
fun Iterable<Pair<String, String>>.columnize(separator: String = " | "): String {
|
||||
val col1w = map { (a, _) -> a.length }.maxOrNull()!!
|
||||
val col2w = map { (_, b) -> b.length }.maxOrNull()!!
|
||||
val col1w = map { (a, _) -> a.length }.max()!!
|
||||
val col2w = map { (_, b) -> b.length }.max()!!
|
||||
return map { it.first.padEnd(col1w) + separator + it.second.padEnd(col2w) }.joinToString("\n")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user